Skip to content

Commit

Permalink
User Story #1567 Создать режим "Ответить"
Browse files Browse the repository at this point in the history
При выборе переключателя "Ответить" в 15 px под нижними переключателями появляется поле для ввода комментария, при этом возможность изменять оценку не появляется.
  • Loading branch information
vintorez committed Aug 8, 2013
1 parent 48df9c0 commit ad58e59
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 88 deletions.
46 changes: 0 additions & 46 deletions exmo/scores/templates/form_dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,6 @@ <h3 class="recomendation">{{ form.comment.label }}</h3>
{# end--редактируемая таблица #}



{% if object %}

{% check_object_permission exmo2010.view_comment_score object as view_comment %}
Expand All @@ -357,49 +356,4 @@ <h3 class="recomendation">{{ form.comment.label }}</h3>

{% endif %}


{#<ul class="nav-tabs edit-tabs">#}
{# {% if view_comment %}#}
{# <li class="active">#}
{# <span>#}
{# <a href="#reply" data-toggle="tab" class="pseudo">#}
{# {% trans 'Reply' %}#}
{# </a>#}
{# </span>#}
{# </li>#}
{# <li{% if not view_comment %} class="active"{% endif %}>#}
{# <span>#}
{# <a href="#chenge_score" data-toggle="tab" class="pseudo">#}
{# {% trans 'Change score' %}#}
{# </a>#}
{# </span>#}
{# </li>#}
{# <li{% if not view_clarification and not view_comment %} class="active"{% endif %}>#}
{# <span>#}
{# <a href="#edit" data-toggle="tab" class="pseudo">#}
{# {% trans 'Edit' %}#}
{# </a>#}
{# </span>#}
{# </li>#}
{# {% endif %}#}
{#</ul>#}


{#<div class="edit-tabs">#}
{# <span>#}
{# <a href="#reply" data-toggle="tab" class="pseudo">#}
{# {% trans 'Reply' %}#}
{# </a>#}
{# </span>#}
{# <span>#}
{# <a href="#chenge_score" data-toggle="tab" class="pseudo">#}
{# {% trans 'Change score' %}#}
{# </a>#}
{# </span>#}
{# <span>#}
{# <a href="#edit" data-toggle="tab" class="pseudo">#}
{# {% trans 'Edit' %}#}
{# </a>#}
{# </span>#}
{#</div>#}
{% endblock %}
22 changes: 12 additions & 10 deletions exmo/static/exmo2010/css/score_messages.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
# This file is part of EXMO2010 software.
# Copyright 2010, 2011 Al Nikolov
# Copyright 2010, 2011, 2013 Al Nikolov
# Copyright 2010, 2011 non-profit partnership Institute of Information Freedom Development
# Copyright 2012, 2013 Foundation "Institute for Information Freedom Development"
#
Expand Down Expand Up @@ -161,20 +161,22 @@ a.messages-pseudo-off:hover
padding-top: 5px;
}

div.comment-form > p {
width: 112px;
float: left;
}
/* Form for comment */

div.comment-form > p, div.comment-form > form {
display: block;
.comment-form > p {
float: left;
}

div.comment-form > form {
.comment-form > form {
margin-left: 122px;
}

div.comment-form > form input[type="submit"] {
.comment-form > form input[type="submit"] {
width: 160px;
font-size: 13px; /* Firefox fix */
}
}

.comment-field {
margin-top: 15px;
display: none
}
4 changes: 4 additions & 0 deletions exmo/static/exmo2010/js/score.form.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,20 @@ $(document).ready(function() {

$('.edit-tabs').live('click', function(e) {
var $link;
var $form_comment = $('.comment-form');

switch (e.target.hash) {
case '#reply':
$link = $('a[href="#reply"]');
$form_comment.show();
break;
case '#change_score':
$link = $('a[href="#change_score"]');
$form_comment.hide();
break;
case '#edit':
$link = $('a[href="#edit"]');
$form_comment.hide();
break;
}

Expand Down
62 changes: 32 additions & 30 deletions exmo/templates/exmo2010/score/comment_dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,33 +88,35 @@
{% endif %}
{% endif %}

{#{% if add_comment %}#}
{# <div class="comment-form">#}
{# <p>{% trans 'Your comment' %}</p>#}
{# {% get_comment_form for object as form %}#}
{# <form action="{% comment_form_target %}" method="post">{% csrf_token %}#}
{# {% for hidden in form.hidden_fields %}#}
{# {{ hidden }}#}
{# {% endfor %}#}
{# {% if user %}#}
{# <input type="hidden" name="id_user" value="{{ user }}" />#}
{# {% else %}#}
{# <label class="label-comment">{{ form.user.label }}</label>#}
{# <br />#}
{# {{ form.user }}#}
{# <br />#}
{# {% endif %}#}
{# {% if user.email %}#}
{# <input type="hidden" name="id_email" value="{{ user.email }}" />#}
{# {% else %}#}
{# <label class="label-comment">{{ form.email.label }}</label>#}
{# <br />#}
{# {{ form.email }}#}
{# {% endif %}#}
{# {{ form.comment }}#}
{# {% wysiwyg_editor "id_comment" %}#}
{# <input type="hidden" name="next" value="{% url exmo2010:score_view object.pk %}" />#}
{# <input type="submit" name="post" id="submit-comment" class="submit-post" value="{% trans 'Post comment' %}" />#}
{# </form>#}
{# </div>#}
{#{% endif %}#}
{% include "tabs_edit.html" %}

{% if add_comment %}
<div class="comment-form comment-field">
<p>{% trans 'Your comment' %}</p>
{% get_comment_form for object as form %}
<form action="{% comment_form_target %}" method="post">{% csrf_token %}
{% for hidden in form.hidden_fields %}
{{ hidden }}
{% endfor %}
{% if user %}
<input type="hidden" name="id_user" value="{{ user }}" />
{% else %}
<label class="label-comment">{{ form.user.label }}</label>
<br />
{{ form.user }}
<br />
{% endif %}
{% if user.email %}
<input type="hidden" name="id_email" value="{{ user.email }}" />
{% else %}
<label class="label-comment">{{ form.email.label }}</label>
<br />
{{ form.email }}
{% endif %}
{{ form.comment }}
{% wysiwyg_editor "id_comment" %}
<input type="hidden" name="next" value="{% url exmo2010:score_view object.pk %}" />
<input type="submit" name="post" id="submit-comment" class="submit-post" value="{% trans 'Post comment' %}" />
</form>
</div>
{% endif %}
2 changes: 0 additions & 2 deletions exmo/templates/exmo2010/score/tabs_dev.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@
{% if view_comment %}
<div class="tab-pane active" id="comments">
{% include "exmo2010/score/comment_dev.html" %}
{% include "tabs_edit.html" %}
</div>
{% endif %}

Expand All @@ -82,4 +81,3 @@
</div>
{% endif %}
</div>

0 comments on commit ad58e59

Please sign in to comment.