refactors shared part of debate & proposal views
This commit is contained in:
@@ -21,31 +21,7 @@
|
||||
<% end %>
|
||||
|
||||
<div class="debate-info">
|
||||
<%= avatar_image(@debate.author, seed: @debate.author_id, size: 32, class: 'author-photo') %>
|
||||
|
||||
<% if @debate.author.hidden? || @debate.author.erased? %>
|
||||
<i class="icon-deleted author-deleted"></i>
|
||||
<span class="author">
|
||||
<%= t("debates.show.author_deleted") %>
|
||||
</span>
|
||||
<% else %>
|
||||
<span class="author">
|
||||
<%= @debate.author.name %>
|
||||
</span>
|
||||
<% if @debate.author.official? %>
|
||||
•
|
||||
<span class="label round level-<%= @debate.author.official_level %>">
|
||||
<%= @debate.author.official_position %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if @debate.author.verified_organization? %>
|
||||
•
|
||||
<span class="label round is-association">
|
||||
<%= t("shared.collective") %>
|
||||
</span>
|
||||
<% end %>
|
||||
<%= render '/shared/author_info', resource: @debate %>
|
||||
|
||||
<span class="bullet"> • </span>
|
||||
<%= l @debate.created_at.to_date %>
|
||||
|
||||
@@ -27,31 +27,7 @@
|
||||
<% end %>
|
||||
|
||||
<div class="proposal-info">
|
||||
<%= avatar_image(@proposal.author, seed: @proposal.author_id, size: 32, class: 'author-photo') %>
|
||||
|
||||
<% if @proposal.author.hidden? || @proposal.author.erased? %>
|
||||
<i class="icon-deleted author-deleted"></i>
|
||||
<span class="author">
|
||||
<%= t("proposals.show.author_deleted") %>
|
||||
</span>
|
||||
<% else %>
|
||||
<span class="author">
|
||||
<%= @proposal.author.name %>
|
||||
</span>
|
||||
<% if @proposal.author.official? %>
|
||||
•
|
||||
<span class="label round level-<%= @proposal.author.official_level %>">
|
||||
<%= @proposal.author.official_position %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if @proposal.author.verified_organization? %>
|
||||
•
|
||||
<span class="label round is-association">
|
||||
<%= t("shared.collective") %>
|
||||
</span>
|
||||
<% end %>
|
||||
<%= render '/shared/author_info', resource: @proposal %>
|
||||
|
||||
<span class="bullet"> • </span>
|
||||
<%= l @proposal.created_at.to_date %>
|
||||
|
||||
25
app/views/shared/_author_info.html.erb
Normal file
25
app/views/shared/_author_info.html.erb
Normal file
@@ -0,0 +1,25 @@
|
||||
<%= avatar_image(resource.author, seed: resource.author_id, size: 32, class: 'author-photo') %>
|
||||
|
||||
<% if resource.author.hidden? || resource.author.erased? %>
|
||||
<i class="icon-deleted author-deleted"></i>
|
||||
<span class="author">
|
||||
<%= t("shared.author_info.author_deleted") %>
|
||||
</span>
|
||||
<% else %>
|
||||
<span class="author">
|
||||
<%= resource.author.name %>
|
||||
</span>
|
||||
<% if resource.author.official? %>
|
||||
•
|
||||
<span class="label round level-<%= resource.author.official_level %>">
|
||||
<%= resource.author.official_position %>
|
||||
</span>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% if resource.author.verified_organization? %>
|
||||
•
|
||||
<span class="label round is-association">
|
||||
<%= t("shared.collective") %>
|
||||
</span>
|
||||
<% end %>
|
||||
@@ -310,6 +310,8 @@ en:
|
||||
debate: "secret code did not match with the image"
|
||||
proposal: "secret code did not match with the image"
|
||||
shared:
|
||||
author_info:
|
||||
author_deleted: Deleted user
|
||||
tags_cloud:
|
||||
tags: Trend
|
||||
print:
|
||||
|
||||
@@ -310,6 +310,8 @@ es:
|
||||
debate: "el código secreto no coincide con la imagen"
|
||||
proposal: "el código secreto no coincide con la imagen"
|
||||
shared:
|
||||
author_info:
|
||||
author_deleted: Usuario eliminado
|
||||
tags_cloud:
|
||||
tags: Tendencias
|
||||
print:
|
||||
|
||||
Reference in New Issue
Block a user