salvator avatar salvator committed fbaa47b

#9 change list ordering

Comments (0)

Files changed (2)

admintools_bootstrap/static/admintools_bootstrap/lib/style.less

 		padding-left: 25px !important;
 	}
 }
+
+.results {
+	th div {
+		float: left;
+	}
+	.sortoptions {
+		a { float: left; }
+		margin-left: 1em;
+	}
+}

admintools_bootstrap/templates/admin/change_list_results.html

+{% load i18n %}
 {% if result_hidden_fields %}
 <div class="hiddenfields">{# DIV for HTML validation #}
 {% for item in result_hidden_fields %}{{ item }}{% endfor %}
 <table cellspacing="0" id="result_list" class="bordered-table zebra-striped">
 <thead>
 <tr>
-{% for header in result_headers %}<th scope="col"{{ header.class_attrib }}>
-{% if header.sortable %}<a href="{{ header.url }}">{% endif %}
-{{ header.text|capfirst }}
-{% if header.sortable %}</a>{% endif %}</th>{% endfor %}
+{% for header in result_headers %}
+<th scope="col" {{ header.class_attrib }}>
+   <div class="text">{% if header.sortable %}<a href="{{ header.url_primary }}">{{ header.text|capfirst }}</a>{% else %}<span>{{ header.text|capfirst }}</span>{% endif %}</div>
+   {% if header.sortable %}
+     {% if header.sort_priority > 0 %}
+       <div class="sortoptions label info">
+         <a href="{{ header.url_toggle }}" class="ui-icon {% if header.ascending %}ui-icon-triangle-1-n{% else %}ui-icon-triangle-1-s{% endif %}" title="{% trans "Toggle sorting" %}"></a>
+         <a class="ui-icon ui-icon-close" href="{{ header.url_remove }}" title="{% trans "Remove from sorting" %}"></a>
+       </div>
+     {% endif %}
+   {% endif %}
+   <div class="clear"></div>
+</th>{% endfor %}
 </tr>
 </thead>
 <tbody>
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.