merges master and fixes conflicts

This commit is contained in:
kikito
2015-08-28 19:57:28 +02:00
20 changed files with 141 additions and 69 deletions

View File

@@ -1,16 +1,18 @@
<div class="row">
<div id="<%= dom_id(comment) %>" class="comment small-12 column">
<% if comment.not_visible? %>
<%= t("debates.comment.deleted") %>
<% if comment.hidden? || comment.user.hidden? %>
<% if comment.children_count > 0 %>
<div class="is-deleted">
<p><%= t("debates.comment.deleted") %></p>
</div>
<% end %>
<% else %>
<% if comment.as_administrator? %>
<%= image_tag("admin_avatar.png", size: 32, class: "admin-avatar left") %>
<% elsif comment.as_moderator? %>
<%= image_tag("moderator_avatar.png", size: 32, class: "moderator-avatar left") %>
<% else %>
<% if comment.user.organization? %>
<%= image_tag("collective_avatar.png", size: 32, class: "avatar left") %>
<% else %>
@@ -19,7 +21,6 @@
<% if comment.user.hidden? %>
<i class="icon-deleted user-deleted"></i>
<% end %>
<% end %>
<div class="comment-body">
@@ -91,11 +92,10 @@
<% end %>
</div>
</div>
<% end %>
<div class="comment-children">
<%= render comment.children.for_render.reorder('id DESC, lft') %>
</div>
<div class="comment-children">
<%= render comment.children.for_render.reorder('id DESC, lft') %>
</div>
</div>
</div>

View File

@@ -1,6 +1,7 @@
<div id="js-comment-form-<%= dom_id(parent) %>" <%= "style='display:none'".html_safe if toggeable %>>
<%= form_for [@debate, Comment.new], remote: true do |f| %>
<%= f.text_area :body, label: t("comments.form.leave_comment") %>
<%= label_tag "comment-body-#{dom_id(parent)}", t("comments.form.leave_comment") %>
<%= f.text_area :body, id: "comment-body-#{dom_id(parent)}", label: false %>
<%= f.hidden_field :commentable_type, value: parent.class %>
<%= f.hidden_field :commentable_id, value: parent.id %>
@@ -8,14 +9,14 @@
<% if can? :comment_as_moderator, @debate %>
<div class="right">
<%= f.check_box :as_moderator, label: false %>
<%= f.label :as_moderator, t("comments.form.comment_as_moderator"), class: "checkbox" %>
<%= f.check_box :as_moderator, id: "comment-as-moderator-#{dom_id(parent)}", label: false %>
<%= label_tag "comment-as-moderator-#{dom_id(parent)}", t("comments.form.comment_as_moderator"), class: "checkbox" %>
</div>
<% end %>
<% if can? :comment_as_administrator, @debate %>
<div class="right">
<%= f.check_box :as_administrator, label: false %>
<%= f.label :as_administrator, t("comments.form.comment_as_admin"), class: "checkbox" %>
<%= f.check_box :as_administrator, id: "comment-as-administrator-#{dom_id(parent)}",label: false %>
<%= label_tag "comment-as-administrator-#{dom_id(parent)}", t("comments.form.comment_as_admin"), class: "checkbox" %>
</div>
<% end %>
<% end %>

View File

@@ -1,2 +1,2 @@
var field_with_errors = "#js-comment-form-<%= dom_id(@parent) %> #comment_body";
var field_with_errors = "#js-comment-form-<%= dom_id(@parent) %> #comment-body-<%= dom_id(@parent) %>";
App.Comments.display_error(field_with_errors, "<%= j render('comments/errors') %>");

View File

@@ -1,34 +1,45 @@
<section role="main">
<!-- Filters -->
<div class="filters row">
<div class="small-12 column">
<h2><%= t("debates.index.showing") %></h2>
<form class="inline-block">
<select class="js-location-changer" name="order-selector">
<% @valid_orders.each do |order| %>
<option <%= 'selected' if order == @order %>
value='<%= url_for(request.query_parameters.merge(order: order))%>'>
<%= t("debates.index.orders.#{order}") %>
</option>
<% end %>
</select>
</form>
</div>
</div>
<!-- /. Filters -->
<div class="small-9 column">
<!-- Filter topic results -->
<div class="filters row">
<div class="small-12 column">
<h2>
<%= t("debates.index.filter_topic",
number: "N",
topic: "topic").html_safe %>
</h2>
<div class="inline-block" >
<% if @tag_filter %>
<h2>
<%= t("debates.index.filter_topic",
number: @debates.size,
topic: @tag_filter) %>
</h2>
<% else %>
<h2><%= t("debates.index.select_topic") %></h2>
<form class="inline-block">
<select class="js-location-changer" name="tag-filter">
<option value="/" selected="selected"><%= t("debates.index.all") %></option>
<% @tags.each do |tag| %>
<option value='<%= url_for(request.query_parameters.merge(tag: tag.name))%>'>
<%= tag.name %>
</option>
<% end %>
</select>
</form>
<% end %>
</div>
<div class="inline-block right">
<h6 class="inline-block"><%= t("debates.index.select_order") %></h6>
<form class="inline-block">
<select class="js-location-changer" name="order-selector">
<% @valid_orders.each do |order| %>
<option <%= 'selected' if order == @order %>
value='<%= url_for(request.query_parameters.merge(order: order))%>'>
<%= t("debates.index.orders.#{order}") %>
</option>
<% end %>
</select>
</form>
</div>
</div>
</div>
<!-- /. Filter topic results -->
<div class="row">
<div id="debates" class="debates-list small-12 medium-9 column">