Skip to content

Commit

Permalink
cards images displayed better + date layouts for events
Browse files Browse the repository at this point in the history
  • Loading branch information
sic2 committed Oct 24, 2016
1 parent 4096950 commit c2bbe4a
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 15 deletions.
11 changes: 8 additions & 3 deletions webapp/app/views/events/_table.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<th class="col-xs">Quando</th>
<th class="col-xs">Dove</th>
<th class="col-xs">Chi</th>
<th class="col-xs">Link</th>
<th class="col-xs"></th>
</tr>
</thead>

Expand All @@ -14,12 +14,17 @@
<% events.each do |event| %>
<% if event_type == :future %>
<tr id="future" class="table-success">
<% elsif event_type == :old%>
<% elsif event_type == :old %>
<tr id="old" class="table-warning">
<% end %>

<td class="col-xs"><%= event.name %></td>
<td class="col-xs"><%= l event.starts_at, format: :short %></td>
<% if event_type == :future %>
<td class="col-xs"><%= l event.starts_at, format: :rfc822_short %></td>
<% elsif event_type == :old %>
<td class="col-xs"><%= l event.starts_at, format: :rfc822 %></td>
<% end %>

<td class="col-xs"><%= event.location_name %></td>
<td class="col-xs"><%= event.organiser %></td>
<td class="col-xs">
Expand Down
5 changes: 1 addition & 4 deletions webapp/app/views/feed/_card.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
<%= content_tag(:div, class: 'post card-block', data: {toggle: "modal", target: '#' + post.uid} ) do %>
<% if post.picture %>
<img src=<%= post.picture %> class="center-block img-fluid img-rounded">
<br>
<% end %>

<blockquote class="card-blockquote">
<p>
<%= truncate(post.name, length: 40) if post.name %>
Expand Down
3 changes: 3 additions & 0 deletions webapp/app/views/feed/_posts.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
data-intro="This is a post of the PAC group. Yellow posts are links. Orange posts are photos." data-position='right'
<% end %>
>
<% if post.picture %>
<img src=<%= post.picture %> class="card-img-top img-fluid">
<% end %>
<%= render partial: "card", locals: {post: post} %>
</div>
<% end %>
3 changes: 3 additions & 0 deletions webapp/app/views/feed/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@
<% @posts_jobs.each_with_index do |post, index| %>
<div class="card" style="background-color: #90CAF9; border-color: #64B5F6;" <% if index==0 %>
data-intro="This is a post about a job advertisement recently posted on the group PAC" data-position='left' <% end %>>
<% if post.picture %>
<img src=<%= post.picture %> class="card-img-top img-fluid">
<% end %>
<%= render partial: "card", locals: {post: post} %>
</div>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion webapp/app/views/home/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Su <strong>isamuni</strong> puoi trovare (clicca i link ed esplora!):
<a href="/communities"><i class="fa fa-institution"></i></a> <%= @communities_count %> <a href="/communities">comunità</a>
</li>
<li>
<a href="/users"><i class="fa fa-users"></i></a> <%= @users_count %> <a href="/companies">studenti o professionisti</a>
<a href="/users"><i class="fa fa-users"></i></a> <%= @users_count %> <a href="/users">studenti o professionisti</a>
</li>
<li>
<a href="/feed"><i class="fa fa-rss-square"></i></a> la scorsa settimana ci sono stati <%= @posts_count %> <a href="/feed">post</a> nelle varie comunità tecniche (PAC - Facebook only)
Expand Down
2 changes: 1 addition & 1 deletion webapp/app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,6 @@
<div class="container" id="main-container">
<%= yield %>
</div>

<br>
</body>
</html>
6 changes: 0 additions & 6 deletions webapp/app/views/profile/all_posts.html.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
<p id="notice"><%= notice %></p>
<div class="row">
<div class="col-md-6">
<h1>Post di <%= link_to @user.name, @user %></h1>
</div>
<div class="col-md-6">
SEARCH POSTS HERE
</div>
</div>

<hr>
<div id="posts-view" class="card-columns">
<%= render partial: "posts", locals: {posts: @posts} %>
</div>

<br>
2 changes: 2 additions & 0 deletions webapp/config/locales/it.yml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ it:
default: "%a %d %b %Y, %H:%M:%S %z"
long: "%d %B %Y %H:%M"
short: "%d %b %H:%M"
rfc822: "%d %b %Y"
rfc822_short: "%d %b"
pm: pm
will_paginate:
previous_label: "precedente"
Expand Down

0 comments on commit c2bbe4a

Please sign in to comment.