Kalender update - tabs...

This commit is contained in:
Andreas Stephanides
2013-08-13 22:23:02 +02:00
parent 5c14fdadaf
commit 501554eee1
7 changed files with 49 additions and 3 deletions

View File

@@ -1,6 +1,7 @@
class CalendarsController < ApplicationController class CalendarsController < ApplicationController
# GET /calendars # GET /calendars
# GET /calendars.json # GET /calendars.json
load_and_authorize_resource
def index def index
@calendars = Calendar.all @calendars = Calendar.all
respond_to do |format| respond_to do |format|
@@ -80,4 +81,6 @@ class CalendarsController < ApplicationController
format.json { head :no_content } format.json { head :no_content }
end end
end end
def verwalten
end
end end

View File

@@ -2,4 +2,5 @@ class Calendar < ActiveRecord::Base
attr_accessible :name, :public, :picture attr_accessible :name, :public, :picture
has_and_belongs_to_many :calentries has_and_belongs_to_many :calentries
mount_uploader :picture, PictureUploader mount_uploader :picture, PictureUploader
resourcify
end end

View File

@@ -8,6 +8,7 @@ class Calentry < ActiveRecord::Base
errors.add(:ende, "Es muss ein Endzeitpunkt vorhanden sein") errors.add(:ende, "Es muss ein Endzeitpunkt vorhanden sein")
end end
end end
resourcify
def start_time def start_time
start start
end end
@@ -17,4 +18,5 @@ class Calentry < ActiveRecord::Base
def name def name
summary summary
end end
end end

View File

@@ -0,0 +1,16 @@
<ul class="nav nav-tabs">
<li <%= (request.fullpath == calendars_path)? 'class="active"' : ''%> >
<%= link_to I18n.t 'calendars.alle' , calendars_path %> </li>
<% for c in Calendar.all %>
<li <%= (!@calendar.nil? && c == @calendar) ? 'class="active"' : '' %> title="<%= c.name %>">
<%= link_to c.name, c %>
</li>
<% end %>
<% if request.fullpath == calendars_verwalten_path %>
<li class="active pull-right">
<% else %>
<li class="pull-right">
<% end %>
<%= link_to "Verwaltung", calendars_verwalten_path %>
</li>
</ul>

View File

@@ -1,5 +1,13 @@
<h1>Listing calendars</h1> <div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<%= render 'tabs' %>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<h1><%= I18n.t 'calendars.calendar' %></h1>
<% @calendars.each do |calendar| %> <% @calendars.each do |calendar| %>
<div class="media"> <div class="media">
<a class="pull-left" href="#"> <a class="pull-left" href="#">
@@ -10,5 +18,11 @@
</div> </div>
</div> </div>
<% end %> <% end %>
</div>
<%= link_to 'New Calendar', new_calendar_path %> </div>
<div class="row-fluid">
<div class="span12">
<%= link_to 'New Calendar', new_calendar_path unless cannot?(:new, Calendar) %>
</div>
</div>
</div>

View File

@@ -1,5 +1,10 @@
<div class="container-fluid"> <div class="container-fluid">
<div class="row-fluid"> <div class="row-fluid">
<div class="span12">
<%= render 'calendars/tabs' %>
</div>
</div>
<div class="row-fluid">
<p id="notice"><%= notice %></p> <p id="notice"><%= notice %></p>
<h1> <h1>

View File

@@ -0,0 +1,5 @@
de:
calendars:
alle: "Alle Kalender"
calendar: "Kalender"