<%= f.actions do %>
diff --git a/app/views/gremien/_form.html.erb b/app/views/gremien/_form.html.erb
index ca48368..d448de1 100644
--- a/app/views/gremien/_form.html.erb
+++ b/app/views/gremien/_form.html.erb
@@ -5,6 +5,36 @@
<%= f.input :typ, :as => :select, :collection => Gremium::TYPEN.invert %>
<%= f.input :geschlecht, :as => :select, :collection => Gremium::GESCHLECHT.invert %>
<%= f.input :thema, :as=> :select, :collection => Thema.all %>
+
+
+ <% f.inputs :for => :memberships, :objects=>@memberships do |membership,i| %>
+
+ <% end %>
+
+
+<% @memberships.each do |m| %>
+
+ <%= f.semantic_fields_for :memberships, m do |memberships_attributes| %>
+
+ <% end %>
+<% end %>
+
<% end %>
<%= f.actions do %>
From 75083064d76b746459c56089e4135998a0522bd4 Mon Sep 17 00:00:00 2001
From: Andreas Stephanides
Date: Wed, 13 Nov 2013 11:05:04 +0100
Subject: [PATCH 14/16] nettere Kalendereinttragsbearbeitung
---
app/controllers/calentries_controller.rb | 59 ++++++++++---------
app/models/calentry.rb | 3 +-
app/models/neuigkeit.rb | 7 ++-
app/views/calentries/_calentry.html.erb | 5 ++
app/views/calentries/_nested_fields.html.erb | 9 +++
app/views/neuigkeiten/_form.html.erb | 29 ++++++---
public/icon_kalender_small.png | Bin 0 -> 2012 bytes
7 files changed, 73 insertions(+), 39 deletions(-)
create mode 100644 app/views/calentries/_calentry.html.erb
create mode 100644 app/views/calentries/_nested_fields.html.erb
create mode 100644 public/icon_kalender_small.png
diff --git a/app/controllers/calentries_controller.rb b/app/controllers/calentries_controller.rb
index 7e0c537..6b488e1 100644
--- a/app/controllers/calentries_controller.rb
+++ b/app/controllers/calentries_controller.rb
@@ -2,14 +2,14 @@ class CalentriesController < ApplicationController
# GET /calentries
# GET /calentries.json
load_and_authorize_resource
- def index
- @calentries = Calentry.all
+ # def index
+ # @calentries = Calentry.all
- respond_to do |format|
- format.html # index.html.erb
- format.json { render json: @calentries }
- end
- end
+ # respond_to do |format|
+ # format.html # index.html.erb
+ # format.json { render json: @calentries }
+ # end
+ # end
# GET /calentries/1
# GET /calentries/1.json
@@ -25,35 +25,36 @@ class CalentriesController < ApplicationController
# GET /calentries/new
# GET /calentries/new.json
- def new
- @calentry = Calentry.new
+ # def new
+ # @calentry = Calentry.new
- respond_to do |format|
- format.html # new.html.erb
- format.json { render json: @calentry }
- end
- end
+ # respond_to do |format|
+ # format.html # new.html.erb
+ # format.json { render json: @calentry }
+ # end
+ # end
# GET /calentries/1/edit
- def edit
- @calentry = Calentry.find(params[:id])
- end
+ #def edit
+ # @calentry = Calentry.find(params[:id])
+
+ # end
# POST /calentries
# POST /calentries.json
- def create
- @calentry = Calentry.new(params[:calentry])
+ # def create
+ # @calentry = Calentry.new(params[:calentry])
- respond_to do |format|
- if @calentry.save
- format.html { redirect_to @calentry, notice: 'Calentry was successfully created.' }
- format.json { render json: @calentry, status: :created, location: @calentry }
- else
- format.html { render action: "new" }
- format.json { render json: @calentry.errors, status: :unprocessable_entity }
- end
- end
- end
+# respond_to do |format|
+# if @calentry.save
+# format.html { redirect_to @calentry, notice: 'Calentry was successfully created.' }
+# format.json { render json: @calentry, status: :created, location: @calentry }
+# else
+ # format.html { render action: "new" }
+# format.json { render json: @calentry.errors, status: :unprocessable_entity }
+# end
+# end
+# end
# PUT /calentries/1
# PUT /calentries/1.json
diff --git a/app/models/calentry.rb b/app/models/calentry.rb
index e8f8ef4..9057992 100644
--- a/app/models/calentry.rb
+++ b/app/models/calentry.rb
@@ -15,8 +15,9 @@
class Calentry < ActiveRecord::Base
attr_accessible :ende, :start, :summary, :typ,:calendar_ids, :calendar, :dauer
belongs_to :calendar
- belongs_to :neuigkeit
+ #belongs_to :neuigkeit
validates :start, :presence => true
+ validates :object, :presence => true
validates :typ, :presence => true
before_save :get_public
belongs_to :object, polymorphic: true # Objekt zu dem der Calentry gehört (derzeit ein Newsartikel)
diff --git a/app/models/neuigkeit.rb b/app/models/neuigkeit.rb
index e957fe1..d15cf71 100755
--- a/app/models/neuigkeit.rb
+++ b/app/models/neuigkeit.rb
@@ -20,13 +20,13 @@ class Neuigkeit < ActiveRecord::Base
validates :rubrik, :presence=>true
validates :author, :presence=>true
translates :title,:text, :versioning=>true, :fallbacks_for_empty_translations => true
- has_one :calentry
+ has_one :calentry, inverse_of: :object
mount_uploader :picture, PictureUploader
scope :published, -> {where("datum <= ? AND datum IS NOT NULL", Time.now.to_date).order(:datum).reverse_order}
scope :recent, -> { published.where("updated_at >= ? ",Time.now - 7.days)}
scope :unpublished, -> {where("datum >= ? OR datum IS NULL", Date.today)}
scope :public, ->{includes(:rubrik).where("rubriken.public"=>:true)}
-accepts_nested_attributes_for :calentry
+accepts_nested_attributes_for :calentry, :allow_destroy=>true
def datum_nilsave
self.datum.nil? ? Time.now + 42.years : self.datum
end
@@ -39,6 +39,9 @@ accepts_nested_attributes_for :calentry
def reverse_publish
self.datum = nil
end
+ def name
+self.title
+end
def text_first_words
md = /(?[\w\s,\.!\?]*)/.match self.text
md[:text].split(" ")[0..100].join(" ")+ " ..."
diff --git a/app/views/calentries/_calentry.html.erb b/app/views/calentries/_calentry.html.erb
new file mode 100644
index 0000000..37e4989
--- /dev/null
+++ b/app/views/calentries/_calentry.html.erb
@@ -0,0 +1,5 @@
+
+<%= image_tag("/icon_kalender_small.png") %>
+
+<%= link_to I18n.l(calentry.start) +" bis "+ I18n.l(calentry.ende), calendar_path(calentry.calendar) %>
+
diff --git a/app/views/calentries/_nested_fields.html.erb b/app/views/calentries/_nested_fields.html.erb
new file mode 100644
index 0000000..b678357
--- /dev/null
+++ b/app/views/calentries/_nested_fields.html.erb
@@ -0,0 +1,9 @@
+
+
+<%= image_tag("/icon_kalender_small.png") %>
+
+
+ <%= f.input :start, :as => :datepicker %>
+ <%= f.input :dauer , :as => :string, :append=>"h" %>
+ <%= f.input :typ %>
<%= f.check_box :_destroy %>
+
diff --git a/app/views/neuigkeiten/_form.html.erb b/app/views/neuigkeiten/_form.html.erb
index 3956dfd..879cd8d 100755
--- a/app/views/neuigkeiten/_form.html.erb
+++ b/app/views/neuigkeiten/_form.html.erb
@@ -1,17 +1,31 @@
<%= tinymce_assets %>
+
<%= semantic_form_for [@neuigkeit.rubrik,@neuigkeit] do |f| %>
<%= f.inputs do %>
+
+
<%= f.input :title, :placeholder=> "Titel" %>
<%= f.input :text, :as=> :tinymce_text %>
- <% f.input :datum, :as=> :datepicker %>
+
+
+
+
+ <% f.input :datum, :as=> :datepicker %>
<%= f.input :rubrik, :as=> :radio, :collection=>Rubrik.all %>
- <%= f.input :author, :as=> :radio %>
- <%= f.input :picture, :as=> :file %>
- <% unless @neuigkeit.calentry.nil? %>
+
+
+ <%= f.input :author, :as=> :select %>
+
+
+
+ <%= f.input :picture, :as=> :file %>
+
+
+ <% unless @neuigkeit.calentry.nil? %>
+
+
<%= f.inputs :for => :calentry do |calentry| %>
- <%= calentry.input :start, :as => :datepicker %>
- <%= calentry.input :dauer , :as => :string %>
- <%= calentry.input :typ %>
+ <%= render 'calentries/nested_fields', :f => calentry %>
<% end %>
<% end %>
<% end %>
@@ -19,5 +33,6 @@
<%= f.action :submit, :as => :input %>
<% end %>
<% end %>
+
<%= tinymce %>
diff --git a/public/icon_kalender_small.png b/public/icon_kalender_small.png
new file mode 100644
index 0000000000000000000000000000000000000000..831448974034147be7716194a80583f6fe08d17f
GIT binary patch
literal 2012
zcmV<22P622P)<~SV*REe+b>K5BnqONaP$(2wzI-{07A+!!Vn}5PD-*v|4F9tq-Dj}0sfpg+UNl`N
z5C{+m1h{tX8q1a~BN~medGlr(8X9JV?*X+G+_}|9$IyrT{a!amns*gLpzAuW>r%+&
zI2+27|MoiY6es~Bcd?J2$FY65%N7uJJiKfcVOoSLZ6t7Sc$n8-eU-_nDNda__3(o$
z$iLIZyz~crN&6)$QVj$vD~bdFg25o!Yz_=(8eAb<4~zf_pO5Z_2ySu#7&=Hm0j%P~
zzg*^pntHm&K4!i%?-8mia%Z-qPyCI7&t`OFoUcE>4bwF56Np42Or%l>U4keAC`}*&
z7JY4BDZVhKk-bs^xmfWkj>s|ctxFlS{0{;5$eno+J$(f%i$C7|0UI`M!RPbcuL6Lo
zsw(W5$egeV;mr3uiW$O=G$l+#2dna?$X6bLCu%b8`Wl)^c)19R%H2+QQ~;7&Gf
z-hyRWGs_Sl9*!;o?xhqfjUS0?&1ErA`4!UTPGSM_%*5b3u7v
z=;UPKKKR)mVobdUrpE94cd~iggWwM+pnzmfaHL`xxm>oqNz*iRT}MiZQVJ<0Qp)ms
zuV|(q1i6C3y|@P>{Vqxq9R6qro3?%9q2QFY1sWS0@%#N`vsqlvMQR#S)6flrlW)Gs
zm!Ex>r=NL-mv`;LFim`x#jo4jd8)Ay%d#*G1I_T0xv&Q#^)?DP-2Xi`ZEM5t_dn7b
z$^>lNMk$3-iqX;0=>rL*l`<#`+(_%6?H`S0K}Lg4rN@w{Svjg5^Fi^UK^AcWxT*|Q`P34A^u3l=OOoldi9
z(tYWHOm@jD-+H
zqfz$k*~8__m$591*49=G!ypg{pqW98Yp)PlmBP)tyxzNk7j}MUR^T&2P*OlC#qjVj
znx>VLP1kjXhlg3RWC@Prux8B~48tJn3XcDxnGK)M;N}XvetkVFTi4DS`~d|@&NVhR
zRwf{XK+`mi9Xo~)f{hzDa`ECtZubvSpM8txR*sOH$nn!ZKgHG^8?Y>kbUIBa6nZ=Y
ze!m~rEgH$-;9yyPAq1VBoz&FS;JPkdU0ndwO}#}`_D|%e9KQOB$G;|S@bb^&OioTR
zHa7P71WI)dkj-Y%b-i5kw{G2H-@bhSG%f!uZ~VB0WbPzhHb>{p=h*+-tyEN0FgZDi
z5CX?>W*q|gpAVr>2&GiflBeS@rR2bY1Ef+Z##3p|{q9?=jJ}V`Ivna6(UamqiDQX(}S_r`IO`J>=Wv8BV}%#}A#>JYJ5jGCGnVzC%K
zJv~%cR}+au2#3S7Qep;yXf%pxnnk(C#~B$J;lzm(}C%1VO4Af{m#{er=H4}+Mid}CyKXhG3(=<%eBp3`*U0qEm6v8ykSzlsi5SW;l;P&m?
zI8K&IV}OzVD|8RcqrRa5pU+orR;5z2ZJSsuhCV&2myGL)70BoF+`W63k&%16|K0^w
ztXN4^G>YrGD5VfW5Dte4hr<|#fe?aJD#hsND2YU(Z0Ao*z;#{5$HyrY3Mi%UJP#=)
z6%`d&mi0hpkB*MwI1Y(K;)$cOUs+P66sc6ItVUH;6}D}co7Mkx
uH~gecN~!WCw4_YQDN8fsr%K?{T>l0vfBx{?>3K5%0000+tJ
literal 0
HcmV?d00001
From 0b6ed94662912f4b7134e9e32c7af218715351ff Mon Sep 17 00:00:00 2001
From: Andreas Stephanides
Date: Wed, 13 Nov 2013 11:05:23 +0100
Subject: [PATCH 15/16] locales for fetprofile
---
config/locales/fetprofile.de.yml | 7 +++++++
1 file changed, 7 insertions(+)
create mode 100644 config/locales/fetprofile.de.yml
diff --git a/config/locales/fetprofile.de.yml b/config/locales/fetprofile.de.yml
new file mode 100644
index 0000000..a19b6ed
--- /dev/null
+++ b/config/locales/fetprofile.de.yml
@@ -0,0 +1,7 @@
+de:
+ profile:
+ remove_picture: "Bild entfernen"
+ all_members: "Alle Mitglieder"
+ all_groups: "Alle Gremien und Gruppen"
+ active_members: "Aktive Mitglieder"
+ new_profile: "Neues Profil anlegen"
\ No newline at end of file
From e62f5a2600552f22929b943c024f349205fed2e9 Mon Sep 17 00:00:00 2001
From: Andreas Stephanides
Date: Wed, 13 Nov 2013 12:50:04 +0100
Subject: [PATCH 16/16] mehrere Termine je neuigkeit
---
app/controllers/neuigkeiten_controller.rb | 15 ++++++++++-----
app/controllers/rubriken_controller.rb | 9 +++++++++
app/models/ability.rb | 2 +-
app/models/calendar.rb | 2 +-
app/models/calentry.rb | 9 +++++++--
app/models/neuigkeit.rb | 18 +++++++++++++++---
app/models/rubrik.rb | 1 +
app/views/calendars/index.html.erb | 2 +-
app/views/calendars/show.html.erb | 2 +-
app/views/calentries/_calentry.html.erb | 8 ++++++--
app/views/calentries/_nested_fields.html.erb | 2 +-
app/views/neuigkeiten/_form.html.erb | 6 +++---
app/views/neuigkeiten/show.html.erb | 4 +++-
app/views/rubriken/_form.html.erb | 4 +++-
app/views/rubriken/show.html.erb | 5 ++---
config/locales/date.de.yml | 1 +
config/locales/neuigkeiten.de.yml | 4 +++-
config/routes.rb | 1 +
18 files changed, 69 insertions(+), 26 deletions(-)
diff --git a/app/controllers/neuigkeiten_controller.rb b/app/controllers/neuigkeiten_controller.rb
index 1211e41..dabdad6 100755
--- a/app/controllers/neuigkeiten_controller.rb
+++ b/app/controllers/neuigkeiten_controller.rb
@@ -8,15 +8,17 @@ class NeuigkeitenController < ApplicationController
@neuigkeit.versions.reverse[params[:version].to_i].reify.save!
@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
+ @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 << {:text=>I18n.t('common.edit'),:path=>edit_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:icon=>:pencil} if can? :edit, @neuigkeit.rubrik
@versions= @neuigkeit.versions.select([:created_at]).reverse
@toolbar_elements <<{:path=>rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:method=>:versions,:versions=>@versions}
- @toolbar_elements << {:text=>I18n.t('common.edit'),:path=>edit_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:icon=>:pencil} if can? :edit, @neuigkeit.rubrik
- @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 << {: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
@@ -66,6 +68,9 @@ class NeuigkeitenController < ApplicationController
def edit
@neuigkeit = Neuigkeit.find(params[:id])
@toolbar_elements << {:text=>I18n.t('common.show'),:path=>rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit)} if can? :show, @neuigkeit
+ @calentries= @neuigkeit.calentries
+ @calentries<< Calentry.new
+
end
def create
diff --git a/app/controllers/rubriken_controller.rb b/app/controllers/rubriken_controller.rb
index 9ab537e..639fc9d 100755
--- a/app/controllers/rubriken_controller.rb
+++ b/app/controllers/rubriken_controller.rb
@@ -14,6 +14,12 @@ class RubrikenController < ApplicationController
else
@neuigkeiten = @rubrik.neuigkeiten.published
end
+@toolbar_elements << {:text=>I18n.t('neuigkeit.new.title'),:path=> new_rubrik_neuigkeit_path(@rubrik),:hicon=>'icon-plus-sign'} if can? :verwalten, @rubrik
+
+@toolbar_elements << {:text=>I18n.t('common.verwalten'),:path=>verwalten_rubrik_path(@rubrik),:icon=>:pencil} if can? :verwalten, @rubrik
+
+
+
end
def new
@@ -83,6 +89,9 @@ end
@neuigkeiten_unpublished = @rubrik.neuigkeiten.unpublished
@neuigkeiten_published=@rubrik.neuigkeiten.published
@moderatoren=User.with_role(:newsmoderator,@rubrik)
+@toolbar_elements << {:text=>I18n.t('neuigkeit.new.title'),:path=> new_rubrik_neuigkeit_path(@rubrik),:hicon=>'icon-plus-sign'} if can? :verwalten, @rubrik
+
+
end
# Alle Rubriken verwalten und Sachen einstellen..
diff --git a/app/models/ability.rb b/app/models/ability.rb
index 8b9a52d..f9388ae 100755
--- a/app/models/ability.rb
+++ b/app/models/ability.rb
@@ -67,7 +67,7 @@ class Ability
if user.has_role?("newsadmin") || user.has_role?("fetadmin")
can :addmoderator, Rubrik
end
- can [:show, :index], [Rubrik,Neuigkeit], :public=>true
+ can [:show, :index], [Rubrik,Neuigkeit]
if user.has_role?("newsadmin") || user.has_role?( "fetadmin") || user.has_role?( "fetuser")
can :manage, Rubrik
can :manage, Neuigkeit
diff --git a/app/models/calendar.rb b/app/models/calendar.rb
index e4bbad6..1f3b903 100644
--- a/app/models/calendar.rb
+++ b/app/models/calendar.rb
@@ -15,7 +15,7 @@ class Calendar < ActiveRecord::Base
has_many :calentries
mount_uploader :picture, PictureUploader
belongs_to :rubrik
- validates :rubrik, :presence=>true
+ # validates :rubrik, :presence=>true
resourcify
scope :public_cals, -> { where(:public => :true) }
diff --git a/app/models/calentry.rb b/app/models/calentry.rb
index 9057992..a52157b 100644
--- a/app/models/calentry.rb
+++ b/app/models/calentry.rb
@@ -40,10 +40,15 @@ validate do |entry|
start.to_date
end
def dauer
- (self.ende-self.start)/3600
+if self.ende.nil? && self.start.nil?
+0
+else
+self.ende = self.start unless self.start.nil?
+ (self.ende-self.start)/3600
+end
end
def dauer=(dauer)
- self.ende=self.start+dauer.to_i.hours
+ self.ende=self.start+dauer.to_i.hours
end
def name
unless self.object.nil?
diff --git a/app/models/neuigkeit.rb b/app/models/neuigkeit.rb
index d15cf71..72b4f94 100755
--- a/app/models/neuigkeit.rb
+++ b/app/models/neuigkeit.rb
@@ -14,25 +14,30 @@
class Neuigkeit < ActiveRecord::Base
- attr_accessible :datum, :text, :title, :rubrik_id, :author_id,:picture, :calentry_attributes
+ attr_accessible :datum, :text, :title, :rubrik_id, :author_id,:picture, :calentries_attributes
belongs_to :author, :class_name =>'User'
belongs_to :rubrik, :class_name =>'Rubrik', :foreign_key => "rubrik_id"
validates :rubrik, :presence=>true
validates :author, :presence=>true
translates :title,:text, :versioning=>true, :fallbacks_for_empty_translations => true
- has_one :calentry, inverse_of: :object
+ has_many :calentries, inverse_of: :object
mount_uploader :picture, PictureUploader
scope :published, -> {where("datum <= ? AND datum IS NOT NULL", Time.now.to_date).order(:datum).reverse_order}
scope :recent, -> { published.where("updated_at >= ? ",Time.now - 7.days)}
scope :unpublished, -> {where("datum >= ? OR datum IS NULL", Date.today)}
scope :public, ->{includes(:rubrik).where("rubriken.public"=>:true)}
-accepts_nested_attributes_for :calentry, :allow_destroy=>true
+ accepts_nested_attributes_for :calentries, :allow_destroy=>true , :reject_if=> lambda{|a| a[:start].blank?}
+before_save :sanitize
def datum_nilsave
self.datum.nil? ? Time.now + 42.years : self.datum
end
def public
self.rubrik.public && self.datum_nilsave >=Time.now.to_date
end
+ def published?
+ self.datum_nilsave>=Time.now.to_date
+ end
+
def publish
self.datum = Date.today
end
@@ -46,4 +51,11 @@ end
md = /(?[\w\s,\.!\?]*)/.match self.text
md[:text].split(" ")[0..100].join(" ")+ " ..."
end
+private
+def sanitize
+self.calentries.each do |calentry|
+calentry.calendar= self.rubrik.calendar
+calentry.typ=1
+end
+end
end
diff --git a/app/models/rubrik.rb b/app/models/rubrik.rb
index ba10a5f..f98a143 100755
--- a/app/models/rubrik.rb
+++ b/app/models/rubrik.rb
@@ -16,6 +16,7 @@ class Rubrik < ActiveRecord::Base
has_many :calentries, :through => :neuigkeiten, :as=>:object
resourcify
has_one :calendar
+validates :calender , :presence=>true
def moderator
u=User.with_role(:newsmoderator).first
if !u.nil?
diff --git a/app/views/calendars/index.html.erb b/app/views/calendars/index.html.erb
index 9a238b9..47e394c 100644
--- a/app/views/calendars/index.html.erb
+++ b/app/views/calendars/index.html.erb
@@ -17,7 +17,7 @@
- y
diff --git a/app/views/calendars/show.html.erb b/app/views/calendars/show.html.erb
index 11a4657..07c434d 100644
--- a/app/views/calendars/show.html.erb
+++ b/app/views/calendars/show.html.erb
@@ -24,7 +24,7 @@