Skip to content

Commit

Permalink
Forum reply update.
Browse files Browse the repository at this point in the history
  • Loading branch information
ngodfraind committed Jan 13, 2016
1 parent 25d0f15 commit 1cd452c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 25 deletions.
1 change: 1 addition & 0 deletions Resources/translations/forum.en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ reply_to: Reply to %author%:
quote: Quote
title_option_form_last_messages: Just display the last messages which I have contributed
title_form_last_messages: Display messages
please_connect_to_answer: You need to be logged on to reply on this forum
1 change: 1 addition & 0 deletions Resources/translations/forum.fr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,4 @@ reply_to: Répondre à %author%:
quote: Citer
title_option_form_last_messages: Afficher seulement les conversations auxquelles j'ai participé
title_form_last_messages: Apparence des messages
please_connect_to_answer: Il est nécessaire de se connecter pour participer au forum
49 changes: 24 additions & 25 deletions Resources/views/Forum/messages.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -143,36 +143,35 @@
{{ renderPager(subject.getId(), pager, max) }}

{% if canPost %}
<btn id='fast-reply-btn' class='btn btn-primary pull-right'>{{ 'fast_reply'|trans({}, 'forum')}}</btn>
<btn id='fast-reply-btn' class='btn btn-primary pull-right {% if has_role('ROLE_ANONYMOUS') %} disabled {% endif %}'>
{{ 'fast_reply'|trans({}, 'forum')}}
</btn>
{% endif %}
</div>
{% if canPost %}
<div class="fast-reply" style="display: none;">
<h4><i class="fa fa-reply"></i> {{ 'new_message' | trans({}, 'forum') }}</h4>
<div>
{% if not subject.isClosed() %}
<textarea class="forum-answer claroline-tiny-mce hide"></textarea>
{# something may be wrong here because _token doesn't always exists #}
{% if form._token is defined %} {{ form_widget(form._token) }} {% endif %}
{% if has_role('ROLE_ANONYMOUS') %}
<div class='pull-right alert alert-warning'> {{ 'please_connect_to_answer'|trans({}, 'forum') }}
{% endif %}
<div class="fast-reply" style="display: none;">
<h4><i class="fa fa-reply"></i> {{ 'new_message' | trans({}, 'forum') }}</h4>
<div>
{% if not subject.isClosed() %}
<textarea class="forum-answer claroline-tiny-mce hide"></textarea>
{# something may be wrong here because _token doesn't always exists #}
{% if form._token is defined %} {{ form_widget(form._token) }} {% endif %}
{% endif %}
</div>
</br>
<div class="pull-right">
<a class="btn btn-default" href='{{ path('claro_forum_subjects', { 'category': category.getId() }) }}'>
{{ 'back'|trans({}, 'platform') }}
</a>
<a id="submit-message" class="btn btn-primary">
<i class="fa fa-reply"></i> {{ 'send' | trans({}, 'platform') }}
</a>
</div>
</div>
{% endif %}
</div>
</div>
<div class="panel-footer clearfix">
<div class="pull-right">
{% if not subject.isClosed() %}
<a class="btn btn-default" href='{{ path('claro_forum_subjects', { 'category': category.getId() }) }}'>
{{ 'back'|trans({}, 'platform') }}
</a>
{% if canPost %}
<a class="btn btn-primary">
<i class="fa fa-reply"></i> {{ 'send' | trans({}, 'platform') }}
</a>
{% endif %}
{% endif %}
</div>
</div>
{% endblock %}

{% block javascripts %}
Expand All @@ -192,7 +191,7 @@
<script>
(function () {
'use strict';
$('body').on('click', '.panel-footer .btn-primary', function () {
$('body').on('click', '#submit-message', function () {
var content = $('textarea.claroline-tiny-mce').val();
var token = $('#forum_message_form__token').val();
Expand Down

0 comments on commit 1cd452c

Please sign in to comment.