From 48fcdc1d7e3f7b103d1ee3d19871376cb0199f3d Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sun, 13 Apr 2014 15:50:44 +0200 Subject: [PATCH 01/48] gemfile lock --- Gemfile.lock | 1 - 1 file changed, 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index f01eff7..5267261 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -258,7 +258,6 @@ DEPENDENCIES paper_trail (>= 2.7.0)! paperclip (~> 3.4.0) rails (= 3.2.13) - remotipart! rmagick rolify rspec-rails From 0cc90eb220ecbcd97ffa6b446ee7aaf3d6f7e5f3 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sun, 13 Apr 2014 15:52:23 +0200 Subject: [PATCH 02/48] gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index 306bf75..4678fd7 100755 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,5 @@ console /public/uploads/ /bak/* *# +Gemfile.lock +/config/database.yml From 13514317c9ee93166637e8d2db218c948e5b717f Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Tue, 27 May 2014 19:41:35 +0530 Subject: [PATCH 03/48] fetprofileprivate data --- app/controllers/fetprofiles_controller.rb | 7 ++++-- app/models/fetprofile.rb | 20 +++++++++++++++- app/views/fetprofiles/_form.html.erb | 23 +++++++++++++++++++ app/views/fetprofiles/_interninfo.html.erb | 13 +++++++++++ app/views/fetprofiles/_internrow.html.erb | 12 ++++++++++ app/views/fetprofiles/internlist.html.erb | 5 ++++ app/views/fetprofiles/show.html.erb | 9 ++++++-- app/views/home/intern.html.erb | 22 +++++++++++++----- config/routes.rb | 1 + ...20140522094444_add_adress_to_fetprofile.rb | 15 ++++++++++++ 10 files changed, 116 insertions(+), 11 deletions(-) create mode 100644 app/views/fetprofiles/_interninfo.html.erb create mode 100644 app/views/fetprofiles/_internrow.html.erb create mode 100644 app/views/fetprofiles/internlist.html.erb create mode 100644 db/migrate/20140522094444_add_adress_to_fetprofile.rb diff --git a/app/controllers/fetprofiles_controller.rb b/app/controllers/fetprofiles_controller.rb index ad61588..83af41c 100644 --- a/app/controllers/fetprofiles_controller.rb +++ b/app/controllers/fetprofiles_controller.rb @@ -12,9 +12,12 @@ class FetprofilesController < ApplicationController @gremientabs = Gremium.tabs respond_to do |format| format.html # index.html.erb - format.json { render json: @fetprofiles } - end + end end + def internlist + @fetprofiles = Fetprofile.order(:vorname,:nachname) + end + # GET /fetprofiles/1 # GET /fetprofiles/1.json diff --git a/app/models/fetprofile.rb b/app/models/fetprofile.rb index 787c175..143b672 100644 --- a/app/models/fetprofile.rb +++ b/app/models/fetprofile.rb @@ -15,7 +15,7 @@ # class Fetprofile < ActiveRecord::Base - attr_accessible :active, :desc, :fetmailalias, :nachname, :picture, :short, :vorname, :memberships_attributes, :remove_picture, :picture_cache + attr_accessible :active, :desc, :fetmailalias, :nachname, :picture, :short, :vorname, :memberships_attributes, :remove_picture, :picture_cache, :plz, :street, :city, :instant,:skype, :telnr, :hdynr, :birth_day,:birth_month, :birth_year has_many :memberships, dependent: :delete_all has_many :gremien, :through=> :membership mount_uploader :picture, PictureUploader @@ -23,11 +23,18 @@ class Fetprofile < ActiveRecord::Base validates :desc, :presence=>true validates :nachname, length:{minimum: 3},:presence=>true validates :vorname, length:{minimum: 3},:presence=>true + validate :validate_birthday has_many :users scope :search, ->(query) {where("nachname like ? or vorname like ? or short like ?", "%#{query}%", "%#{query}%", "%#{query}%")} accepts_nested_attributes_for :memberships, :reject_if=>lambda{|a| a[:typ].blank?|| a[:start].blank? ||a[:gremium_id].blank?}, :allow_destroy=>true has_many :nlinks, as: :link + def validate_birthday + unless Date.valid_date?(birth_year, birth_month, birth_day) + errors.add(:birth_month, "Invalides Datum") + errors.add(:birth_day, "Invalides Datum") + end + end def title self.name @@ -39,4 +46,15 @@ validates :desc, :presence=>true def fetmail (fetmailalias.nil? || fetmailalias.empty?) ? short.to_s + "@fet.at" : fetmailalias.to_s + "@fet.at" end + def adress + connector= (self.street.nil?||self.street.empty?||(self.city.empty? && self.plz.empty?)) ? '' : ', ' + self.plz.to_s + ' ' + self.city.to_s + connector.to_s + self.street.to_s + end + def birthday + if self.birth_year.nil? || self.birth_year.zero? + Date.new( Date.today.year,self.birth_month,self.birth_day) + else + Date.new( self.birth_year,self.birth_month,self.birth_day) + end + end end diff --git a/app/views/fetprofiles/_form.html.erb b/app/views/fetprofiles/_form.html.erb index 8143c08..3714148 100644 --- a/app/views/fetprofiles/_form.html.erb +++ b/app/views/fetprofiles/_form.html.erb @@ -28,6 +28,29 @@
<%= f.input :fetmailalias %>
+
+
+Adresse: + +<%=f.input :street %> +<%=f.input :plz %> +<%=f.input :city %> +KOntakt: +<%=f.input :instant %> +<%=f.input :skype %> +<%=f.input :telnr %> +<%=f.input :hdynr %> + +
+
+Geburtstag: +<%=f.input :birth_day %> +<%=f.input :birth_month %> +<%=f.input :birth_year %> + +
+ +
<% @memberships.each do |m| %> <%= f.semantic_fields_for :memberships, m do |membership| %> diff --git a/app/views/fetprofiles/_interninfo.html.erb b/app/views/fetprofiles/_interninfo.html.erb new file mode 100644 index 0000000..b85b608 --- /dev/null +++ b/app/views/fetprofiles/_interninfo.html.erb @@ -0,0 +1,13 @@ +

+ Adresse: + <%= interninfo.plz %> + <%= interninfo.city %>, + <%= interninfo.street %> +

+

+ <%= raw("Telefon: ")+ interninfo.telnr + "
" unless interninfo.telnr.empty?%> + <%= raw("Handy: ") +interninfo.hdynr unless interninfo.hdynr.empty? %>
+<%= raw("Skype: ") +interninfo.skype unless interninfo.skype.empty? %>
+<%= raw("Instant Messaging: ") +interninfo.instant unless interninfo.instant.empty? %>
+ +

diff --git a/app/views/fetprofiles/_internrow.html.erb b/app/views/fetprofiles/_internrow.html.erb new file mode 100644 index 0000000..63fbb75 --- /dev/null +++ b/app/views/fetprofiles/_internrow.html.erb @@ -0,0 +1,12 @@ + + <%= link_to internrow.name, internrow %> + + <%= internrow.adress %> + + <%= raw("Telefon: ")+ internrow.telnr + "
" unless internrow.telnr.nil? || internrow.telnr.empty?%> + <%= raw("Handy: ") +internrow.hdynr + raw("
") unless internrow.hdynr.nil? || internrow.hdynr.empty? %> +<%= raw("Skype: ") +internrow.skype + raw("
") unless internrow.skype.nil? || internrow.skype.empty? %> +<%= raw("Instant Messaging: ") +internrow.instant + raw("
") unless internrow.instant.nil? || internrow.instant.empty? %> + +<%= internrow.fetmail %> + diff --git a/app/views/fetprofiles/internlist.html.erb b/app/views/fetprofiles/internlist.html.erb new file mode 100644 index 0000000..5d8f566 --- /dev/null +++ b/app/views/fetprofiles/internlist.html.erb @@ -0,0 +1,5 @@ + +<% @fetprofiles.each do |item| %> +<%= render partial: "internrow", object: item %> +<% end %> +
diff --git a/app/views/fetprofiles/show.html.erb b/app/views/fetprofiles/show.html.erb index ded2659..b62caae 100644 --- a/app/views/fetprofiles/show.html.erb +++ b/app/views/fetprofiles/show.html.erb @@ -10,10 +10,15 @@

<%= @fetprofile.fetmail %>

-

+ respond_to do |format| + format.html # index.html.erb + format.json { render json: @fetprofiles } + end + +

<%= @fetprofile.desc %>

- + <%= render partial: "interninfo", object: @fetprofile if can?(:seeintern, @fetprofile) %>
    <% @memberships.each do |m| %>
  • diff --git a/app/views/home/intern.html.erb b/app/views/home/intern.html.erb index b419c02..2948dfa 100644 --- a/app/views/home/intern.html.erb +++ b/app/views/home/intern.html.erb @@ -1,10 +1,20 @@

    FET Intern NEU

    -

    Neuigkeiten

    - +
    +
    +
    + <%= link_to "Adressliste", internlist_fetprofiles_path %> + <%= link_to "Internes Nachschlagewerk" %> +
    +
    +

    Neuigkeiten

    + +
    +
    +

    diff --git a/config/routes.rb b/config/routes.rb index 4e8a1aa..a3d5cd6 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -57,6 +57,7 @@ resources :fetprofiles do collection do get 'verwalten' + get 'internlist' end resources :memberships, :only => [:new, :edit, :update,:destroy,:create] end diff --git a/db/migrate/20140522094444_add_adress_to_fetprofile.rb b/db/migrate/20140522094444_add_adress_to_fetprofile.rb new file mode 100644 index 0000000..6a01af2 --- /dev/null +++ b/db/migrate/20140522094444_add_adress_to_fetprofile.rb @@ -0,0 +1,15 @@ +class AddAdressToFetprofile < ActiveRecord::Migration + def change + add_column :fetprofiles, :street, :string + add_column :fetprofiles, :plz, :string + add_column :fetprofiles, :telnr, :string + add_column :fetprofiles, :hdynr, :string + add_column :fetprofiles, :skype, :string + add_column :fetprofiles, :instant, :string + add_column :fetprofiles, :city, :string + add_column :fetprofiles, :birth_day, :integer + add_column :fetprofiles, :birth_month, :integer + add_column :fetprofiles, :birth_year, :integer + add_column :fetprofiles, :public_birthday, :boolean + end +end From adfec2446ee9521a7f7414c0137e49465201ef2c Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Tue, 27 May 2014 19:42:05 +0530 Subject: [PATCH 04/48] themengruppeprivate --- app/controllers/gremien_controller.rb | 2 ++ app/controllers/themengruppen_controller.rb | 4 +++- app/models/calentry.rb | 2 +- app/models/themengruppe.rb | 2 +- app/views/gremien/verwalten.html.erb | 3 ++- app/views/themengruppen/_form.html.erb | 1 + app/views/themengruppen/index.html.erb | 3 ++- app/views/themes/2003/themengruppen/verwalten_all.html.erb | 3 ++- db/migrate/20140526054302_add_public_to_themengruppe.rb | 5 +++++ 9 files changed, 19 insertions(+), 6 deletions(-) create mode 100644 db/migrate/20140526054302_add_public_to_themengruppe.rb diff --git a/app/controllers/gremien_controller.rb b/app/controllers/gremien_controller.rb index 497163f..3aec4da 100644 --- a/app/controllers/gremien_controller.rb +++ b/app/controllers/gremien_controller.rb @@ -7,6 +7,8 @@ class GremienController < ApplicationController @gremien = Gremium.all @gremientabs=Gremium.tabs @toolbar_elements << {:text=>I18n.t('gremium.new'),:path=>new_gremium_path() ,:icon=>:plus} if can? :new, Gremium + @toolbar_elements << {:text=>I18n.t('profile.new'),:path=>new_fetprofile_path() ,:icon=>:plus} if can? :new, Fetprofile + respond_to do |format| format.html # index.html.erb format.json { render json: @gremien } diff --git a/app/controllers/themengruppen_controller.rb b/app/controllers/themengruppen_controller.rb index f639b42..ae9fbd9 100644 --- a/app/controllers/themengruppen_controller.rb +++ b/app/controllers/themengruppen_controller.rb @@ -52,7 +52,9 @@ class ThemengruppenController < ApplicationController end def verwalten_all @themengruppen =Themengruppe.order(:priority).reverse - end + @toolbar_elements = [{:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.new'), :path=>new_themengruppe_path()}] + + end def verwalten @themengruppe = Themengruppe.find(params[:themengruppe_id]) @themen = @themengruppe.themen.order(:priority).reverse diff --git a/app/models/calentry.rb b/app/models/calentry.rb index f7f0699..8ee967e 100644 --- a/app/models/calentry.rb +++ b/app/models/calentry.rb @@ -32,7 +32,7 @@ class Calentry < ActiveRecord::Base resourcify def get_public - self.public = (self.try(:object).nil?)? (self.calendar.try(:public)) : object.try(:public) + self.public = (self.try(:object).nil?)? (self.calendar.try(:public?)) : object.try(:public?) true end def start_time diff --git a/app/models/themengruppe.rb b/app/models/themengruppe.rb index ca42007..0dd89b2 100644 --- a/app/models/themengruppe.rb +++ b/app/models/themengruppe.rb @@ -10,7 +10,7 @@ class Themengruppe < ActiveRecord::Base WORD_COUNT = 50 - attr_accessible :text, :title, :picture, :priority + attr_accessible :text, :title, :picture, :priority, :public has_many :themen, class_name: 'Thema' has_many :fragen, through: :themen diff --git a/app/views/gremien/verwalten.html.erb b/app/views/gremien/verwalten.html.erb index 38a339e..27b7113 100644 --- a/app/views/gremien/verwalten.html.erb +++ b/app/views/gremien/verwalten.html.erb @@ -1,4 +1,5 @@

    Listing gremien

    +<%= render 'layouts/pretty_toolbar' %>
    <% @gremien.each do |gremium| %>
    @@ -38,7 +39,7 @@
    -<%= render 'layouts/pretty_toolbar' %> + diff --git a/app/views/themengruppen/_form.html.erb b/app/views/themengruppen/_form.html.erb index e8c5f15..90e9409 100644 --- a/app/views/themengruppen/_form.html.erb +++ b/app/views/themengruppen/_form.html.erb @@ -2,6 +2,7 @@ <%= f.inputs do %> <%= f.input :title %> <%= f.input :priority %> + <%= f.input :public %> <%= f.input :picture, :as => :file %> <%= f.input :text %> diff --git a/app/views/themengruppen/index.html.erb b/app/views/themengruppen/index.html.erb index 2bcb394..a083311 100644 --- a/app/views/themengruppen/index.html.erb +++ b/app/views/themengruppen/index.html.erb @@ -1,4 +1,5 @@
    +<%= render :partial=>'layouts/pretty_toolbar' %>

    <%= link_to "FAQS", faqs_themengruppen_path,class: :btn %>

    -
    <%= f.input :active %>
    +
    <%= f.input :active %> <%= f.input :geschlecht,:as=>:select, :collection=>Fetprofile::GESCHLECHT.invert %>
    <%= image_tag(@fetprofile.picture.thumb.url) unless @fetprofile.picture.nil? %> <%= f.file_field :picture %> diff --git a/app/views/memberships/_membership.html.erb b/app/views/memberships/_membership.html.erb index f6b8679..e2689e9 100644 --- a/app/views/memberships/_membership.html.erb +++ b/app/views/memberships/_membership.html.erb @@ -2,5 +2,5 @@ <%= membership.stop.nil? ? "seit " : "von " %> <%=membership.start.to_s %> <%= " bis "+membership.stop.to_s unless membership.stop.nil? %> -<%= Membership::TYPEN[membership.typ.to_i] %> +<%= Membership::TYPEN_g[membership.fetprofile.geschlecht.to_i][membership.typ.to_i] %> <%= membership.gremium.fall2 %> diff --git a/db/migrate/20140603140147_add_sex_to_fetprofile.rb b/db/migrate/20140603140147_add_sex_to_fetprofile.rb new file mode 100644 index 0000000..eabdcf5 --- /dev/null +++ b/db/migrate/20140603140147_add_sex_to_fetprofile.rb @@ -0,0 +1,5 @@ +class AddSexToFetprofile < ActiveRecord::Migration + def change + add_column :fetprofiles, :geschlecht, :integer + end +end From babbfb7d73996530baa2748df70c06f4c87978a9 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Wed, 4 Jun 2014 23:16:25 +0530 Subject: [PATCH 08/48] div kleinigkeiten(FAQ Link) --- app/controllers/rubriken_controller.rb | 2 +- app/models/fetprofile.rb | 2 +- app/views/studien/semesteransicht.html.erb | 9 +++++---- app/views/themes/blue1/home/index.html.erb | 5 +++++ 4 files changed, 12 insertions(+), 6 deletions(-) diff --git a/app/controllers/rubriken_controller.rb b/app/controllers/rubriken_controller.rb index 436b990..7ec78a9 100755 --- a/app/controllers/rubriken_controller.rb +++ b/app/controllers/rubriken_controller.rb @@ -8,7 +8,7 @@ class RubrikenController < ApplicationController @rubriken = Rubrik.where(:public=>true) end @neuigkeiten = @rubriken.collect(&:neuigkeiten).map(&:recent).flatten - @calentries= @rubriken.collect(&:calendar).collect(&:calentries).flatten + @calentries= @rubriken.collect(&:calentries).flatten end def intern diff --git a/app/models/fetprofile.rb b/app/models/fetprofile.rb index 49c674b..a73c3ce 100644 --- a/app/models/fetprofile.rb +++ b/app/models/fetprofile.rb @@ -15,7 +15,7 @@ # class Fetprofile < ActiveRecord::Base - attr_accessible :active, :desc, :fetmailalias, :nachname, :picture, :short, :vorname, :memberships_attributes, :remove_picture, :picture_cache, :plz, :street, :city, :instant,:skype, :telnr, :hdynr, :birth_day,:birth_month, :birth_year,:geschlecht + attr_accessible :active, :desc, :fetmailalias, :nachname, :picture, :short, :vorname, :memberships_attributes, :remove_picture, :picture_cache, :plz, :street, :city, :instant,:skype, :telnr, :hdynr, :birth_day, :birth_month, :birth_year,:geschlecht has_many :memberships, dependent: :delete_all has_many :gremien, :through=> :membership mount_uploader :picture, PictureUploader diff --git a/app/views/studien/semesteransicht.html.erb b/app/views/studien/semesteransicht.html.erb index 5ea2bde..078f445 100644 --- a/app/views/studien/semesteransicht.html.erb +++ b/app/views/studien/semesteransicht.html.erb @@ -20,16 +20,17 @@ <% end %> <% @studium.semester.each do |sem| %> -
    +
    -

    <%= sem.name %>

    -
    -
    <%= link_to I18n.t("lva.addrem"), edit_semester_path(sem), :class=>"btn-small"%>
    +

    <%= sem.name %>

    +
    +
    +
    <% sem.lvas.each do |lva| %>
    diff --git a/app/views/themes/blue1/home/index.html.erb b/app/views/themes/blue1/home/index.html.erb index 69ac8dd..b10b28b 100644 --- a/app/views/themes/blue1/home/index.html.erb +++ b/app/views/themes/blue1/home/index.html.erb @@ -28,6 +28,10 @@
    <%= link_to "Entwicklungsstatus" , dev_home_index_path %> +

    + <%= link_to "FAQS", faqs_themengruppen_path,class: :btn %> +

    + <%= render 'beispiele' %>
    @@ -44,6 +48,7 @@ Verschiedene Styles
  • <%= link_to "2003", home_index_path({:theme=>"2003"}) %>
  • <%= link_to "white_1", home_index_path({:theme=>"white_1"}) %>
+ From 6451c0f1757da7745db792692ca174d3f339d9b1 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Mon, 9 Jun 2014 23:14:05 +0530 Subject: [PATCH 09/48] themen ueberarbeitet attachments verwalten --- app/controllers/attachments_controller.rb | 28 ++-- app/controllers/themen_controller.rb | 9 +- app/controllers/wikis_controller.rb | 6 +- app/models/attachment.rb | 15 +- app/models/gremium.rb | 4 +- app/models/thema.rb | 2 +- app/uploaders/attachment_uploader.rb | 6 + app/views/attachments/_attachment.html.erb | 4 +- app/views/attachments/_form_bulk.html.erb | 143 ++++++++++++++++++ app/views/fragen/_form.html.erb | 2 + app/views/fragen/_rform.html.erb | 1 + app/views/themen/_attachment_list.html.erb | 6 + .../themen/_attachment_verwalten.html.erb | 3 + app/views/themen/_form.html.erb | 2 +- app/views/themen/_small.html.erb | 18 ++- app/views/themen/attachments.js.erb | 2 +- app/views/themen/edit.html.erb | 2 +- app/views/themen/edit.js.erb | 2 +- app/views/themen/verwalten.html.erb | 23 ++- app/views/wikis/_form.html.erb | 2 +- app/views/wikis/edit.html.erb | 2 +- app/views/wikis/edit.js.erb | 1 + 22 files changed, 245 insertions(+), 38 deletions(-) create mode 100644 app/views/attachments/_form_bulk.html.erb create mode 100644 app/views/themen/_attachment_verwalten.html.erb create mode 100644 app/views/wikis/edit.js.erb diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 4a37fb1..59ea3df 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -46,19 +46,29 @@ class AttachmentsController < ApplicationController # POST /attachments.json def create @attachment = Attachment.new(params[:attachment]) - @thema = Thema.find(params[:thema_id]) - @attachment.thema_id = @thema.id - @action="create" - logger.info "#{@attachment.inspect}" + @thema = Thema.find_by_id(params[:thema_id]) + # logger.info "gg" + @attachment.thema = @thema + @attachment.name=@attachment.datei.filename + @action="create" + + + # logger.info "sdf" respond_to do |format| - if @attachment.save - format.html { redirect_to @thema, notice: 'Attachment was successfully created.' } - format.json { render json: @thema, status: :created, location: @thema } - format.js { } + if @attachment.save + format.html { + render :json => [@attachment.to_jq_upload].to_json, + :content_type => 'text/html', + :layout => false + } + + # format.html { redirect_to @thema, notice: 'Attachment was successfully created.' } + format.json { render json: {files: [@attachment.to_jq_upload]}, status: :created, location: [@thema, @attachment]} + else format.html { render action: "new" } format.json { render json: @attachment.errors, status: :unprocessable_entity } - format.js { render action: "new.js.erb"} + end end end diff --git a/app/controllers/themen_controller.rb b/app/controllers/themen_controller.rb index 4462131..a4a635f 100644 --- a/app/controllers/themen_controller.rb +++ b/app/controllers/themen_controller.rb @@ -32,7 +32,8 @@ class ThemenController < ApplicationController end def verwalten @thema = Thema.find(params[:id]) - unless (@thema.wikiname.empty? || @thema.wikiname.nil?) + @attachment=Attachment.new + unless (@thema.is_wiki?) redirect_to verwalten_wiki_path(Wiki.find(@thema.id)) end @@ -58,7 +59,10 @@ class ThemenController < ApplicationController # GET /themen/1/edit def edit @thema = Thema.find(params[:id]) - + unless ( @thema.wikiname.nil? || @thema.wikiname.empty? ) + redirect_to edit_wiki_path(Wiki.find(@thema.id)) + return + end respond_to do |format| format.html format.js @@ -93,6 +97,7 @@ class ThemenController < ApplicationController def attachments @thema = Thema.find(params[:id]) @attachments=@thema.attachments + @attachment=Attachment.new respond_to do |format| format.js end diff --git a/app/controllers/wikis_controller.rb b/app/controllers/wikis_controller.rb index 1033d07..d448a14 100644 --- a/app/controllers/wikis_controller.rb +++ b/app/controllers/wikis_controller.rb @@ -23,7 +23,11 @@ class WikisController < ApplicationController end def edit @wiki = Wiki.find(params[:id]) - + respond_to do |format| + format.html + format.js + end + end def update diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 1efccd6..c61214f 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -12,9 +12,22 @@ class Attachment < ActiveRecord::Base has_paper_trail - attr_accessible :name, :datei + attr_accessible :name, :datei, :datei_cache belongs_to :thema mount_uploader :datei, AttachmentUploader validates :thema, :presence => true validates :name, :presence => true + + def to_jq_upload + { + "id" => read_attribute(:id), + "title" => read_attribute(:title), + "description" => read_attribute(:desc), + "name" => read_attribute(:title), + "size" => datei.size, + "url" => datei.url, + "thumbnail_url" => datei.thumb.url, + "delete_type" => "DELETE" + } + end end diff --git a/app/models/gremium.rb b/app/models/gremium.rb index ea92010..fe5d2d1 100644 --- a/app/models/gremium.rb +++ b/app/models/gremium.rb @@ -14,8 +14,8 @@ class Gremium < ActiveRecord::Base TYPEN={1=>"offiziell", 2=>"offiziell-temporär", 3 => "inoffiziell",4=>"inoffiziell-tempo", 11=> "berufungskommission",12=> "habilitationskommission" } # 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 - ART4FALL={0=>"das", 1=>"den",2=>"die"} # Artikel 2.Fall abhängig vom Geschlecht + ART2FALL={0=>"des", 1=>"des",2=>"der"} # Artikel 2.Fall abhängig vom Geschlecht + ART4FALL={0=>"das", 1=>"den",2=>"die"} # Artikel 2.Fall abhängig vom Geschlecht FILTER={11=>I18n.t("gremium.filter.berufung.title"),12=>I18n.t("gremium.filter.habil.title")} TEXT={11=>I18n.t("gremium.filter.berufung.text"),12=>I18n.t("gremium.filter.habil.text")} diff --git a/app/models/thema.rb b/app/models/thema.rb index 2a3a9c4..156a3f5 100644 --- a/app/models/thema.rb +++ b/app/models/thema.rb @@ -23,7 +23,7 @@ class Thema < ActiveRecord::Base scope :search, ->(query) {where("text like ? or title like ?", "%#{query}%", "%#{query}%")} translates :title,:text, :versioning =>true, :fallbacks_for_empty_translations => true def is_wiki? - wikiname.empty? || wikiname.nil? + wikiname.nil? || wikiname.empty? end def text_first_words md = /

(?[^\<\>]*)/.match Sanitize.clean(self.text,:elements=>['p']) diff --git a/app/uploaders/attachment_uploader.rb b/app/uploaders/attachment_uploader.rb index cba26e4..2973828 100644 --- a/app/uploaders/attachment_uploader.rb +++ b/app/uploaders/attachment_uploader.rb @@ -6,6 +6,9 @@ class AttachmentUploader < CarrierWave::Uploader::Base include CarrierWave::RMagick # include CarrierWave::RMagick # include CarrierWave::MiniMagick +def root + Rails.root.join 'public/' +end # Choose what kind of storage to use for this uploader: storage :file @@ -20,6 +23,9 @@ class AttachmentUploader < CarrierWave::Uploader::Base version :thumb do process :resize_to_fill => [64, 64] end + version :thumb_small do + process :resize_to_fill => [32, 32] + end # Provide a default URL as a default if there hasn't been a file uploaded: # def default_url diff --git a/app/views/attachments/_attachment.html.erb b/app/views/attachments/_attachment.html.erb index 1fc66d3..0045f70 100644 --- a/app/views/attachments/_attachment.html.erb +++ b/app/views/attachments/_attachment.html.erb @@ -1,9 +1,9 @@ <% data_ext = attachment.datei.file.extension.downcase %> - <%= attachment.name %>
+ <% if (!["jpg","png","jpeg"].find_index(data_ext).nil?) %> <%= image_tag attachment.datei.thumb.url %> <% else %> <%= image_tag "pdf-logo.jpg" %> <% end %> - + <%= attachment.name %> diff --git a/app/views/attachments/_form_bulk.html.erb b/app/views/attachments/_form_bulk.html.erb new file mode 100644 index 0000000..b8c8616 --- /dev/null +++ b/app/views/attachments/_form_bulk.html.erb @@ -0,0 +1,143 @@ + +

+ <%= semantic_form_for [@thema,@attachment], :remote=>true, :html => { :multipart => true, :id => "fileupload" } do |f| %> + +
+ +
+
+ + + + Add files... + <%= f.file_field :datei, :multiple=>true %> + <% f.input :thema %> + + + + + +
+
+ +
+
+
+
+
+
+ +
+
+ + +
+ <% end %> + +
+ + + + + + + + diff --git a/app/views/fragen/_form.html.erb b/app/views/fragen/_form.html.erb index ce19bc5..a445ffe 100644 --- a/app/views/fragen/_form.html.erb +++ b/app/views/fragen/_form.html.erb @@ -10,3 +10,5 @@ <%= f.action :submit, :as => :input %> <% end %> <% end %> + + <%= tinymce %> diff --git a/app/views/fragen/_rform.html.erb b/app/views/fragen/_rform.html.erb index a3780d1..923744a 100644 --- a/app/views/fragen/_rform.html.erb +++ b/app/views/fragen/_rform.html.erb @@ -10,3 +10,4 @@ <%= f.action :submit, :as => :input %> <% end %> <% end %> + <%= tinymce %> diff --git a/app/views/themen/_attachment_list.html.erb b/app/views/themen/_attachment_list.html.erb index 7b9c0cf..a1c128d 100644 --- a/app/views/themen/_attachment_list.html.erb +++ b/app/views/themen/_attachment_list.html.erb @@ -2,11 +2,17 @@ <% attachment_list.each do |a| %> + <%= link_to a.datei.url do %> <%= render a %> +<% end %> +<% if editor %> <%= link_to "Edit", edit_thema_attachment_path(a.thema,a) %> +<%= link_to "Delete", thema_attachment_path(a.thema,a), method: "DELETE", confirm: "Sure?" %> + +<% end %> <% end %> diff --git a/app/views/themen/_attachment_verwalten.html.erb b/app/views/themen/_attachment_verwalten.html.erb new file mode 100644 index 0000000..8fb67c3 --- /dev/null +++ b/app/views/themen/_attachment_verwalten.html.erb @@ -0,0 +1,3 @@ + +<%= render :partial=>"attachments/form_bulk" %> +<%= render partial: "themen/attachment_list", object:@thema.attachments ,locals: {:editor => true}%> diff --git a/app/views/themen/_form.html.erb b/app/views/themen/_form.html.erb index 08e8b59..6a77d03 100644 --- a/app/views/themen/_form.html.erb +++ b/app/views/themen/_form.html.erb @@ -2,7 +2,7 @@
-<%= semantic_form_for @thema, :remote=>true do |f| %> +<%= semantic_form_for @thema, :remote=>remote do |f| %> <%= f.inputs do %>
diff --git a/app/views/themen/_small.html.erb b/app/views/themen/_small.html.erb index dfe8095..7cee6e1 100644 --- a/app/views/themen/_small.html.erb +++ b/app/views/themen/_small.html.erb @@ -1,18 +1,22 @@ - -

<%= small.title %>

-
+ +

<%= small.title %>

+
<%= raw(small.text) %>
-<%= raw("FAQs:") unless small.fragen.empty? %> +<%= raw("FAQs:") unless small.fragen.empty? %>
<% small.fragen.each do |frage| %>

- <%= frage.title %>
-<%= raw(frage.text) %> + <%= frage.title %>
+ <%= raw(frage.text) %>

-
<% end %> + +<%= render partial: "themen/attachment_list", object: small.attachments, locals:{editor: false} unless small.attachments.empty? %> +
+ + <% @small_elements = [] @small_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('thema.edit'), :path=>small} if can? :edit, small diff --git a/app/views/themen/attachments.js.erb b/app/views/themen/attachments.js.erb index 79f8f32..e1dceb5 100644 --- a/app/views/themen/attachments.js.erb +++ b/app/views/themen/attachments.js.erb @@ -1 +1 @@ -$("#themaview").html("<%= escape_javascript(raw("

"+I18n.t('thema.show')+"

")+render(:partial=>"themen/attachment_list", :object=>@attachments) )%>"); \ No newline at end of file +$("#themaview").html("<%= escape_javascript(raw("

"+I18n.t('thema.show')+"

")+render(:partial=>"themen/attachment_verwalten") )%>"); \ No newline at end of file diff --git a/app/views/themen/edit.html.erb b/app/views/themen/edit.html.erb index de6c7a3..10d69ea 100644 --- a/app/views/themen/edit.html.erb +++ b/app/views/themen/edit.html.erb @@ -1,5 +1,5 @@

Editing thema

-<%= render 'form' %> +<%= render 'form' , :locals=>{:remote=>false}, :remote=>false %>

<%= link_to 'Back', @thema %> diff --git a/app/views/themen/edit.js.erb b/app/views/themen/edit.js.erb index 30ca8ab..7256636 100644 --- a/app/views/themen/edit.js.erb +++ b/app/views/themen/edit.js.erb @@ -1 +1 @@ -$("#themaview").html("<%= escape_javascript(raw("

"+I18n.t('thema.edit')+"

")+render(:partial=>"themen/form") )%>"); +$("#themaview").html("<%= escape_javascript(raw("

"+I18n.t('thema.edit')+"

")+render(:partial=>"themen/form", :locals=>{:remote=>true}) )%>"); diff --git a/app/views/themen/verwalten.html.erb b/app/views/themen/verwalten.html.erb index 70177ca..6b1a1bd 100644 --- a/app/views/themen/verwalten.html.erb +++ b/app/views/themen/verwalten.html.erb @@ -1,6 +1,9 @@

<%= notice %>

-

<%= @thema.title %>

+
+
+
+

<%= raw(@thema.text) %>

@@ -11,16 +14,22 @@ --> <%= render :partial=>'layouts/pretty_toolbar' %> +

<%= I18n.t('attachment.title')%>:

+
+
+<%= render partial: "attachment_verwalten" %> +<%= render :partial => "themen/select", :object => @thema, :locals=>{:editor => :false} %> + +
+
+ <%= render :partial=>'themen/fragen' %>
-

<%= I18n.t('attachment.title')%>:

-
-
- -<%= link_to new_thema_attachment_path(@thema) ,:remote=>true do %> new Attachment <% end %> -<%= render :partial => "themen/select", :object => @thema, :locals=>{:editor => :false} %> <%= link_to I18n.t('common.back'), themengruppen_path, :class=>:btn %> +
+
+
diff --git a/app/views/wikis/_form.html.erb b/app/views/wikis/_form.html.erb index 18361c3..b17a9e9 100644 --- a/app/views/wikis/_form.html.erb +++ b/app/views/wikis/_form.html.erb @@ -1,6 +1,6 @@ <%= tinymce_assets %>
- <%= semantic_form_for @wiki do |f| %> + <%= semantic_form_for @wiki, :remote=>remote do |f| %> <%= f.inputs do %>
diff --git a/app/views/wikis/edit.html.erb b/app/views/wikis/edit.html.erb index de6c7a3..93d58a1 100644 --- a/app/views/wikis/edit.html.erb +++ b/app/views/wikis/edit.html.erb @@ -1,5 +1,5 @@

Editing thema

-<%= render 'form' %> +<%= render 'form', :remote=>false, :locals=>{:remote=>false} %>

<%= link_to 'Back', @thema %> diff --git a/app/views/wikis/edit.js.erb b/app/views/wikis/edit.js.erb new file mode 100644 index 0000000..0255518 --- /dev/null +++ b/app/views/wikis/edit.js.erb @@ -0,0 +1 @@ +$("#themaview").html("<%= escape_javascript(raw("

"+I18n.t('wiki.edit')+"

")+render(:partial=>"wikis/form", :locals=>{:remote=>true}) )%>"); From 67ccecaf51538069eece25dbf1ae7d371c2e4bf1 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Tue, 10 Jun 2014 18:47:16 +0530 Subject: [PATCH 10/48] #143 #143 fixed themen fixed --- Gemfile.lock | 29 +++++++++++++++++++++ app/controllers/themen_controller.rb | 4 +-- app/controllers/themengruppen_controller.rb | 9 ++++--- app/controllers/wikis_controller.rb | 8 ++---- app/models/modul.rb | 2 +- app/views/lvas/show.html.erb | 2 +- app/views/themen/_fragen.html.erb | 4 +-- app/views/themen/_small.html.erb | 2 +- app/views/themengruppen/show.html.erb | 11 +++----- app/views/themengruppen/verwalten.html.erb | 2 ++ 10 files changed, 49 insertions(+), 24 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 5267261..47b8928 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -9,6 +9,7 @@ GIT GEM remote: https://rubygems.org/ specs: + RedCloth (4.2.9) actionmailer (3.2.13) actionpack (= 3.2.13) mail (~> 2.5.3) @@ -53,6 +54,7 @@ GEM activemodel (>= 3.2.0) activesupport (>= 3.2.0) json (>= 1.7) + charlock_holmes (0.6.9.4) climate_control (0.0.3) activesupport (>= 3.0) cocaine (0.5.3) @@ -73,6 +75,7 @@ GEM erubis (2.7.0) execjs (1.4.0) multi_json (~> 1.0) + expression_parser (0.9.0) factory_girl (4.3.0) activesupport (>= 3.0.0) factory_girl_rails (4.3.0) @@ -87,12 +90,25 @@ GEM formtastic-bootstrap (2.1.3) formtastic (~> 2.2) git (1.2.6) + github-markup (0.7.5) + gitlab-grit (2.6.0) + charlock_holmes (~> 0.6.9) + diff-lcs (~> 1.1) + mime-types (~> 1.15) + posix-spawn (~> 0.3.6) globalize (3.0.4) activemodel (>= 3.0.0, < 4.0.0) activerecord (>= 3.0.0, < 4.0.0) globalize-versioning (0.1.0.alpha.1) globalize (>= 3, < 5) paper_trail (~> 3.0.0) + gollum-lib (2.0.0) + github-markup (>= 0.7.5, < 1.0.0) + gitlab-grit (= 2.6.0) + nokogiri (~> 1.6.0) + rouge (~> 1.3.1) + sanitize (~> 2.0.6) + stringex (~> 2.1.0) haml (4.0.5) tilt hashie (2.0.5) @@ -150,6 +166,7 @@ GEM cocaine (~> 0.5.0) mime-types polyglot (0.3.3) + posix-spawn (0.3.8) pyu-ruby-sasl (0.0.3.3) rack (1.4.5) rack-cache (1.2) @@ -177,8 +194,10 @@ GEM rdoc (3.12.2) json (~> 1.4) ref (1.0.5) + rinku (1.7.3) rmagick (2.13.2) rolify (3.2.0) + rouge (1.3.4) rspec-core (2.14.7) rspec-expectations (2.14.4) diff-lcs (>= 1.1.3, < 2.0) @@ -208,6 +227,7 @@ GEM rack (~> 1.0) tilt (~> 1.1, != 1.3.0) sqlite3 (1.3.8) + stringex (2.1.2) themes_for_rails (0.5.1) rails (>= 3.0.0) therubyracer (0.12.0) @@ -226,11 +246,17 @@ GEM json (>= 1.8.0) warden (1.2.3) rack (>= 1.0) + webrick (1.3.1) + wikicloth (0.8.1) + builder + expression_parser + rinku PLATFORMS ruby DEPENDENCIES + RedCloth annotate (>= 2.5.0) awesome_nested_set bootstrap-addons-rails @@ -247,6 +273,7 @@ DEPENDENCIES git globalize (~> 3.0.4) globalize-versioning + gollum-lib haml jquery-fileupload-rails jquery-rails @@ -271,3 +298,5 @@ DEPENDENCIES therubyracer tinymce-rails (~> 3.5.8) uglifier (>= 1.0.3) + webrick (= 1.3.1) + wikicloth diff --git a/app/controllers/themen_controller.rb b/app/controllers/themen_controller.rb index a4a635f..a4fbea3 100644 --- a/app/controllers/themen_controller.rb +++ b/app/controllers/themen_controller.rb @@ -33,9 +33,7 @@ class ThemenController < ApplicationController def verwalten @thema = Thema.find(params[:id]) @attachment=Attachment.new - unless (@thema.is_wiki?) - redirect_to verwalten_wiki_path(Wiki.find(@thema.id)) - end + @fragen=@thema.fragen @toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>"Verwalten", :path=>verwalten_thema_path(@thema)}] diff --git a/app/controllers/themengruppen_controller.rb b/app/controllers/themengruppen_controller.rb index ae9fbd9..ce8a741 100644 --- a/app/controllers/themengruppen_controller.rb +++ b/app/controllers/themengruppen_controller.rb @@ -24,10 +24,7 @@ class ThemengruppenController < ApplicationController @themen = @themengruppe.themen.order(:priority).reverse @toolbar_elements = [] - @toolbar_elements << {:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('thema.add'), :path=>new_themengruppe_thema_path(@themengruppe)} if can? :new, Themengruppe - @toolbar_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('themengruppe.edit'), :path=>edit_themengruppe_path(@themengruppe)} if can? :edit, @themengruppe @toolbar_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t("themengruppe.manage"), :path=>themengruppe_verwalten_path(@themengruppe)} if can? :edit, @themengruppe - @toolbar_elements << {:hicon=>'icon-remove-circle',:text=>I18n.t('themengruppe.remove'), :path=>themengruppe_path(@themengruppe), :method=>:delete,:confirm=>I18n.t('themengruppe.sure')} if can? :delete, @themengruppe respond_to do |format| format.html # show.html.erb @@ -58,6 +55,12 @@ class ThemengruppenController < ApplicationController def verwalten @themengruppe = Themengruppe.find(params[:themengruppe_id]) @themen = @themengruppe.themen.order(:priority).reverse + + @toolbar_elements =[] + @toolbar_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('themengruppe.edit'), :path=>edit_themengruppe_path(@themengruppe)} if can? :edit, @themengruppe + @toolbar_elements << {:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('thema.add'), :path=>new_themengruppe_thema_path(@themengruppe)} if can? :new, Themengruppe + @toolbar_elements << {:hicon=>'icon-remove-circle',:text=>I18n.t('themengruppe.remove'), :path=>themengruppe_path(@themengruppe), :method=>:delete,:confirm=>I18n.t('themengruppe.sure')} if can? :delete, @themengruppe + end def sort_themengruppen diff --git a/app/controllers/wikis_controller.rb b/app/controllers/wikis_controller.rb index d448a14..a61be11 100644 --- a/app/controllers/wikis_controller.rb +++ b/app/controllers/wikis_controller.rb @@ -16,11 +16,7 @@ class WikisController < ApplicationController redirect_to wiki_path(@wiki) end - def verwalten - @wiki = Wiki.find(params[:id]) - @toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('wiki.edit'), :path=>edit_wiki_path(@wiki)}] - - end + def edit @wiki = Wiki.find(params[:id]) respond_to do |format| @@ -36,7 +32,7 @@ class WikisController < ApplicationController @wiki.raw_data=params[:wiki][:raw_data] respond_to do |format| if @wiki.update_attributes(params[:wiki]) - format.html { redirect_to @wiki, notice: 'Thema was successfully updated.' } + format.html { redirect_to verwalten_thema_path(@wiki), notice: 'Thema was successfully updated.' } format.json { head :no_content } format.js else diff --git a/app/models/modul.rb b/app/models/modul.rb index 3b46cd9..1c3bb42 100755 --- a/app/models/modul.rb +++ b/app/models/modul.rb @@ -12,7 +12,7 @@ # class Modul < ActiveRecord::Base - attr_accessible :desc,:name, :depend, :studium_id, :modulgruppen + attr_accessible :desc,:name, :depend, :studium_id, :modulgruppen, :modulgruppe_ids has_and_belongs_to_many :lvas , :uniq=>true has_and_belongs_to_many :modulgruppen diff --git a/app/views/lvas/show.html.erb b/app/views/lvas/show.html.erb index d5bb9cb..8ef15af 100755 --- a/app/views/lvas/show.html.erb +++ b/app/views/lvas/show.html.erb @@ -7,7 +7,7 @@

Prüfungsinformation

- <%= @lva.pruefungsinformation.html_safe %> + <%= @lva.pruefungsinformation.to_s.html_safe %>

Lernaufwand

diff --git a/app/views/themen/_fragen.html.erb b/app/views/themen/_fragen.html.erb index 727a14f..ea30282 100644 --- a/app/views/themen/_fragen.html.erb +++ b/app/views/themen/_fragen.html.erb @@ -6,5 +6,5 @@
<%= render :partial=>'fragen/rform' %>
-<% @frage_elements = [{:icon=>:plus, :hicon=>'icon-plus', :text=>I18n.t('frage.add'), :path=>new_frage_path}] %> -<%= render :partial=>'layouts/pretty_toolbar', :object=>@frage_elements %> +<% # @frage_elements = [{:icon=>:plus, :hicon=>'icon-plus', :text=>I18n.t('frage.add'), :path=>new_frage_path}] %> +<% # render :partial=>'layouts/pretty_toolbar', :object=>@frage_elements %> diff --git a/app/views/themen/_small.html.erb b/app/views/themen/_small.html.erb index 7cee6e1..8c40748 100644 --- a/app/views/themen/_small.html.erb +++ b/app/views/themen/_small.html.erb @@ -1,5 +1,5 @@ -

<%= small.title %>

+

<%= small.title %> <%= link_to fa_icon("pencil"), verwalten_thema_path(small) if can? :edit, small %>

<%= raw(small.text) %>
diff --git a/app/views/themengruppen/show.html.erb b/app/views/themengruppen/show.html.erb index daf766d..141a0ca 100644 --- a/app/views/themengruppen/show.html.erb +++ b/app/views/themengruppen/show.html.erb @@ -1,7 +1,10 @@
<%= link_to fa_icon("arrow-circle-left 2x")+" Alle Themengruppen", themengruppen_path, :class=>"linkbox" %> <%= link_to fa_icon("question 2x")+" Häufige Fragen", faqs_themengruppen_path(:anchor=>"themengruppe_"+@themengruppe.id.to_s), :class=>"linkbox" %> + <%= render :partial=>'layouts/pretty_toolbar' %> +

<%= @themengruppe.title %>

+

<%= @themengruppe.text %>

@@ -10,13 +13,8 @@
  • <%= render :partial => 'themen/small', :object => thema %> - tools: - <% - @small_elements2 = [] - @small_elements2 << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('common.verwalten'), :path=>verwalten_thema_path(thema)} if can? :edit, thema - %> - <%= render :partial=>'layouts/pretty_toolbar', :object=>@small_elements2 unless @small_elements2.empty? %> +
      <% unless thema.gremium.nil? %> @@ -37,5 +35,4 @@ <% end %>
    - <%= render :partial=>'layouts/pretty_toolbar' %>
    diff --git a/app/views/themengruppen/verwalten.html.erb b/app/views/themengruppen/verwalten.html.erb index 5522f5f..ce0b343 100644 --- a/app/views/themengruppen/verwalten.html.erb +++ b/app/views/themengruppen/verwalten.html.erb @@ -2,6 +2,8 @@ #themen { list-style-type: none; margin: 0; padding: 0; margin-bottom: 15px;zoom: 1; } #themen li { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em; width: 95%; } +<%= render :partial=>'layouts/pretty_toolbar' %> +
    From 91e04fdeb7849913ed414ad0cdd9d666e9db9545 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Tue, 10 Jun 2014 20:12:06 +0530 Subject: [PATCH 11/48] gremien for ueberarbeitet --- app/views/gremien/_form.html.erb | 46 ++++++++++++++++---------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/app/views/gremien/_form.html.erb b/app/views/gremien/_form.html.erb index d253575..9537158 100644 --- a/app/views/gremien/_form.html.erb +++ b/app/views/gremien/_form.html.erb @@ -7,35 +7,29 @@ <%= 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| %> + <% @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 %>
    - - +
    + + + + + + +
    <%= memberships_attributes.input :start, :as=>:datepicker, :prepend=>"von",:label=>false , :input_html => { :style => "width:6em" } ,:value=>Proc.new { |c| I18n.l(c) }%> + + <%= memberships_attributes.input :stop, :as=>:datepicker,:label=>false, :prepend =>"bis" , :input_html => { :style => "width:6em"},:value_method=>Proc.new { |c| I18n.l(c) }%> + + <%= memberships_attributes.input :typ ,:as=>:select, :collection=>Membership::TYPEN.invert, :label=>false, :input_html => { :style => "width:12em" } %> + <%= memberships_attributes.input :fetprofile, :as=>:select, :label=>false %>
    +
    + <% end %> + <% end %> <% end %> -<% end %> - - <% end %> <%= f.actions do %> <%= f.action :submit, :as => :input %> @@ -43,3 +37,9 @@ <% end %> <%= tinymce %> + + + + + + From e3b6eebe1d2ba4cd68b0ed0780d84132a3747c7b Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Wed, 11 Jun 2014 00:37:49 +0530 Subject: [PATCH 12/48] fetprofile form fixed --- app/views/fetprofiles/_form.html.erb | 22 +++++-------------- .../fetprofiles/_membership_fields.html.erb | 13 +++++++++++ 2 files changed, 18 insertions(+), 17 deletions(-) create mode 100644 app/views/fetprofiles/_membership_fields.html.erb diff --git a/app/views/fetprofiles/_form.html.erb b/app/views/fetprofiles/_form.html.erb index b133c30..1467d1f 100644 --- a/app/views/fetprofiles/_form.html.erb +++ b/app/views/fetprofiles/_form.html.erb @@ -47,28 +47,16 @@ Geburtstag: <%=f.input :birth_day %> <%=f.input :birth_month %> <%=f.input :birth_year %> -
    +
    <% @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 %>
    -
    <%= membership.input :gremium, :label=>false %> - +<%= render partial:"membership_fields", object: m , locals: {:f=>f} %> +<% end %>
    -
    <%= membership.check_box :_destroy %> <%= I18n.t 'common.delete' %>
    - -
    - <% end %> - <% end %> <% end %> + +<% end %>
    <%= f.actions do %> diff --git a/app/views/fetprofiles/_membership_fields.html.erb b/app/views/fetprofiles/_membership_fields.html.erb new file mode 100644 index 0000000..957347e --- /dev/null +++ b/app/views/fetprofiles/_membership_fields.html.erb @@ -0,0 +1,13 @@ +<%= f.semantic_fields_for :memberships, membership_fields do |membership| %> +
    +<%= membership.input :start, :as=>:datepicker, :prepend=>"von",:label=>false , :input_html => { :style => "width:6em"} %> + + <%= membership.input :stop, :as=>:datepicker,:label=>false, :prepend =>"bis" , :input_html => { :style => "width:6em"}%> + +<%= membership.input :typ ,:as=>:select, :collection=>Membership::TYPEN.invert, :label=>false , :input_html => { :style => "width:12em" }%> + +<%= membership.input :gremium, :label=>false %> + +<%= membership.check_box :_destroy %> <%= I18n.t 'common.delete' %>
    + +<% end %> From 0526ea71f2102ce3aa46058b01289a8b537932ca Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Wed, 11 Jun 2014 00:55:46 +0530 Subject: [PATCH 13/48] lvas ueberarbeitet --- app/controllers/application_controller.rb | 2 +- app/models/lva.rb | 6 ++++-- app/views/lvas/_lva.html.erb | 2 +- app/views/lvas/show.html.erb | 2 +- app/views/studien/_semesteransicht.html.erb | 4 ++-- 5 files changed, 9 insertions(+), 7 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index cdd3a1f..1691fd0 100755 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -18,7 +18,7 @@ def get_theme params[:theme] else -"2003" +"blue1" end end def default_url_options diff --git a/app/models/lva.rb b/app/models/lva.rb index 5a0f5d5..4c80b04 100755 --- a/app/models/lva.rb +++ b/app/models/lva.rb @@ -58,12 +58,14 @@ class Lva < ActiveRecord::Base validates_presence_of :modul # Zugehöriges Modul eingetragen? # (zumindest eines) - + def typ_n + typ=="andere" ? "" : typ + end def title self.name end def full_name - return self.typ + ' ' + self.name + return self.typ_n + ' ' + self.name end def add_semesters # Diese Methode fügt die Instanz automatisch zu allen Studien als "Ohne Semesterempfehlung" (Semester 0) zu, bei denen die Instanz im Studium noch nicht vorkommt. diff --git a/app/views/lvas/_lva.html.erb b/app/views/lvas/_lva.html.erb index a49bb55..16ff66f 100755 --- a/app/views/lvas/_lva.html.erb +++ b/app/views/lvas/_lva.html.erb @@ -1,6 +1,6 @@

    <%= notice %>

    -

    <%=lva.typ.to_s + ' ' + lva.name %>

    +

    <%= lva.typ_n.to_s + ' ' + lva.name %>

    Prüfungsinformation

    <%= lva.pruefungsinformation.to_s.html_safe %> diff --git a/app/views/lvas/show.html.erb b/app/views/lvas/show.html.erb index 8ef15af..a7b8818 100755 --- a/app/views/lvas/show.html.erb +++ b/app/views/lvas/show.html.erb @@ -3,7 +3,7 @@

    <%= notice %>

    -

    <%=@lva.typ.to_s + ' ' + @lva.name %>

    +

    <%= @lva.full_name %>

    Prüfungsinformation

    diff --git a/app/views/studien/_semesteransicht.html.erb b/app/views/studien/_semesteransicht.html.erb index 416e667..66ed037 100644 --- a/app/views/studien/_semesteransicht.html.erb +++ b/app/views/studien/_semesteransicht.html.erb @@ -15,8 +15,8 @@

    <%= sem.name %>

    -
    <%= link_to I18n.t("lva.addrem"), edit_semester_path(sem), :class=>"btn-small"%> -
    +
    +
    <% sem.lvas.each do |lva| %> From d24e127b902ae3a1d83e004ded521feeb362e8b5 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Thu, 12 Jun 2014 11:18:22 +0200 Subject: [PATCH 14/48] mergeconflict Gemfilelock --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 47b8928..bfd0ce0 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -247,11 +247,11 @@ GEM warden (1.2.3) rack (>= 1.0) webrick (1.3.1) +<<<<<<< Updated upstream wikicloth (0.8.1) builder expression_parser rinku - PLATFORMS ruby From 25743f8b9f5645a22f6b6cfd47358aed3d17f2e6 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Thu, 12 Jun 2014 13:04:20 +0200 Subject: [PATCH 15/48] error fixes --- app/controllers/themengruppen_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/themengruppen_controller.rb b/app/controllers/themengruppen_controller.rb index ce8a741..7cc6872 100644 --- a/app/controllers/themengruppen_controller.rb +++ b/app/controllers/themengruppen_controller.rb @@ -3,7 +3,7 @@ class ThemengruppenController < ApplicationController # GET /themengruppen.json load_and_authorize_resource def index - @themengruppen = Themengruppe.order(:priority).reverse + @themengruppen = Themengruppe.public.order(:priority).reverse @toolbar_elements = [{:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.new'), :path=>new_themengruppe_path()}] @toolbar_elements = [{:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('common.verwalten'), :path=>verwalten_all_themengruppen_path()}] From b1c46a3dc379fdba18f0380d7ac6c48eda38bc6b Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sat, 14 Jun 2014 14:16:16 +0200 Subject: [PATCH 16/48] error fixes --- .gitignore | 1 + Gemfile | 1 + Gemfile.lock | 16 +++++++++++++++- app/controllers/themengruppen_controller.rb | 2 +- app/controllers/wikis_controller.rb | 2 +- app/models/fetprofile.rb | 4 +++- app/models/user.rb | 2 +- app/views/fetprofiles/_interninfo.html.erb | 8 ++++---- config/routes.rb | 2 +- db/migrate/20140529120536_add_wiki_to_thema.rb | 2 +- 10 files changed, 29 insertions(+), 11 deletions(-) diff --git a/.gitignore b/.gitignore index 2f63aa3..987aa9b 100755 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,7 @@ /config/omniauth_secrets.yml /config/database.yml /config/initializers/omniauth_secrets.rb +/config/databas* # See http://help.github.com/ignore-files/ for more about ignoring files. # # If you find yourself ignoring temporary files generated by your text editor diff --git a/Gemfile b/Gemfile index ac45d67..6d9a3a2 100755 --- a/Gemfile +++ b/Gemfile @@ -60,6 +60,7 @@ gem "omniauth" gem "omniauth-facebook" gem "omniauth-ldap" +gem "fb_graph" # Roles for users gem "rolify" diff --git a/Gemfile.lock b/Gemfile.lock index bfd0ce0..1574ef4 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -41,6 +41,7 @@ GEM activerecord (>= 2.3.0) rake (>= 0.8.7) arel (3.0.3) + attr_required (1.0.0) awesome_nested_set (2.1.6) activerecord (>= 3.0.0) bcrypt-ruby (3.1.2) @@ -83,6 +84,11 @@ GEM railties (>= 3.0.0) faraday (0.8.8) multipart-post (~> 1.2.0) + fb_graph (2.7.15) + httpclient (>= 2.2.0.2) + multi_json (>= 1.3) + rack-oauth2 (>= 0.14.4) + tzinfo font-awesome-rails (4.0.3.1) railties (>= 3.2, < 5.0) formtastic (2.2.1) @@ -114,6 +120,7 @@ GEM hashie (2.0.5) hike (1.2.3) httpauth (0.2.0) + httpclient (2.4.0) i18n (0.6.1) journey (1.0.4) jquery-fileupload-rails (0.4.1) @@ -171,6 +178,12 @@ GEM rack (1.4.5) rack-cache (1.2) rack (>= 0.4) + rack-oauth2 (1.0.8) + activesupport (>= 2.3) + attr_required (>= 0.0.5) + httpclient (>= 2.2.0.2) + multi_json (>= 1.3.6) + rack (>= 1.1) rack-ssl (1.3.3) rack rack-test (0.6.2) @@ -247,11 +260,11 @@ GEM warden (1.2.3) rack (>= 1.0) webrick (1.3.1) -<<<<<<< Updated upstream wikicloth (0.8.1) builder expression_parser rinku + PLATFORMS ruby @@ -267,6 +280,7 @@ DEPENDENCIES devise (~> 2.2.3) execjs (~> 1.4.0) factory_girl_rails + fb_graph font-awesome-rails formtastic (~> 2.2.1) formtastic-bootstrap (~> 2.1.3) diff --git a/app/controllers/themengruppen_controller.rb b/app/controllers/themengruppen_controller.rb index 7cc6872..8d0b956 100644 --- a/app/controllers/themengruppen_controller.rb +++ b/app/controllers/themengruppen_controller.rb @@ -3,7 +3,7 @@ class ThemengruppenController < ApplicationController # GET /themengruppen.json load_and_authorize_resource def index - @themengruppen = Themengruppe.public.order(:priority).reverse + @themengruppen = Themengruppe.where(:public=>true).order(:priority).reverse @toolbar_elements = [{:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.new'), :path=>new_themengruppe_path()}] @toolbar_elements = [{:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('common.verwalten'), :path=>verwalten_all_themengruppen_path()}] diff --git a/app/controllers/wikis_controller.rb b/app/controllers/wikis_controller.rb index a61be11..46b6b15 100644 --- a/app/controllers/wikis_controller.rb +++ b/app/controllers/wikis_controller.rb @@ -4,7 +4,7 @@ class WikisController < ApplicationController def show @wiki = Wiki.find(params[:id]) @fragen = @wiki.fragen - @toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('wiki.edit'), :path=>verwalten_wiki_path(@wiki)}] + @toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('wiki.edit'), :path=>verwalten_thema_path(@wiki)}] end def wiki diff --git a/app/models/fetprofile.rb b/app/models/fetprofile.rb index a73c3ce..bf367bf 100644 --- a/app/models/fetprofile.rb +++ b/app/models/fetprofile.rb @@ -31,10 +31,12 @@ class Fetprofile < ActiveRecord::Base accepts_nested_attributes_for :memberships, :reject_if=>lambda{|a| a[:typ].blank?|| a[:start].blank? ||a[:gremium_id].blank?}, :allow_destroy=>true has_many :nlinks, as: :link def validate_birthday - unless Date.valid_date?(birth_year, birth_month, birth_day) + unless birth_month.nil? || birth_day.nil? + unless Date.valid_date?((birth_year.nil?) ? Date.today.year : birth_year, birth_month, birth_day) errors.add(:birth_month, "Invalides Datum") errors.add(:birth_day, "Invalides Datum") end +end end def title diff --git a/app/models/user.rb b/app/models/user.rb index ea6c46b..a715c06 100755 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -38,7 +38,7 @@ belongs_to :fetprofile def self.find_for_facebook_oauth(auth, signed_in_resource=nil) logger.debug auth.to_s logger.debug "DDD Username= #{auth.username}" - # user = User.where(:provider => auth.provider, :uid => auth.uid).first + user = User.where(:provider => auth.provider, :uid => auth.extra.raw_info.uid).first unless user user = User.create(name:auth.uid, provider:auth.provider, diff --git a/app/views/fetprofiles/_interninfo.html.erb b/app/views/fetprofiles/_interninfo.html.erb index 889ab47..bd5fc1f 100644 --- a/app/views/fetprofiles/_interninfo.html.erb +++ b/app/views/fetprofiles/_interninfo.html.erb @@ -8,9 +8,9 @@ <%= interninfo.street %>

    - <%= raw("Telefon: ")+ interninfo.telnr + "
    " unless interninfo.telnr.empty?%> - <%= raw("Handy: ") +interninfo.hdynr unless interninfo.hdynr.empty? %>
    -<%= raw("Skype: ") +interninfo.skype unless interninfo.skype.empty? %>
    -<%= raw("Instant Messaging: ") +interninfo.instant unless interninfo.instant.empty? %>
    + <%= raw("Telefon: ")+ interninfo.telnr + "
    " unless (interninfo.telnr.nil? || interninfo.telnr.empty?) %> + <%= raw("Handy: ") +interninfo.hdynr unless interninfo.hdynr.nil? || interninfo.hdynr.empty? %>
    +<%= raw("Skype: ") +interninfo.skype unless interninfo.skype.nil? || interninfo.skype.empty? %>
    +<%= raw("Instant Messaging: ") +interninfo.instant unless interninfo.instant.nil? || interninfo.instant.empty? %>

    diff --git a/config/routes.rb b/config/routes.rb index 8c50b6c..da56eba 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -25,7 +25,7 @@ get "wiki/:name", action: :wiki, controller: :wikis resources :wikis do member do - get :verwalten + end end end diff --git a/db/migrate/20140529120536_add_wiki_to_thema.rb b/db/migrate/20140529120536_add_wiki_to_thema.rb index 0c5ccca..6b5fa81 100644 --- a/db/migrate/20140529120536_add_wiki_to_thema.rb +++ b/db/migrate/20140529120536_add_wiki_to_thema.rb @@ -2,6 +2,6 @@ class AddWikiToThema < ActiveRecord::Migration def change add_column :themen, :wikiname, :string add_column :themen, :wikiformat, :integer - add_column :themen, :hidelink, :boolea + add_column :themen, :hidelink, :boolean end end From 61510a8891086184a42e05636c3c7cd1588bb354 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sun, 15 Jun 2014 18:03:57 +0530 Subject: [PATCH 17/48] gemfile --- Gemfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile b/Gemfile index 6d9a3a2..34f2e41 100755 --- a/Gemfile +++ b/Gemfile @@ -61,9 +61,9 @@ gem "omniauth-facebook" gem "omniauth-ldap" gem "fb_graph" + # Roles for users gem "rolify" - # Abilities gem "cancan" From 2df0d89b617750f1310e107f38945fa1369fda33 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Fri, 20 Jun 2014 00:15:45 +0530 Subject: [PATCH 18/48] facebookpublish,themen fixes --- app/controllers/home_controller.rb | 6 +++ app/controllers/neuigkeiten_controller.rb | 25 +++++++-- app/controllers/themen_controller.rb | 15 ++++-- app/controllers/themengruppen_controller.rb | 3 +- .../users/omniauth_callbacks_controller.rb | 18 ++++--- app/controllers/users_controller.rb | 13 ++++- app/models/ability.rb | 1 + app/models/neuigkeit.rb | 2 +- app/models/thema.rb | 11 +++- app/models/themengruppe.rb | 1 + app/models/user.rb | 7 +-- app/views/home/admin.html.erb | 12 +++++ app/views/home/intern.html.erb | 6 +-- app/views/themen/edit.js.erb | 2 + .../themengruppen/verwalten_all.html.erb | 54 +++++++++++++++++++ config/routes.rb | 19 ++++--- 16 files changed, 158 insertions(+), 37 deletions(-) create mode 100644 app/views/home/admin.html.erb create mode 100644 app/views/themengruppen/verwalten_all.html.erb diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 2aa11d6..1162d63 100755 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -14,6 +14,12 @@ class HomeController < ApplicationController @neuigkeiten = Neuigkeit.intern.recent @themengruppen=Themengruppe.intern end + def admin + authorize! :doadmin, User + + + end + def startdev render 'setup_fetsite_dev' end diff --git a/app/controllers/neuigkeiten_controller.rb b/app/controllers/neuigkeiten_controller.rb index e3bc175..8d05e84 100755 --- a/app/controllers/neuigkeiten_controller.rb +++ b/app/controllers/neuigkeiten_controller.rb @@ -1,3 +1,4 @@ +# -*- coding: utf-8 -*- class NeuigkeitenController < ApplicationController before_filter :load_toolbar_elements, :only=>[:show,:find_link] before_filter :load_toolbar_elements_edit, :only=>[:edit] @@ -61,9 +62,19 @@ class NeuigkeitenController < ApplicationController if params[:verwalten] redirect_to verwalten_rubrik_path(@neuigkeit.rubrik) end - redirect_to rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit) + redirect_to rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit) end - + def publish_to_facebook + @neuigkeit = Neuigkeit.find(params[:id]) + unless @neuigkeit.published? + redirect_to [@neuigkeit.rubrik,@neuigkeit], notice: 'Neuigkeit muss veröffentlicht sein um sie auf Facebook zu posten.' + else + page=YAML.load_file("#{::Rails.root.to_s}/tmp/page.yml") + page.feed!(:access_token=>page.access_token, :message=>@neuigkeit.text_first_words, :name=>@neuigkeit.title, :link=>rubrik_neuigkeit_url(@neuigkeit.rubrik, @neuigkeit)+".html") + + redirect_to [@neuigkeit.rubrik,@neuigkeit], notice: 'Neuigkeit auf Facebook gepostet' + end + end def edit @neuigkeit = Neuigkeit.find(params[:id]) @@ -137,9 +148,13 @@ private def load_toolbar_elements @neuigkeit=Neuigkeit.find(params[:id]) @toolbar_elements=[] - @toolbar_elements << {:hicon=>'icon-plus', :text=> I18n.t('neuigkeit.publish'),:path => publish_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:confirm=>'Sure?' } if can?(:publish, @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? - @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-plus', :text=> I18n.t('neuigkeit.publish'),:path => publish_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:confirm=>'Sure?' } if can?(:publish, @neuigkeit) && !@neuigkeit.published? + @toolbar_elements << {:hicon=>'icon-facebook', :text=> I18n.t('neuigkeit.publish')+" to facebook",:path => publish_to_facebook_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 << {:text=>I18n.t('common.edit'),:path=>edit_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:icon=>:pencil} if can? :edit, @neuigkeit.rubrik @versions= @neuigkeit.translation.versions.select([:created_at]).reverse @toolbar_elements <<{:path=>rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:method=>:versions,:versions=>@versions} diff --git a/app/controllers/themen_controller.rb b/app/controllers/themen_controller.rb index a4fbea3..a3aef45 100644 --- a/app/controllers/themen_controller.rb +++ b/app/controllers/themen_controller.rb @@ -57,13 +57,14 @@ class ThemenController < ApplicationController # GET /themen/1/edit def edit @thema = Thema.find(params[:id]) - unless ( @thema.wikiname.nil? || @thema.wikiname.empty? ) + + if @thema.is_wiki? redirect_to edit_wiki_path(Wiki.find(@thema.id)) return end respond_to do |format| format.html - format.js + format.js { @themen= @thema.themengruppe.themen } end end @@ -72,13 +73,15 @@ class ThemenController < ApplicationController def create @thema = Thema.new(params[:thema]) - @themen = @thema.themengruppe.themen.order(:priority).reverse + respond_to do |format| if @thema.save + @themen = @thema.themengruppe.themen.order(:priority).reverse format.html { redirect_to @thema, notice: 'Thema was successfully created.' } format.json { render json: @thema, status: :created, location: @thema } format.js {render action: "update"} else + @themen = @thema.themengruppe.themen.order(:priority).reverse format.html { render action: "new" } format.json { render json: @thema.errors, status: :unprocessable_entity } format.js { render action: "edit" } @@ -105,8 +108,10 @@ class ThemenController < ApplicationController def update @thema = Thema.find(params[:id]) @themen = @thema.themengruppe.themen.order(:priority).reverse + @thema.assign_attributes(params[:thema]) + @thema.fix_links(request.host_with_port) respond_to do |format| - if @thema.update_attributes(params[:thema]) + if @thema.save format.html { redirect_to @thema, notice: 'Thema was successfully updated.' } format.json { head :no_content } format.js @@ -123,7 +128,7 @@ class ThemenController < ApplicationController def destroy @thema = Thema.find(params[:id]) @thema.destroy - + @themen = @thema.themengruppe.themen.order(:priority).reverse respond_to do |format| format.html { redirect_to themengruppe_path(@thema.themengruppe) } format.json { head :no_content } diff --git a/app/controllers/themengruppen_controller.rb b/app/controllers/themengruppen_controller.rb index 8d0b956..cdd6465 100644 --- a/app/controllers/themengruppen_controller.rb +++ b/app/controllers/themengruppen_controller.rb @@ -48,7 +48,8 @@ class ThemengruppenController < ApplicationController @themengruppe = Themengruppe.find(params[:id]) end def verwalten_all - @themengruppen =Themengruppe.order(:priority).reverse + @themengruppen =Themengruppe.public.order(:priority).reverse +@themengruppen_intern =Themengruppe.intern.order(:priority).reverse @toolbar_elements = [{:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.new'), :path=>new_themengruppe_path()}] end diff --git a/app/controllers/users/omniauth_callbacks_controller.rb b/app/controllers/users/omniauth_callbacks_controller.rb index 2c72832..82ed6ea 100644 --- a/app/controllers/users/omniauth_callbacks_controller.rb +++ b/app/controllers/users/omniauth_callbacks_controller.rb @@ -1,15 +1,17 @@ class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController -skip_before_filter :verify_authenticity_token -def failure - - # flash[:notice] = "Failure #{Hash.new(request.env)} #{Hash.new(params)}" -#redirect_to new_user_registration_url , :notice=>"Omniauth Login failed" -super -end -def facebook + skip_before_filter :verify_authenticity_token + def failure + + # flash[:notice] = "Failure #{Hash.new(request.env)} #{Hash.new(params)}" + #redirect_to new_user_registration_url , :notice=>"Omniauth Login failed" + super + end + def facebook # You need to implement the method below in your model (e.g. app/models/user.rb) @user = User.find_for_facebook_oauth(request.env["omniauth.auth"], current_user) + data=request.env["omniauth.auth"] + session[:fbuser_access_token]=data.credentials.token if @user sign_in_and_redirect @user, :event => :authentication #this will throw if @user is not activated diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 474839f..f5a0334 100755 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -12,9 +12,19 @@ class UsersController < ApplicationController end redirect_to users_url end + def fb_set_default_publish_page + if params["page"].nil? || !(current_user.provider=="facebook") + redirect_to intern_home_index_path + else + @fbu=FbGraph::User.new(current_user.uid.to_s).fetch(:access_token=>session["fbuser_access_token"]) + File.open("tmp/page.yml",'w'){|f| f.write(@fbu.accounts(:access_token=>session["fbuser_access_token"]).select { |p| p.name == params["page"] }.first.to_yaml)} + logger.debug @fbu.to_s + redirect_to admin_home_index_path + end + + end def all_update - params[:users].each do |id,u| user=User.find(id) user.fetprofile = Fetprofile.find(u[:fetprofile_id].to_i) if u[:fetprofile_id].to_i>0 @@ -26,7 +36,6 @@ class UsersController < ApplicationController def do_confirm @user= User.find(params[:id]) @user.confirm! - redirect_to users_url end end diff --git a/app/models/ability.rb b/app/models/ability.rb index f61425f..d2a1a9e 100755 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -61,6 +61,7 @@ class Ability if( user.has_role?("fetadmin")) can [:delete],Calendar can [:delete],Calentry + can :doadmin, User end # Rechteverwaltung fuer Neuigkeiten diff --git a/app/models/neuigkeit.rb b/app/models/neuigkeit.rb index 72946df..261e1d1 100755 --- a/app/models/neuigkeit.rb +++ b/app/models/neuigkeit.rb @@ -46,7 +46,7 @@ class Neuigkeit < ActiveRecord::Base self.rubrik.public end def published? - self.datum_nilsave>=Time.now.to_date + self.datum_nilsave(query) {where("text like ? or title like ?", "%#{query}%", "%#{query}%")} translates :title,:text, :versioning =>true, :fallbacks_for_empty_translations => true def is_wiki? - wikiname.nil? || wikiname.empty? + !(wikiname.nil? || wikiname.empty?) end def text_first_words md = /

    (?[^\<\>]*)/.match Sanitize.clean(self.text,:elements=>['p']) @@ -36,4 +37,10 @@ class Thema < ActiveRecord::Base end end + def fix_links(host) + full_url= URI.parse(root_url(:host=>host)) + self.text.gsub!(/src="[^"]*attachment\/datei\/(\d+)[^"]*"/){|s| full_url.path=Attachment.find($1.to_i).datei.url; 'src="'+full_url.to_s+'"'} + self.text.gsub!(/href="[^"]*themen\/(\d+)[^"]*"/){|s| full_url.path=thema_path(Thema.find($1.to_i)); 'href="'+full_url.to_s+'"'} + + end end diff --git a/app/models/themengruppe.rb b/app/models/themengruppe.rb index f4f206e..ccb5e5a 100644 --- a/app/models/themengruppe.rb +++ b/app/models/themengruppe.rb @@ -22,6 +22,7 @@ class Themengruppe < ActiveRecord::Base translates :title,:text, :versioning =>true, :fallbacks_for_empty_translations => true scope :intern,-> {where(:public=>false)} + scope :public,-> {where(:public=>true)} def self.find_wiki_default where(:wiki_default=>true).first diff --git a/app/models/user.rb b/app/models/user.rb index a715c06..a81f497 100755 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -38,16 +38,17 @@ belongs_to :fetprofile def self.find_for_facebook_oauth(auth, signed_in_resource=nil) logger.debug auth.to_s logger.debug "DDD Username= #{auth.username}" - user = User.where(:provider => auth.provider, :uid => auth.extra.raw_info.uid).first + user = User.where(:provider => auth.provider, :uid => auth.uid).first unless user - user = User.create(name:auth.uid, + user = User.create(name: auth.uid, provider:auth.provider, - uid:auth.uid, + uid: auth.uid, email:auth.info.email, password:Devise.friendly_token[0,20] ) end + user end def self.find_for_ldap_oauth(auth,signed_in_resource=nil) diff --git a/app/views/home/admin.html.erb b/app/views/home/admin.html.erb new file mode 100644 index 0000000..55cc15d --- /dev/null +++ b/app/views/home/admin.html.erb @@ -0,0 +1,12 @@ +

    <%= link_to "Grant extra FB privileges", user_omniauth_authorize_path(:facebook,:params=>{scope:"manage_pages,publish_actions,email"}) %> +

    +

    +<%= link_to "user", users_path %> +

    +

    +<%= @fbu.to_yaml.to_s %> + +<%= semantic_form_for :set_page, url: fb_set_default_publish_page_user_path(current_user), html:{method: :get} do |f| %> +<%= f.input :page , :input_html => { :name => 'page' }%> +<% end %> +

    diff --git a/app/views/home/intern.html.erb b/app/views/home/intern.html.erb index ac474c8..e5d5eef 100644 --- a/app/views/home/intern.html.erb +++ b/app/views/home/intern.html.erb @@ -3,7 +3,8 @@
    <%= link_to "Adressliste", internlist_fetprofiles_path %> - <%= link_to "Internes Nachschlagewerk" %> + <%= link_to "Admin" , admin_home_index_path if current_user.has_role?(:fetadmin) %> + - + <%= link_to "Users", users_path %>

    Neuigkeiten

    @@ -28,4 +29,3 @@

    - diff --git a/app/views/themen/edit.js.erb b/app/views/themen/edit.js.erb index 7256636..5c8ca30 100644 --- a/app/views/themen/edit.js.erb +++ b/app/views/themen/edit.js.erb @@ -1 +1,3 @@ $("#themaview").html("<%= escape_javascript(raw("

    "+I18n.t('thema.edit')+"

    ")+render(:partial=>"themen/form", :locals=>{:remote=>true}) )%>"); + + diff --git a/app/views/themengruppen/verwalten_all.html.erb b/app/views/themengruppen/verwalten_all.html.erb new file mode 100644 index 0000000..8d40ec1 --- /dev/null +++ b/app/views/themengruppen/verwalten_all.html.erb @@ -0,0 +1,54 @@ + +<%= render :partial=>'layouts/pretty_toolbar' %> +
    +
    +
    +
      +<% @themengruppen.each do |themengruppe| %> +
    • <%= themengruppe.title %>-<%= themengruppe.priority %>
    • +<% end %> +
    +
      +<% @themengruppen_intern.each do |themengruppe| %> +
    • <%= themengruppe.title %>-<%= themengruppe.priority %>
    • +<% end %> +
    + +
    +
    +
    + diff --git a/config/routes.rb b/config/routes.rb index da56eba..8d41d4d 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -11,6 +11,9 @@ get :index post :all_update end + member do + get :fb_set_default_publish_page + end end get 'users/:id/add_role/:role', :controller=>:users, :action=>:add_role, :as=>'user_add_role' get 'users/:id/do_confirm', :controller=>:users, :action=>:do_confirm, :as=>'user_do_confirm' @@ -34,7 +37,7 @@ # end # end - scope ':locale' do + scope '(:locale)' do scope '(t/:theme)' do # Studien @@ -126,6 +129,7 @@ get 'rm_calentry' get 'create_link' get 'find_link' + get 'publish_to_facebook' end end end @@ -135,13 +139,14 @@ # get 'rubriken/verwalten',:controller=>:rubriken,:action=>:alle_verwalten, :as=>'rubriken_verwalten' resources :home, :only=>[:index] do - get :search, :on=>:collection + get :search, :on => :collection collection do - get 'intern' - get 'dev' - get 'startdev' - get 'linksnotimplemented' - get 'kontakt' + get 'intern' + get 'admin' + get 'dev' + get 'startdev' + get 'linksnotimplemented' + get 'kontakt' end end From 6fdee8a7d6fe8cd99ac0832d662755a0e935b30c Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sat, 21 Jun 2014 14:52:45 +0530 Subject: [PATCH 19/48] datetimepicker --- app/assets/javascripts/application.js | 2 ++ app/inputs/datetimepicker_input.rb | 30 ++++++++++++++++++++ app/models/calentry.rb | 3 ++ app/views/calentries/_nested_fields.html.erb | 2 +- 4 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 app/inputs/datetimepicker_input.rb diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 50fb36d..ebf404f 100755 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -26,6 +26,8 @@ //= require bootstrap/image-gallery.min //= require jquery-fileupload // require jquery.remotipart +//= require jquery.datetimepicker + function insertAttachment(url,name) { var ext = url.split('.').pop().toLowerCase(); var img_ext = [ "jpg", "png", "bmp" , "jpeg" ]; diff --git a/app/inputs/datetimepicker_input.rb b/app/inputs/datetimepicker_input.rb new file mode 100644 index 0000000..5654827 --- /dev/null +++ b/app/inputs/datetimepicker_input.rb @@ -0,0 +1,30 @@ +class DatetimepickerInput < FormtasticBootstrap::Inputs::StringInput + def input_html_options + super + super.merge(:class => "datetimepicker",:value=>builder.to_s) + end + + def html_options + super + + end + def wrapper_html_options + super.merge(:class=>"") + #super.merge(:class=>"datepicker",'date-date-format'.to_sym=>"%d.%m.%Y") + end + def controls_wrapper_html_options + super.merge(:class=> " date input-append", 'data-date'.to_sym =>I18n.l(Date.today()).to_s, 'data-date-format'.to_sym=>I18n.t('date.formats.default-picker'), 'data-time-format'.to_sym=>"hh:mm" ,) + end + def to_html + bootstrap_wrapping do + builder.text_field(method, input_html_options) + + ''.html_safe() + end + end + def options + super +#d.merge(:class=>"datepicker") + #super.merge(:append_content=>''') + end +end diff --git a/app/models/calentry.rb b/app/models/calentry.rb index 8ee967e..2070a03 100644 --- a/app/models/calentry.rb +++ b/app/models/calentry.rb @@ -35,6 +35,9 @@ class Calentry < ActiveRecord::Base self.public = (self.try(:object).nil?)? (self.calendar.try(:public?)) : object.try(:public?) true end + def s_time=(s_time) + start + end def start_time start end diff --git a/app/views/calentries/_nested_fields.html.erb b/app/views/calentries/_nested_fields.html.erb index e4fc987..6f1f97d 100644 --- a/app/views/calentries/_nested_fields.html.erb +++ b/app/views/calentries/_nested_fields.html.erb @@ -4,7 +4,7 @@
    - <%= f.input :start, :as => :datepicker %>
    + <%= f.input :start, :as => :datetimepicker %>
    <%= f.input :dauer , :as => :string, :append=>"h" %>
    <% f.input :typ %>
    <%= f.check_box :_destroy %> <%= I18n.t 'common.delete' %>
    From 6c9a1b51c426042e6c1523badfc39345e7d607d2 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sat, 21 Jun 2014 14:53:16 +0530 Subject: [PATCH 20/48] themen interface cleanup1 --- Gemfile | 1 + .../themes/blue1/application.css.scss | 1 + app/controllers/themen_controller.rb | 33 ++++-------- app/controllers/themengruppen_controller.rb | 2 +- app/views/fragen/_frage.html.erb | 6 +-- app/views/neuigkeiten/_form.html.erb | 2 +- app/views/themen/_form.html.erb | 52 +++++++++---------- .../themengruppen/_themengruppe.html.erb | 2 +- app/views/themengruppen/faqs.html.erb | 45 ++++++++-------- app/views/themengruppen/index.html.erb | 2 +- app/views/themengruppen/show.html.erb | 11 ++-- config/locales/de.yml | 1 - config/locales/en.yml | 8 +++ config/locales/themen.de.yml | 21 +++++++- .../20140621060036_add_draft_to_themen.rb | 6 +++ 15 files changed, 102 insertions(+), 91 deletions(-) create mode 100644 db/migrate/20140621060036_add_draft_to_themen.rb diff --git a/Gemfile b/Gemfile index 34f2e41..6b7d562 100755 --- a/Gemfile +++ b/Gemfile @@ -91,6 +91,7 @@ gem 'bootstrap-addons-rails' gem "jquery-fileupload-rails" gem "jquery-ui-rails","~> 4.1.1" gem "font-awesome-rails" +gem "jquery-datetimepicker-rails" # gem "jquery-sortable-rails" gem "seed_dump", "~> 0.5.3" #gem "themes_for_rails" ,:git =>'git://github.com/tkriplean/themes_for_rails.git' diff --git a/app/assets/stylesheets/themes/blue1/application.css.scss b/app/assets/stylesheets/themes/blue1/application.css.scss index fe7a383..f4e4f19 100755 --- a/app/assets/stylesheets/themes/blue1/application.css.scss +++ b/app/assets/stylesheets/themes/blue1/application.css.scss @@ -12,6 +12,7 @@ *= require_self * require_tree . *= require jquery.fileupload-ui +*= require jquery.datetimepicker * require 'bootstrap' * require 'neuigkeiten' diff --git a/app/controllers/themen_controller.rb b/app/controllers/themen_controller.rb index a3aef45..a8d9aef 100644 --- a/app/controllers/themen_controller.rb +++ b/app/controllers/themen_controller.rb @@ -3,24 +3,12 @@ class ThemenController < ApplicationController # GET /themen.json load_and_authorize_resource - def index - @themen = Thema.all - - respond_to do |format| - format.html # index.html.erb - format.json { render json: @themen } - end - end - - # GET /themen/1 - # GET /themen/1.json def show @thema = Thema.find(params[:id]) - @fragen=@thema.fragen - @toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>"Verwalten", :path=>verwalten_thema_path(@thema)}] - @toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('thema.edit'), :path=>edit_thema_path(@thema)}] + @toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t("thema.manage"), :path=>verwalten_thema_path(@thema)}] + @toolbar_elements << [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('thema.edit'), :path=>edit_thema_path(@thema)}] @toolbar_elements << {:hicon=>'icon-remove-circle', :text=>I18n.t('thema.remove'), :path=>thema_path(@thema), :method=>:delete, :confirm=>I18n.t('thema.sure')} respond_to do |format| @@ -33,10 +21,7 @@ class ThemenController < ApplicationController def verwalten @thema = Thema.find(params[:id]) @attachment=Attachment.new - - @fragen=@thema.fragen - @toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>"Verwalten", :path=>verwalten_thema_path(@thema)}] @toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('thema.edit'), :path=>edit_thema_path(@thema)}] @toolbar_elements << {:hicon=>'icon-remove-circle', :text=>I18n.t('thema.remove'), :path=>thema_path(@thema), :method=>:delete, :confirm=>I18n.t('thema.sure')} @@ -57,7 +42,7 @@ class ThemenController < ApplicationController # GET /themen/1/edit def edit @thema = Thema.find(params[:id]) - + if @thema.is_wiki? redirect_to edit_wiki_path(Wiki.find(@thema.id)) return @@ -72,12 +57,11 @@ class ThemenController < ApplicationController # POST /themen.json def create @thema = Thema.new(params[:thema]) - - + respond_to do |format| if @thema.save @themen = @thema.themengruppe.themen.order(:priority).reverse - format.html { redirect_to @thema, notice: 'Thema was successfully created.' } + format.html { redirect_to @thema, notice: I18n.t("thema.created") } format.json { render json: @thema, status: :created, location: @thema } format.js {render action: "update"} else @@ -107,12 +91,13 @@ class ThemenController < ApplicationController # PUT /themen/1.json def update @thema = Thema.find(params[:id]) - @themen = @thema.themengruppe.themen.order(:priority).reverse + @themen = @thema.themengruppe.themen.order(:priority).reverse @thema.assign_attributes(params[:thema]) @thema.fix_links(request.host_with_port) + respond_to do |format| if @thema.save - format.html { redirect_to @thema, notice: 'Thema was successfully updated.' } + format.html { redirect_to @thema, notice: I18n.t("thema.updated") } format.json { head :no_content } format.js else @@ -128,7 +113,7 @@ class ThemenController < ApplicationController def destroy @thema = Thema.find(params[:id]) @thema.destroy - @themen = @thema.themengruppe.themen.order(:priority).reverse + @themen = @thema.themengruppe.themen.order(:priority).reverse respond_to do |format| format.html { redirect_to themengruppe_path(@thema.themengruppe) } format.json { head :no_content } diff --git a/app/controllers/themengruppen_controller.rb b/app/controllers/themengruppen_controller.rb index cdd6465..88dfc8d 100644 --- a/app/controllers/themengruppen_controller.rb +++ b/app/controllers/themengruppen_controller.rb @@ -5,7 +5,7 @@ class ThemengruppenController < ApplicationController def index @themengruppen = Themengruppe.where(:public=>true).order(:priority).reverse @toolbar_elements = [{:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.new'), :path=>new_themengruppe_path()}] - @toolbar_elements = [{:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('common.verwalten'), :path=>verwalten_all_themengruppen_path()}] + @toolbar_elements = [{:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.manage_all'), :path=>verwalten_all_themengruppen_path()}] respond_to do |format| format.html # index.html.erb diff --git a/app/views/fragen/_frage.html.erb b/app/views/fragen/_frage.html.erb index 1197db7..d7357a8 100644 --- a/app/views/fragen/_frage.html.erb +++ b/app/views/fragen/_frage.html.erb @@ -1,8 +1,8 @@

    - <%= frage.title %>
    + <%= frage.title %>?
    <%= raw(frage.text) %>
    -<%= link_to 'Edit', edit_frage_path(frage),:remote=>true %> | -<%= link_to 'Destroy',frage, method: :delete, :remote=> true , data: { confirm: 'Are you sure?' } %> +<%= link_to 'Edit', edit_frage_path(frage),:remote=>true %> +<%= link_to 'Destroy',frage, method: :delete, :remote=> true , data: { confirm: I18n.t("frage.sure") } %>

    diff --git a/app/views/neuigkeiten/_form.html.erb b/app/views/neuigkeiten/_form.html.erb index 480709e..72fced6 100755 --- a/app/views/neuigkeiten/_form.html.erb +++ b/app/views/neuigkeiten/_form.html.erb @@ -33,5 +33,5 @@ <% end %> <% end %>
    - + <%= tinymce %> diff --git a/app/views/themen/_form.html.erb b/app/views/themen/_form.html.erb index 6a77d03..cb241d7 100644 --- a/app/views/themen/_form.html.erb +++ b/app/views/themen/_form.html.erb @@ -1,33 +1,29 @@ <%= tinymce_assets %>
    - - -<%= semantic_form_for @thema, :remote=>remote do |f| %> + <%= semantic_form_for @thema, :remote=>remote do |f| %> <%= f.inputs do %> -
    -
    - <%= f.input :title %> -
    -
    - <%= f.input :themengruppe %> -
    -
    -
    - <%= f.input :text, :as=>:tinymce_text,:label=>false, :input_html=>{:rows=>20} %> -
    -
    - - -
    - -<%= f.actions do %> -<%= f.action :submit, :as => :button %> - -<%= f.action :cancel, :as => :link %> -<% end %> -<% end %><% end %> - <%= tinymce %> -

    Attachments:

    -<%= render :partial => "themen/select", :object => @thema,:locals =>{ :editor => :true} %> +
    +
    + <%= f.input :title %> +
    +
    + <%= f.input :themengruppe %> +
    +
    +
    + <%= f.input :text, :as=>:tinymce_text,:label=>false, :input_html=>{:rows=>20} %> +
    +
    +
    + + <%= f.actions do %> + <%= f.action :submit, :as => :button %> + <%= f.action :submit, :as => :button, :label=> "&edit", :params=>{edit: true} %> + <%= f.action :cancel, :as => :link %> + <% end %> + <% end %><% end %> + <%= tinymce %> +

    Attachments:

    + <%= render :partial => "themen/select", :object => @thema,:locals =>{ :editor => :true} %> diff --git a/app/views/themengruppen/_themengruppe.html.erb b/app/views/themengruppen/_themengruppe.html.erb index a565d37..5a760cf 100644 --- a/app/views/themengruppen/_themengruppe.html.erb +++ b/app/views/themengruppen/_themengruppe.html.erb @@ -26,7 +26,7 @@
      - <% themengruppe.themen.order(:title).each do |t| %> + <% themengruppe.themen.order(:priority).reverse.each do |t| %>
    • <%= render t %>
    • diff --git a/app/views/themengruppen/faqs.html.erb b/app/views/themengruppen/faqs.html.erb index d3a7ab0..f758585 100644 --- a/app/views/themengruppen/faqs.html.erb +++ b/app/views/themengruppen/faqs.html.erb @@ -1,24 +1,25 @@ +

      <%= I18n.t("themengruppe.faqs") %>
      - <% @themengruppen.each do |tg| %> -
      - -

      <%= tg.title%>

      -
        - <% tg.themen.order(:priority).reverse.each do |t| %> -
      • <%= t.title %> -
          <% t.fragen.each do |f| %> -
        • - <%= f.title %> -

          <%= f.text %>

          -
        • - - <% end %> -
        - -
      • - <% end %> -
      - -
      - <% end %> + <% @themengruppen.each do |tg| %> +
      + +

      <%= tg.title%>

      +
        + <% tg.themen.order(:priority).reverse.each do |t| %> +
      • <%= t.title %> +
          <% t.fragen.each do |f| %> +
        • + <%= f.title %>? +

          <%= f.text %>

          +
        • + + <% end %> +
        + +
      • + <% end %> +
      + +
      + <% end %>
      diff --git a/app/views/themengruppen/index.html.erb b/app/views/themengruppen/index.html.erb index 40e7649..7f1a920 100644 --- a/app/views/themengruppen/index.html.erb +++ b/app/views/themengruppen/index.html.erb @@ -1,7 +1,7 @@
      <%= render :partial=>'layouts/pretty_toolbar' %>

      - <%= link_to "FAQS", faqs_themengruppen_path,class: :btn %> + <%= link_to I18n.t("themengruppe.faqs"), faqs_themengruppen_path,class: :btn %>


      -<% unless @thema.id.nil? %> -<% @att_elements = [{:icon=>:plus, :hicon=>'icon-plus', :text=>I18n.t('attachment.add'), :path=>new_thema_attachment_path(@thema),:remote=>true}] %> -
      -
      -<%= render :partial=>'layouts/pretty_toolbar', :object=>@att_elements %> -<% end %> + + +
      diff --git a/app/views/themen/edit.html.erb b/app/views/themen/edit.html.erb index 10d69ea..3518641 100644 --- a/app/views/themen/edit.html.erb +++ b/app/views/themen/edit.html.erb @@ -1,5 +1,5 @@
      -

      Editing thema

      -<%= render 'form' , :locals=>{:remote=>false}, :remote=>false %> +

      <%= I18n.t("thema.edit")%>

      +<%= render 'form', :locals=>{:remote=>false}, :remote=>false %>

      <%= link_to 'Back', @thema %> diff --git a/config/locales/themen.de.yml b/config/locales/themen.de.yml index ed8c3bf..6f5de2e 100644 --- a/config/locales/themen.de.yml +++ b/config/locales/themen.de.yml @@ -14,6 +14,8 @@ de: edit: "Thema bearbeiten" remove: "Thema löschen" manage: "Thema verwalten" + save: "Thema speichern" + savecont: "Thema zwischenspeichern" created: "Thema erfolgreich erstellt" updated: "Thema erfolgreich gespeichert" sure: "Sicher, dass Sie dieses Thema löschen möchten?" @@ -42,8 +44,8 @@ de: text: "Antwort" thema: "Thema" hints: - thema: - title: "Überschrift" + + activerecord: errors: models: From 3a8ccdd20543adf4dc50a0de88ab7e90472bddda Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Tue, 24 Jun 2014 13:53:38 +0530 Subject: [PATCH 22/48] =?UTF-8?q?Oberfl=C3=A4che=20aufr=C3=A4umen...?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/fetprofiles_controller.rb | 10 ++- app/controllers/galleries_controller.rb | 2 +- app/controllers/studien_controller.rb | 18 ++--- app/controllers/themengruppen_controller.rb | 5 +- app/models/calentry.rb | 2 +- app/views/fetprofiles/_form.html.erb | 33 +++++--- app/views/fetprofiles/edit.html.erb | 7 +- app/views/fetprofiles/index.html.erb | 14 ++-- app/views/fetprofiles/new.html.erb | 2 +- app/views/fetprofiles/show.html.erb | 7 +- app/views/galleries/index.html.erb | 2 +- app/views/home/_beispiele.html.erb | 7 +- app/views/home/dev.html.erb | 31 -------- app/views/home/index.html.erb | 5 +- app/views/home/kontakt.html.erb | 14 ++-- app/views/layouts/_pretty_toolbar.html.erb | 6 +- app/views/memberships/_membership.html.erb | 4 +- app/views/modulgruppen/index.html.erb | 4 +- app/views/neuigkeiten/_compact.html.erb | 2 +- app/views/neuigkeiten/_nlink_list.html.erb | 2 +- app/views/neuigkeiten/show.html.erb | 9 +-- app/views/rubriken/_tabs.html.erb | 2 +- app/views/semesters/_semester.html.erb | 17 ++++ app/views/studien/_semesteransicht.html.erb | 43 ++++------ app/views/studien/_tabs.html.erb | 2 +- app/views/studien/semesteransicht.html.erb | 52 ------------ app/views/studien/show.html.erb | 2 + app/views/themen/_verw_liste.html.erb | 8 +- config/locales/de.yml | 80 ++++--------------- config/locales/en.yml | 14 ++-- config/locales/fetprofile.de.yml | 44 ++++++++--- config/locales/fetprofile_public.de.yml | 20 +++++ config/locales/neuigkeiten.de.yml | 17 +++- config/locales/neuigkeiten_public.de.yml | 10 +++ config/locales/neuigkeiten_public.en.yml | 10 +++ config/locales/studien.de.yml | 88 +++++++++++++++------ config/locales/studien_public.de.yml | 25 ++++++ 37 files changed, 320 insertions(+), 300 deletions(-) delete mode 100755 app/views/home/dev.html.erb create mode 100644 app/views/semesters/_semester.html.erb delete mode 100644 app/views/studien/semesteransicht.html.erb create mode 100644 config/locales/fetprofile_public.de.yml create mode 100644 config/locales/neuigkeiten_public.de.yml create mode 100644 config/locales/neuigkeiten_public.en.yml create mode 100644 config/locales/studien_public.de.yml diff --git a/app/controllers/fetprofiles_controller.rb b/app/controllers/fetprofiles_controller.rb index 83af41c..77850e1 100644 --- a/app/controllers/fetprofiles_controller.rb +++ b/app/controllers/fetprofiles_controller.rb @@ -10,6 +10,8 @@ class FetprofilesController < ApplicationController @fetprofiles = Fetprofile.where(:active=>false).order(:vorname,:nachname) if params[:filter]== "notactive" @gremientabs = Gremium.tabs + @toolbar_elements << {:hicon=>'icon-plus', :text=> I18n.t('profile.new_profile'),:path => new_fetprofile_path(@fetprofile) } if can? :new, @fetprofile + respond_to do |format| format.html # index.html.erb end @@ -87,7 +89,13 @@ class FetprofilesController < ApplicationController respond_to do |format| if @fetprofile.update_attributes(params[:fetprofile]) - format.html { redirect_to @fetprofile, notice: 'Fetprofile was successfully updated.' } + format.html { + unless params[:button]=="continue" || params[:commit]=="continue" + redirect_to @fetprofile, notice: 'Fetprofile was successfully updated.' + else + redirect_to edit_fetprofile_path(@fetprofile), notice: 'Fetprofile was successfully updated.' + end + } format.json { head :no_content } else @memberships=@fetprofile.memberships.order(:typ) diff --git a/app/controllers/galleries_controller.rb b/app/controllers/galleries_controller.rb index 5906b5c..7745872 100644 --- a/app/controllers/galleries_controller.rb +++ b/app/controllers/galleries_controller.rb @@ -6,7 +6,7 @@ class GalleriesController < ApplicationController # GET /galleries.json def index @galleries = Gallery.all - @toolbar_elements << {:hicon => 'icon-plus', :text => I18n.t('fotos.new-gallery'), :path => new_gallery_path } + @toolbar_elements << {:hicon => 'icon-plus', :text => I18n.t('fotos.new-gallery'), :path => new_gallery_path } if can? :new, Gallery respond_to do |format| format.html # index.html.erb diff --git a/app/controllers/studien_controller.rb b/app/controllers/studien_controller.rb index 79de843..cbfd4a6 100755 --- a/app/controllers/studien_controller.rb +++ b/app/controllers/studien_controller.rb @@ -7,7 +7,7 @@ class StudienController < ApplicationController @topbar_elements=[{:hicon=>'icon-list', :text=>I18n.t("studien.allestudien"),:path=>studien_path}] @topbar_elements<<{:hicon=>'icon-list', :text=>I18n.t("modul.list"),:path=>moduls_path} @topbar_elements<<{:hicon=>'icon-list', :text=>I18n.t("lva.list"),:path=>lvas_path} - @toolbar_elements<<{:icon =>:plus, :hicon=>'icon-plus-sign', :text=> I18n.t('studien.new') ,:path=>new_studium_path } + @toolbar_elements<<{:icon =>:plus, :hicon=>'icon-plus-sign', :text=> I18n.t('studien.new') ,:path=>new_studium_path } if can? :new, Studium # @toolbar_elements<<{:text=> I18n.t('modulgruppe.show.link') ,:path=>modulgruppen_path } end @@ -31,14 +31,14 @@ class StudienController < ApplicationController end @studienphasen << {:modulgruppen=>modulgruppen, :phase => ph}.merge(opts) end - - @toolbar_elements=[{:icon=>:plus, :hicon =>'icon-plus-sign' ,:text=> I18n.t('studien.new') , :path => new_studium_path(@studium) }, - {:icon=>:pencil, :hicon=>'icon-pencil',:text =>I18n.t('common.edit'),:path => edit_studium_path(@studium)}, - {:icon=>:pencil, :hicon=>'icon-pencil',:text =>I18n.t('common.edit'),:path => edit_lvas_studium_path(@studium)}, - {:hicon=>'icon-remove-circle', :text=> I18n.t('common.delete'),:path => studium_path(@studium), :method=> :delete,:confirm=>'Sure?' }] - - @toolbar_modulgruppen =[ {:hicon=>'icon-plus-sign', :text=> I18n.t('modulgruppe.new'), :path=>new_studium_modulgruppe_path(@studium)}, - {:hicon=>'icon-list', :text => I18n.t('modulgruppe.list'), :path=>modulgruppen_path}] + @toolbar_elements=[] + @toolbar_elements<<{:icon=>:plus, :hicon =>'icon-plus-sign' ,:text=> I18n.t('studien.new') , :path => new_studium_path(@studium) } if can? :new, Studium + @toolbar_elements<<{:icon=>:pencil, :hicon=>'icon-pencil',:text =>I18n.t('common.edit'),:path => edit_studium_path(@studium)} if can? :edit, Studium +@toolbar_elements<<{:icon=>:pencil, :hicon=>'icon-pencil',:text =>I18n.t('common.edit'),:path => edit_lvas_studium_path(@studium)} if can? :edit_lvas, Studium +@toolbar_elements<<{:hicon=>'icon-remove-circle', :text=> I18n.t('common.delete'),:path => studium_path(@studium), :method=> :delete,:confirm=>'Sure?' } if can? :delete, Studium + @toolbar_modulgruppen =[] + @toolbar_modulgruppen << {:hicon=>'icon-plus-sign', :text=> I18n.t('modulgruppe.new'), :path=>new_studium_modulgruppe_path(@studium)} if can? :new, Modulgruppe + @toolbar_modulgruppen << {:hicon=>'icon-list', :text => I18n.t('modulgruppe.list'), :path=>modulgruppen_path} if can? :index, Modulgruppe case params[:ansicht] when 'semesteransicht' when 'infoansicht' diff --git a/app/controllers/themengruppen_controller.rb b/app/controllers/themengruppen_controller.rb index 88dfc8d..c321236 100644 --- a/app/controllers/themengruppen_controller.rb +++ b/app/controllers/themengruppen_controller.rb @@ -4,8 +4,9 @@ class ThemengruppenController < ApplicationController load_and_authorize_resource def index @themengruppen = Themengruppe.where(:public=>true).order(:priority).reverse - @toolbar_elements = [{:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.new'), :path=>new_themengruppe_path()}] - @toolbar_elements = [{:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.manage_all'), :path=>verwalten_all_themengruppen_path()}] + @toolbar_elements = [] + @toolbar_elements << {:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.new'), :path=>new_themengruppe_path()} if can? :new, Themengruppe + @toolbar_elements << {:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.manage_all'), :path=>verwalten_all_themengruppen_path()} if can? :verwalten_all, Themengruppe respond_to do |format| format.html # index.html.erb diff --git a/app/models/calentry.rb b/app/models/calentry.rb index 2070a03..66c401f 100644 --- a/app/models/calentry.rb +++ b/app/models/calentry.rb @@ -63,7 +63,7 @@ end end end def text - I18n.l(self.start) +" bis "+ I18n.l(self.ende) + I18n.l(self.start) +" "+ I18n.t("cal.bis")+" "+ I18n.l(self.ende) end scope :public, -> { where(:public => :true) } # scope :upcoming, -> { where("start >= ?" , Time.now).where("start <= ?", 28.days.from_now) } diff --git a/app/views/fetprofiles/_form.html.erb b/app/views/fetprofiles/_form.html.erb index 1467d1f..208c2d6 100644 --- a/app/views/fetprofiles/_form.html.erb +++ b/app/views/fetprofiles/_form.html.erb @@ -11,7 +11,7 @@

    - <%= f.input :desc %> + <%= f.input :desc , input_html: {style: "width:100%"}%>
    @@ -30,23 +30,30 @@
    -Adresse: + +<%= I18n.t("fetprofile.adresse") %>: <%=f.input :street %> -<%=f.input :plz %> -<%=f.input :city %> -KOntakt: -<%=f.input :instant %> -<%=f.input :skype %> + +
    +<%=f.input :plz, input_html: {style: "width:5em"} %><%=f.input :city, input_html: {style: "width:5em"} %>
    <%=f.input :telnr %> <%=f.input :hdynr %>
    -Geburtstag: -<%=f.input :birth_day %> -<%=f.input :birth_month %> -<%=f.input :birth_year %> +<%= I18n.t("fetprofile.geburtstag") %>: + + + + +
    <%=f.input :birth_day, input_html: {style: "width:3em"}%><%=f.input :birth_month, input_html: {style: "width:3em"} %><%=f.input :birth_year, input_html: {style: "width:5em"} %>
    + + + +<%=f.input :instant %> +<%=f.input :skype %> +
    @@ -60,7 +67,9 @@ Geburtstag:
    <%= f.actions do %> - <%= f.action :submit, :as => :input %> + <%= f.action :submit, :as => :input , :label=>I18n.t("common.save") %> + <%= f.action :submit, :as => :input, :button_html=>{value: "continue"} , :label=>I18n.t("common.savecont") %> + <%= f.action :cancel, :as=> :link , :label=>I18n.t("common.cancel") %> <% end %>
    diff --git a/app/views/fetprofiles/edit.html.erb b/app/views/fetprofiles/edit.html.erb index c2d79e3..f63468c 100644 --- a/app/views/fetprofiles/edit.html.erb +++ b/app/views/fetprofiles/edit.html.erb @@ -1,6 +1,7 @@ -

    Editing fetprofile

    +

    <%= I18n.t("fetprofile.edit")%>

    <%= render 'form' %> -<%= link_to 'Show', @fetprofile %> | -<%= link_to 'Back', fetprofiles_path %> + + + diff --git a/app/views/fetprofiles/index.html.erb b/app/views/fetprofiles/index.html.erb index d80a255..21c64a6 100644 --- a/app/views/fetprofiles/index.html.erb +++ b/app/views/fetprofiles/index.html.erb @@ -6,9 +6,15 @@ <%= I18n.t 'profile.active_members' if params[:filter].nil? || params[:filter]== "active" %> +
    +
    + <%= render 'layouts/pretty_toolbar' %> + + <% link_to I18n.t('profile.new_profile'), new_fetprofile_path %> +
    +
    -
    -
    - <%= link_to I18n.t('profile.new_profile'), new_fetprofile_path %> -
    -
    +
    diff --git a/app/views/fetprofiles/new.html.erb b/app/views/fetprofiles/new.html.erb index 0499665..08d39f3 100644 --- a/app/views/fetprofiles/new.html.erb +++ b/app/views/fetprofiles/new.html.erb @@ -2,4 +2,4 @@ <%= render 'form' %> -<%= 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 b62caae..866cb66 100644 --- a/app/views/fetprofiles/show.html.erb +++ b/app/views/fetprofiles/show.html.erb @@ -10,12 +10,7 @@

    <%= @fetprofile.fetmail %>

    - respond_to do |format| - format.html # index.html.erb - format.json { render json: @fetprofiles } - end - -

    +

    <%= @fetprofile.desc %>

    <%= render partial: "interninfo", object: @fetprofile if can?(:seeintern, @fetprofile) %> diff --git a/app/views/galleries/index.html.erb b/app/views/galleries/index.html.erb index 258fd23..105c0a4 100644 --- a/app/views/galleries/index.html.erb +++ b/app/views/galleries/index.html.erb @@ -1,4 +1,5 @@

    <%= I18n.t('fotos.galleries')%>

    +<%= render :partial => 'layouts/pretty_toolbar' %> <% @galleries.each_slice(2) do |row| %>
    <% row.each do |gallery| %> @@ -37,4 +38,3 @@ <% end %>
    -<%= render :partial => 'layouts/pretty_toolbar' %> diff --git a/app/views/home/_beispiele.html.erb b/app/views/home/_beispiele.html.erb index b6f178b..c15721d 100644 --- a/app/views/home/_beispiele.html.erb +++ b/app/views/home/_beispiele.html.erb @@ -1,17 +1,12 @@
    -
    -

    Neueste Beispiele in unserer Sammlung

    +

    I18n.t("home.newexamples")

    <%= link_to I18n.t("beispiel.add"), new_beispiel_path, :class=>"btn"%>
    - - - -
    <%= link_to "Entwicklungsstatus" , dev_home_index_path %> <%= render 'beispiele' %> -Verschiedene Styles +<%= I18n.t("home.selectstyle") %>
    • <%= link_to "Darkblue", home_index_path({:theme=>"darkblue"}) %>
    • <%= link_to "Blue1", home_index_path({:theme=>"blue1"}) %>
    • diff --git a/app/views/home/kontakt.html.erb b/app/views/home/kontakt.html.erb index 11b1e32..f2d4a8b 100644 --- a/app/views/home/kontakt.html.erb +++ b/app/views/home/kontakt.html.erb @@ -1,10 +1,12 @@
      -

      Kontakt

      +

      <%= I18n.t "kontakt.H1" %>

      - <%= I18n.t "home.kontakt" %> + <%= I18n.t "kontakt.text" %>

      -

      Service

      - -

      Impressum

      -

      Credits

      +

      <%= I18n.t "kontakt.service" %>

      + <%= raw(I18n.t( "kontakt.service_text")) %> +

      <%= I18n.t "kontakt.adresse" %>

      +

      <%= raw(I18n.t("kontakt.adresse_text")) %>

      +

      <%= raw(I18n.t ("kontakt.telefon_text")) %>

      +
      diff --git a/app/views/layouts/_pretty_toolbar.html.erb b/app/views/layouts/_pretty_toolbar.html.erb index 8922e02..3ec90f4 100644 --- a/app/views/layouts/_pretty_toolbar.html.erb +++ b/app/views/layouts/_pretty_toolbar.html.erb @@ -5,6 +5,7 @@ Verwendung: Aufruf mit --> <% toolbar_elements = !pretty_toolbar.nil? ? pretty_toolbar : @toolbar_elements %> +<% unless toolbar_elements.nil? || toolbar_elements.empty? %> <%= I18n.t("common.actions")%>
      <% toolbar_elements.each do |t| %> @@ -14,10 +15,10 @@ Verwendung: Aufruf mit <% else %>
      - Versionen + <%= I18n.t("common.versions") %>
      +<% end %> diff --git a/app/views/memberships/_membership.html.erb b/app/views/memberships/_membership.html.erb index e2689e9..ad5daef 100644 --- a/app/views/memberships/_membership.html.erb +++ b/app/views/memberships/_membership.html.erb @@ -1,6 +1,6 @@ -<%= membership.stop.nil? ? "seit " : "von " %> +<%= membership.stop.nil? ? I18n.t("gremium.seit")+" " : I18n.t("gremium.von")+" " %> <%=membership.start.to_s %> -<%= " bis "+membership.stop.to_s unless membership.stop.nil? %> +<%= " "+I18n.t("gremium.bis")+" "+membership.stop.to_s unless membership.stop.nil? %> <%= Membership::TYPEN_g[membership.fetprofile.geschlecht.to_i][membership.typ.to_i] %> <%= membership.gremium.fall2 %> diff --git a/app/views/modulgruppen/index.html.erb b/app/views/modulgruppen/index.html.erb index fb37c87..9e735dd 100755 --- a/app/views/modulgruppen/index.html.erb +++ b/app/views/modulgruppen/index.html.erb @@ -1,10 +1,8 @@

      <%= I18n.t("modulgruppe.show.title")%>

      - - <% @modulgruppen.sort_by{|n| n[:name]}.each do |modulgruppe| %> <%= render modulgruppe%> <% end %>
      <% if !@studium.nil? %> -<%= link_to 'New Modulgruppe', new_studium_modulgruppe_path(@studium) %> +<%= link_to I18n.t("modulgruppe.new"), new_studium_modulgruppe_path(@studium) if can? :new, Modulgruppe %> <% end%> diff --git a/app/views/neuigkeiten/_compact.html.erb b/app/views/neuigkeiten/_compact.html.erb index b82f795..0a01cb9 100644 --- a/app/views/neuigkeiten/_compact.html.erb +++ b/app/views/neuigkeiten/_compact.html.erb @@ -7,7 +7,7 @@
      <%= neuigkeit.rubrik.name %> - <%= "am "+ I18n.l(neuigkeit.try(:datum).try(:to_date)) unless neuigkeit.try(:datum).try(:to_date).nil? %> + <%= I18n.t("neuigkeit.am")+" "+ I18n.l(neuigkeit.try(:datum).try(:to_date)) unless neuigkeit.try(:datum).try(:to_date).nil? %>

      <%= neuigkeit.title%> diff --git a/app/views/neuigkeiten/_nlink_list.html.erb b/app/views/neuigkeiten/_nlink_list.html.erb index abbed76..d93927c 100644 --- a/app/views/neuigkeiten/_nlink_list.html.erb +++ b/app/views/neuigkeiten/_nlink_list.html.erb @@ -1,4 +1,4 @@ -
    • +
    • <%= link_to nlink_list.link do %>
      <% p = nlink_list.link_type.downcase.pluralize+"/nlink" %> diff --git a/app/views/neuigkeiten/show.html.erb b/app/views/neuigkeiten/show.html.erb index 2dcb846..1dcc02e 100755 --- a/app/views/neuigkeiten/show.html.erb +++ b/app/views/neuigkeiten/show.html.erb @@ -7,7 +7,7 @@ <%= @neuigkeit.author.email.to_s unless @neuigkeit.try(:author).try(:email).to_s %> - <%= @neuigkeit.author.text+ " am " + I18n.l(@neuigkeit.try(:datum).try(:to_date)) unless @neuigkeit.try(:datum).try(:to_date).nil? %> + <%= @neuigkeit.author.text+ " "+ I18n.t("neuigkeit.am")+" " + I18n.l(@neuigkeit.try(:datum).try(:to_date)) unless @neuigkeit.try(:datum).try(:to_date).nil? %>
      @@ -17,7 +17,6 @@

      <%= @neuigkeit.title%> -

      <%= raw(@neuigkeit.text) %>

      @@ -29,7 +28,7 @@ <%= render 'layouts/pretty_toolbar', :object=> @toolbar_elements %>
      -Siehe auch: +<%= I18n.t("neuigekeit.sieheauch") %>
      - +<% if can? :find_link, @neuigkeit %> <%= semantic_form_for :find_link, :url=>find_link_rubrik_neuigkeit_path(@rubrik,@neuigkeit), :html=>{:id=>"search_form", :method=>'get'} do |f| %> <%= f.input :query, :input_html => { :name => 'query' },:label=>false %> <% end %> - +<% end %>
      diff --git a/app/views/rubriken/_tabs.html.erb b/app/views/rubriken/_tabs.html.erb index 4478b08..f6320a5 100644 --- a/app/views/rubriken/_tabs.html.erb +++ b/app/views/rubriken/_tabs.html.erb @@ -14,7 +14,7 @@ <% else %>
    • <% end %> -<%= link_to "Verwaltung", verwalten_rubriken_path %> +<%= link_to I18n.t("rubrik.management"), verwalten_rubriken_path if can? :verwalten, Rubrik %>
    • <% end %>

    diff --git a/app/views/semesters/_semester.html.erb b/app/views/semesters/_semester.html.erb new file mode 100644 index 0000000..26de7b9 --- /dev/null +++ b/app/views/semesters/_semester.html.erb @@ -0,0 +1,17 @@ +
    +
    +
    +
    +

    <%= semester.name %>

    +
    +
    + +
    +
    + <% semester.lvas.each do |lva| %> +
    + <%= render :partial=>'lvas/lva_semester', :locals =>{:lva => lva}%> +
    + <% end %> +
    +
    diff --git a/app/views/studien/_semesteransicht.html.erb b/app/views/studien/_semesteransicht.html.erb index 66ed037..3a82b05 100644 --- a/app/views/studien/_semesteransicht.html.erb +++ b/app/views/studien/_semesteransicht.html.erb @@ -1,34 +1,19 @@ +<% 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) %> +<% end %> +
    - <% 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) %> - <% end %> - - <% @studium.semester.each do |sem| %> -
    -
    -
    -
    -
    -
    -

    <%= sem.name %>

    -
    -
    - -
    -
    - <% sem.lvas.each do |lva| %> -
    - <%= render :partial=>'lvas/lva_semester', :locals =>{:lva => lva}%> -
    - <% end %> -
    -
    -
    + <% @studium.semester.each_slice(2) do |row| %> +
    + <% row.each do |sem| %> +
    + <%= render sem %>
    <% end %> - - <%= render :partial=>'layouts/pretty_toolbar', :locals=>{:elements=>@toolbar_elements} %> +
    + <% end %>
    + <%= render :partial=>'layouts/pretty_toolbar', :locals=>{:elements=>@toolbar_elements} %> diff --git a/app/views/studien/_tabs.html.erb b/app/views/studien/_tabs.html.erb index 358baa7..b35a622 100644 --- a/app/views/studien/_tabs.html.erb +++ b/app/views/studien/_tabs.html.erb @@ -20,6 +20,6 @@ <% else %>
  • <% end %> -<%= link_to I18n.t("studien.verwaltung.title"), studien_verwalten_path %> +<%= link_to I18n.t("studien.verwaltung.title"), studien_verwalten_path if can? :verwalten, Studium %>
  • diff --git a/app/views/studien/semesteransicht.html.erb b/app/views/studien/semesteransicht.html.erb deleted file mode 100644 index 078f445..0000000 --- a/app/views/studien/semesteransicht.html.erb +++ /dev/null @@ -1,52 +0,0 @@ - -
    -
    - <%= render 'studien/tabs' %> -
    -

    <%= @studium.typ %> <%= @studium.name %> (<%= @studium.zahl %>)

    -
    -
    -
    - <%= link_to @text, studium_path(@studium, :ansicht=>@flip), :class=>"btn" %> - <%= link_to "Infoansicht", studium_path(@studium, :ansicht=>'infoansicht'), :class=>"btn" unless params[:ansicht]=='infoansicht'%> -
    -
    -
    - - <% 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) %> - <% end %> - - <% @studium.semester.each do |sem| %> -
    -
    -
    -
    -
    - -
    -

    <%= sem.name %>

    -
    -
    -
    -
    - <% sem.lvas.each do |lva| %> -
    - - - <%= render :partial=>'lvas/lva_semester', :locals =>{:lva => lva}%> - - -
    - <% end %> - -
    -
    -
    -
    - <% end %> - - <%= render :partial=>'layouts/pretty_toolbar', :locals=>{:elements=>@toolbar_elements} %> -
    diff --git a/app/views/studien/show.html.erb b/app/views/studien/show.html.erb index 5ec47b1..2a056bc 100644 --- a/app/views/studien/show.html.erb +++ b/app/views/studien/show.html.erb @@ -2,6 +2,7 @@

    <%= notice %>

    <%= @studium.typ %> <%= @studium.name %> (<%= @studium.zahl %>)

    +

    <%= link_to I18n.t("studien.ansicht.semester"), studium_path(@studium, :ansicht=>"semesteransicht"), :class=>"btn" unless params[:ansicht]=='semesteransicht' %> @@ -9,6 +10,7 @@ <%= link_to I18n.t("studien.ansicht.info"), studium_path(@studium, :ansicht=>"infoansicht"), :class=>"btn" unless params[:ansicht]=='infoansicht' %>

    +
    <% if params[:ansicht]=='modulgruppenansicht' %> <%= render partial: 'modulgruppenansicht' %> <% else if params[:ansicht]=='infoansicht' %> diff --git a/app/views/themen/_verw_liste.html.erb b/app/views/themen/_verw_liste.html.erb index 8783dbe..777a730 100644 --- a/app/views/themen/_verw_liste.html.erb +++ b/app/views/themen/_verw_liste.html.erb @@ -1,4 +1,8 @@ <% verw_liste.each do |thema| %> -
  • <%= thema.title %>

    -<%= link_to thema_path(thema),:remote=>true do %> Show <% end %> <%= link_to edit_thema_path(thema),:remote=>true do %> Edit <% end %> <%= link_to fragen_thema_path(thema),:remote=>true do %> Fragen <% end %><%= link_to attachments_thema_path(thema),:remote=>true do %> Attachments <% end %>
  • +
  • <%= thema.title %>
    + +<%= link_to thema_path(thema),:remote=>true do %> Show <% end %> +<%= link_to edit_thema_path(thema),:remote=>true do %> Edit <% end %> +<%= link_to fragen_thema_path(thema),:remote=>true do %> Fragen <% end %> +<%= link_to attachments_thema_path(thema),:remote=>true do %> Attachments <% end %>
  • <% end %> diff --git a/config/locales/de.yml b/config/locales/de.yml index 4d7e774..6a37ddd 100755 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -1,5 +1,4 @@ -# Sample localization file for English. Add more files in this directory for other locales. -# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. + de: ohnezuordnung: "Ohne Zuordnung" hello: "Hallo Welt" @@ -10,6 +9,11 @@ de: delete: "Löschen" verwalten: "Verwalten" sure_del: "Sicher endgültig löschen?" + versions: "Versionen" + activeversion: "Akutelle Version" + cancel: "Abbrechen" + save: "Speichern" + savecont: "Zwischenspeichern" home: sprache: "Deutsch" kontakt: "Kontakt" @@ -24,68 +28,16 @@ de: mitarbeiter: "Mitarbeiter" fotos: "Fotos" search: "Suche" - - formtastic: - titles: - modul: - title: "Modul Details" - edit: "Modul Details" - hints: - modul: - name: "Name des Moduls" - labels: - modul: - name: "Name" - desc: "Beschreibung" - depend: "Voraussetzungen" - activerecord: - errors: - models: - modulgruppe: - attributes: - studium_id: - blank: "Bitte wählen Sie ein Studium aus" - typ: - inclusion: "Bitte wählen Sie einen Typ aus" - phase: - not_a_number: "Die Phase muss eine Nummer sein" - inclusion: "Bitte wählen sie eine gültige Zahl für die Phase" - name: - blank: "Bitte geben sie einen Namen ein" - taken: "Der Name ist schon vergeben (Hier ist ein Bug)" - lva: - attributes: - modul: - blank: "Lva muss zumindest einem Modul zugewiesen sein" - name: - blank: "Die Lva muss einen Namen haben" - ects: - blank: "Es müssen ECTS eingetragen sein" - stunden: - blank: "Es muss die Studenanzahl eingettragen sein" - lvanr: - invalid: "Die Nummer muss im Format 000.000 eingegeben sein" - blank: "Geben sie eine Lva-Nr an" - taken: "Die Lva-Nummer ist vergeben" - typ: - blank: "Es muss ein Lva-Typ angegeben sein" - inclusion: "Der Typ ist nicht aus der Auswahl der gültigen Typen" - - studium: - attributes: - zahl: - blank: "Geben Sie die Studienkennzahl an" - invalid: "Die eingegebene Form stimmt nicht. (4-10 Zeichen, Ziffern und Großbuchstaben" - taken: "Die Kennzahl wird bereits verwendet" - name: - blank: "Geben Sie den Namen des Studiums ein" - taken: "Der Name ist bereits vergeben" - typ: - inclusion: 'Wählen Sie "Bachelor" oder "Master" aus' - modul: - attributes: - modulgruppen: - blank: "Wählen Sie zumindest eine Modulgruppe aus" + newexamples: "Neueste Beispiele in unserer Sammlung" + selectstyle: "Wähle dein Design" support: array: two_words_connector: ', ' + kontakt: + H1: "Kontakt" + text: "Du kannst uns telefonisch, E-Mail, Skype und persönlich erreichen." + service: "Service" + adresse: "Adresse" + adresse_text: "Gußhausstraße 25-27
    1220 Wien" + service_text: "Für individuelle Beratung und alle sonstigen Angelegenheiten stehen wir mit unserem Servicedienst während der Vorlesungszeit jenen Mo-Fr von 9 bis 15 Uhr zur Verfügung. Außerhalb dieser Zeiten ist oft trotzdem jemand auf der Fachschaft der dir weiterhelfen kann." + telefon_text: "Telefon: +43 2241341
    Skype:
    E-Mail: service@fet.at" \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index 24c0753..2324a9c 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1,8 +1,7 @@ -# Sample localization file for English. Add more files in this directory for other locales. -# See https://github.com/svenfuchs/rails-i18n/tree/master/rails%2Flocale for starting points. -en: - hello: "Hello world" +en: + ohnezuordnung: "Without x" + hello: "Hello World" common: back: "Back" edit: "Edit" @@ -10,11 +9,12 @@ en: delete: "Delete" verwalten: "Manage" sure_del: "Are you sure you want to delete this?" - home: sprache: "English" kontakt: "Contact" mtitle: "Menu" + login: "FET Login" + willkommen: "Welcome at Fachschaft Elektrotechnik" hallobeiderfet: "This is the page of Fachschaft Elektrotechnik at TU Wien" home: "Home" studien: "Studies" @@ -23,4 +23,6 @@ en: mitarbeiter: "Members" fotos: "Fotos" search: "Search" - willkommen: "Welcome at Fachschaft Elektrotechnik" + newexamples: "Newest examples in our collection" + selectstyle: "Choose a style" + diff --git a/config/locales/fetprofile.de.yml b/config/locales/fetprofile.de.yml index 8d938b5..f341712 100644 --- a/config/locales/fetprofile.de.yml +++ b/config/locales/fetprofile.de.yml @@ -1,14 +1,32 @@ +# -------------- interne Strings --------- de: - profile: - remove_picture: "Bild entfernen" - all_members: "Alle Mitglieder" - all_groups: "Alle Gremien und Gruppen" - active_members: "Aktive Mitglieder" - notactive_members: "Pension" - new_profile: "Neues Profil anlegen" - gremium: - new: "Neues Gremium" - filter: - berufung: - title: "Berufungskommission" - text: "B.." \ No newline at end of file + fetprofile: + edit: "Profil bearbeiten" + geburtstag: "Geburtstag" + adresse: "Adresse" + formtastic: + labels: + fetprofile: + birth_day: "Tag" + birth_month: "Monat" + birth_year: "Jahr" + geschlecht: "Geschlecht" + hdynr: "Handynummer" + telnr: "Telefonnummer" + skype: "Skype" + instant: "anderer Instantmessanger" + city: "Stadt" + street: "Straße" + plz: "PLZ" + picture: "Portraitfoto" + vorname: "Vorname" + nachname: "Nachname" + short: "Spitzname" + fetmailalias: "Spitzname bei Mailadresse" + desc: "Beschreibungstext" + active: "AktiveR MitarbeiterIn" + membership: + start: "Beginn" + stop: "Ende" + type: "Typ" + \ No newline at end of file diff --git a/config/locales/fetprofile_public.de.yml b/config/locales/fetprofile_public.de.yml new file mode 100644 index 0000000..08853d2 --- /dev/null +++ b/config/locales/fetprofile_public.de.yml @@ -0,0 +1,20 @@ +de: + profile: + remove_picture: "Bild entfernen" + all_members: "Alle Mitglieder" + all_groups: "Alle Gremien und Gruppen" + active_members: "Aktive Mitglieder" + notactive_members: "Pension" + new_profile: "Neues Profil anlegen" + gremium: + new: "Neues Gremium" + seit: "seit" + von: "von" + bis: "bis" + filter: + berufung: + title: "Berufungskommission" + text: "B.." + habil: + title: "Habilitationskommission" + text: "Die Habilitation ist die Verleihung der Lehrbefugnis an einer Universität. Die Habilitation ist mit dem Abfassen einer Habilitationsschrift ähnlich einer Dissertation verbunden. Außerdem werden die didaktischen Fähigkeiten und die sonstige wissenschaftliche Laufbahn beurteilt." \ No newline at end of file diff --git a/config/locales/neuigkeiten.de.yml b/config/locales/neuigkeiten.de.yml index 9a12ca3..ef0c6b0 100644 --- a/config/locales/neuigkeiten.de.yml +++ b/config/locales/neuigkeiten.de.yml @@ -1,20 +1,29 @@ de: +# -------- Interne Strings --------- neuigkeit: publish: "Neuigkeit veröffentlichen" + publishfb: "Neuigkeit auf Facebook veröffentlichen" republish: "Neuigkeit erneut veröffentlichen" unpublish: "Veröffentlichung rückgängig" new: title: "Neuer Artikel" - rubriken: - alle: "Alle Rubriken" rubrik: - title: "Neuigkeiten und aktuelle Infos" moderatoradded: "Neuen Moderator hinzugefügt!" moderatoraddnorights: "Keine Berechtigung neue Moderatoren hinzuzufügen!" new: "Neue Rubrik" edit: "Rubrik bearbeiten" - + management: "Verwaltung" + formtastic: + labels: + neuigkeit: + text: "Text" + title: "Überschrift" + author: "Author" + picture: "Bild" + calentry: + start: "Beginn" + dauer: "Dauer" activerecord: errors: models: diff --git a/config/locales/neuigkeiten_public.de.yml b/config/locales/neuigkeiten_public.de.yml new file mode 100644 index 0000000..0fa3bc3 --- /dev/null +++ b/config/locales/neuigkeiten_public.de.yml @@ -0,0 +1,10 @@ +de: + neuigkeit: + am: "am" + sieheauch: "Siehe auch" + rubriken: + alle: "Alle Rubriken" + cal: + bis: "bis" + rubrik: + title: "Neuigkeiten und aktuelle Infos" diff --git a/config/locales/neuigkeiten_public.en.yml b/config/locales/neuigkeiten_public.en.yml new file mode 100644 index 0000000..beb4e34 --- /dev/null +++ b/config/locales/neuigkeiten_public.en.yml @@ -0,0 +1,10 @@ +en: + neuigkeit: + am: "on" + sieheauch: "Stuff that could interest you" + rubriken: + alle: "All Rubrics" + cal: + bis: "to" + rubrik: + title: "News and current information" diff --git a/config/locales/studien.de.yml b/config/locales/studien.de.yml index 5b15360..d6f1063 100644 --- a/config/locales/studien.de.yml +++ b/config/locales/studien.de.yml @@ -1,23 +1,13 @@ + +# --------------- interne Strings de: - studien: - desc: "Beschreibung" - studien: "Studien" - list: "Studien der Fakultät Elektrotechnik" - anzeigen: "Studium anzeigen" - new: "Neues Studium" - allestudien: "Alle Studien" - loeschen: "Dieses Studium löschen" - edit: "Studium bearbeiten" + studien: verwaltung: title: "Studien verwalten" explanation: "
    • Klick auf den Namen eines Objektes führt zu dessen Ansicht, ein Klick auf edit direkt zum Bearbeitungsformular
    • Per Dropdown-Menü kann nach einzelnen Objekten gefiltert werden. Die Filter können kombiniert werden, wobei nur erlaubte Kombinationen möglich sind. Solange validation-Fehler (im Log rot und fett) auftreten, keine Filter verwenden
    " - ansicht: - modulgruppe: "Modulgruppenansicht" - semester: "Semesteransicht" - info: "Infoansicht" modul: edit: "Modul bearbeiten" list: "Alle Module" @@ -25,17 +15,10 @@ de: lvas: "LVAs" mgs: "Modulgruppen" desc: "Beschreibung" - keine: - beschreibung: "Keine Beschreibung vorhanden" - beispiel: - add: "Beispiel hinzufügen" lva: add: "Lva hinzufügen" addrem: "Lva hinzufügen/entfernen" list: "Alle Lvas" - semester: - ohne: "Ohne Semesterzuordnung" - semester: "Semester" modulgruppe: typ: "Typ" edit: "Modulgruppe bearbeiten" @@ -56,8 +39,65 @@ de: verwalten: fehler: keine: "Keine Fehlermeldungen oder Warnungen" - lecturers: - lecturers: "Vortragende" - file: - size: "Dateigröße" + formtastic: + titles: + modul: + title: "Modul Details" + edit: "Modul Details" + hints: + modul: + name: "Name des Moduls" + labels: + modul: + name: "Name" + desc: "Beschreibung" + depend: "Voraussetzungen" + activerecord: + errors: + models: + modulgruppe: + attributes: + studium_id: + blank: "Bitte wählen Sie ein Studium aus" + typ: + inclusion: "Bitte wählen Sie einen Typ aus" + phase: + not_a_number: "Die Phase muss eine Nummer sein" + inclusion: "Bitte wählen sie eine gültige Zahl für die Phase" + name: + blank: "Bitte geben sie einen Namen ein" + taken: "Der Name ist schon vergeben (Hier ist ein Bug)" + lva: + attributes: + modul: + blank: "Lva muss zumindest einem Modul zugewiesen sein" + name: + blank: "Die Lva muss einen Namen haben" + ects: + blank: "Es müssen ECTS eingetragen sein" + stunden: + blank: "Es muss die Studenanzahl eingettragen sein" + lvanr: + invalid: "Die Nummer muss im Format 000.000 eingegeben sein" + blank: "Geben sie eine Lva-Nr an" + taken: "Die Lva-Nummer ist vergeben" + typ: + blank: "Es muss ein Lva-Typ angegeben sein" + inclusion: "Der Typ ist nicht aus der Auswahl der gültigen Typen" + + studium: + attributes: + zahl: + blank: "Geben Sie die Studienkennzahl an" + invalid: "Die eingegebene Form stimmt nicht. (4-10 Zeichen, Ziffern und Großbuchstaben" + taken: "Die Kennzahl wird bereits verwendet" + name: + blank: "Geben Sie den Namen des Studiums ein" + taken: "Der Name ist bereits vergeben" + typ: + inclusion: 'Wählen Sie "Bachelor" oder "Master" aus' + modul: + attributes: + modulgruppen: + blank: "Wählen Sie zumindest eine Modulgruppe aus" diff --git a/config/locales/studien_public.de.yml b/config/locales/studien_public.de.yml new file mode 100644 index 0000000..3e12e8c --- /dev/null +++ b/config/locales/studien_public.de.yml @@ -0,0 +1,25 @@ +de: + studien: + desc: "Beschreibung" + studien: "Studien" + list: "Studien der Fakultät Elektrotechnik" + anzeigen: "Studium anzeigen" + new: "Neues Studium" + allestudien: "Alle Studien" + loeschen: "Dieses Studium löschen" + edit: "Studium bearbeiten" + ansicht: + modulgruppe: "Modulgruppenansicht" + semester: "Semesteransicht" + info: "Infoansicht" + keine: + beschreibung: "Keine Beschreibung vorhanden" + beispiel: + add: "Beispiel hinzufügen" + lecturers: + lecturers: "Vortragende" + file: + size: "Dateigröße" + semester: + ohne: "Ohne Semesterzuordnung" + semester: "Semester" From c1469c596492de9c6becda21b56d3eb93c68b8c9 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Tue, 24 Jun 2014 12:59:49 +0200 Subject: [PATCH 23/48] home fix --- app/controllers/home_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 1162d63..c9ba72a 100755 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -12,7 +12,7 @@ class HomeController < ApplicationController def intern authorize! :seeintern, User @neuigkeiten = Neuigkeit.intern.recent - @themengruppen=Themengruppe.intern + @themengruppen=Themengruppe.intern.order(:priority).reverse end def admin authorize! :doadmin, User From 87bc66f7dfcf225cdac861e99cd1e923a4420b74 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Tue, 24 Jun 2014 13:00:24 +0200 Subject: [PATCH 24/48] sort themen --- app/views/themengruppen/show.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/themengruppen/show.html.erb b/app/views/themengruppen/show.html.erb index 4cfe8ef..416ec70 100644 --- a/app/views/themengruppen/show.html.erb +++ b/app/views/themengruppen/show.html.erb @@ -9,7 +9,7 @@ <%= @themengruppe.text %>

    +<% unless I18n.locale == :de %> +@thema.text +<% end %> <%= f.actions do %> <%= f.action :submit, :as => :button, :label=> I18n.t("thema.save" ) %> <%= f.action :submit, :as => :button, :label=> I18n.t("thema.savecont"), :button_html=>{:value=>"continue"} %> diff --git a/app/views/themen/_small.html.erb b/app/views/themen/_small.html.erb index 8c40748..a2094b2 100644 --- a/app/views/themen/_small.html.erb +++ b/app/views/themen/_small.html.erb @@ -1,6 +1,13 @@

    <%= small.title %> <%= link_to fa_icon("pencil"), verwalten_thema_path(small) if can? :edit, small %>

    +<% if small.is_outdated? %> +
    Outdated
    +<% end %> +<% if small.isdraft %> +
    isdraft
    + +<% end %> <%= raw(small.text) %>
    From ee8f2d0076d194c701a854f6526daab6cbdcda18 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Wed, 25 Jun 2014 23:09:05 +0530 Subject: [PATCH 26/48] themessticker, cleanup routes --- app/assets/stylesheets/themengruppen.css.scss | 25 +- .../themes/blue1/application.css.scss | 2 +- app/controllers/fetprofiles_controller.rb | 9 +- app/controllers/themengruppen_controller.rb | 5 +- app/models/ability.rb | 4 +- app/models/thema.rb | 5 +- app/models/themengruppe.rb | 2 +- app/uploaders/attachment_uploader.rb | 6 + app/views/themen/_form.html.erb | 6 +- app/views/themen/_small.html.erb | 7 +- .../themengruppen/_themengruppe.html.erb | 2 +- app/views/themengruppen/show.html.erb | 4 +- config/locales/themen.de.yml | 5 + config/routes.rb | 389 +++++++----------- 14 files changed, 208 insertions(+), 263 deletions(-) diff --git a/app/assets/stylesheets/themengruppen.css.scss b/app/assets/stylesheets/themengruppen.css.scss index a6d8688..bbd0ddb 100644 --- a/app/assets/stylesheets/themengruppen.css.scss +++ b/app/assets/stylesheets/themengruppen.css.scss @@ -1,22 +1,17 @@ // Place all the styles related to the themengruppen controller here. // They will automatically be included in application.css. // You can use Sass (SCSS) here: http://sass-lang.com/ -div.themengruppe -{padding:10px; -margin:2px; -border-radius: 10px; -min-width:13em; -border: #91B4FF solid 0px; -height: 90% -} -a.themengruppe:hover -{ - box-shadow: 1px 1px 2px 2px lightgray; -} -a.themengruppe +div.sticker { - padding: 5px; - display:block; + width: 90%; + text-align: center; + padding: 5px +} +div.sticker-red +{ background: red; +} +div.sticker-yellow +{ background: yellow; } \ No newline at end of file diff --git a/app/assets/stylesheets/themes/blue1/application.css.scss b/app/assets/stylesheets/themes/blue1/application.css.scss index f4e4f19..8f85488 100755 --- a/app/assets/stylesheets/themes/blue1/application.css.scss +++ b/app/assets/stylesheets/themes/blue1/application.css.scss @@ -59,7 +59,7 @@ $sansFontFamily: Helvetica, Arial; @import 'bootstrap/image-gallery'; @import 'font-awesome'; @import 'neuigkeiten'; - +@import 'themengruppen'; div.header { display: block; diff --git a/app/controllers/fetprofiles_controller.rb b/app/controllers/fetprofiles_controller.rb index 77850e1..bedb427 100644 --- a/app/controllers/fetprofiles_controller.rb +++ b/app/controllers/fetprofiles_controller.rb @@ -91,9 +91,14 @@ class FetprofilesController < ApplicationController if @fetprofile.update_attributes(params[:fetprofile]) format.html { unless params[:button]=="continue" || params[:commit]=="continue" - redirect_to @fetprofile, notice: 'Fetprofile was successfully updated.' + + redirect_to @fetprofile, notice: 'profile was successfully updated.' else - redirect_to edit_fetprofile_path(@fetprofile), notice: 'Fetprofile was successfully updated.' + @memberships=@fetprofile.memberships.order(:typ) + @memberships<< Membership.new + @memberships<< Membership.new + @memberships<< Membership.new + render action: "edit", notice: 'profile was successfully updated.' end } format.json { head :no_content } diff --git a/app/controllers/themengruppen_controller.rb b/app/controllers/themengruppen_controller.rb index c321236..a648f77 100644 --- a/app/controllers/themengruppen_controller.rb +++ b/app/controllers/themengruppen_controller.rb @@ -22,8 +22,11 @@ class ThemengruppenController < ApplicationController # GET /themengruppen/1.json def show @themengruppe = Themengruppe.find(params[:id]) + if can? :showdraft , Thema @themen = @themengruppe.themen.order(:priority).reverse - + else + @themen = @themengruppe.themen.where(:isdraft=>false).order(:priority).reverse + end @toolbar_elements = [] @toolbar_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t("themengruppe.manage"), :path=>themengruppe_verwalten_path(@themengruppe)} if can? :edit, @themengruppe diff --git a/app/models/ability.rb b/app/models/ability.rb index d2a1a9e..0f57417 100755 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -38,7 +38,7 @@ class Ability can [:show, :index], Lva can [:show,:index], Gallery can [:show, :index,:faqs], Themengruppe - can [:show], Thema + can [:show], Thema, :isdraft=>false can [:create], Beispiel can [:show, :index], Fetprofile can [:show, :index],Gremium @@ -53,7 +53,7 @@ class Ability if( user.has_role?("fetuser") || user.has_role?("fetadmin")) can :manage,:all can :manage, Modulgruppe - + can :showdraft , Thema can [:show,:index], Calendar can [:edit, :update,:new,:create,:verwalten], Calendar can [:edit, :update,:new,:create,:verwalten], Calentry diff --git a/app/models/thema.rb b/app/models/thema.rb index 589ae6c..5d98ce0 100644 --- a/app/models/thema.rb +++ b/app/models/thema.rb @@ -21,11 +21,12 @@ include Rails.application.routes.url_helpers validates :themengruppe, :presence => true validates :title, :presence => true validates :text, :presence => true + scope :search, ->(query) {where("text like ? or title like ?", "%#{query}%", "%#{query}%")} - scope :outdated, -> {where("updated_at < ?", 1.week.ago)} + scope :outdated, -> {where("updated_at < ?", 2.month.ago)} translates :title,:text, :versioning =>true, :fallbacks_for_empty_translations => true def is_outdated? - updated_at < 1.week.ago + updated_at < 1.month.ago end def is_wiki? !(wikiname.nil? || wikiname.empty?) diff --git a/app/models/themengruppe.rb b/app/models/themengruppe.rb index ccb5e5a..b60f5c2 100644 --- a/app/models/themengruppe.rb +++ b/app/models/themengruppe.rb @@ -21,7 +21,7 @@ class Themengruppe < ActiveRecord::Base translates :title,:text, :versioning =>true, :fallbacks_for_empty_translations => true - scope :intern,-> {where(:public=>false)} + scope :intern,-> {where("NOT public")} scope :public,-> {where(:public=>true)} def self.find_wiki_default diff --git a/app/uploaders/attachment_uploader.rb b/app/uploaders/attachment_uploader.rb index 2973828..be7212e 100644 --- a/app/uploaders/attachment_uploader.rb +++ b/app/uploaders/attachment_uploader.rb @@ -26,6 +26,12 @@ end version :thumb_small do process :resize_to_fill => [32, 32] end + version :thumb_big do + process :resize_to_fill => [200,200] + end + version :resized do + process :resize_to_fit => [1024,1024] + end # Provide a default URL as a default if there hasn't been a file uploaded: # def default_url diff --git a/app/views/themen/_form.html.erb b/app/views/themen/_form.html.erb index 5d99eb7..0185a60 100644 --- a/app/views/themen/_form.html.erb +++ b/app/views/themen/_form.html.erb @@ -33,8 +33,10 @@
    <% unless I18n.locale == :de %> -@thema.text -<% end %> +<% I18n.with_locale(:de) do %> +<%= raw(@thema.text) %> +<% end %><% end %> + <%= f.actions do %> <%= f.action :submit, :as => :button, :label=> I18n.t("thema.save" ) %> <%= f.action :submit, :as => :button, :label=> I18n.t("thema.savecont"), :button_html=>{:value=>"continue"} %> diff --git a/app/views/themen/_small.html.erb b/app/views/themen/_small.html.erb index a2094b2..e3b6652 100644 --- a/app/views/themen/_small.html.erb +++ b/app/views/themen/_small.html.erb @@ -2,10 +2,10 @@

    <%= small.title %> <%= link_to fa_icon("pencil"), verwalten_thema_path(small) if can? :edit, small %>

    <% if small.is_outdated? %> -
    Outdated
    +
    <%= I18n.t("thema.outdated") %>
    <% end %> <% if small.isdraft %> -
    isdraft
    +
    <%= I18n.t("thema.isdraft") %>
    <% end %> <%= raw(small.text) %> @@ -19,8 +19,9 @@ <%= raw(frage.text) %>

    <% end %> - +<% unless small.hideattachment %> <%= render partial: "themen/attachment_list", object: small.attachments, locals:{editor: false} unless small.attachments.empty? %> +<% end %>
    diff --git a/app/views/themengruppen/_themengruppe.html.erb b/app/views/themengruppen/_themengruppe.html.erb index 5a760cf..a310498 100644 --- a/app/views/themengruppen/_themengruppe.html.erb +++ b/app/views/themengruppen/_themengruppe.html.erb @@ -26,7 +26,7 @@
      - <% themengruppe.themen.order(:priority).reverse.each do |t| %> + <% themengruppe.themen.where(" (NOT hidelink) and ( NOT isdraft) ").order(:priority).reverse.each do |t| %>
    • <%= render t %>
    • diff --git a/app/views/themengruppen/show.html.erb b/app/views/themengruppen/show.html.erb index 416ec70..8dacb84 100644 --- a/app/views/themengruppen/show.html.erb +++ b/app/views/themengruppen/show.html.erb @@ -21,7 +21,9 @@ <% end %> <% thema.nlinks.each do |l| %> -
    • <%= render l.neuigkeit %>
    • +
    • + <%= render l.neuigkeit %> +
    • <% end %>
    diff --git a/config/locales/themen.de.yml b/config/locales/themen.de.yml index 6f5de2e..ae5550b 100644 --- a/config/locales/themen.de.yml +++ b/config/locales/themen.de.yml @@ -19,6 +19,8 @@ de: created: "Thema erfolgreich erstellt" updated: "Thema erfolgreich gespeichert" sure: "Sicher, dass Sie dieses Thema löschen möchten?" + isdraft: "Entwurf" + outdated: "Veraltete Information" frage: add: "Frage hinzufügen" edit: "Frage bearbeiten" @@ -33,6 +35,9 @@ de: title: "Themen Überschrift" text: "Text" themengruppe: "Gruppe" + isdraft: "Entwurf" + hideattachment: "Anhangtabelle ausblenden" + hidelink: "Thema in Überblick nicht anzeigen" themengruppe: title: "Überschrift" priority: "Sortierung" diff --git a/config/routes.rb b/config/routes.rb index 8d41d4d..37c23ef 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,235 +1,160 @@ - Fetsite::Application.routes.draw do - themes_for_rails - devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" } - resources :home, :only=>[:index] do - - end - #get 'home',:controller=>home,:action=>:index,:as=>"home_index" - scope '(:locale)/admin' do - resources :users, :only=>[] do - collection do - get :index - post :all_update - end - member do - get :fb_set_default_publish_page - end - end - get 'users/:id/add_role/:role', :controller=>:users, :action=>:add_role, :as=>'user_add_role' - get 'users/:id/do_confirm', :controller=>:users, :action=>:do_confirm, :as=>'user_do_confirm' - get 'config',:controller=>:config,:action=>:index , :as => 'config' - - end - - devise_for :users , :controllers=>{:omniauth_callbacks=> "users/omniauth_callbacks"} - scope '(:locale)' do - scope '(t/:theme)' do - - get "wiki/:name", action: :wiki, controller: :wikis - resources :wikis do - member do - - end - end - end - - end - - # end - # end - scope '(:locale)' do - scope '(t/:theme)' do - # Studien - - scope '(:ansicht)' do - resources :studien, :only=>[:new,:edit,:update,:destroy,:show] do - member do - get :edit_lvas - end - end - end - - resources :modulgruppen,:only =>[:create,:index] do - end - - resources :studien,:except=>[:show,:new,:edit,:update,:destroy], :shallow=>true do - resources :modulgruppen, :path => "(:locale)/modulgruppen" - - end - get 'verwalten/studien', :controller=>:studien, :action=>:verwalten, :as=>'studien_verwalten' - - resources :fetzneditions - resources :galleries do - collection do - get 'verwalten' - end - resources :fotos - end - - resources :gremien do - collection do - get 'verwalten' - end - end - resources :fetprofiles do - collection do - get 'verwalten' - get 'internlist' - end - resources :memberships, :only => [:new, :edit, :update,:destroy,:create] - end - resources :lecturers - resources :semesters - resources :moduls do - member do - get 'edit_lvas' - post 'update_lvas' - get 'load_tiss' - post 'show_tiss' - end - collection do - get 'edit_bulk' - get 'new_bulk' - post 'update_bulk' - end - - end - resources :beispiele#, :only=>[:show,:index,:create] - resources :lvas do - member do - get 'compare_tiss' - get 'load_tiss' - end - resources :beispiele#, :only=>[:show,:index,:create] - - end - - resources :fragen - # get 'rubriken/verwalten', :controller=>:rubriken, :action=>:alle_verwalten, :as=>'alle_verwalten_rubrik' - #resources :neuigkeiten, :except => [:index] do - - #end - resources :neuigkeiten, :only =>[:show] - - resources :rubriken do - collection do - get 'verwalten' , :action => :alle_verwalten - get 'intern' - end - member do - get 'verwalten' - put 'addmoderator' - get 'removemoderator' - end - resources :neuigkeiten, :except => [:index] do - member do - get 'publish' - get 'unpublish' - get 'add_calentry' - get 'rm_calentry' - get 'create_link' - get 'find_link' - get 'publish_to_facebook' - end - end - end - - # put 'rubriken/(:id)/addmoderator',:controller=>:rubriken,:action=>:addmoderator - # get 'rubriken/:id/verwalten',:controller=>:rubriken,:action=>:verwalten, :as=>'verwalten_rubrik' - # get 'rubriken/verwalten',:controller=>:rubriken,:action=>:alle_verwalten, :as=>'rubriken_verwalten' - - resources :home, :only=>[:index] do - get :search, :on => :collection - collection do - get 'intern' - get 'admin' - get 'dev' - get 'startdev' - get 'linksnotimplemented' - get 'kontakt' - end +Fetsite::Application.routes.draw do + themes_for_rails + devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" } + resources :home, :only=>[:index] do + end + + scope '(:locale)/admin' do + resources :users, :only=>[] do + collection do + get :index + post :all_update + end + member do + get :fb_set_default_publish_page + end end - - resources :themen do - member do - get :attachments - get :fragen - get :verwalten - end - resources :attachments - end - - resources :themengruppen do - get :verwalten - get :verwalten_all,:on=>:collection - get :faqs, :on=>:collection - post :sort_themen - post :sort_themengruppen, :on=>:collection - resources :themen, :only=>[:new, :show] - end - - resources :calendars - get 'verwalten/calendars', :controller=>:calendars, :action=>:verwalten, :as=>'calendars_verwalten' - - resources :calentries - end + get 'users/:id/add_role/:role', :controller=>:users, :action=>:add_role, :as=>'user_add_role' + get 'users/:id/do_confirm', :controller=>:users, :action=>:do_confirm, :as=>'user_do_confirm' + get 'config',:controller=>:config,:action=>:index , :as => 'config' + end + devise_for :users , :controllers=>{:omniauth_callbacks=> "users/omniauth_callbacks"} + + scope '(:locale)' do + scope '(t/:theme)' do + get "wiki/:name", action: :wiki, controller: :wikis + resources :wikis + end + end + + scope '(:locale)' do + scope '(t/:theme)' do + + scope '(:ansicht)' do + resources :studien, :only=>[:new,:edit,:update,:destroy,:show] do + member do + get :edit_lvas + end + end + end + + resources :modulgruppen,:only =>[:create,:index] do + end + + resources :studien,:except=>[:show,:new,:edit,:update,:destroy], :shallow=>true do + resources :modulgruppen, :path => "(:locale)/modulgruppen" + end + get 'verwalten/studien', :controller=>:studien, :action=>:verwalten, :as=>'studien_verwalten' + + resources :lecturers + resources :semesters + resources :moduls do + member do + get 'edit_lvas' + post 'update_lvas' + get 'load_tiss' + post 'show_tiss' + end + collection do + get 'edit_bulk' + get 'new_bulk' + post 'update_bulk' + end + + end + resources :beispiele#, :only=>[:show,:index,:create] + resources :lvas do + member do + get 'compare_tiss' + get 'load_tiss' + end + resources :beispiele#, :only=>[:show,:index,:create] + + end + + resources :fetzneditions + resources :galleries do + collection do + get 'verwalten' + end + resources :fotos + end + + resources :gremien do + collection do + get 'verwalten' + end + end + resources :fetprofiles do + collection do + get 'verwalten' + get 'internlist' + end + end + + resources :fragen, :only =>[:new, :edit, :update, :destroy, :create] + + + + resources :rubriken do + collection do + get 'verwalten' , :action => :alle_verwalten + get 'intern' + end + member do + get 'verwalten' + put 'addmoderator' + get 'removemoderator' + end + + resources :neuigkeiten, :except => [:index] do + member do + get 'publish' + get 'unpublish' + get 'add_calentry' + get 'rm_calentry' + get 'create_link' + get 'find_link' + get 'publish_to_facebook' + end + end + end + + resources :home, :only=>[:index] do + get :search, :on => :collection + collection do + get 'intern' + get 'admin' + get 'dev' + get 'startdev' + get 'linksnotimplemented' + get 'kontakt' + end + end + + resources :themengruppen do + get :verwalten + get :verwalten_all,:on=>:collection + get :faqs, :on=>:collection + post :sort_themen + post :sort_themengruppen, :on=>:collection + resources :themen, :only=>[:new, :show] + end + + resources :themen do + member do + get :attachments + get :fragen + get :verwalten + end + resources :attachments + end + + resources :calendars + get 'verwalten/calendars', :controller=>:calendars, :action=>:verwalten, :as=>'calendars_verwalten' + resources :calentries + end + end + root :to => 'home#index' end - # The priority is based upon order of creation: - # first created -> highest priority. - # Sample of regular route: - # match 'products/:id' => 'catalog#view' - # Keep in mind you can assign values other than :controller and :action - - # Sample of named route: - # match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase - # This route can be invoked with purchase_url(:id => product.id) - - # Sample resource route (maps HTTP verbs to controller actions automatically): - # resources :products - - # Sample resource route with options: - # resources :products do - # member do - # get 'short' - # post 'toggle' - # end - # - # collection do - # get 'sold' - # end - # end - - # Sample resource route with sub-resources: - # resources :products do - # resources :comments, :sales - # resource :seller - # end - - # Sample resource route with more complex sub-resources - # resources :products do - # resources :comments - # resources :sales do - # get 'recent', :on => :collection - # end - # end - - # Sample resource route within a namespace: - # namespace :admin do - # # Directs /admin/products/* to Admin::ProductsController - # # (app/controllers/admin/products_controller.rb) - # resources :products - # end - - # You can have the root of your site routed with "root" - # just remember to delete public/index.html. - - root :to => 'home#index' - - # See how all your routes lay out with "rake routes" - - # This is a legacy wild controller route that's not recommended for RESTful applications. - # Note: This route will make all actions in every controller accessible via GET requests. - # match ':controller(/:action(/:id))(.:format)' - end - From b76818eaab1ee284d106a1f675284f2d12b84871 Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Thu, 26 Jun 2014 10:47:29 +0200 Subject: [PATCH 27/48] fix neuigkeit_path --- config/routes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/routes.rb b/config/routes.rb index 37c23ef..e5b55b0 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -95,7 +95,7 @@ Fetsite::Application.routes.draw do resources :fragen, :only =>[:new, :edit, :update, :destroy, :create] - + resources :neuigkeiten, :only => [:show] resources :rubriken do collection do get 'verwalten' , :action => :alle_verwalten From 38716d7a588b05304ff608082cd7c2a21684b9ba Mon Sep 17 00:00:00 2001 From: Andreas Stephanides Date: Sat, 28 Jun 2014 18:11:46 +0530 Subject: [PATCH 28/48] neuigkeiten form --- app/controllers/neuigkeiten_controller.rb | 8 +-- app/views/neuigkeiten/_form.html.erb | 57 ++++++++++--------- .../neuigkeiten/_nlink_list_search.html.erb | 2 +- app/views/neuigkeiten/edit.html.erb | 2 +- app/views/neuigkeiten/show.html.erb | 2 +- app/views/themen/update.js.erb | 2 +- config/locales/neuigkeiten.de.yml | 4 ++ config/locales/themen.de.yml | 1 + config/tinymce.yml | 16 ++++++ 9 files changed, 59 insertions(+), 35 deletions(-) diff --git a/app/controllers/neuigkeiten_controller.rb b/app/controllers/neuigkeiten_controller.rb index 8d05e84..8867f72 100755 --- a/app/controllers/neuigkeiten_controller.rb +++ b/app/controllers/neuigkeiten_controller.rb @@ -36,7 +36,7 @@ class NeuigkeitenController < ApplicationController if params[:calentry_id].nil? ce = Calentry.new(:start=>Time.now, :ende=>1.hour.from_now, :typ=>1, :calendar=>@neuigkeit.rubrik.calendar) else - ce=Calentry.find(params[:calentry_id]) + ce = Calentry.find(params[:calentry_id]) end @calentry=ce ce.object=@neuigkeit @@ -148,10 +148,10 @@ private def load_toolbar_elements @neuigkeit=Neuigkeit.find(params[:id]) @toolbar_elements=[] - @toolbar_elements << {:hicon=>'icon-plus', :text=> I18n.t('neuigkeit.publish'),:path => publish_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:confirm=>'Sure?' } if can?(:publish, @neuigkeit) && !@neuigkeit.published? - @toolbar_elements << {:hicon=>'icon-facebook', :text=> I18n.t('neuigkeit.publish')+" to facebook",:path => publish_to_facebook_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=> I18n.t('neuigkeit.publish_sure') } if can?(:publish, @neuigkeit) && !@neuigkeit.published? + @toolbar_elements << {:hicon=>'icon-facebook', :text=> I18n.t('neuigkeit.publishfb'),:path => publish_to_facebook_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:confirm=>I18n.t('neuigkeit.publishfb_sure') } if can?(:publish, @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? + @toolbar_elements << {:hicon=>'icon-minus', :text=> I18n.t('neuigkeit.unpublish'),:path => unpublish_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:confirm=> I18n.t('neuigkeit.unpublish_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 diff --git a/app/views/neuigkeiten/_form.html.erb b/app/views/neuigkeiten/_form.html.erb index 72fced6..e92ea7b 100755 --- a/app/views/neuigkeiten/_form.html.erb +++ b/app/views/neuigkeiten/_form.html.erb @@ -1,37 +1,40 @@ <%= tinymce_assets %>
    -<%= semantic_form_for [@neuigkeit.rubrik,@neuigkeit] do |f| %> + <%= 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 :rubrik, :as=> :radio, :collection=>Rubrik.all %> +
    +
    + <%= f.input :title, :placeholder=> "Titel" %> + <%= f.input :text, :as=> :tinymce_text %> +
    +
    +
    +
    + <% f.input :datum, :as=> :datepicker %> + <%= f.input :rubrik, :as=> :radio, :collection=>Rubrik.all %> +
    +
    + <%= f.input :author, :as=> :select %> +
    -
    - <%= f.input :author, :as=> :select %> +
    +
    + <%= f.input :picture, :as=> :file %> +
    -
    -
    -
    - <%= f.input :picture, :as=> :file %> -
    -
    - -<%= f.semantic_fields_for :calentries , @calentries do |calentry| %> -<%= render 'calentries/nested_fields', :f => calentry %> - <% end %> - + + <%= f.semantic_fields_for :calentries , @calentries do |calentry| %> + <%= render 'calentries/nested_fields', :f => calentry %> + <% end %> + <% end %> <%= f.actions do %> - <%= f.action :submit, :as => :input %> + <%= f.action :submit, :as => :input %> + <% end %> <% end %> -<% end %>
    - + <%= tinymce %> diff --git a/app/views/neuigkeiten/_nlink_list_search.html.erb b/app/views/neuigkeiten/_nlink_list_search.html.erb index b8521af..be5a2c9 100644 --- a/app/views/neuigkeiten/_nlink_list_search.html.erb +++ b/app/views/neuigkeiten/_nlink_list_search.html.erb @@ -1,7 +1,7 @@
  • <%= link_to nlink_list_search.title, nlink_list_search %> -<%= link_to "add:"+nlink_list_search.title, create_link_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit, :link_id=>nlink_list_search.id, :link_type=>nlink_list_search.class.to_s) %> + <%= link_to "add:"+nlink_list_search.title, create_link_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit, :link_id=>nlink_list_search.id, :link_type=>nlink_list_search.class.to_s) %>
    <% p = nlink_list_search.class.to_s.downcase.pluralize+"/nlink" %> <%= render :partial=>p, :object=>nlink_list_search %> diff --git a/app/views/neuigkeiten/edit.html.erb b/app/views/neuigkeiten/edit.html.erb index d9bec4c..8c8b5a9 100755 --- a/app/views/neuigkeiten/edit.html.erb +++ b/app/views/neuigkeiten/edit.html.erb @@ -1,4 +1,4 @@ -

    Editing neuigkeit

    +

    <%= I18n.t("neuigkeit.edit") %>

    <%= %> <%= render 'form' %> <%= render 'layouts/pretty_toolbar' %> diff --git a/app/views/neuigkeiten/show.html.erb b/app/views/neuigkeiten/show.html.erb index 1dcc02e..0021b45 100755 --- a/app/views/neuigkeiten/show.html.erb +++ b/app/views/neuigkeiten/show.html.erb @@ -28,7 +28,7 @@ <%= render 'layouts/pretty_toolbar', :object=> @toolbar_elements %>
    -<%= I18n.t("neuigekeit.sieheauch") %> +<%= I18n.t("neuigkeit.sieheauch") %>
    -