Skip to content
This repository was archived by the owner on Mar 15, 2018. It is now read-only.

Commit d748e6d

Browse files
committed
show rating stars + counts on detail page (bug 755922)
1 parent 146095a commit d748e6d

11 files changed

Lines changed: 178 additions & 169 deletions

File tree

apps/users/helpers.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111

1212
@register.function
13-
def emaillink(email, title=None):
13+
def emaillink(email, title=None, klass=None):
1414
if not email:
1515
return ""
1616

@@ -28,8 +28,8 @@ def emaillink(email, title=None):
2828
else:
2929
title = '<span class="emaillink">%s</span>' % fallback
3030

31-
node = u'<a href="#">%s</a><span class="emaillink js-hidden">%s</span>' % (
32-
title, fallback)
31+
node = (u'<a%s href="#">%s</a><span class="emaillink js-hidden">%s</span>'
32+
% ((' class="%s"' % klass) if klass else '', title, fallback))
3333
return jinja2.Markup(node)
3434

3535

media/css/mkt/buttons.less

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,25 @@
11
@import 'lib';
22

3+
a.arrow {
4+
position: relative;
5+
&:after {
6+
.arrow;
7+
content: "";
8+
display: block;
9+
opacity: .7;
10+
position: absolute;
11+
top: 15px;
12+
right: 10px;
13+
height: 18px;
14+
width: 18px;
15+
}
16+
&:hover, &:active {
17+
&:after {
18+
opacity: 1;
19+
}
20+
}
21+
}
22+
323
.button, button {
424

525
border: 0;

media/css/mkt/detail.less

Lines changed: 90 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -331,34 +331,51 @@ h1 .num {
331331
}
332332
}
333333

334-
.support ul {
335-
margin-top: 47px;
336-
list-style-type: none;
337-
padding: 0;
334+
.developer-comments {
335+
margin-bottom: 10px;
336+
}
337+
338+
.support {
338339
font-size: 14px;
340+
.average-rating {
341+
.fat-button;
342+
.width(4);
343+
margin: 10px 0;
344+
}
345+
.overall-reviews {
346+
text-align: left;
347+
&:hover {
348+
span {
349+
color: darken(@green, 5%);
350+
text-decoration: none;
351+
}
352+
}
353+
}
354+
a, time {
355+
display: inline-block;
356+
padding: 5px 20px 5px 0;
357+
}
358+
ul {
359+
margin: 0;
360+
list-style-type: none;
361+
padding: 0;
362+
}
339363
li {
364+
.width(7);
340365
float: left;
341366
margin-bottom: 10px;
342367
min-height: 100px;
343-
.width(7);
344-
h3 {
345-
font-size: 22px;
346-
}
347-
p {
348-
margin: 0;
349-
a, time {
350-
display: inline-block;
351-
padding: 5px 20px 5px 0;
352-
}
353-
a {
354-
background: url(../../img/mkt/arrows/support.png) no-repeat 100% 50%;
355-
}
356-
}
368+
}
369+
h3 {
370+
font-size: 22px;
371+
}
372+
p {
373+
margin: 0;
357374
}
358375
}
359376

360-
.html-rtl .support ul {
361-
a, time {
377+
.html-rtl .support {
378+
p a, time {
362379
padding: 5px 0 5px 20px;
363380
}
364381
}
@@ -383,26 +400,45 @@ h1 .num {
383400
}
384401
}
385402

386-
// 7 columns
387-
@media (max-width: @7col) {
388-
.product-details {
389-
.actions {
403+
// Anything larger than mobile.
404+
@media (min-width: @4col) {
405+
#reviews {
406+
margin: 40px 0 20px;
407+
}
408+
.support li {
409+
margin-top: 20px;
410+
}
411+
.not-rated {
412+
font-size: 16px;
413+
}
414+
.support {
415+
p a.arrow:after {
416+
background-image: url(../../img/mkt/arrows/support.png);
417+
background-position: 100% 0;
418+
right: 0;
419+
top: 8px;
390420
}
391421
}
392-
.support ul li {
422+
}
423+
424+
@media (max-width: @7col) {
425+
.support li {
393426
.width(2);
394427
}
395428
}
396429

397-
//4 columns
398430
@media (max-width: @4col) {
399431
#page > .description {
400432
border-width: 1px 0;
401433
padding: 10px;
402434
.summary {
435+
margin: 0 0 5px;
403436
max-width: 100%;
404437
width: 100%;
405438
}
439+
.show .more {
440+
margin-top: 15px;
441+
}
406442
a.collapse.narrow {
407443
.transition(none);
408444
display: block;
@@ -565,45 +601,43 @@ h1 .num {
565601
}
566602
}
567603
}
568-
.support ul {
569-
li {
570-
margin-bottom: 15px;
571-
min-height: inherit;
572-
}
604+
#add-first-review {
605+
display: none;
573606
}
574607
.support {
608+
.not-rated,
609+
.average-rating {
610+
margin: 20px 0 10px;
611+
}
612+
.not-rated {
613+
color: @medium-gray;
614+
}
615+
.average-rating {
616+
width: 100%;
617+
}
575618
a {
576619
.fat-button;
577620
}
578-
.overall-reviews {
579-
text-align: left;
580-
margin: 25px 0 0;
581-
+ ul {
582-
margin: 0;
621+
li {
622+
.border-box;
623+
float: left;
624+
margin: 10px 0 0;
625+
min-height: inherit;
626+
padding-right: 5px;
627+
width: 50%;
628+
&:nth-child(2n) {
629+
padding: 0 0 0 5px;
583630
}
584631
}
585-
ul {
632+
dl {
586633
margin: 15px 0 0;
587-
li {
588-
.border-box;
589-
float: left;
590-
margin: 10px 0 0;
591-
padding-right: 5px;
592-
width: 50%;
593-
&:nth-child(2n) {
594-
padding: 0 0 0 5px;
595-
}
596-
}
597634
}
598-
dl {
599-
margin: 20px 0 15px;
600-
dt, dd {
601-
color: @text;
602-
display: inline-block;
603-
}
604-
dt {
605-
margin-right: 5px;
606-
}
635+
dt, dd {
636+
color: @text;
637+
display: inline-block;
638+
}
639+
dt {
640+
margin-right: 5px;
607641
}
608642
}
609643
.previews.slider {
@@ -614,12 +648,3 @@ h1 .num {
614648
}
615649
}
616650

617-
.detail #reviews {
618-
margin-top: 45px;
619-
h3 {
620-
margin-bottom: 10px;
621-
}
622-
.not-rated {
623-
font-size: 16px;
624-
}
625-
}

media/css/mkt/promo-grid.less

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
11
@import 'lib';
22

3-
.item-arrows() {
4-
&:after {
5-
.arrow;
6-
content: "";
7-
display: block;
8-
opacity: .7;
9-
position: absolute;
10-
top: 15px;
11-
right: 10px;
12-
height: 18px;
13-
width: 18px;
14-
}
3+
.view-more a,
4+
.mkt-tile {
155
&:hover,
166
&:active {
177
background: @faint-gray;
188
.box-shadow(none);
19-
&:after {
20-
opacity: 1;
21-
}
229
}
2310
&:active {
2411
.depressed;
@@ -233,7 +220,6 @@
233220
}
234221
}
235222
.view-more a {
236-
.item-arrows;
237223
background: @bg;
238224
border-top: 1px solid @light-gray;
239225
display: block;
@@ -301,7 +287,6 @@
301287
background: @bg-lite;
302288
height: 74px;
303289
padding: 10px 40px 0 85px;
304-
.item-arrows;
305290
}
306291
}
307292
}

media/css/mkt/ratings.less

Lines changed: 5 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,8 @@ header.product {
182182
}
183183

184184
#submit-review {
185-
form {
186-
.simple-field {
187-
margin: 0;
188-
}
189-
}
190-
.barometer {
191-
font-size: 120%;
192-
line-height: 1.2;
193-
margin-bottom: 20px;
185+
form .simple-field {
186+
margin: 0;
194187
}
195188
.form-footer {
196189
margin-top: 30px;
@@ -214,52 +207,6 @@ header.product {
214207
}
215208
}
216209

217-
.barometer {
218-
span {
219-
display: inline-block;
220-
.width(1.5);
221-
&:before {
222-
background: url(../../img/icons/thumbs.png) no-repeat;
223-
content: "";
224-
display: block;
225-
float: left;
226-
margin-right: 10px;
227-
height: 20px;
228-
width: 15px;
229-
}
230-
&:hover {
231-
cursor: pointer;
232-
}
233-
&.voted {
234-
font-weight: bold;
235-
}
236-
}
237-
.upvotes {
238-
color: #00b960;
239-
&:before {
240-
background-position: 0 -42px;
241-
}
242-
&:hover, &.voted {
243-
&:before {
244-
background-position: 0 0;
245-
}
246-
}
247-
}
248-
.downvotes {
249-
color: #d93a40;
250-
&:before {
251-
background-position: 100% 100%;
252-
}
253-
&:hover, &.voted {
254-
&:before {
255-
background-position: 100% -82px;
256-
}
257-
}
258-
}
259-
}
260-
261-
262-
263210
.stars {
264211
background: url(../../img/impala/stars.png) no-repeat left top;
265212
display: inline-block;
@@ -302,6 +249,9 @@ header.product {
302249
color: @green;
303250
vertical-align: middle;
304251
}
252+
&:hover span {
253+
text-decoration: none;
254+
}
305255
}
306256

307257
.ratingwidget {

media/css/mkt/site.less

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,15 +238,15 @@ body {
238238
}
239239
.account {
240240
.border-box;
241-
margin: 15px 10px;
241+
margin: 5px 10px;
242242
color: @white;
243243
.button {
244244
padding: 5px 0;
245245
width: 100%;
246246
}
247247
}
248248
.footer-links {
249-
margin: 0 0 15px;
249+
margin: 10px 0;
250250
text-align: left;
251251
a {
252252
.border-box;

0 commit comments

Comments
 (0)