Adds styles to communities views

This commit is contained in:
decabeza
2018-10-05 17:46:45 +02:00
parent 71c70b8324
commit 76ec44a810
5 changed files with 72 additions and 43 deletions

View File

@@ -1,5 +1,10 @@
<%= link_to poll do %> <div class="community-poll">
<strong><%= poll.title %></strong> <h4>
<% end %> <%= link_to poll.title, poll %>
<p class="help-text"><%= t('.take_part', from: l(poll.starts_at.to_date), to:(poll.ends_at.to_date)) %></p> </h4>
<hr>
<p class="topic-info">
<%= t("communities.poll.take_part",
from: l(poll.starts_at.to_date), to:(poll.ends_at.to_date)) %>
</p>
</div>

View File

@@ -1,6 +1,11 @@
<div class="row column communities-participant"> <div class="row column communities-participant">
<ul class="tabs" data-tabs id="communities-show-tabs"> <ul class="tabs" id="communities_show_tabs"
data-deep-link="true"
data-update-history="true"
data-deep-link-smudge="true"
data-deep-link-smudge-delay="500"
data-tabs>
<li class="tabs-title is-active"> <li class="tabs-title is-active">
<%= link_to "#tab-participants" do %> <%= link_to "#tab-participants" do %>
@@ -13,9 +18,9 @@
<% if @community.proposal.present? %> <% if @community.proposal.present? %>
<li class="tabs-title"> <li class="tabs-title">
<%= link_to '#tab-polls' do %> <%= link_to "#tab-polls" do %>
<h3> <h3>
<%= t('.surveys') %> <%= t("communities.subnav.surveys") %>
<span class="js-comments-count">(<%= @community.proposal.polls.count %>)</span> <span class="js-comments-count">(<%= @community.proposal.polls.count %>)</span>
</h3> </h3>
<% end %> <% end %>
@@ -23,13 +28,13 @@
<% end %> <% end %>
</ul> </ul>
<div class="tabs-content" data-tabs-content="communities-show-tabs"> <div class="tabs-content" data-tabs-content="communities_show_tabs">
<div class="tabs-panel is-active" id="tab-participants"> <div class="tabs-panel is-active" id="tab-participants">
<%= render partial: 'participant', collection: @participants %> <%= render partial: 'participant', collection: @participants %>
</div> </div>
<% if @community.proposal.present? %> <% if @community.proposal.present? %>
<div class="tabs-panel" id="tab-polls"> <div class="tabs-panel topic-show" id="tab-polls">
<%= render partial: 'poll', collection: @community.proposal.polls %> <%= render partial: 'poll', collection: @community.proposal.polls %>
</div> </div>
<% end %> <% end %>

View File

@@ -17,7 +17,8 @@
<aside class="small-12 column show-for-small-only"> <aside class="small-12 column show-for-small-only">
<div class="sidebar-divider"></div> <div class="sidebar-divider"></div>
<h2><%= t("community.show.sidebar.participate") %></h2> <h2><%= t("community.show.sidebar.participate") %></h2>
<%= link_to t("community.show.sidebar.new_topic"), create_topic_link(@community) , class: "button expanded" %> <%= link_to t("community.show.sidebar.new_topic"),
create_topic_link(@community), class: "button expanded" %>
</aside> </aside>
<div class="small-12 medium-9 column"> <div class="small-12 medium-9 column">
@@ -30,20 +31,22 @@
<aside class="small-12 medium-3 column hide-for-small-only"> <aside class="small-12 medium-3 column hide-for-small-only">
<% if @community.proposal.present? %> <% if @community.proposal.present? %>
<div class="sidebar-divider"></div> <div class="sidebar-divider"></div>
<h2><%= t('.author') %></h2> <h2><%= t("communities.show.author") %></h2>
<%= link_to t('.send_notification'), <%= link_to t("communities.show.send_notification"),
new_proposal_notification_path(proposal_id: @community.proposal.id), new_proposal_notification_path(proposal_id: @community.proposal.id),
class: 'button expanded hollow' %> class: "button expanded hollow" %>
<% end %> <% end %>
<div class="sidebar-divider"></div> <div class="sidebar-divider"></div>
<h2><%= t("community.show.sidebar.participate") %></h2> <h2><%= t("community.show.sidebar.participate") %></h2>
<%= link_to t("community.show.sidebar.new_topic"), create_topic_link(@community) , class: "button expanded" %> <%= link_to t("community.show.sidebar.new_topic"),
create_topic_link(@community), class: "button expanded" %>
<% if @community.proposal&.polls&.current&.any? %> <% if @community.proposal&.polls&.current&.any? %>
<div class="sidebar-divider"></div> <div class="sidebar-divider"></div>
<h2><%= t('.surveys') %></h2> <h2><%= t("communities.show.surveys") %></h2>
<%= link_to t('.complete_survey'), @community.proposal.polls.current.first, class: 'button expanded hollow' %> <%= link_to t("communities.show.complete_survey"),
@community.proposal.polls.current.first, class: "button expanded hollow" %>
<% end %> <% end %>
</aside> </aside>
</div> </div>

View File

@@ -1,10 +1,10 @@
<li> <li>
<%= comment.body %> <%= comment.body %>
<p class="help-text"> <p class="topic-info">
<%= comment.commentable.title %> <%= comment.commentable.title %>
- &nbsp;&bullet;&nbsp;
<%= l(comment.updated_at.to_date) %> <%= l(comment.updated_at.to_date) %>
- &nbsp;&bullet;&nbsp;
<%= comment.author.name %> <%= comment.author.name %>
</p> </p>
</li> </li>

View File

@@ -1,39 +1,55 @@
<% content_for :action_title, t("dashboard.menu.community") %> <% content_for :action_title, t("dashboard.menu.community") %>
<div class="row"> <div class="row expanded dashboard-community">
<div class="small-12 large-9 column"> <div class="small-12 medium-9 column">
<%= link_to t("dashboard.community.access_community"), community_path(proposal.community), class: 'button hollow', target: '_blank' %> <%= link_to t("dashboard.community.access_community"),
<% unless proposal.community.latest_activity.nil? %> community_path(proposal.community),
<p class="help-text"><%= t("dashboard.community.latest_activity", at: l(proposal.community.latest_activity.to_date)) %></p> class: "button hollow",
target: "_blank" %>
<% if proposal.community.latest_activity.present? %>
<p class="help-text">
<%= t("dashboard.community.latest_activity",
at: l(proposal.community.latest_activity.to_date)) %>
</p>
<% end %> <% end %>
</div> </div>
<div class="small-12 large-1 column community-totals"> <div class="small-12 medium-1 column community-totals">
<span class="fi-torsos-all"></span> <span class="icon-organizations"></span>
&nbsp;<strong><%= number_with_delimiter(proposal.community.participants_count, delimiter: '.') %></strong> <span class="community-number">
<p><%= t("dashboard.community.participants") %></p> <%= number_with_delimiter(proposal.community.participants_count, delimiter: '.') %>
</span>
<p class="community-info">
<%= t("dashboard.community.participants") %>
</p>
</div> </div>
<div class="small-12 large-1 column community-totals"> <div class="small-12 large-1 column community-totals">
<span class="fi-comment-quotes"></span> <span class="icon-debates"></span>
&nbsp;<strong><%= number_with_delimiter(proposal.community.debates_count, delimiter: '.') %></strong> <span class="community-number">
<p><%= t("dashboard.community.debates") %></p> <%= number_with_delimiter(proposal.community.debates_count, delimiter: '.') %>
</span>
<p class="community-info">
<%= t("dashboard.community.debates") %>
</p>
</div> </div>
<div class="small-12 large-1 column community-totals"> <div class="small-12 large-1 column community-totals">
<span class="fi-comments"></span> <span class="icon-comments"></span>
&nbsp;<strong><%= number_with_delimiter(proposal.community.comments_count, delimiter: '.') %></strong> <span class="community-number">
<p><%= t("dashboard.community.comments") %></p> <%= number_with_delimiter(proposal.community.comments_count, delimiter: '.') %>
</span>
<p class="community-info">
<%= t("dashboard.community.comments") %>
</p>
</div> </div>
</div> </div>
<% if proposal.community.comments.any? %> <% if proposal.community.comments.any? %>
<div class="action-title"> <h4 class="title"><%= t("dashboard.community.latest_comments") %></h5>
<h5><%= t("dashboard.community.latest_comments") %></h5>
<hr>
</div>
<ul> <ul class="topic-show">
<%= render partial: 'comment', collection: proposal.community.comments.sort_by_newest.limit(5) %> <%= render partial: 'comment',
collection: proposal.community.comments.sort_by_newest.limit(5) %>
</ul> </ul>
<% end %> <% end %>