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 }
|
format.json { render json: @calendar }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# GET /calendars/1/edit
|
# GET /calendars/1/edit
|
||||||
def edit
|
def edit
|
||||||
@calendar = Calendar.find(params[:id])
|
@calendar = Calendar.find(params[:id])
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ class NeuigkeitenController < ApplicationController
|
|||||||
@neuigkeit=Neuigkeit.find(params[:id])
|
@neuigkeit=Neuigkeit.find(params[:id])
|
||||||
end
|
end
|
||||||
@calentries1=@neuigkeit.calentries
|
@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-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?
|
@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 << {: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}
|
# @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
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ class RubrikenController < ApplicationController
|
|||||||
def index
|
def index
|
||||||
@rubriken = Rubrik.all
|
@rubriken = Rubrik.all
|
||||||
@neuigkeiten = Neuigkeit.recent
|
@neuigkeiten = Neuigkeit.recent
|
||||||
@calentries= Calentry.all
|
@calentries= Calentry.public
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
|||||||
@@ -22,10 +22,10 @@ class Calentry < ActiveRecord::Base
|
|||||||
before_save :get_public
|
before_save :get_public
|
||||||
belongs_to :object, polymorphic: true # Objekt zu dem der Calentry gehört (derzeit ein Newsartikel)
|
belongs_to :object, polymorphic: true # Objekt zu dem der Calentry gehört (derzeit ein Newsartikel)
|
||||||
|
|
||||||
validate do |entry|
|
validate do |entry|
|
||||||
if entry.ende.nil?
|
if entry.ende.nil?
|
||||||
errors.add(:ende, "Es muss ein Endzeitpunkt vorhanden sein")
|
errors.add(:ende, "Es muss ein Endzeitpunkt vorhanden sein")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
resourcify
|
resourcify
|
||||||
@@ -61,5 +61,5 @@ def text
|
|||||||
I18n.l(self.start) +" bis "+ I18n.l(self.ende)
|
I18n.l(self.start) +" bis "+ I18n.l(self.ende)
|
||||||
end
|
end
|
||||||
scope :public, -> { where(:public => :true) }
|
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
|
end
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ format=:timeonly
|
|||||||
else
|
else
|
||||||
format =:default
|
format =:default
|
||||||
end%>
|
end%>
|
||||||
<%= link_to calentry.text, calentry_path(calentry) %>
|
<%= calentry.text %>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -14,7 +14,10 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="media-body">
|
<div class="media-body">
|
||||||
<h1><%= link_to @neuigkeit.title,rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit) %></h1>
|
<h1>
|
||||||
|
<%= @neuigkeit.title%>
|
||||||
|
|
||||||
|
</h1>
|
||||||
<%= raw(@neuigkeit.text) %>
|
<%= raw(@neuigkeit.text) %>
|
||||||
<p></p>
|
<p></p>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -30,6 +30,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="span3">
|
<div class="span3">
|
||||||
<%= render 'calendars/calentries', :object=>@rubrik.calendar.calentries %>
|
<%= render 'calendars/calentries', :object=>@rubrik.calendar.calentries %>
|
||||||
|
<%= link_to "ics-format", calendar_path(@rubrik.calendar,:format=>:ics) %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user