diff --git a/Gemfile.lock b/Gemfile.lock deleted file mode 100755 index 9073631..0000000 --- a/Gemfile.lock +++ /dev/null @@ -1,257 +0,0 @@ -GEM - remote: https://rubygems.org/ - specs: - actionmailer (3.2.9) - actionpack (= 3.2.9) - mail (~> 2.4.4) - actionpack (3.2.9) - activemodel (= 3.2.9) - activesupport (= 3.2.9) - builder (~> 3.0.0) - erubis (~> 2.7.0) - journey (~> 1.0.4) - rack (~> 1.4.0) - rack-cache (~> 1.2) - rack-test (~> 0.6.1) - sprockets (~> 2.2.1) - activemodel (3.2.9) - activesupport (= 3.2.9) - builder (~> 3.0.0) - activerecord (3.2.9) - activemodel (= 3.2.9) - activesupport (= 3.2.9) - arel (~> 3.0.2) - tzinfo (~> 0.3.29) - activeresource (3.2.9) - activemodel (= 3.2.9) - activesupport (= 3.2.9) - activesupport (3.2.9) - i18n (~> 0.6) - multi_json (~> 1.0) - annotate (2.5.0) - rake - arel (3.0.2) - awesome_nested_set (2.1.6) - activerecord (>= 3.0.0) - bcrypt-ruby (3.0.1) - bcrypt-ruby (3.0.1-x86-mingw32) - bootstrap-addons-rails (0.1.2) - rails - bootstrap-sass (2.3.2.1) - sass (~> 3.2) - builder (3.0.4) - cancan (1.6.9) - carrierwave (0.9.0) - activemodel (>= 3.2.0) - activesupport (>= 3.2.0) - json (>= 1.7) - cocaine (0.4.2) - coffee-rails (3.2.2) - coffee-script (>= 2.2.0) - railties (~> 3.2.0) - coffee-script (2.2.0) - coffee-script-source - execjs - coffee-script-source (1.4.0) - devise (2.2.3) - bcrypt-ruby (~> 3.0) - orm_adapter (~> 0.1) - railties (~> 3.1) - warden (~> 1.2.1) - diff-lcs (1.2.4) - erubis (2.7.0) - execjs (1.4.0) - multi_json (~> 1.0) - factory_girl (4.2.0) - activesupport (>= 3.0.0) - factory_girl_rails (4.2.1) - factory_girl (~> 4.2.0) - railties (>= 3.0.0) - faraday (0.8.8) - multipart-post (~> 1.2.0) - formtastic (2.2.1) - actionpack (>= 3.0) - formtastic-bootstrap (2.1.3) - formtastic (~> 2.2) - git (1.2.5) - globalize3 (0.3.0) - activemodel (>= 3.0.0) - activerecord (>= 3.0.0) - paper_trail (~> 2) - haml (4.0.0) - tilt - hashie (2.0.5) - hike (1.2.1) - httpauth (0.2.0) - i18n (0.6.1) - journey (1.0.4) - jquery-fileupload-rails (0.4.1) - actionpack (>= 3.1) - railties (>= 3.1) - jquery-rails (2.2.1) - railties (>= 3.0, < 5.0) - thor (>= 0.14, < 2.0) - json (1.7.7) - jwt (0.1.8) - multi_json (>= 1.5) - libv8 (3.11.8.13) - mail (2.4.4) - i18n (>= 0.4.0) - mime-types (~> 1.16) - treetop (~> 1.4.8) - mime-types (1.21) - mini_portile (0.5.2) - multi_json (1.5.1) - multipart-post (1.2.0) - mysql2 (0.3.13) - net-ldap (0.2.2) - nokogiri (1.5.6) - nokogiri (1.6.0) - mini_portile (~> 0.5.0) - nokogiri (1.6.0-x86-mingw32) - mini_portile (~> 0.5.0) - oauth2 (0.8.1) - faraday (~> 0.8) - httpauth (~> 0.1) - jwt (~> 0.1.4) - multi_json (~> 1.0) - rack (~> 1.2) - omniauth (1.1.4) - hashie (>= 1.2, < 3) - rack - omniauth-facebook (1.4.1) - omniauth-oauth2 (~> 1.1.0) - omniauth-ldap (1.0.3) - net-ldap (~> 0.2.2) - omniauth (~> 1.0) - pyu-ruby-sasl (~> 0.0.3.1) - rubyntlm (~> 0.1.1) - omniauth-oauth2 (1.1.1) - oauth2 (~> 0.8.0) - omniauth (~> 1.0) - orm_adapter (0.4.0) - paper_trail (2.7.0) - activerecord (~> 3.0) - railties (~> 3.0) - paperclip (3.4.0) - activemodel (>= 3.0.0) - activerecord (>= 3.0.0) - activesupport (>= 3.0.0) - cocaine (~> 0.4.0) - mime-types - polyglot (0.3.3) - pyu-ruby-sasl (0.0.3.3) - rack (1.4.5) - rack-cache (1.2) - rack (>= 0.4) - rack-ssl (1.3.3) - rack - rack-test (0.6.2) - rack (>= 1.0) - rails (3.2.9) - actionmailer (= 3.2.9) - actionpack (= 3.2.9) - activerecord (= 3.2.9) - activeresource (= 3.2.9) - activesupport (= 3.2.9) - bundler (~> 1.0) - railties (= 3.2.9) - railties (3.2.9) - actionpack (= 3.2.9) - activesupport (= 3.2.9) - rack-ssl (~> 1.3.2) - rake (>= 0.8.7) - rdoc (~> 3.4) - thor (>= 0.14.6, < 2.0) - rake (10.0.3) - rdoc (3.12.1) - json (~> 1.4) - ref (1.0.2) - rmagick (2.13.2) - rolify (3.2.0) - rspec-core (2.14.4) - rspec-expectations (2.14.0) - diff-lcs (>= 1.1.3, < 2.0) - rspec-mocks (2.14.1) - rspec-rails (2.14.0) - actionpack (>= 3.0) - activesupport (>= 3.0) - railties (>= 3.0) - rspec-core (~> 2.14.0) - rspec-expectations (~> 2.14.0) - rspec-mocks (~> 2.14.0) - rubyntlm (0.1.1) - sanitize (2.0.6) - nokogiri (>= 1.4.4) - sass (3.2.5) - sass-rails (3.2.6) - railties (~> 3.2.0) - sass (>= 3.1.10) - tilt (~> 1.3) - seed_dump (0.5.3) - simple_calendar (0.1.9) - rails (>= 3.0) - sprockets (2.2.2) - hike (~> 1.2) - multi_json (~> 1.0) - rack (~> 1.0) - tilt (~> 1.1, != 1.3.0) - sqlite3 (1.3.7) - sqlite3 (1.3.7-x86-mingw32) - therubyracer (0.11.3) - libv8 (~> 3.11.8.12) - ref - thor (0.17.0) - tilt (1.3.3) - tinymce-rails (3.5.8) - railties (>= 3.1.1) - treetop (1.4.12) - polyglot - polyglot (>= 0.3.1) - tzinfo (0.3.35) - uglifier (1.3.0) - execjs (>= 0.3.0) - multi_json (~> 1.0, >= 1.0.2) - warden (1.2.1) - rack (>= 1.0) - -PLATFORMS - ruby - x86-mingw32 - -DEPENDENCIES - annotate (>= 2.5.0) - awesome_nested_set - bootstrap-addons-rails - bootstrap-sass (~> 2.3.2.1) - cancan - carrierwave (~> 0.9.0) - coffee-rails (~> 3.2.1) - devise (~> 2.2.3) - execjs (~> 1.4.0) - factory_girl_rails - formtastic (~> 2.2.1) - formtastic-bootstrap (~> 2.1.3) - git - globalize3 (~> 0.3.0) - haml - jquery-fileupload-rails - jquery-rails - mysql2 - omniauth - omniauth-facebook - omniauth-ldap - paper_trail (>= 2.7.0) - paperclip (~> 3.4.0) - rails (= 3.2.9) - rmagick - rolify - rspec-rails - sanitize - sass-rails (~> 3.2) - seed_dump (~> 0.5.3) - simple_calendar (~> 0.1.9) - sqlite3 - therubyracer - tinymce-rails (>= 3.5.8) - uglifier (>= 1.0.3) 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/controllers/fetprofiles_controller.rb b/app/controllers/fetprofiles_controller.rb index 17cdd4c..c056ada 100644 --- a/app/controllers/fetprofiles_controller.rb +++ b/app/controllers/fetprofiles_controller.rb @@ -50,6 +50,8 @@ class FetprofilesController < ApplicationController # GET /fetprofiles/1/edit def edit @fetprofile = Fetprofile.find(params[:id]) + @memberships=@fetprofile.memberships.order(:typ) + @memberships<'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 e7a20e5..639fc9d 100755 --- a/app/controllers/rubriken_controller.rb +++ b/app/controllers/rubriken_controller.rb @@ -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.. diff --git a/app/models/ability.rb b/app/models/ability.rb index 1b2ede8..f9388ae 100755 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -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 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 e0b5508..a52157b 100644 --- a/app/models/calentry.rb +++ b/app/models/calentry.rb @@ -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 diff --git a/app/models/fetprofile.rb b/app/models/fetprofile.rb index 2612509..97e55a3 100644 --- a/app/models/fetprofile.rb +++ b/app/models/fetprofile.rb @@ -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" diff --git a/app/models/gremium.rb b/app/models/gremium.rb index b3bc9fa..95cb6f9 100644 --- a/app/models/gremium.rb +++ b/app/models/gremium.rb @@ -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 diff --git a/app/models/membership.rb b/app/models/membership.rb index 29c7ea6..fcc5385 100644 --- a/app/models/membership.rb +++ b/app/models/membership.rb @@ -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 diff --git a/app/models/neuigkeit.rb b/app/models/neuigkeit.rb index e957fe1..72b4f94 100755 --- a/app/models/neuigkeit.rb +++ b/app/models/neuigkeit.rb @@ -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 = /

(?[\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 e69658a..f98a143 100755 --- a/app/models/rubrik.rb +++ b/app/models/rubrik.rb @@ -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? 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

+

<%= calendar.name %>

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 @@
<%= calendar @calendar.calentries do |entry| %> -
<%= link_to entry.name.to_s, entry %>
+
<%= link_to entry.name.to_s, polymorphic_path(entry.object) %>
<% end %>
diff --git a/app/views/calentries/_calentry.html.erb b/app/views/calentries/_calentry.html.erb new file mode 100644 index 0000000..2b2fbe7 --- /dev/null +++ b/app/views/calentries/_calentry.html.erb @@ -0,0 +1,9 @@ +
+<%= 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) %> +
diff --git a/app/views/calentries/_nested_fields.html.erb b/app/views/calentries/_nested_fields.html.erb new file mode 100644 index 0000000..b29f4fe --- /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 %> <%= I18n.t 'common.delete' %>
+
diff --git a/app/views/fetprofiles/_form.html.erb b/app/views/fetprofiles/_form.html.erb index d6d6efb..d66a6bb 100644 --- a/app/views/fetprofiles/_form.html.erb +++ b/app/views/fetprofiles/_form.html.erb @@ -22,15 +22,19 @@ <%= f.hidden_field :picture_cache %>
<%= f.input :fetmailalias %>
- <%= f.inputs :for => :memberships do |membership,i| %> +<% @memberships.each do |m| %> + + <%= f.semantic_fields_for :memberships, m do |membership| %> +
+
<%= membership.input :start, :as=>:datepicker, :prepend=>"von",:label=>false%>
<%= membership.input :stop, :as=>:datepicker,:label=>false, :prepend =>"bis" %>
<%= membership.input :typ ,:as=>:select, :collection=>Membership::TYPEN.invert, :label=>false %>
@@ -39,7 +43,7 @@
<% end %> - <% end %> + <% end %> <% end %>
<%= f.actions do %> diff --git a/app/views/fetprofiles/_tabs.html.erb b/app/views/fetprofiles/_tabs.html.erb index 71f204d..a17254b 100644 --- a/app/views/fetprofiles/_tabs.html.erb +++ b/app/views/fetprofiles/_tabs.html.erb @@ -1,9 +1,9 @@ diff --git a/app/views/fetprofiles/index.html.erb b/app/views/fetprofiles/index.html.erb index 9584ed9..7bda4db 100644 --- a/app/views/fetprofiles/index.html.erb +++ b/app/views/fetprofiles/index.html.erb @@ -2,8 +2,8 @@ <%= render 'fetprofiles/tabs' %>

- <%= 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" %>

diff --git a/app/views/fetprofiles/new.html.erb b/app/views/fetprofiles/new.html.erb index 94b4554..0499665 100644 --- a/app/views/fetprofiles/new.html.erb +++ b/app/views/fetprofiles/new.html.erb @@ -1,5 +1,5 @@ -

New fetprofile

+

<%= I18n.t('profile.new_profile')%>

<%= render 'form' %> -<%= link_to 'Back', fetprofiles_path %> +<%= link_to I18n.t('common.back'), fetprofiles_path %> diff --git a/app/views/fetprofiles/show.html.erb b/app/views/fetprofiles/show.html.erb index 760381c..8f6ba1e 100644 --- a/app/views/fetprofiles/show.html.erb +++ b/app/views/fetprofiles/show.html.erb @@ -18,8 +18,8 @@ <% @fetprofile.memberships.each do |m| %>
  • <%= 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 ) %>
  • <% end %> 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| %> +
    +
    +
    <%= membership.input :start, :as=>:datepicker, :prepend=>"von",:label=>false%>
    +
    <%= membership.input :stop, :as=>:datepicker,:label=>false, :prepend =>"bis" %>
    +
    <%= membership.input :typ ,:as=>:select, :collection=>Membership::TYPEN.invert, :label=>false %>
    +
    <%= membership.input :fetprofile, :as=>:select, :label=>false %>
    + + +
    + <% end %> + + +<% @memberships.each do |m| %> + + <%= f.semantic_fields_for :memberships, m do |memberships_attributes| %> +
    +
    +
    <%= memberships_attributes.input :start, :as=>:datepicker, :prepend=>"von",:label=>false%>
    +
    <%= memberships_attributes.input :stop, :as=>:datepicker,:label=>false, :prepend =>"bis" %>
    +
    <%= memberships_attributes.input :typ ,:as=>:select, :collection=>Membership::TYPEN.invert, :label=>false %>
    +
    <%= memberships_attributes.input :fetprofile, :as=>:select, :label=>false %>
    + + +
    + <% end %> +<% end %> + <% end %> <%= f.actions do %> diff --git a/app/views/neuigkeiten/_form.html.erb b/app/views/neuigkeiten/_form.html.erb index 4e55f1d..0712bab 100755 --- a/app/views/neuigkeiten/_form.html.erb +++ b/app/views/neuigkeiten/_form.html.erb @@ -1,23 +1,38 @@ <%= 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.inputs :for => :calentry do |calentry| %> - <%= calentry.input :start, :as => :datepicker %> - <%= calentry.input :ende , :as => :datepicker %> - <%= calentry.input :typ %> +
    +
    + <%= f.input :author, :as=> :select %> +
    +
    +
    + <%= f.input :picture, :as=> :file %> +
    + + + + + <%= 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 %> +
    <%= tinymce %> diff --git a/app/views/neuigkeiten/show.html.erb b/app/views/neuigkeiten/show.html.erb index e2162ef..36de7a7 100755 --- a/app/views/neuigkeiten/show.html.erb +++ b/app/views/neuigkeiten/show.html.erb @@ -19,5 +19,7 @@

    - +<% @calentries1.each do |ce|%> +<%= render ce unless ce.nil? %> +<% end %> <%= render 'layouts/pretty_toolbar', :object=> @toolbar_elements %> diff --git a/app/views/rubriken/_form.html.erb b/app/views/rubriken/_form.html.erb index a7071d5..ab6d620 100755 --- a/app/views/rubriken/_form.html.erb +++ b/app/views/rubriken/_form.html.erb @@ -3,6 +3,9 @@ <%= f.input :name %> <%= f.input :desc %> <%= f.input :prio %> + <%= f.input :public %> + + <% end %> <%= f.actions do %> diff --git a/app/views/rubriken/show.html.erb b/app/views/rubriken/show.html.erb index 0c36e27..a024b9a 100755 --- a/app/views/rubriken/show.html.erb +++ b/app/views/rubriken/show.html.erb @@ -14,7 +14,7 @@ -<% @rubrik.neuigkeiten.each_slice(1) do |row| %> +<% @neuigkeiten.each_slice(1) do |row| %>