close Warning: HTML preview using PatchRenderer failed (ValueError: not enough values to unpack (expected 2, got 1))

Ticket #16212: 16212.better-admin-multiple-sort.2.diff

File 16212.better-admin-multiple-sort.2.diff, 8.6 KB (added by Julien Phalip, 13 years ago)

Patch updated to latest trunk

Line 
1diff --git a/django/contrib/admin/static/admin/css/base.css b/django/contrib/admin/static/admin/css/base.css
2index 89f2225..d0a02f4 100644
3--- a/django/contrib/admin/static/admin/css/base.css
4+++ b/django/contrib/admin/static/admin/css/base.css
5@@ -309,46 +309,57 @@ tr.alt {
6
7 /* SORTABLE TABLES */
8
9+thead th {
10+ padding: 0;
11+ line-height: normal;
12+}
13+
14 thead th a:link, thead th a:visited {
15 color: #666;
16- display: block;
17+}
18+
19+thead th a.sortremove {
20+ display: none; /* Hide by default */
21 }
22
23 thead th.sorted {
24 background: #c5c5c5 url(../img/nav-bg-selected.gif) top left repeat-x;
25 }
26
27-table thead th.sorted a {
28- padding-right: 13px;
29+table thead th .text a {
30+ display: block;
31+ padding: 2px 5px;
32+ cursor: pointer; /* IE needs this */
33 }
34
35-table thead th.ascending a {
36- background: url(../img/arrow-up.gif) right .4em no-repeat;
37+table thead th .text a:hover {
38+ background-color: #FFFFF4;
39 }
40
41-table thead th.descending a {
42- background: url(../img/arrow-down.gif) right .4em no-repeat;
43+table thead th.sorted .sortoptions {
44+ display: block;
45+ padding: 2px 5px;
46+ float: right;
47+ text-align: right;
48 }
49
50-table thead th.sorted a span.text {
51- display: block;
52- float: left;
53- cursor: pointer; /* IE needs this */
54+table thead th.sorted img#primary-sort-icon {
55+ cursor: pointer;
56 }
57
58-table thead th.sorted a span.sortpos {
59- display: block;
60- float: right;
61- font-size: .6em;
62- text-align: right;
63- cursor: pointer; /* IE needs this */
64+table thead th.sorted .sortposition {
65+ font-size: .8em;
66+ min-width: 12px;
67+ text-align: center;
68+ display:inline-block;
69+ cursor: pointer; /* IE needs this */
70 }
71
72 table thead th.sorted a img {
73 vertical-align: top;
74 }
75
76-table thead th.sorted a span.clear {
77+table thead th.sorted a .clear {
78 display: block;
79 clear: both;
80 }
81diff --git a/django/contrib/admin/static/admin/css/rtl.css b/django/contrib/admin/static/admin/css/rtl.css
82index c32fcf0..76a439d 100644
83--- a/django/contrib/admin/static/admin/css/rtl.css
84+++ b/django/contrib/admin/static/admin/css/rtl.css
85@@ -80,22 +80,7 @@ div.breadcrumbs {
86
87 /* SORTABLE TABLES */
88
89-
90-table thead th.sorted a {
91- padding-left: 13px;
92- padding-right: 0px;
93-}
94-
95-table thead th.ascending a,
96-table thead th.descending a {
97- background-position: left;
98-}
99-
100-table thead th.sorted a span.text {
101- float: right;
102-}
103-
104-table thead th.sorted a span.sortpos {
105+table thead th.sorted .sortoptions {
106 float: left;
107 }
108
109@@ -260,4 +245,4 @@ div.colM {
110
111 .submit-row input {
112 float: left;
113-}
114\ No newline at end of file
115+}
116diff --git a/django/contrib/admin/static/admin/img/arrow-down-hover.gif b/django/contrib/admin/static/admin/img/arrow-down-hover.gif
117new file mode 100644
118index 0000000000000000000000000000000000000000..30d63d61788f7cc03d18f1516738b11f89cdf36f
119GIT binary patch
120literal 69
121zcmZ?wbh9u|<Y(Yvn8?5o*tzh<ix&)Fp!k!8k%57UK?lSG$ulsCP3d2Gx|Tti$IB~9
122RH|~1pOUY=DX?~0h)&ML^5a$2@
123
124literal 0
125HcmV?d00001
126
127diff --git a/django/contrib/admin/static/admin/img/arrow-down.gif b/django/contrib/admin/static/admin/img/arrow-down.gif
128index a967b9fd5563a0fc2f5fde8ec0f7de3fc8fbc5a9..1161248023ee7d02f6bdc9eb0f4185cf6c1280ac 100644
129GIT binary patch
130literal 88
131zcmZ?wbhEHb<Y(YvSj50EbLPyA8#kUfapJ{`7Ys;1@h1x>0|N_#4oD27mVsH;W7nO3
132g26_(KvV1HDEe}L0u*EN#xFFKY>(oAjISdTe06$F_qW}N^
133
134literal 80
135zcmZ?wbhEHb<YZuDSj5I~;>3wfn>L+1d2-{%jW1rjm^pLi|Ns9P7#I|PvM@3LmFNK3
136i3?Q`(%%TyyyiA!oB04G)Te5yh$2@OMO7G-kum%ACMICAY
137
138diff --git a/django/contrib/admin/static/admin/img/arrow-up-hover.gif b/django/contrib/admin/static/admin/img/arrow-up-hover.gif
139new file mode 100644
140index 0000000000000000000000000000000000000000..29a3dc500b6ae6f442e46da95ec10b63dabf0a58
141GIT binary patch
142literal 70
143zcmZ?wbh9u|<Y(Yvn8?5o*tzh<ix&(G40Db#D*j|)WME)o&;fE8K=KSs;#2xpp5FVA
144YkKw}E$m@G0-`<s!7oVCI$-rO@0ITy9_y7O^
145
146literal 0
147HcmV?d00001
148
149diff --git a/django/contrib/admin/static/admin/img/arrow-up.gif b/django/contrib/admin/static/admin/img/arrow-up.gif
150index 3fe4851399a37337891ccf5452ee5d59bbedeec7..d0842b3545151ab949a84aeefa39bcfdd83c828b 100644
151GIT binary patch
152literal 87
153zcmZ?wbhEHb<Y(YvSj50EbLPyA8#kUfapJ{`7Ys;1@h1x>0|N_#4oD27mVsHuW7nO3
154f2KyAn8A6x@3+_0+uuRZMJF|3E#?yU)ObpflIM^AU
155
156literal 838
157zcmZ?wbhEHb<YZuD_|Cv^;>3wfn>L+1d2-{%jW1rjm^pJM!zdUHfe{k|ia%Kx8Gu<q
158z2jpW=o?zfmX5i&8aY$HjkcpK`j>SOX;Q=NFCLWFl0*@NH#f6pb?3n1_z+epkX4f1j
159
160diff --git a/django/contrib/admin/static/admin/img/icon-remove-small.gif b/django/contrib/admin/static/admin/img/icon-remove-small.gif
161new file mode 100644
162index 0000000000000000000000000000000000000000..288c2ad7cc7b807ab02d035c098c80b2c11458b6
163GIT binary patch
164literal 189
165zcmZ?wbh9u|<YC}pIKsfNO;diiuJQ>RQwTcgWCKJO94ybcJ6`ei0HUkGen50BGysSm
166z$45O*h<cTs{-vh;{Dkfc6M8Psn|W=)90mpkW@aD(1R7A<2TCjcWMO1r5NFT<NrLQT
167zV6}Rn+Lw|!OH4H=EK}DvRMFKssP~FWzrob0ZciFl%+T7?dcb3mf&#}u#ShYvT&KMl
168R5;m{WoBS@*hmVoL8UXbGKC1u#
169
170literal 0
171HcmV?d00001
172
173diff --git a/django/contrib/admin/static/admin/img/icon_cog-hover.gif b/django/contrib/admin/static/admin/img/icon_cog-hover.gif
174new file mode 100644
175index 0000000000000000000000000000000000000000..45611686ee942ed9ee4277564f7c00a83684417b
176GIT binary patch
177literal 131
178zcmZ?wbh9u|<Y(Yv*v!BX*tzf&7+eQ~mtgSq>sJOGK=CIFBLf2mgAPa@WCjC^fq-Wu
179z*DB*+1}^zqPYUBLCTUnK)R{i_pzEsa$}HX4yq4nG%g-ySFn?gMf26QY#!rdC8UTGS
180BDRlq<
181
182literal 0
183HcmV?d00001
184
185diff --git a/django/contrib/admin/templates/admin/change_list_results.html b/django/contrib/admin/templates/admin/change_list_results.html
186index b1db647..af9176e 100644
187--- a/django/contrib/admin/templates/admin/change_list_results.html
188+++ b/django/contrib/admin/templates/admin/change_list_results.html
189@@ -11,15 +11,18 @@
190 <tr>
191 {% for header in result_headers %}
192 <th scope="col" {{ header.class_attrib }}>
193- {% if header.sortable %}<a href="{{ header.url_primary }}">{% endif %}
194- <span class="text">{{ header.text|capfirst }}</span>
195- {% if header.sortable %}
196- {% if header.sort_pos > 0 %}<span class="sortpos">
197- {% if header.sort_pos == 1 %}<img id="primary-sort-icon" src="{% static "admin/img/icon_cog.gif" %}" alt="" />&nbsp;{% endif %}
198- {{ header.sort_pos }}</span>
199- {% endif %}
200- <span class="clear"></span></a>
201- {% endif %}
202+ {% if header.sortable %}
203+ {% if header.sort_pos > 0 %}
204+ <div class="sortoptions">
205+ {% if header.sort_pos == 1 %}<img id="primary-sort-icon" src="{% static "admin/img/icon_cog.gif" %}" alt="{% trans "options" %}" title="{% trans "Sorting options" %}"/>&nbsp;{% endif %}
206+ <span class="sortposition">{{ header.sort_pos }}</span>
207+ <a class="sortremove" href="{{ header.url_remove }}" title="{% trans "Remove from sorting" %}"><img src="{% static "admin/img/icon-remove-small.gif" %}"></a>
208+ <a href="{{ header.url_toggle }}" class="toggle {% if header.ascending %}ascending{% else %}descending{% endif %}"><img src="{% if header.ascending %}{% static "admin/img/arrow-up.gif" %}{% else %}{% static "admin/img/arrow-down.gif" %}{% endif %}" alt="{% trans "toggle" %}" title="{% trans "Toggle sorting" %}" /></a>
209+ </div>
210+ {% endif %}
211+ {% endif %}
212+ <div class="text">{% if header.sortable %}<a href="{{ header.url_primary }}" title="{% trans "Make primary sorting column and toggle sorting" %}">{{ header.text|capfirst }}</a>{% else %}{{ header.text|capfirst }}{% endif %}</div>
213+ <div class="clear"></div>
214 </th>{% endfor %}
215 </tr>
216 </thead>
217@@ -114,6 +117,33 @@
218 hidePopup();
219 ev.preventDefault()
220 });
221+
222+ $('a.toggle.ascending img').mouseenter(function(){
223+ $(this).attr('src', '{% static "admin/img/arrow-up-hover.gif" %}');
224+ });
225+ $('a.toggle.ascending img').mouseout(function(){
226+ $(this).attr('src', '{% static "admin/img/arrow-up.gif" %}');
227+ });
228+ $('a.toggle.descending img').mouseenter(function(){
229+ $(this).attr('src', '{% static "admin/img/arrow-down-hover.gif" %}');
230+ });
231+ $('a.toggle.descending img').mouseout(function(){
232+ $(this).attr('src', '{% static "admin/img/arrow-down.gif" %}');
233+ });
234+ $('img#primary-sort-icon').mouseenter(function(){
235+ $(this).attr('src', '{% static "admin/img/icon_cog-hover.gif" %}');
236+ });
237+ $('img#primary-sort-icon').mouseout(function(){
238+ $(this).attr('src', '{% static "admin/img/icon_cog.gif" %}');
239+ });
240+ $('span.sortposition').mouseover(function(){
241+ $(this).hide();
242+ $(this).siblings('a.sortremove').show();
243+ });
244+ $('a.sortremove').mouseleave(function(){
245+ $(this).hide();
246+ $(this).siblings('span.sortposition').show();
247+ });
248 });
249 })(django.jQuery);
250 //-->
Back to Top