neuigkeiten/calender kleine anpassungen
+ ics link - Kein "Verwalten Button" mehr
This commit is contained in:
@@ -34,7 +34,6 @@ class CalendarsController < ApplicationController
|
||||
format.json { render json: @calendar }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /calendars/1/edit
|
||||
def edit
|
||||
@calendar = Calendar.find(params[:id])
|
||||
|
||||
@@ -10,7 +10,7 @@ class NeuigkeitenController < ApplicationController
|
||||
@neuigkeit=Neuigkeit.find(params[:id])
|
||||
end
|
||||
@calentries1=@neuigkeit.calentries
|
||||
if params[:verwalten]
|
||||
|
||||
@toolbar_elements << {:hicon=>'icon-plus', :text=> I18n.t('neuigkeit.publish'),:path => publish_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:confirm=>"Sure?" } if can? :publish, @neuigkeit
|
||||
@toolbar_elements << {:hicon=>'icon-minus', :text=> I18n.t('neuigkeit.unpublish'),:path => unpublish_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:confirm=>"Sure?" } if can?(:unpublish, @neuigkeit) && !@neuigkeit.published?
|
||||
|
||||
@@ -21,10 +21,7 @@ class NeuigkeitenController < ApplicationController
|
||||
@toolbar_elements << {:hicon=>'icon-remove-circle', :text=> I18n.t('common.delete'),:path => rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit), :method=> :delete,:confirm=>'Sure?' } if can? :delete, @neuigkeit
|
||||
# @toolbar_elements << {:path=> add_calentry_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit), :text=>"Add Calentry", :icon=>:plus}
|
||||
|
||||
else
|
||||
@toolbar_elements << {:text=>I18n.t('common.verwalten'),:path=>rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit,{:verwalten=>true}),:icon=>:pencil} if can? :verwalten, @neuigkeit
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
def new
|
||||
|
||||
@@ -4,7 +4,7 @@ class RubrikenController < ApplicationController
|
||||
def index
|
||||
@rubriken = Rubrik.all
|
||||
@neuigkeiten = Neuigkeit.recent
|
||||
@calentries= Calentry.all
|
||||
@calentries= Calentry.public
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
@@ -22,10 +22,10 @@ class Calentry < ActiveRecord::Base
|
||||
before_save :get_public
|
||||
belongs_to :object, polymorphic: true # Objekt zu dem der Calentry gehört (derzeit ein Newsartikel)
|
||||
|
||||
validate do |entry|
|
||||
if entry.ende.nil?
|
||||
errors.add(:ende, "Es muss ein Endzeitpunkt vorhanden sein")
|
||||
end
|
||||
validate do |entry|
|
||||
if entry.ende.nil?
|
||||
errors.add(:ende, "Es muss ein Endzeitpunkt vorhanden sein")
|
||||
end
|
||||
end
|
||||
|
||||
resourcify
|
||||
@@ -61,5 +61,5 @@ def text
|
||||
I18n.l(self.start) +" bis "+ I18n.l(self.ende)
|
||||
end
|
||||
scope :public, -> { where(:public => :true) }
|
||||
scope :upcoming, -> { where("start >= ?" , Time.now).where("start <= ?", 8.days.from_now) }
|
||||
scope :upcoming, -> { where("start >= ?" , Time.now).where("start <= ?", 28.days.from_now) }
|
||||
end
|
||||
|
||||
@@ -5,6 +5,7 @@ format=:timeonly
|
||||
else
|
||||
format =:default
|
||||
end%>
|
||||
<%= link_to calentry.text, calentry_path(calentry) %>
|
||||
<%= calentry.text %>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
@@ -14,7 +14,10 @@
|
||||
</p>
|
||||
</div>
|
||||
<div class="media-body">
|
||||
<h1><%= link_to @neuigkeit.title,rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit) %></h1>
|
||||
<h1>
|
||||
<%= @neuigkeit.title%>
|
||||
|
||||
</h1>
|
||||
<%= raw(@neuigkeit.text) %>
|
||||
<p></p>
|
||||
</div>
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
</div>
|
||||
<div class="span3">
|
||||
<%= render 'calendars/calentries', :object=>@rubrik.calendar.calentries %>
|
||||
<%= link_to "ics-format", calendar_path(@rubrik.calendar,:format=>:ics) %>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user