Skip to content

Commit

Permalink
fix: Some id were localized in the templates (#1350)
Browse files Browse the repository at this point in the history
* fix: id's localized

* Update filer/templates/admin/filer/folder/directory_table_list.html

Co-authored-by: ivarsg <[email protected]>

* Update filer/templates/admin/filer/folder/directory_table_list.html

Co-authored-by: ivarsg <[email protected]>

* Update filer/templates/admin/filer/folder/directory_thumbnail_list.html

Co-authored-by: ivarsg <[email protected]>

* Update filer/templates/admin/filer/folder/directory_thumbnail_list.html

Co-authored-by: ivarsg <[email protected]>

---------

Co-authored-by: ivarsg <[email protected]>
  • Loading branch information
fsbraun and ivarsg authored Jun 6, 2023
1 parent b7ee617 commit 34803bc
Show file tree
Hide file tree
Showing 9 changed files with 25 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@
{% csrf_token %}
<div>
{% for f in files_queryset %}
<input type="hidden" name="{{ action_checkbox_name }}" value="file-{{ f.pk }}">
<input type="hidden" name="{{ action_checkbox_name }}" value="file-{{ f.pk|safe }}">
{% endfor %}
{% for f in folders_queryset %}
<input type="hidden" name="{{ action_checkbox_name }}" value="folder-{{ f.pk }}">
<input type="hidden" name="{{ action_checkbox_name }}" value="folder-{{ f.pk|safe }}">
{% endfor %}
{% if is_popup %}
<input type="hidden" name="_popup" value="1">
Expand Down
19 changes: 3 additions & 16 deletions filer/templates/admin/filer/folder/choose_copy_destination.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,9 @@

{% block extrahead %}
{{ block.super }}
<script src="{% static 'filer/js/libs/jquery.min.js' %}"></script>
<script src="{% static 'admin/js/jquery.init.js' %}"></script>
<script type="text/javascript">
var __jQuery = django.jQuery;
window.jQuery = (__jQuery) ? __jQuery : window.jQuery || undefined;
window.$ = window.jQuery;
</script>
<script src="{% static 'filer/js/addons/tooltip.js' %}"></script>
<script src="{% static 'filer/js/addons/copy-move-files.js' %}"></script>
<script type="text/javascript">
var __jQuery;
var __$;
// reassign jQuery if jQuery is already loaded
__jQuery = (window.jQuery) ? window.jQuery.noConflict(true) : undefined;
__$ = __jQuery;
</script>
{% endblock %}

{% block content %}
Expand Down Expand Up @@ -56,18 +43,18 @@
{% csrf_token %}
<div>
{% for f in files_queryset %}
<input type="hidden" name="{{ action_checkbox_name }}" value="file-{{ f.pk }}">
<input type="hidden" name="{{ action_checkbox_name }}" value="file-{{ f.pk|safe }}">
{% endfor %}
{% for f in folders_queryset %}
<input type="hidden" name="{{ action_checkbox_name }}" value="folder-{{ f.pk }}">
<input type="hidden" name="{{ action_checkbox_name }}" value="folder-{{ f.pk|safe }}">
{% endfor %}
<input type="hidden" name="action" value="copy_files_and_folders">
<input type="hidden" name="post" value="yes">
<p>
<label for="destination">{% blocktrans %}Destination folder:{% endblocktrans %}</label>
<select name="destination" id="destination">
{% for folder, name_and_enabled in destination_folders %}
<option value="{{ folder.pk }}"{% if not name_and_enabled.1 %} disabled="disabled"{% endif %}{% if selected_destination_folder and folder.pk == selected_destination_folder %} selected="selected"{% endif %}>{{ name_and_enabled.0 }}</option>
<option value="{{ folder.pk|safe }}"{% if not name_and_enabled.1 %} disabled="disabled"{% endif %}{% if selected_destination_folder and folder.pk == selected_destination_folder %} selected="selected"{% endif %}>{{ name_and_enabled.0 }}</option>
{% endfor %}
</select>
</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
<form action="" method="post">{% csrf_token %}
<div>
{% for f in files_queryset %}
<input type="hidden" name="{{ action_checkbox_name }}" value="file-{{ f.pk }}">
<input type="hidden" name="{{ action_checkbox_name }}" value="file-{{ f.pk|safe }}">
{% endfor %}
{% for f in folders_queryset %}
<input type="hidden" name="{{ action_checkbox_name }}" value="folder-{{ f.pk }}">
<input type="hidden" name="{{ action_checkbox_name }}" value="folder-{{ f.pk|safe }}">
{% endfor %}
<input type="hidden" name="action" value="resize_images">
<input type="hidden" name="post" value="yes">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@

{% block extrahead %}
{{ block.super }}
<script src="{% static 'filer/js/libs/jquery.min.js' %}"></script>
<script src="{% static 'admin/js/jquery.init.js' %}"></script>
<script type="text/javascript">
var __jQuery = django.jQuery;
Expand Down Expand Up @@ -55,17 +54,17 @@
<form action="" method="post">{% csrf_token %}
<div>
{% for f in files_queryset %}
<input type="hidden" name="{{ action_checkbox_name }}" value="file-{{ f.pk }}">
<input type="hidden" name="{{ action_checkbox_name }}" value="file-{{ f.pk|safe }}">
{% endfor %}
{% for f in folders_queryset %}
<input type="hidden" name="{{ action_checkbox_name }}" value="folder-{{ f.pk }}">
<input type="hidden" name="{{ action_checkbox_name }}" value="folder-{{ f.pk|safe }}">
{% endfor %}
<input type="hidden" name="action" value="move_files_and_folders">
<input type="hidden" name="post" value="yes">
<p><label for="destination">{% blocktrans %}Destination folder:{% endblocktrans %}</label>
<select name="destination" id="destination">
{% for folder, name_and_enabled in destination_folders %}
<option value="{{ folder.pk }}"{% if not name_and_enabled.1 %} disabled="disabled"{% endif %}>{{ name_and_enabled.0 }}</option>
<option value="{{ folder.pk|safe }}"{% if not name_and_enabled.1 %} disabled="disabled"{% endif %}>{{ name_and_enabled.0 }}</option>
{% endfor %}
</select></p>

Expand Down
4 changes: 2 additions & 2 deletions filer/templates/admin/filer/folder/choose_rename_format.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@
{% csrf_token %}
<div>
{% for f in files_queryset %}
<input type="hidden" name="{{ action_checkbox_name }}" value="file-{{ f.pk }}">
<input type="hidden" name="{{ action_checkbox_name }}" value="file-{{ f.pk|safe }}">
{% endfor %}
{% for f in folders_queryset %}
<input type="hidden" name="{{ action_checkbox_name }}" value="folder-{{ f.pk }}">
<input type="hidden" name="{{ action_checkbox_name }}" value="folder-{{ f.pk|safe }}">
{% endfor %}
<input type="hidden" name="action" value="rename_files">
<input type="hidden" name="post" value="yes">
Expand Down
2 changes: 1 addition & 1 deletion filer/templates/admin/filer/folder/directory_listing.html
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ <h2>&nbsp;</h2>
{% block object-tools-items %}
<div class="navigator-button-wrapper">
{% if folder.can_have_subfolders and can_make_folder %}
<a href="{% url 'admin:filer-directory_listing-make_root_folder' %}?parent_id={{ folder.id }}{% if is_popup %}&amp;_popup=1{% endif %}"
<a href="{% url 'admin:filer-directory_listing-make_root_folder' %}?parent_id={{ folder.pk|safe }}{% if is_popup %}&amp;_popup=1{% endif %}"
title="{% trans 'Adds a new Folder' %}"
class="navigator-button"
onclick="return showAddAnotherPopup(this);">
Expand Down
8 changes: 4 additions & 4 deletions filer/templates/admin/filer/folder/directory_table_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@
<td class="column-checkbox">
{% if filer_admin_context.pick_folder and item.file_type == 'Folder' %}
<a class="insertlink insertlinkButton"
href="#" onclick="opener.dismissRelatedFolderLookupPopup(window, {{ subfolder.id }}, '{{ subfolder.quoted_logical_path }}'); return false;" >
href="#" onclick="opener.dismissRelatedFolderLookupPopup(window, '{{ subfolder.pk|safe }}', '{{ subfolder.quoted_logical_path }}'); return false;" >
&nbsp;
</a>
{% elif action_form and item.pk and not is_popup %}
<input type="checkbox" class="action-select" value="folder-{{ item.pk }}" name="_selected_action">
<input type="checkbox" class="action-select" value="folder-{{ item.pk|safe }}" name="_selected_action">
{% endif %}
</td>
<td class="column-icon">
Expand Down Expand Up @@ -89,10 +89,10 @@
<tr>
<td class="column-checkbox">
{% if is_popup and filer_admin_context.pick_file %}
<a class="insertlink insertlinkButton" href="#" onclick="opener.dismissRelatedImageLookupPopup(window, {{ file.id|unlocalize }}, '{% file_icon_url file %}', '{{ file.label|escapejs }}'); return false;"
<a class="insertlink insertlinkButton" href="#" onclick="opener.dismissRelatedImageLookupPopup(window, '{{ file.id|unlocalize }}', '{% file_icon_url file %}', '{{ file.label|escapejs }}'); return false;"
title="{% trans 'Select this file' %}">&nbsp;</a>
{% elif action_form and not is_popup %}
<input type="checkbox" class="action-select" value="file-{{ item.pk }}" name="_selected_action">
<input type="checkbox" class="action-select" value="file-{{ item.pk|safe }}" name="_selected_action">
{% endif %}
</td>
<td class="column-icon">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@
<div class="navigator-checkbox">
{% if filer_admin_context.pick_folder and item.file_type == 'Folder' %}
<a class="insertlink insertlinkButton"
href="#" onclick="opener.dismissRelatedFolderLookupPopup(window, {{ subfolder.id }}, '{{ subfolder.quoted_logical_path }}'); return false;" >
href="#" onclick="opener.dismissRelatedFolderLookupPopup(window, '{{ subfolder.pk|safe }}', '{{ subfolder.quoted_logical_path }}'); return false;" >
&nbsp;
</a>
{% elif action_form and item.pk and not is_popup %}
<input type="checkbox" class="action-select" value="folder-{{ item.pk }}" name="_selected_action">
<input type="checkbox" class="action-select" value="folder-{{ item.pk|safe }}" name="_selected_action">
{% endif %}
</div>
<div class="item-icon">
Expand Down Expand Up @@ -82,10 +82,10 @@
<div class="list-item thumbnail-item thumbnail-file-item">
<div class="navigator-checkbox">
{% if is_popup and filer_admin_context.pick_file %}
<a class="insertlink insertlinkButton" href="#" onclick="opener.dismissRelatedImageLookupPopup(window, {{ file.id|unlocalize }}, '{% file_icon_url file %}', '{{ file.label|escapejs }}'); return false;"
<a class="insertlink insertlinkButton" href="#" onclick="opener.dismissRelatedImageLookupPopup(window, '{{ file.id|unlocalize }}', '{% file_icon_url file %}', '{{ file.label|escapejs }}'); return false;"
title="{% trans 'Select this file' %}">&nbsp;</a>
{% elif action_form and not is_popup %}
<input type="checkbox" class="action-select" value="file-{{ item.pk }}" name="_selected_action">
<input type="checkbox" class="action-select" value="file-{{ item.pk|safe }}" name="_selected_action">
{% endif %}
</div>
<div class="thumbnail-file-item-box">
Expand Down
8 changes: 4 additions & 4 deletions filer/templates/admin/filer/tools/clipboard/clipboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@
<td colspan="3">
<form action="{% url 'admin:filer-paste_clipboard_to_folder' %}" method="post" style="display: inline;">
{% csrf_token %}
<input type="hidden" name="folder_id" value="{{ folder.id }}">
<input type="hidden" name="clipboard_id" value="{{ clipboard.id }}">
<input type="hidden" name="folder_id" value="{{ folder.pk|safe }}">
<input type="hidden" name="clipboard_id" value="{{ clipboard.pk|safe }}">
<input type="hidden" name="redirect_to" value="{{ current_url }}">
{% filer_admin_context_hidden_formfields %}
<button class="pastelink" type="submit" {% if folder.is_root or not permissions.has_add_children_permission %} disabled="disabled" style="color: gray;"{% endif %} title="{% trans 'Paste all items here' %}"><span>&lArr;</span>&nbsp;Paste</button>
</form>
<form action="{% url 'admin:filer-discard_clipboard' %}" method="post" style="display: inline;">{% csrf_token %}
<input type="hidden" name="clipboard_id" value="{{ clipboard.id }}">
<input type="hidden" name="clipboard_id" value="{{ clipboard.pk|safe }}">
<input type="hidden" name="redirect_to" value="{{ current_url }}">
{% filer_admin_context_hidden_formfields %}
<button class="deletelink" type="submit" title="{% trans 'Move all clipboard files to' %} &#39;{% trans 'Unsorted Uploads' %}&#39; {% trans 'folder' %}"><span>{% trans "Empty Clipboard" %}</span></button>
</form>
{% comment %}
<form action="{% url 'admin:filer-delete_clipboard' %}" method="post" style="display: inline;">{% csrf_token %}
<input type="hidden" name="clipboard_id" value="{{ clipboard.id }}">
<input type="hidden" name="clipboard_id" value="{{ clipboard.pk|safe }}">
<input type="hidden" name="redirect_to" value="{{ current_url }}">
{% if is_popup %}
<input type="hidden" name="_popup" value="1">
Expand Down

0 comments on commit 34803bc

Please sign in to comment.