From 49c468fec45cad3ad84ffcb5a23c36096c7d1bd8 Mon Sep 17 00:00:00 2001 From: Matt Claypotch Date: Fri, 29 Jul 2011 16:46:10 -0700 Subject: [PATCH] prettying-up the reviews add page --- .../reviews/templates/reviews/impala/add.html | 33 ++++++++++--------- .../templates/reviews/impala/reply.html | 32 +++++++++--------- media/css/impala/forms.less | 31 +++++++++++++---- media/css/impala/prose.less | 9 ++++- media/css/impala/reviews.less | 6 ++-- media/css/impala/site.less | 3 +- media/css/impala/typography.less | 33 +++++++++++++------ templates/includes/forms.html | 14 ++++++++ 8 files changed, 110 insertions(+), 51 deletions(-) diff --git a/apps/reviews/templates/reviews/impala/add.html b/apps/reviews/templates/reviews/impala/add.html index c8b9c8f183..9f5c4de01c 100644 --- a/apps/reviews/templates/reviews/impala/add.html +++ b/apps/reviews/templates/reviews/impala/add.html @@ -1,4 +1,5 @@ {% extends "impala/base.html" %} +{% from 'includes/forms.html' import required, pretty_field %} {% set title = _('Add a review for {0}')|f(addon.name) %} @@ -13,19 +14,17 @@ (url('i_reviews.list', addon.slug), _('Reviews')), (None, _('Add'))]) }} +

{{ title }}

+
{{ addon|sidebar_listing }}
-
-
-

{{ title }}

-
- -
+
+
{% trans support=addon.get_url_path() + "#support", guide=remora_url('pages/review_guide') %} -

Keep these tips in mind:

+

Keep these tips in mind:

  • Write like you're telling a friend about your experience with the add-on. @@ -47,18 +46,20 @@

    Please read the Review Guidelines for more detail about user add-on reviews.

    {% endtrans %} -
- +
{{ csrf() }} -

- - {{ form.title }} -

- {{ field(form.rating, _('Rating:')) }} - {{ field(form.body, _('Review:')) }} - +
+
    + {{ pretty_field(form.title, label=_('title')) }} + {{ pretty_field(form.rating, label=_('rating')) }} + {{ pretty_field(form.body, label=_('review')) }} +
+
+
+ +
{% endblock %} diff --git a/apps/reviews/templates/reviews/impala/reply.html b/apps/reviews/templates/reviews/impala/reply.html index f9b88951f6..54b85012ee 100644 --- a/apps/reviews/templates/reviews/impala/reply.html +++ b/apps/reviews/templates/reviews/impala/reply.html @@ -1,4 +1,5 @@ {% extends "impala/base.html" %} +{% from 'includes/forms.html' import required, pretty_field %} {% set title = _('Reply to review by {0}')|f(review.user.name) %} @@ -12,30 +13,31 @@ (addon.get_url_path(impala=True), addon.name), (url('i_reviews.list', addon.slug), _('Reviews')), (None, _('Reply'))]) }} +

{{ title }}

{{ addon|sidebar_listing }}
-
-

{{ title }}

- +
{% include "reviews/impala/review.html" %} - -
+

{{ _('Write a Reply') }}

{{ csrf() }} -

- - {{ form.title }} -

- {{ field(form.body, _('Reply:')) }} - - {# L10n: this string is following a + {# L10n: this string is following a
diff --git a/media/css/impala/forms.less b/media/css/impala/forms.less index a9dadcce89..76dc32870a 100644 --- a/media/css/impala/forms.less +++ b/media/css/impala/forms.less @@ -17,9 +17,6 @@ textarea { width: 100%; } -form p { - margin-bottom: 1em; -} .note { color: @medium-gray; @@ -27,6 +24,11 @@ form p { line-height: 1.4; } +.errorlist { + color: #C00000; + font-size: 12px; +} + .edit_with_prefix, .edit-with-suffix { span { border: 1px solid #5875A0; @@ -100,7 +102,10 @@ form p { text-transform: uppercase; } } - label { + li { + margin-bottom: 1em; + } + li > label { color: #555; display: inline-block; font-weight: normal; @@ -129,12 +134,17 @@ form p { box-shadow: 2px 2px #EFF6FE inset; color: #5B738E; font-size: 1em; - margin-bottom: 1em; padding: 4px 7px; &:focus { color: #394D63; border-color: #809CBA; } + display: inline-block; + vertical-align: middle; + } + textarea { + width: 400px; + vertical-align: text-top; } p.note { color: #888; @@ -183,9 +193,18 @@ form p { padding-left: 1em; } } - .listing-footer { + footer { button { float: right; } } + .error { + input[type="text"], input[type="password"], select, textarea { + border-color: #C00000; + } + } + .errorlist { + margin-top: 2px; + padding-left: 137px; + } } diff --git a/media/css/impala/prose.less b/media/css/impala/prose.less index 0f69404b9b..77630fe412 100644 --- a/media/css/impala/prose.less +++ b/media/css/impala/prose.less @@ -1,5 +1,11 @@ +@import 'lib.less'; + .prose { - line-height: 1.2em; + color: @dark-gray; + line-height: 1.4em; + h2 { + margin-bottom: .5em; + } ul, ol { margin: 0 0 0 20px; } @@ -11,6 +17,7 @@ } li { margin-left: 1em; + margin-bottom: 1em; } b, strong { font-weight: bold; diff --git a/media/css/impala/reviews.less b/media/css/impala/reviews.less index 53dab7f05f..106e29dbcb 100644 --- a/media/css/impala/reviews.less +++ b/media/css/impala/reviews.less @@ -38,6 +38,9 @@ &.reply { padding-left: 56px; } + &:first-child { + padding-top: 0; + } } .stars { @@ -200,10 +203,9 @@ } .ratingwidget { - display: block; + display: inline-block; float: none; width: 65px; - margin-bottom: 1em; input { display: none; } diff --git a/media/css/impala/site.less b/media/css/impala/site.less index 8aab99a2ed..609aa7009c 100644 --- a/media/css/impala/site.less +++ b/media/css/impala/site.less @@ -28,7 +28,8 @@ a { .gradient-two-color(#FCFDFE, #F4F8FC); border: 1px solid @border-blue; .border-radius(5px); - .box-shadow(0 -2px 0 rgba(204, 223, 243, 0.3) inset, 0 0 1px rgba(0, 0, 0, 0.1)); + .box-shadow(0 -2px 0 rgba(204, 223, 243, 0.3) inset, + 0 0 1px rgba(0, 0, 0, 0.1)); display: block; float: left; margin-bottom: 15px; diff --git a/media/css/impala/typography.less b/media/css/impala/typography.less index da1b13d17c..343c8aebd9 100644 --- a/media/css/impala/typography.less +++ b/media/css/impala/typography.less @@ -18,11 +18,6 @@ body { font-size: 13px; } -h1 { - color: @red; - font: italic 24px/1.3 @serif-stack; -} - section + h1 { margin: 15px 0; } @@ -31,11 +26,27 @@ section + h1 { font: normal 40px/40px MetaBlack; letter-spacing: -1px; text-transform: uppercase; + margin-bottom: 7px; +} + +h1 { + font: italic 24px @serif-stack; + color: @red; + margin-bottom: 16px; } h2 { - color: @dark-gray; font: italic 18px @serif-stack; + color: @dark-gray; +} + +hgroup { + h2 { + color: #666; + } + b { + font-weight: bold; + } } h4 { @@ -89,9 +100,6 @@ pre { } .gutter { - .primary, .secondary { - font-family: @serif-stack; - } .secondary h3 { font-style: italic; } @@ -103,9 +111,14 @@ pre { margin-left: .5em; } +.addon-details { + .primary, .secondary { + font-family: @serif-stack; + } +} + .island, .modal, .popup { h2 { - font-size: 18px; margin-bottom: .5em; .seeall { .defaultlink diff --git a/templates/includes/forms.html b/templates/includes/forms.html index 4754ebace4..f3fb5fdd4e 100644 --- a/templates/includes/forms.html +++ b/templates/includes/forms.html @@ -1,3 +1,17 @@ {% macro required() -%} * {%- endmacro %} + +{% macro pretty_field(field, label=None, tag='li', req=False) %} + {% set req = field.field.required or req %} + <{{ tag }} class="row{{ ' error' if field.errors else '' }}"> + + {{ field.as_widget() }} + {{ field.errors }} + +{% endmacro %} \ No newline at end of file