Skip to content

Commit

Permalink
clean up Edit Review form (bug 680177)
Browse files Browse the repository at this point in the history
  • Loading branch information
Chris Van committed Sep 26, 2011
1 parent 290652a commit 11553ce
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 27 deletions.
46 changes: 22 additions & 24 deletions apps/reviews/templates/reviews/impala/reply.html
@@ -1,5 +1,5 @@
{% extends "impala/base.html" %}
{% from 'includes/forms.html' import required, pretty_field %}
{% from 'includes/forms.html' import pretty_field %}

{% set title = _('Reply to review by {0}')|f(review.user.name) %}

Expand All @@ -10,9 +10,9 @@
{% block content %}

{{ impala_breadcrumbs([(addon.type_url(), amo.ADDON_TYPES[addon.type]),
(addon.get_url_path(), addon.name),
(url('i_reviews.list', addon.slug), _('Reviews')),
(None, _('Reply'))]) }}
(addon.get_url_path(), addon.name),
(addon.reviews_url, _('Reviews')),
(None, _('Reply'))]) }}
<h1>{{ title }}</h1>

<div class="secondary">
Expand All @@ -21,26 +21,24 @@ <h1>{{ title }}</h1>

<div class="primary island hero" id="reviews">
{% include "reviews/impala/review.html" %}
<div class="c">
<h2>{{ _('Write a Reply') }}</h2>
<form method="post" class="prettyform"
action="{{ url('i_reviews.reply', addon.slug, review.id) }}">
{{ csrf() }}
<fieldset>
<ul>
{{ pretty_field(form.title, label=_('Title')) }}
{{ pretty_field(form.body, label=_('Reply')) }}
</ul>
</fieldset>
<footer>
<button type="submit">{{ _('Submit review') }}</button>
{# L10n: this string is following a <button>. #}
{% trans url=url('i_reviews.list', addon.slug) %}
<a href="{{ url }}">Cancel</a>
{% endtrans %}
</footer>
</form>
</div>
<form method="post" class="prettyform c"
action="{{ url('i_reviews.reply', addon.slug, review.id) }}">
{{ csrf() }}
<fieldset>
<h2>{{ _('Write a Reply') }}</h2>
<ul>
{{ pretty_field(form.title, label=_('Title')) }}
{{ pretty_field(form.body, label=_('Reply')) }}
</ul>
</fieldset>
<footer>
<button type="submit">{{ _('Submit review') }}</button>
{# L10n: this string is following a <button>. #}
{% trans url=addon.reviews_url %}
or <a href="{{ url }}">Cancel</a>
{% endtrans %}
</footer>
</form>
</div>
{{ report_review_popup() }}
{% endblock %}
38 changes: 35 additions & 3 deletions media/css/impala/reviews.less
@@ -1,8 +1,40 @@
@import 'lib';

#reviews h2 + .article {
border-top: 1px dotted @border-blue;
padding: 1em;
#reviews {
form {
background-color: fadeOut(@border-blue, 90%);
padding: 1em 0;
fieldset, footer {
padding: 0 1em;
}
fieldset {
margin: 0;
}
footer {
input, button {
margin-right: .25em;
}
button {
float: none;
}
a {
padding-left: .25em;
}
}
}
h2 + .article {
border-top: 1px dotted @border-blue;
padding: 1em;
}
}

.html-rtl #reviews form footer {
input, button {
margin: 0 .25em 0 0;
}
a {
padding: 0 .25em;
}
}

.reviews header h3 {
Expand Down

0 comments on commit 11553ce

Please sign in to comment.