forked from bofh/fetsite
Merge branch 'master' of https://github.com/fetsite/fetsite
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -50,6 +50,8 @@ class FetprofilesController < ApplicationController
|
||||
# GET /fetprofiles/1/edit
|
||||
def edit
|
||||
@fetprofile = Fetprofile.find(params[:id])
|
||||
@memberships=@fetprofile.memberships.order(:typ)
|
||||
@memberships<<Membership.new
|
||||
end
|
||||
|
||||
# POST /fetprofiles
|
||||
|
||||
@@ -45,6 +45,10 @@ class GremienController < ApplicationController
|
||||
# GET /gremien/1/edit
|
||||
def edit
|
||||
@gremium = Gremium.find(params[:id])
|
||||
|
||||
@memberships=@gremium.memberships.order(:fetprofile_id).active
|
||||
@memberships<<Membership.new
|
||||
|
||||
end
|
||||
|
||||
# POST /gremien
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -9,6 +9,17 @@ class RubrikenController < ApplicationController
|
||||
def show
|
||||
@rubrik = Rubrik.find(params[:id])
|
||||
@moderatoren=User.with_role(:newsmoderator,@rubrik)
|
||||
if can?(:showunpublished, Neuigkeit)
|
||||
@neuigkeiten = @rubrik.neuigkeiten
|
||||
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
|
||||
@@ -78,6 +89,9 @@ class RubrikenController < ApplicationController
|
||||
@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..
|
||||
|
||||
@@ -71,6 +71,7 @@ class Ability
|
||||
if user.has_role?("newsadmin") || user.has_role?( "fetadmin") || user.has_role?( "fetuser")
|
||||
can :manage, Rubrik
|
||||
can :manage, Neuigkeit
|
||||
can :showunpublished, Neuigkeit
|
||||
end
|
||||
|
||||
|
||||
|
||||
@@ -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) }
|
||||
|
||||
@@ -13,10 +13,11 @@
|
||||
#
|
||||
|
||||
class Calentry < ActiveRecord::Base
|
||||
attr_accessible :ende, :start, :summary, :typ,:calendar_ids, :calendar
|
||||
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)
|
||||
@@ -38,6 +39,17 @@ validate do |entry|
|
||||
def start1
|
||||
start.to_date
|
||||
end
|
||||
def dauer
|
||||
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
|
||||
end
|
||||
def name
|
||||
unless self.object.nil?
|
||||
self.object.name
|
||||
|
||||
@@ -20,10 +20,15 @@ class Fetprofile < ActiveRecord::Base
|
||||
has_many :gremien, :through=> :membership
|
||||
mount_uploader :picture, PictureUploader
|
||||
has_paper_trail
|
||||
validates :desc, :presence=>true
|
||||
validates :nachname, length:{minimum: 3},:presence=>true
|
||||
validates :vorname, length:{minimum: 3},:presence=>true
|
||||
validates :short, length:{minimum: 3},:presence=>true
|
||||
|
||||
def name
|
||||
[vorname, nachname, "(",short,")"].join(" ")
|
||||
end
|
||||
accepts_nested_attributes_for :memberships
|
||||
accepts_nested_attributes_for :memberships, :reject_if=>lambda{|a| a[:typ].blank?|| a[:start].blank? ||a[:fetprofile_id].blank?}
|
||||
scope :active, -> { where(:active=>true).order(:vorname) }
|
||||
def fetmail
|
||||
(fetmailalias.nil? || fetmailalias.empty?) ? short.to_s + "@fet.at" : fetmailalias.to_s + "@fet.at"
|
||||
|
||||
@@ -15,11 +15,12 @@ class Gremium < ActiveRecord::Base
|
||||
TYPEN={1=>"offiziell", 2=>"offiziell-temporär", 3 => "inoffiziell",4=>"inoffiziell-tempo"} # Kategorien, im Wesentlichen wichtig für Listung oder nicht Listung
|
||||
GESCHLECHT={0=>"saechlich", 1 => "maennlich", 2 => "weiblich"} # Geschlecht des Gremiums zur richtige Deklination
|
||||
ART2FALL={0=>"des", 1=>"des",2=>"der"} # Artikel 2.Fall abhängig vom Geschlecht
|
||||
attr_accessible :desc, :name, :typ, :geschlecht,:thema_id
|
||||
attr_accessible :desc, :name, :typ, :geschlecht,:thema_id, :memberships_attributes
|
||||
has_many :memberships # Mitgliedschaften bei dem Gremium
|
||||
belongs_to :thema # Gehört zu einem Thema
|
||||
scope :tabs, -> { where(:typ => [1,3]).order(:typ).order(:name) } # Gremien die in Tabs angezeigt werden (Alle Anderen nur in der Liste
|
||||
# Gremium im 2. Fall für die Konstruktion "Mitglied des ... / der ... "
|
||||
accepts_nested_attributes_for :memberships, :reject_if=>lambda{|a| a[:typ].blank?|| a[:start].blank? ||a[:fetprofile_id].blank?}
|
||||
def fall2
|
||||
Gremium::ART2FALL[self.geschlecht.to_i].to_s+" "+ self.name.to_s+ ((self.geschlecht.to_i==1||self.geschlecht.to_i==0)? "s":"")
|
||||
end
|
||||
|
||||
@@ -18,5 +18,7 @@ class Membership < ActiveRecord::Base
|
||||
belongs_to :fetprofile
|
||||
belongs_to :gremium
|
||||
scope :active, -> {where("stop >= ? OR stop IS NULL", Time.now.to_date)}
|
||||
|
||||
validates :typ, :presence=>true
|
||||
validates :fetprofile, :presence=>true
|
||||
validates :start, :presence=>true
|
||||
end
|
||||
|
||||
@@ -14,33 +14,48 @@
|
||||
|
||||
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
|
||||
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
|
||||
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
|
||||
def reverse_publish
|
||||
self.datum = nil
|
||||
end
|
||||
def name
|
||||
self.title
|
||||
end
|
||||
def text_first_words
|
||||
md = /<p>(?<text>[\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
|
||||
|
||||
@@ -11,11 +11,12 @@
|
||||
#
|
||||
|
||||
class Rubrik < ActiveRecord::Base
|
||||
attr_accessible :desc, :name, :prio, :calendar
|
||||
attr_accessible :desc, :name, :prio, :calendar, :public
|
||||
has_many :neuigkeiten, :class_name => "Neuigkeit"
|
||||
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?
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<span class="pull-left" >
|
||||
<img class="media-object img-circle" src="<%= calendar.picture.thumb.url %>"/>
|
||||
</span>
|
||||
y<div class="media-body">
|
||||
<div class="media-body">
|
||||
<h4><%= calendar.name %></h4>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<%= calendar @calendar.calentries do |entry| %>
|
||||
<div><%= link_to entry.name.to_s, entry %></div>
|
||||
<div><%= link_to entry.name.to_s, polymorphic_path(entry.object) %></div>
|
||||
<% end %>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
|
||||
9
app/views/calentries/_calentry.html.erb
Normal file
9
app/views/calentries/_calentry.html.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
<div class="contentbox">
|
||||
<%= image_tag("/icon_kalender_small.png") %>
|
||||
<% if calentry.start.to_date == calentry.ende.to_date
|
||||
format=:timeonly
|
||||
else
|
||||
format =:default
|
||||
end%>
|
||||
<%= link_to I18n.l(calentry.start) +" bis "+ I18n.l(calentry.ende,:format=>format), calendar_path(calentry.calendar) %>
|
||||
</div>
|
||||
9
app/views/calentries/_nested_fields.html.erb
Normal file
9
app/views/calentries/_nested_fields.html.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
<div class="row-fluid">
|
||||
<div class="span1"></div><div class="span1">
|
||||
<%= image_tag("/icon_kalender_small.png") %>
|
||||
</div>
|
||||
<div class="span4">
|
||||
<%= f.input :start, :as => :datepicker %></div><div class="span4">
|
||||
<%= f.input :dauer , :as => :string, :append=>"h" %></div><div class="span1">
|
||||
<% f.input :typ %></div> <div class="span1"><%= f.check_box :_destroy %> <%= I18n.t 'common.delete' %></div>
|
||||
</div>
|
||||
@@ -22,15 +22,19 @@
|
||||
<%= f.hidden_field :picture_cache %>
|
||||
<label>
|
||||
<%= f.check_box :remove_picture %>
|
||||
Bild Entfernen
|
||||
<%= I18n.t('profile.remove_picture') %>
|
||||
</label>
|
||||
</div>
|
||||
<div class="span4"> <%= f.input :fetmailalias %></div>
|
||||
</div>
|
||||
|
||||
<%= f.inputs :for => :memberships do |membership,i| %>
|
||||
<% @memberships.each do |m| %>
|
||||
|
||||
<%= f.semantic_fields_for :memberships, m do |membership| %>
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span1"></div>
|
||||
|
||||
<div class="span3"><%= membership.input :start, :as=>:datepicker, :prepend=>"von",:label=>false%></div>
|
||||
<div class="span3"><%= membership.input :stop, :as=>:datepicker,:label=>false, :prepend =>"bis" %></div>
|
||||
<div class="span2"><%= membership.input :typ ,:as=>:select, :collection=>Membership::TYPEN.invert, :label=>false %></div>
|
||||
@@ -39,7 +43,7 @@
|
||||
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% end %> <% end %>
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<%= f.actions do %>
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<ul class="nav nav-tabs">
|
||||
<li <%= (request.fullpath == fetprofiles_path(filter: "active")|| request.fullpath == fetprofiles_path) ? 'class="active"'.html_safe : ''%> >
|
||||
<%= link_to "Aktive Mitglieder" , fetprofiles_path( filter: "active") %>
|
||||
<%= link_to I18n.t('profile.active_members') , fetprofiles_path( filter: "active") %>
|
||||
</li>
|
||||
<li>
|
||||
<%= link_to "Alle Gremien und Gruppen", gremien_path %>
|
||||
<%= link_to I18n.t('profile.all_groups'), gremien_path %>
|
||||
</li>
|
||||
<% for g in @gremientabs %>
|
||||
<li <%= (!@gremium.nil? && g == @gremium) ? 'class="active"'.html_safe : '' %> title="<%= g.name %>">
|
||||
@@ -11,7 +11,7 @@
|
||||
</li>
|
||||
<% end %>
|
||||
<li <%= (request.fullpath == fetprofiles_path(filter: "all")) ? 'class="active"'.html_safe : ''%> >
|
||||
<%= link_to "Alle Mitglieder" , fetprofiles_path( filter: "all") %>
|
||||
<%= link_to I18n.t('profile.all_members') , fetprofiles_path( filter: "all") %>
|
||||
</li>
|
||||
<% if can?(:verwalten,Gremium) %>
|
||||
<% if request.fullpath == verwalten_gremien_path %>
|
||||
@@ -19,7 +19,7 @@
|
||||
<% else %>
|
||||
<li class="pull-right">
|
||||
<% end %>
|
||||
<%= link_to "Verwaltung", verwalten_gremien_path %>
|
||||
<%= link_to I18n.t('common.verwalten'), verwalten_gremien_path %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
@@ -2,8 +2,8 @@
|
||||
<%= render 'fetprofiles/tabs' %>
|
||||
|
||||
<h1>
|
||||
<%= I18n.t 'fetprofiles.all' if params[:filter] == "all" %>
|
||||
<%= I18n.t 'fetprofiles.active' if params[:filter].nil? || params[:filter]== "active"
|
||||
<%= I18n.t 'profile.all_members' if params[:filter] == "all" %>
|
||||
<%= I18n.t 'profile.active_members' if params[:filter].nil? || params[:filter]== "active"
|
||||
%>
|
||||
</h1>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<h1>New fetprofile</h1>
|
||||
<h1><%= I18n.t('profile.new_profile')%></h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Back', fetprofiles_path %>
|
||||
<%= link_to I18n.t('common.back'), fetprofiles_path %>
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
<% @fetprofile.memberships.each do |m| %>
|
||||
<li>
|
||||
<%= render m %>
|
||||
<%= link_to 'edit', edit_fetprofile_membership_path(@fetprofile,m) if params["verwalten"] && can?(:delete, m)%>
|
||||
<%= link_to 'delete', [@fetprofile, m], method: :delete, data: {confirm: 'Sure to delete?'} if params["verwalten"] && can?(:delete, m ) %>
|
||||
<%= link_to I18n.t('common.edit'), edit_fetprofile_membership_path(@fetprofile,m) if params["verwalten"] && can?(:edit, m)%>
|
||||
<%= link_to I18n.t('common.delete'), [@fetprofile, m], method: :delete, data: {confirm: I18n.t('common.sure_del')} if params["verwalten"] && can?(:delete, m ) %>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
@@ -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| %>
|
||||
<div class="row-fluid">
|
||||
<div class="span1"></div>
|
||||
<div class="span3"><%= membership.input :start, :as=>:datepicker, :prepend=>"von",:label=>false%></div>
|
||||
<div class="span3"><%= membership.input :stop, :as=>:datepicker,:label=>false, :prepend =>"bis" %></div>
|
||||
<div class="span2"><%= membership.input :typ ,:as=>:select, :collection=>Membership::TYPEN.invert, :label=>false %></div>
|
||||
<div class="span3"><%= membership.input :fetprofile, :as=>:select, :label=>false %></div>
|
||||
|
||||
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% @memberships.each do |m| %>
|
||||
|
||||
<%= f.semantic_fields_for :memberships, m do |memberships_attributes| %>
|
||||
<div class="row-fluid">
|
||||
<div class="span1"></div>
|
||||
<div class="span3"><%= memberships_attributes.input :start, :as=>:datepicker, :prepend=>"von",:label=>false%></div>
|
||||
<div class="span3"><%= memberships_attributes.input :stop, :as=>:datepicker,:label=>false, :prepend =>"bis" %></div>
|
||||
<div class="span2"><%= memberships_attributes.input :typ ,:as=>:select, :collection=>Membership::TYPEN.invert, :label=>false %></div>
|
||||
<div class="span3"><%= memberships_attributes.input :fetprofile, :as=>:select, :label=>false %></div>
|
||||
|
||||
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
|
||||
<%= f.actions do %>
|
||||
|
||||
@@ -1,23 +1,38 @@
|
||||
<%= tinymce_assets %>
|
||||
<div class="container-fluid">
|
||||
<%= semantic_form_for [@neuigkeit.rubrik,@neuigkeit] do |f| %>
|
||||
<%= f.inputs do %>
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<%= f.input :title, :placeholder=> "Titel" %>
|
||||
<%= f.input :text, :as=> :tinymce_text %>
|
||||
<% f.input :datum, :as=> :datepicker %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<div class="span6">
|
||||
<% 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.inputs :for => :calentry do |calentry| %>
|
||||
<%= calentry.input :start, :as => :datepicker %>
|
||||
<%= calentry.input :ende , :as => :datepicker %>
|
||||
<%= calentry.input :typ %>
|
||||
</div>
|
||||
<div class="span6">
|
||||
<%= f.input :author, :as=> :select %>
|
||||
</div> </div>
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<%= f.input :picture, :as=> :file %>
|
||||
</div> </div>
|
||||
|
||||
|
||||
|
||||
|
||||
<%= f.semantic_fields_for :calentries , @calentries do |calentry| %>
|
||||
<%= render 'calentries/nested_fields', :f => calentry %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
<% end %>
|
||||
<%= f.actions do %>
|
||||
<%= f.action :submit, :as => :input %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
<script>$('.datepicker').datepicker()</script>
|
||||
<%= tinymce %>
|
||||
|
||||
@@ -19,5 +19,7 @@
|
||||
<p></p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<% @calentries1.each do |ce|%>
|
||||
<%= render ce unless ce.nil? %>
|
||||
<% end %>
|
||||
<%= render 'layouts/pretty_toolbar', :object=> @toolbar_elements %>
|
||||
|
||||
@@ -3,6 +3,9 @@
|
||||
<%= f.input :name %>
|
||||
<%= f.input :desc %>
|
||||
<%= f.input :prio %>
|
||||
<%= f.input :public %>
|
||||
|
||||
|
||||
<% end %>
|
||||
|
||||
<%= f.actions do %>
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
</i>
|
||||
|
||||
|
||||
<% @rubrik.neuigkeiten.each_slice(1) do |row| %>
|
||||
<% @neuigkeiten.each_slice(1) do |row| %>
|
||||
<ul class="unstyled" style="max-width:70em">
|
||||
<% row.each do |neuigkeit| %>
|
||||
<li>
|
||||
@@ -25,10 +25,9 @@
|
||||
<% end %>
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
<%= link_to 'Verwalten', verwalten_rubrik_path(@rubrik) %> |
|
||||
<%= link_to '<i class="icon-plus-sign"></i>'.html_safe+"Neuer Artikel", new_rubrik_neuigkeit_path(@rubrik) %>
|
||||
<%= render 'layouts/pretty_toolbar', :object=> @toolbar_elements %>
|
||||
|
||||
|
||||
<%= toolbar_html(@toolbar_elements)%>
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row-fluid">
|
||||
<% if params[:info]==true %>
|
||||
<% if params[:info].true? %>
|
||||
<%= raw(@studium.desc) %>
|
||||
<% else %>
|
||||
<%= @studium.desc_first_words %> <%= link_to I18n.t('studium.info'), studium_path(@studium, :ansicht=>params[:ansicht], :info=>true) %>
|
||||
|
||||
Reference in New Issue
Block a user