Merge pull request #1041 from consul/select-featured-debates
Select featured debates
This commit is contained in:
@@ -8,3 +8,14 @@
|
||||
<%= link_to t("admin.actions.hide_author").capitalize, hide_moderation_user_path(debate.author_id),
|
||||
method: :put, data: { confirm: t('admin.actions.confirm') } %>
|
||||
<% end %>
|
||||
|
||||
<% if can? :mark_featured, debate %>
|
||||
|
|
||||
<% if debate.featured? %>
|
||||
<%= link_to t("admin.actions.unmark_featured").capitalize, unmark_featured_debate_path(debate),
|
||||
method: :put, data: { confirm: t('admin.actions.confirm') } %>
|
||||
<% else %>
|
||||
<%= link_to t("admin.actions.mark_featured").capitalize, mark_featured_debate_path(debate),
|
||||
method: :put, data: { confirm: t('admin.actions.confirm') } %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
13
app/views/debates/_featured_debates.html.erb
Normal file
13
app/views/debates/_featured_debates.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<div id="featured-debates" class="row featured-debates">
|
||||
|
||||
<div class="small-12 column">
|
||||
<h2><%= t("debates.index.featured_debates") %></h2>
|
||||
</div>
|
||||
|
||||
<% @featured_debates.each do |debate| %>
|
||||
<div class="small-12 medium-6 column end">
|
||||
<h3><%= link_to debate.title, debate %></h3>
|
||||
<%= link_to debate.author.name, user_path(debate.author)%>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -1,17 +0,0 @@
|
||||
<div id="featured-debates" class="row featured-debates">
|
||||
|
||||
<div class="small-12 column">
|
||||
<h2><%= t("debates.index.featured_debates") %></h2>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-6 column">
|
||||
<h3><%= link_to "#Túpreguntas: Manuela Carmena, Alcaldesa de Madrid.", "https://decide.madrid.es/debates/4320" %></h3>
|
||||
<%= link_to "Manuela Carmena ", "https://decide.madrid.es/users/21452"%>
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-6 column">
|
||||
<h3><%= link_to "¿Y si pudieras entrevistar a Manuela Carmena o a los otros concejales?", "https://decide.madrid.es/debates/4299" %></h3>
|
||||
<%= link_to "ParticipaciónYTransparenciaAytoMadrid", "https://decide.madrid.es/users/52055"%>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -25,8 +25,8 @@
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% unless @tag_filter || @search_terms %>
|
||||
<%= render "featured_debates_static" %>
|
||||
<% unless @tag_filter || @search_terms || !has_featured? %>
|
||||
<%= render "featured_debates" %>
|
||||
<% end %>
|
||||
|
||||
<%= render "shared/advanced_search", search_path: debates_path(page: 1) %>
|
||||
|
||||
Reference in New Issue
Block a user