fixes conflicts [#226]

This commit is contained in:
Alberto Garcia Cabeza
2015-08-25 16:53:11 +02:00
57 changed files with 861 additions and 157 deletions

View File

@@ -26,7 +26,7 @@
<div class="small-12 medium-6 column">
<h2><%= t("account.show.avatar")%></h2>
<%= avatar_image(@account, size: 100) %>
<%= avatar_image(@account, seed: @account.id, size: 100) %>
<h2><%= t("account.show.notifications")%></h2>

View File

@@ -1,10 +1,13 @@
<span id="moderator-comment-actions">
&nbsp;|&nbsp;
<%= link_to t("admin.actions.hide").capitalize, hide_moderation_comment_path(comment),
method: :put, remote: true, data: { confirm: t('admin.actions.confirm') } %>
<% unless comment.user.hidden? %>
<span class='js-moderation-actions'>
<% if can? :hide, comment %>
&nbsp;|&nbsp;
<%= link_to t("admin.actions.hide").capitalize, hide_moderation_comment_path(comment),
method: :put, remote: true, data: { confirm: t('admin.actions.confirm') } %>
<% end %>
<% if can? :hide, comment.user %>
&nbsp;|&nbsp;
<%= link_to t("admin.actions.hide_author").capitalize, hide_moderation_user_path(comment.user_id, debate_id: @debate.id),
method: :put, data: { confirm: t('admin.actions.confirm') } %>
<% end %>
</span>
</span>

View File

@@ -5,50 +5,70 @@
<%= t("debates.comment.deleted") %>
<% else %>
<% if comment.user.organization? %>
<%= image_tag("collective_avatar.png", size: 32, class: "avatar left") %>
<% 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 %>
<%= avatar_image(comment.user, size: 32, class: "left") %>
<% end %>
<% if comment.user.hidden? %>
<i class="icon-deleted user-deleted"></i>
<% if comment.user.organization? %>
<%= image_tag("collective_avatar.png", size: 32, class: "avatar left") %>
<% else %>
<%= avatar_image(comment.user, seed: comment.user_id, size: 32, class: "left") %>
<% end %>
<% if comment.user.hidden? %>
<i class="icon-deleted user-deleted"></i>
<% end %>
<% end %>
<div class="comment-body">
<div class="comment-info">
<% if comment.user.hidden? %>
<span class="user-name"><%= t("debates.comment.user_deleted") %></span>
<% if comment.as_administrator? %>
<span class="user-name"><%= t("debates.comment.admin") %> #<%= comment.administrator_id%></span>
<% elsif comment.as_moderator? %>
<span class="user-name"><%= t("debates.comment.moderator") %> #<%= comment.moderator_id%></span>
<% else %>
<span class="user-name"><%= comment.user.name %></span>
<% if comment.user.official? %>
<% if comment.user.hidden? %>
<span class="user-name"><%= t("debates.comment.user_deleted") %></span>
<% else %>
<span class="user-name"><%= comment.user.name %></span>
<% if comment.user.official? %>
&nbsp;&bullet;&nbsp;
<span class="label round level-<%= comment.user.official_level %>">
<%= comment.user.official_position %>
</span>
<% end %>
<% end %>
<% if comment.user.verified_organization? %>
&nbsp;&bullet;&nbsp;
<span class="label round level-<%= comment.user.official_level %>">
<%= comment.user.official_position %>
<span class="label round is-association">
<%= t("shared.collective") %>
</span>
<% end %>
<% if comment.user_id == @debate.author_id %>
&nbsp;&bullet;&nbsp;
<span class="label round is-author">
<%= t("debates.comment.author") %>
</span>
<% end %>
<% end %>
<% if comment.user.verified_organization? %>
&nbsp;&bullet;&nbsp;
<span class="label round is-association">
<%= t("shared.collective") %>
</span>
<% end %>
<% if comment.user_id == @debate.author_id %>
&nbsp;&bullet;&nbsp;
<span class="label round is-author">
<%= t("debates.comment.author") %>
</span>
<% end %>
&nbsp;&bullet;&nbsp;<%= time_ago_in_words(comment.created_at) %>
<span class="right js-flag-as-inappropiate-actions">
<%= render 'comments/flag_as_inappropiate_actions', comment: comment %>
</span>
</div>
<% if comment.user.official? && comment.user_id == @debate.author_id %>
<% if comment.as_administrator? %>
<p class="comment-user is-admin"><%= comment.body %></p>
<% elsif comment.as_moderator? %>
<p class="comment-user is-moderator"><%= comment.body %></p>
<% elsif comment.user.official? && comment.user_id == @debate.author_id %>
<p class="comment-user level-<%= comment.user.official_level %> is-author"><%= comment.body %></p>
<% elsif comment.user.official? %>
<p class="comment-user level-<%= comment.user.official_level %>"><%= comment.body %></p>
@@ -69,9 +89,7 @@
<%= link_to(comment_link_text(comment), "",
class: "js-add-comment-link", data: {'id': dom_id(comment)}) %>
<% if moderator? %>
<%= render 'comments/actions', comment: comment %>
<% end %>
<%= render 'comments/actions', comment: comment %>
<%= render 'comments/form', {parent: comment, toggeable: true} %>
<% end %>
@@ -83,6 +101,5 @@
<div class="comment-children">
<%= render comment.children.with_hidden.reorder('id DESC, lft') %>
</div>
</div>
</div>

View File

@@ -4,6 +4,19 @@
<%= f.hidden_field :commentable_type, value: parent.class %>
<%= f.hidden_field :commentable_id, value: parent.id %>
<%= f.submit comment_button_text(parent), class: "button radius small" %>
<%= f.submit comment_button_text(parent), class: "button radius small inline-block" %>
<% 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" %>
</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" %>
</div>
<% end %>
<% end %>
</div>

View File

@@ -1,7 +1,9 @@
<%= link_to t("admin.actions.hide").capitalize, hide_moderation_debate_path(debate),
method: :put, remote: true, data: { confirm: t('admin.actions.confirm') } %>
<% if can? :hide, debate %>
<%= link_to t("admin.actions.hide").capitalize, hide_moderation_debate_path(debate),
method: :put, remote: true, data: { confirm: t('admin.actions.confirm') } %>
<% end %>
<% unless debate.author.hidden? %>
<% if can? :hide, debate.author %>
&nbsp;|&nbsp;
<%= link_to t("admin.actions.hide_author").capitalize, hide_moderation_user_path(debate.author_id),
method: :put, data: { confirm: t('admin.actions.confirm') } %>

View File

@@ -13,7 +13,7 @@
<h1><%= @debate.title %></h1>
<div class="debate-info">
<%= avatar_image(@debate.author, size: 32, class: 'author-photo') %>
<%= avatar_image(@debate.author, seed: @debate.author_id, size: 32, class: 'author-photo') %>
<% if @debate.author.hidden? %>
<i class="icon-deleted author-deleted"></i>
<span class="author">
@@ -52,7 +52,7 @@
<%= render 'shared/tags', debate: @debate %>
<% if moderator? %>
<div id='moderator-debate-actions'>
<div class='js-moderator-debate-actions'>
<%= render 'actions', debate: @debate %>
</div>
<% end %>

View File

@@ -0,0 +1,7 @@
<br/>
<%= link_to t("omniauth.twitter.sign_in"), user_omniauth_authorize_path(:twitter), class: 'button radius expand' %>
<%= link_to t("omniauth.facebook.sign_in"), user_omniauth_authorize_path(:facebook), class: 'button radius expand' %>
<%= link_to t("omniauth.google_oauth2.sign_in"), user_omniauth_authorize_path(:google_oauth2), class: 'button radius expand' %>
<hr/>

View File

@@ -7,11 +7,11 @@
<%= link_to(t("devise_views.menu.login_items.logout"), destroy_user_session_path, method: :delete) %>
</li>
<% else %>
<li>
<%= link_to(t("devise_views.menu.login_items.login"), new_user_session_path) %>
</li>
<li>
<%= link_to(t("devise_views.menu.login_items.signup"), new_user_registration_path, class: "button radius small") %>
</li>
<li>
<%= link_to(t("devise_views.menu.login_items.login"), new_user_session_path) %>
</li>
<li>
<%= link_to(t("devise_views.menu.login_items.signup"), new_user_registration_path, class: "button radius small") %>
</li>
<% end %>
</ul>
</ul>

View File

@@ -19,4 +19,4 @@
<%= render "devise/shared/links" %>
</div>
</div>
</div>
</div>

View File

@@ -3,6 +3,8 @@
<div class="panel">
<h2><%= t("devise_views.sessions.new.title") %></h2>
<%= render 'devise/omniauth_form' %>
<%= form_for(resource, as: resource_name, url: session_path(resource_name)) do |f| %>
<div class="row">
<div class="small-12 columns">
@@ -28,4 +30,4 @@
<%= render "devise/shared/links" %>
</div>
</div>
</div>
</div>

View File

@@ -25,7 +25,7 @@
<%= link_to t("devise_views.shared.links.new_unlock"), new_unlock_path(resource_name) %><br>
<% end -%>
<%- if devise_mapping.omniauthable? %>
<%- if devise_mapping.omniauthable? && devise_mapping.name == 'user' %>
<%- resource_class.omniauth_providers.each do |provider| %>
<%= link_to t("devise_views.shared.links.signin_with_provider", provider: provider.to_s.titleize), omniauth_authorize_path(resource_name, provider) %><br>
<% end -%>

View File

@@ -0,0 +1,13 @@
<div class="auth row">
<div class="small-12 medium-8 large-5 column small-centered">
<div class="panel">
<h1><%= t('omniauth.finish_signup.title') %></h1>
<%= form_for current_user, as: :user, url: do_finish_signup_path, html: { role: 'form'} do |f| %>
<%= render 'shared/errors', resource: current_user %>
<%= f.email_field :email, placeholder: t("devise_views.users.registrations.new.email_label"), value: nil %>
<%= f.submit t("devise_views.users.registrations.new.submit"), class: 'button radius' %>
<% end %>
</div>
</div>
</div>

View File

@@ -2,6 +2,9 @@
<div class="small-12 medium-8 large-5 column small-centered">
<div class="panel">
<h2><%= t("devise_views.users.registrations.new.title") %></h2>
<%= render 'devise/omniauth_form' %>
<%= form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
<%= render 'shared/errors', resource: resource %>