Calendar Klasse überarbeitet Views,gefixt, Pictures hinzugefügt

This commit is contained in:
Andreas Stephanides
2013-08-11 01:17:37 +02:00
parent 116446ff63
commit a5a02e065a
17 changed files with 238 additions and 67 deletions

View File

@@ -2,6 +2,7 @@
<%= f.inputs do %>
<%= f.input :name %>
<%= f.input :public %>
<%= f.input :picture, :as => :file %>
<% end %>
<%= f.actions do %>

View File

@@ -1,25 +1,14 @@
<h1>Listing calendars</h1>
<table>
<tr>
<th>Name</th>
<th>Public</th>
<th></th>
<th></th>
<th></th>
</tr>
<% @calendars.each do |calendar| %>
<tr>
<td><%= calendar.name %></td>
<td><%= calendar.public %></td>
<td><%= link_to 'Show', calendar %></td>
<td><%= link_to 'Edit', edit_calendar_path(calendar) %></td>
<td><%= link_to 'Destroy', calendar, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<div class="media">
<a class="pull-left" href="#">
<img class="media-object img-circle" src="<%= calendar.picture.thumb.url %>"/>
</a>
<div class="media-body">
<h4><%= link_to calendar.name, calendar %></h4>
</div>
</div>
<% end %>
</table>
<br />
<%= link_to 'New Calendar', new_calendar_path %>

View File

@@ -1,24 +1,30 @@
<div class="container-fluid">
<div class="row-fluid">
<p id="notice"><%= notice %></p>
<p>
<b>Name:</b>
<%= @calendar.name %>
</p>
<p>
<b>Public:</b>
<%= @calendar.public %>
</p>
<p>
<ul>
<h1>
<%= '<i class="icon-globe"></i>'.html_safe unless !@calendar.public%>
<%= @calendar.name %>
</h1>
<div class="row-fluid">
<ul class="list-group">
<% @calendar.calentries.each do |entry| %>
<%= entry.summary+ "- " + entry.start.to_s %>
<li class="list-group-item">
<%= link_to entry.summary+ " - " + I18n.l(entry.start), entry %>
</li>
<% end %>
</ul>
</div>
<div class="row-fluid">
<%= calendar @calendar.calentries do |entry| %>
<div><%= link_to entry.name, entry %></div>
<% end %>
<%= link_to 'New Entry', new_calentry_path %>
<%= link_to 'Edit', edit_calendar_path(@calendar) %> |
<%= link_to 'Back', calendars_path %>
</div>
<div class="row-fluid">
<div class="btn-group">
<%= link_to 'New Entry', new_calentry_path, {:class=>"btn"} %>
<%= link_to 'Edit', edit_calendar_path(@calendar), {:class=>"btn"} %>
<%= link_to 'Back', calendars_path, {:class=>"btn"} %>
</div>
</div>
</div>

View File

@@ -0,0 +1,3 @@
<% @calendar.calentries.each do |entry| %>
<%= render entry %>
<% end %>