Kalender update - tabs...
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
class CalendarsController < ApplicationController
|
||||
# GET /calendars
|
||||
# GET /calendars.json
|
||||
load_and_authorize_resource
|
||||
def index
|
||||
@calendars = Calendar.all
|
||||
respond_to do |format|
|
||||
@@ -80,4 +81,6 @@ class CalendarsController < ApplicationController
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
def verwalten
|
||||
end
|
||||
end
|
||||
|
||||
@@ -2,4 +2,5 @@ class Calendar < ActiveRecord::Base
|
||||
attr_accessible :name, :public, :picture
|
||||
has_and_belongs_to_many :calentries
|
||||
mount_uploader :picture, PictureUploader
|
||||
resourcify
|
||||
end
|
||||
|
||||
@@ -8,6 +8,7 @@ class Calentry < ActiveRecord::Base
|
||||
errors.add(:ende, "Es muss ein Endzeitpunkt vorhanden sein")
|
||||
end
|
||||
end
|
||||
resourcify
|
||||
def start_time
|
||||
start
|
||||
end
|
||||
@@ -17,4 +18,5 @@ class Calentry < ActiveRecord::Base
|
||||
def name
|
||||
summary
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
16
app/views/calendars/_tabs.html.erb
Normal file
16
app/views/calendars/_tabs.html.erb
Normal 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>
|
||||
@@ -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| %>
|
||||
<div class="media">
|
||||
<a class="pull-left" href="#">
|
||||
@@ -10,5 +18,11 @@
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<%= link_to 'New Calendar', new_calendar_path %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<%= link_to 'New Calendar', new_calendar_path unless cannot?(:new, Calendar) %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,9 @@
|
||||
<div class="container-fluid">
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<%= render 'calendars/tabs' %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
|
||||
5
config/locales/calendars.de.yml
Normal file
5
config/locales/calendars.de.yml
Normal file
@@ -0,0 +1,5 @@
|
||||
|
||||
de:
|
||||
calendars:
|
||||
alle: "Alle Kalender"
|
||||
calendar: "Kalender"
|
||||
Reference in New Issue
Block a user