Skip to content

Commit

Permalink
fix: Allow copy with empty suffix (#1386)
Browse files Browse the repository at this point in the history
* Fix #1377

* Fix: Allow empty suffix in admin copy

* Add submit-row class

* Fix; Cancel link too small if djangocms-admin-style is not present
  • Loading branch information
fsbraun authored Jul 13, 2023
1 parent 71d16ca commit fdd4d64
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion filer/admin/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class CopyFilesAndFoldersForm(forms.Form, AsPWithHelpMixin):
# overwrite_files = forms.BooleanField(required=False, help_text=_("Overwrite a file if there already exists a file with the same filename?"))

def clean_suffix(self):
valid = get_valid_filename(self.cleaned_data['suffix'])
valid = get_valid_filename(self.cleaned_data['suffix']) if self.cleaned_data['suffix'] else ""
if valid != self.cleaned_data['suffix']:
raise forms.ValidationError(_('Suffix should be a valid, simple and lowercase filename part, like "%(valid)s".') % {'valid': valid})
return self.cleaned_data['suffix']
Expand Down
3 changes: 2 additions & 1 deletion filer/private/sass/components/_base.scss
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,10 @@ body {
padding: 20px 0 0;
}

.delete-confirmation form .cancel-link {
form .cancel-link {
height: auto !important;
line-height: inherit !important;
padding: 10px 15px;
}

.sr-only {
Expand Down
2 changes: 1 addition & 1 deletion filer/static/filer/css/admin_filer.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion filer/static/filer/css/maps/admin_filer.css.map

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
</p>
{{ copy_form.as_p_with_help }}

<div class="text-right clearfix">
<div class="submit-row text-right clearfix">
<a href="#" onclick="window.history.back(); return false;" class="button cancel-link">{% translate "No, take me back" %}</a>
<input type="submit" value="{% translate 'Copy' %}" class="default js-submit-copy-move">
<span class="js-disabled-btn-tooltip disabled-btn-tooltip js-filer-tooltip filer-tooltip-wrapper"
Expand Down

0 comments on commit fdd4d64

Please sign in to comment.