Skip to content

Commit

Permalink
Fix templates for django 4
Browse files Browse the repository at this point in the history
  • Loading branch information
smacker committed Feb 2, 2022
1 parent 1c68ab9 commit ff1390e
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 56 deletions.
4 changes: 2 additions & 2 deletions docs/fieldswidgets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ You can use all attributes from :ref:`fileobject`:
{{ blogentry.image }}
<img src="{{ publication.image.url }}" />

{% ifequal blogentry.image.image_orientation "landscape" %}
{% if blogentry.image.image_orientation == "landscape" %}
<img src="{{ blogentry.image.url }}" class="landscape" />
{% endifequal %}
{% endif %}

Showing Thumbnail in the Changelist
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
1 change: 0 additions & 1 deletion filebrowser/sites.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,6 @@ def filter_browse(item):
'breadcrumbs': get_breadcrumbs(query, query.get('dir', '')),
'breadcrumbs_title': "",
'filebrowser_site': self,
'old_design': DJANGO_VERSION < (1, 9)
}
))

Expand Down
10 changes: 0 additions & 10 deletions filebrowser/static/filebrowser/css/filebrowser.css
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,3 @@ span.qq-upload-file {
.popup.filebrowser.change-list .filtered #toolbar {
margin-right: 260px;
}

/* Django 1.8 */
.popup.filebrowser .old-design .object-tools {
margin-top: -20px;
}

.old-design .pulldown-versions-handler:after {
border-top-color: #000;
border-bottom-color: #000;
}
8 changes: 4 additions & 4 deletions filebrowser/templates/filebrowser/include/paginator.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<p class="paginator">
{% if page_range %}
{% for i in page_range %}
{% ifequal i "." %}
{% if i == "." %}
<span>...</span>
{% else %}
{% ifequal i page_num %}
{% if i == page_num %}
<span class="this-page">{{ i|add:"1" }}</span>
{% else %}
<a href="{% query_string "" "p" %}&amp;p={{ i|add:"1" }}"{% if forloop.last %} class="end"{% endif %}>{{ i|add:"1" }}</a>
{% endifequal %}
{% endifequal %}
{% endif %}
{% endif %}
{% endfor %}
{% endif %}
{{ filelisting.results_total }} {% trans 'total' %}
Expand Down
20 changes: 10 additions & 10 deletions filebrowser/templates/filebrowser/include/tableheader.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
{% if query.o == "filetype" %}
<th scope="col" class="sortable sorted {{ query.ot }}ending">
<div class="sortoptions">
<a href="{% query_string "" "o,ot,p" %}&amp;ot={% ifequal query.ot "desc" %}asc{% else %}desc{% endifequal %}&amp;o=filetype" class="toggle {{ query.ot }}ending" title="{% trans "Toggle sorting" %}"></a>
<a href="{% query_string "" "o,ot,p" %}&amp;ot={% if query.ot == "desc" %}asc{% else %}desc{% endif %}&amp;o=filetype" class="toggle {{ query.ot }}ending" title="{% trans "Toggle sorting" %}"></a>
</div>
<div class="text"><a href="{% query_string "" "o,ot,p" %}&amp;ot={% ifequal query.ot "desc" %}asc{% else %}desc{% endifequal %}&amp;o=filetype">{% trans "Type" %}</a></div>
<div class="text"><a href="{% query_string "" "o,ot,p" %}&amp;ot={% if query.ot == "desc" %}asc{% else %}desc{% endif %}&amp;o=filetype">{% trans "Type" %}</a></div>
<div class="clear"></div>
</th>
{% endif %}
Expand All @@ -34,9 +34,9 @@
{% if query.o == "filename_lower" %}
<th scope="col" class="sortable sorted {{ query.ot }}ending">
<div class="sortoptions">
<a href="{% query_string "" "o,ot,p" %}&amp;ot={% ifequal query.ot "desc" %}asc{% else %}desc{% endifequal %}&amp;o=filename_lower" class="toggle {{ query.ot }}ending" title="{% trans "Toggle sorting" %}"></a>
<a href="{% query_string "" "o,ot,p" %}&amp;ot={% if query.ot == "desc" %}asc{% else %}desc{% endif %}&amp;o=filename_lower" class="toggle {{ query.ot }}ending" title="{% trans "Toggle sorting" %}"></a>
</div>
<div class="text"><a href="{% query_string "" "o,ot,p" %}&amp;ot={% ifequal query.ot "desc" %}asc{% else %}desc{% endifequal %}&amp;o=filename_lower">{% trans "Filename" %}</a></div>
<div class="text"><a href="{% query_string "" "o,ot,p" %}&amp;ot={% if query.ot == "desc" %}asc{% else %}desc{% endif %}&amp;o=filename_lower">{% trans "Filename" %}</a></div>
<div class="clear"></div>
</th>{% endif %}
{% if query.o != "filename_lower" %}
Expand All @@ -49,9 +49,9 @@
{% if query.o == 'folder' %}
<th scope="col" class="sortable sorted {{ query.ot }}ending">
<div class="sortoptions">
<a href="{% query_string "" "o,ot,p" %}&amp;ot={% ifequal query.ot "desc" %}asc{% else %}desc{% endifequal %}&amp;o=folder" class="toggle {{ query.ot }}ending" title="{% trans "Toggle sorting" %}"></a>
<a href="{% query_string "" "o,ot,p" %}&amp;ot={% if query.ot == "desc" %}asc{% else %}desc{% endif %}&amp;o=folder" class="toggle {{ query.ot }}ending" title="{% trans "Toggle sorting" %}"></a>
</div>
<div class="text"><a href="{% query_string "" "o,ot,p" %}&amp;ot={% ifequal query.ot "desc" %}asc{% else %}desc{% endifequal %}&amp;o=folder">{% trans "Folder" %}</a></div>
<div class="text"><a href="{% query_string "" "o,ot,p" %}&amp;ot={% if query.ot == "desc" %}asc{% else %}desc{% endif %}&amp;o=folder">{% trans "Folder" %}</a></div>
<div class="clear"></div>
</th>
{% endif %}
Expand All @@ -66,9 +66,9 @@
{% if query.o == "filesize" %}
<th scope="col" class="sortable sorted {{ query.ot }}ending">
<div class="sortoptions">
<a href="{% query_string "" "o,ot,p" %}&amp;ot={% ifequal query.ot "desc" %}asc{% else %}desc{% endifequal %}&amp;o=filesize" class="toggle {{ query.ot }}ending" title="{% trans "Toggle sorting" %}"></a>
<a href="{% query_string "" "o,ot,p" %}&amp;ot={% if query.ot == "desc" %}asc{% else %}desc{% endif %}&amp;o=filesize" class="toggle {{ query.ot }}ending" title="{% trans "Toggle sorting" %}"></a>
</div>
<div class="text"><a href="{% query_string "" "o,ot,p" %}&amp;ot={% ifequal query.ot "desc" %}asc{% else %}desc{% endifequal %}&amp;o=filesize">{% trans "Size" %}</a></div>
<div class="text"><a href="{% query_string "" "o,ot,p" %}&amp;ot={% if query.ot == "desc" %}asc{% else %}desc{% endif %}&amp;o=filesize">{% trans "Size" %}</a></div>
<div class="clear"></div>
</th>
{% endif %}
Expand All @@ -82,9 +82,9 @@
{% if query.o == "date" %}
<th scope="col" class="sortable sorted {{ query.ot }}ending">
<div class="sortoptions">
<a href="{% query_string "" "o,ot,p" %}&amp;ot={% ifequal query.ot "desc" %}asc{% else %}desc{% endifequal %}&amp;o=date" class="toggle {{ query.ot }}ending" title="{% trans "Toggle sorting" %}"></a>
<a href="{% query_string "" "o,ot,p" %}&amp;ot={% if query.ot == "desc" %}asc{% else %}desc{% endif %}&amp;o=date" class="toggle {{ query.ot }}ending" title="{% trans "Toggle sorting" %}"></a>
</div>
<div class="text"><a href="{% query_string "" "o,ot,p" %}&amp;ot={% ifequal query.ot "desc" %}asc{% else %}desc{% endifequal %}&amp;o=date">{% trans "Date" %}</a></div>
<div class="text"><a href="{% query_string "" "o,ot,p" %}&amp;ot={% if query.ot == "desc" %}asc{% else %}desc{% endif %}&amp;o=date">{% trans "Date" %}</a></div>
<div class="clear"></div>
</th>
{% endif %}
Expand Down
38 changes: 21 additions & 17 deletions filebrowser/templates/filebrowser/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@
{{ block.super }}
<script type="text/javascript" src="{% static_jquery %}"></script>
<script type="text/javascript" src="{% static "admin/js/jquery.init.js" %}"></script>
{% ifequal query.pop '1' %} <!-- FileBrowseField -->
{% if query.pop == '1' %} <!-- FileBrowseField -->
<script language="javascript" type="text/javascript" src="{% static "filebrowser/js/FB_FileBrowseField.js" %}"></script>
{% endifequal %}
{% ifequal query.pop '2' %} <!-- TinyMCE -->
{% endif %}
{% if query.pop == '2' %} <!-- TinyMCE -->
<script language="javascript" type="text/javascript" src="{% static "tiny_mce/tiny_mce_popup.js" %}"></script>
<script language="javascript" type="text/javascript" src="{% static "filebrowser/js/FB_TinyMCE.js" %}"></script>
{% if query.mce_rdomain %}<script language="javascript">document.domain = "{{ query.mce_rdomain }}"</script>{% endif %}
{% endifequal %}
{% ifequal query.pop '3' %} <!-- CKeditor (former "FCKeditor") -->
{% endif %}
{% if query.pop == '3' %} <!-- CKeditor (former "FCKeditor") -->
<script language="javascript" type="text/javascript" src="{% static "filebrowser/js/FB_CKEditor.js" %}"></script>
{% endifequal %}
{% ifequal query.pop '4' %} <!-- TinyMCE -->
{% endif %}
{% if query.pop == '4' %} <!-- TinyMCE -->
<script language="javascript" type="text/javascript" src="{% static "filebrowser/js/FB_TinyMCEv4.js" %}"></script>
{% endifequal %}
{% ifequal query.pop '5' %} <!-- TinyMCE -->
{% endif %}
{% if query.pop == '5' %} <!-- TinyMCE -->
<script language="javascript" type="text/javascript" src="{% static "filebrowser/js/FB_TinyMCEv5.js" %}"></script>
{% endifequal %}
{% endif %}
{{ media }}
<script type="text/javascript" charset="utf-8">
(function($) {
Expand Down Expand Up @@ -106,10 +106,12 @@

<!-- CONTENT -->
{% block content %}
<div id="content-main"{%if old_design %} class="old-design"{% endif %}>
<div id="content-main">
<!-- POP-UP BREADCRUMBS -->
{% if query.pop %}
<div class="breadcrumbs">
{% include "filebrowser/include/breadcrumbs.html" %}
</div>
{% endif %}

<!-- OBJECT-TOOLS -->
Expand All @@ -121,6 +123,7 @@
{% endblock %}

<div class="module filtered" id="changelist">
<div class="changelist-form-container">
<!-- SEARCH -->
{% block search %}
<div id="toolbar"><form id="changelist-search" action="" method="get">
Expand All @@ -136,18 +139,14 @@
{% if query.type %}<input type="hidden" name="type" value="{{ query.type }}" />{% endif %}
{% if query.format %}<input type="hidden" name="format" value="{{ query.format }}" />{% endif %}
{% if query.dir %}<input type="hidden" name="dir" value="{{ query.dir|urlencode }}" />{% endif %}
{% ifequal query.pop '3' %} {# Custom CKEditor fields #}
{% if query.pop == '3' %} {# Custom CKEditor fields #}
{% if query.CKEditor %}<input type="hidden" name="CKEditor" value="{{ query.CKEditor }}" />{% endif %}
{% if query.CKEditorFuncNum %}<input type="hidden" name="CKEditorFuncNum" value="{{ query.CKEditorFuncNum }}" />{% endif %}
{% endifequal %}
{% endif %}
</div>
</form></div>
<script type="text/javascript">document.getElementById("searchbar").focus();</script>
{% endblock %}
{% block filters %}
<!-- FILTERS -->
{% include "filebrowser/include/filter.html" %}
{% endblock %}

<form id="changelist-form" action="" method="post">{% csrf_token %}
<!-- RESULTS -->
Expand All @@ -165,5 +164,10 @@
{% pagination %}
</form>
</div>
{% block filters %}
<!-- FILTERS -->
{% include "filebrowser/include/filter.html" %}
{% endblock %}
</div>
</div>
{% endblock %}
4 changes: 2 additions & 2 deletions filebrowser/templates/filebrowser/upload.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,9 @@ <h2>{% trans "Help" %}</h2>
<label class="required">{% trans "Allowed" %}</label>
<p>
{% for extension in settings_var.EXTENSIONS.items %}
{% ifnotequal extension.0 'Folder' %}
{% if extension.0 != 'Folder' %}
<strong>{% trans extension.0|safe %}</strong> ({{ extension.1|join:", "|safe }})<br />
{% endifnotequal %}
{% endif %}
{% endfor %}
</p>
</div>
Expand Down
20 changes: 10 additions & 10 deletions filebrowser/templates/filebrowser/version.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,36 +8,36 @@
{{ block.super }}
<script type="text/javascript" src="{% static_jquery %}"></script>
<script type="text/javascript" src="{% static "admin/js/jquery.init.js" %}"></script>
{% ifequal query.pop '1' %} <!-- FileBrowseField -->
{% if query.pop == '1' %} <!-- FileBrowseField -->
<script language="javascript" type="text/javascript" src="{% static "filebrowser/js/FB_FileBrowseField.js" %}"></script>
{% endifequal %}
{% ifequal query.pop '2' %} <!-- TinyMCE -->
{% endif %}
{% if query.pop == '2' %} <!-- TinyMCE -->
<script language="javascript" type="text/javascript" src="{% static "tiny_mce/tiny_mce_popup.js" %}"></script>
<script language="javascript" type="text/javascript" src="{% static "filebrowser/js/FB_TinyMCE.js" %}"></script>
{% if query.mce_rdomain %}<script language="javascript">document.domain = "{{ query.mce_rdomain }}"</script>{% endif %}
{% endifequal %}
{% ifequal query.pop '4' %} <!-- TinyMCE -->
{% endif %}
{% if query.pop == '4' %} <!-- TinyMCE -->
<script language="javascript" type="text/javascript" src="{% static "filebrowser/js/FB_TinyMCEv4.js" %}"></script>
{% endifequal %}
{% ifequal query.pop '5' %} <!-- TinyMCE -->
{% endif %}
{% if query.pop == '5' %} <!-- TinyMCE -->
<script language="javascript" type="text/javascript" src="{% static "filebrowser/js/FB_TinyMCEv5.js" %}"></script>
{% endifequal %}
{% endif %}
{% endblock %}

<!-- CONTENT -->
{% block content %}
{% if fileobject.filetype == "Image" %}
{% version fileobject.path settings_var.ADMIN_THUMBNAIL as thumbnail_version %}
{% version fileobject.path query.version as image_version %}
{% ifequal query.pop '1' %} <!-- FileBrowseField -->
{% if query.pop == '1' %} <!-- FileBrowseField -->
<script type="text/javascript" charset="utf-8">
(function($) {
$(document).ready(function() {
FileSubmit('{{ image_version.path }}', '{{ image_version.url }}', '{{ thumbnail_version.url }}', '{{ image_version.filetype }}');
});
})(django.jQuery);
</script>
{% endifequal %}
{% endif %}
{% if query.pop == '2' or query.pop == '4' or query.pop == '5' %} <!-- TinyMCE -->
<script type="text/javascript" charset="utf-8">
(function($) {
Expand Down

0 comments on commit ff1390e

Please sign in to comment.