diff --git a/app/assets/stylesheets/application.css.scss b/app/assets/stylesheets/application.css.scss index 73a6def..25ee93f 100755 --- a/app/assets/stylesheets/application.css.scss +++ b/app/assets/stylesheets/application.css.scss @@ -78,7 +78,7 @@ div.header { .navbar .nav li { - min-width:60%; + min-width:100%; } .navbar .nav .divider { border-style: solid; diff --git a/app/controllers/config_controller.rb b/app/controllers/config_controller.rb index 2c13eb3..2192afb 100755 --- a/app/controllers/config_controller.rb +++ b/app/controllers/config_controller.rb @@ -2,12 +2,5 @@ class ConfigController < ApplicationController def index end - def get_git_update - g = Git.open(".") - flash[:notice] ="Test" - flash[:notice] =g.remote("fetsite").fetch - redirect_to config_url - - end end diff --git a/app/models/calendar.rb b/app/models/calendar.rb index 9f2826e..2d817cb 100644 --- a/app/models/calendar.rb +++ b/app/models/calendar.rb @@ -14,6 +14,7 @@ class Calendar < ActiveRecord::Base attr_accessible :name, :public, :picture has_and_belongs_to_many :calentries mount_uploader :picture, PictureUploader + belongs_to :rubrik resourcify scope :public, -> { where(:public => :true) } end diff --git a/app/models/rubrik.rb b/app/models/rubrik.rb index 6087ef8..a74198b 100755 --- a/app/models/rubrik.rb +++ b/app/models/rubrik.rb @@ -15,12 +15,13 @@ class Rubrik < ActiveRecord::Base has_many :neuigkeiten, :class_name => "Neuigkeit" has_many :calentries, :through => :neuigkeiten, :as=>:object resourcify -def moderator - u=User.with_role(:newsmoderator).first - if !u.nil? - u.id - end -end + has_one :calendar + def moderator + u=User.with_role(:newsmoderator).first + if !u.nil? + u.id + end + end end diff --git a/app/views/fetprofiles/index.html.erb b/app/views/fetprofiles/index.html.erb index f6889e8..861cb3e 100644 --- a/app/views/fetprofiles/index.html.erb +++ b/app/views/fetprofiles/index.html.erb @@ -1,36 +1,29 @@ -
-
-
- <%= render 'fetprofiles/tabs' %> -
-
-
-
-

- <%= I18n.t 'fetprofiles.all' if params[:filter] == "all" %> - <%= I18n.t 'fetprofiles.active' if params[:filter].nil? || params[:filter]== "active" - %> - - -

-
-
- <% @fetprofiles.each do |fetprofile| %> -
- <%= link_to fetprofile do %> -
- <%= image_tag fetprofile.picture.portrait.url %> -
-
- -

<%= fetprofile.name %>

-

<%= fetprofile.fetmail %>

-

<%= fetprofile.desc %>

- -
<% end %> + +<%= render 'fetprofiles/tabs' %> +

+ <%= I18n.t 'fetprofiles.all' if params[:filter] == "all" %> + <%= I18n.t 'fetprofiles.active' if params[:filter].nil? || params[:filter]== "active" + %> +

+
-
-<%= link_to 'New Fetprofile', new_fetprofile_path %> +
+ <%= link_to I18n.t('fetprofiles.new'), new_fetprofile_path %>
diff --git a/app/views/fetprofiles/show.html.erb b/app/views/fetprofiles/show.html.erb index 8fbfbf9..bf632cc 100644 --- a/app/views/fetprofiles/show.html.erb +++ b/app/views/fetprofiles/show.html.erb @@ -1,40 +1,40 @@

<%= notice %>

-
- <%= image_tag @fetprofile.picture.portrait.url %> -
-
-

<%= @fetprofile.name %>

+
+ <%= image_tag @fetprofile.picture.portrait.url %> +
+
+

<%= @fetprofile.name %>

-

- <%= @fetprofile.fetmailalias %> -

-

- <%= @fetprofile.desc %> -

-

- <%= "Aktiv".html_safe if @fetprofile.active %> -

-

<%= link_to 'Destroy', @fetprofile, method: :delete, data: { confirm: 'Are you sure?' } %>

-
-
+

+ <%= @fetprofile.fetmailalias %> +

+

+ <%= @fetprofile.desc %> +

+

+ <%= ""+I18n.t('fetprofiles.active')+"".html_safe if @fetprofile.active %> +

+

<%= link_to 'Destroy', @fetprofile, method: :delete, data: { confirm: 'Are you sure?' } %>

+
+
-
-
    +
    +
      <% @fetprofile.memberships.each do |m| %> -
    • -<%= render m %> -<% link_to 'edit', edit_fetprofile_membership_path(@fetprofile,m) %> -
    • +
    • + <%= render m %> + <% link_to 'edit', edit_fetprofile_membership_path(@fetprofile,m) %> +
    • <% end %> -
    +
-<%= link_to 'Neue Mitgliedschaft', new_fetprofile_membership_path(@fetprofile) %> | + <%= link_to 'Neue Mitgliedschaft', new_fetprofile_membership_path(@fetprofile) %> | -<%= link_to 'Edit', edit_fetprofile_path(@fetprofile) %> | -<%= link_to 'Back', fetprofiles_path %> -
+ <%= link_to 'Edit', edit_fetprofile_path(@fetprofile) %> | + <%= link_to 'Back', fetprofiles_path %> +
diff --git a/app/views/galleries/index.html.erb b/app/views/galleries/index.html.erb index e2d0418..657280f 100644 --- a/app/views/galleries/index.html.erb +++ b/app/views/galleries/index.html.erb @@ -1,4 +1,4 @@ -

Listing galleries

+

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

<%= %>
@@ -23,4 +23,4 @@
-<%= link_to 'New Gallery', new_gallery_path %> +<%= link_to I18n.t('fotos.new-gallery'), new_gallery_path %> diff --git a/app/views/gremien/show.html.erb b/app/views/gremien/show.html.erb index 039dd86..0383c88 100644 --- a/app/views/gremien/show.html.erb +++ b/app/views/gremien/show.html.erb @@ -1,41 +1,31 @@ +<%= render 'fetprofiles/tabs' %> +

<%= notice %>

-
-
- <%= render 'fetprofiles/tabs' %> -

<%= notice %>

-
-
-
-
-

- <%= @gremium.name %> -

- <% Gremium::TYPEN[@gremium.typ.to_i].to_s %> -

- <%= @gremium.desc %> -

-
-
- - - <% @gremium.memberships.order(:typ).active.each_slice(4) do |r| %> -
<% r.each do |m| %> - <%= link_to m.fetprofile do %> -
- <%= image_tag m.fetprofile.picture.portrait %> -

- <%= m.fetprofile.name %>
<%= render(m) %> -

-
- <% end %> - <% end %> -
- - <% end %> - - - <%= link_to 'Edit', edit_gremium_path(@gremium) %> | -
-
+
+

+ <%= @gremium.name %> +

+ <% Gremium::TYPEN[@gremium.typ.to_i].to_s %> +

+ <%= @gremium.desc %> +

+
+ <% @gremium.memberships.order(:typ).active.each_slice(4) do |r| %> +
+ <% r.each do |m| %> + <%= link_to m.fetprofile do %> +
+ <%= image_tag m.fetprofile.picture.portrait %> +

+ <%= m.fetprofile.name %>
+ <%= render(m) %> +

+
+ <% end %> + <% end %> +
+ <% end %> + <%= link_to I18n.t('common.edit'), edit_gremium_path(@gremium) %> + diff --git a/app/views/neuigkeiten/index.html.erb b/app/views/neuigkeiten/index.html.erb deleted file mode 100755 index b66a76d..0000000 --- a/app/views/neuigkeiten/index.html.erb +++ /dev/null @@ -1,27 +0,0 @@ -

Listing neuigkeiten

- - - - - - - - - - - -<% @neuigkeiten.each do |neuigkeit| %> - - - - - - - - -<% end %> -
TitleTextDatum
<%= neuigkeit.title %><%= neuigkeit.text %><%= neuigkeit.datum %><%= link_to 'Show', neuigkeit %><%= link_to 'Edit', edit_neuigkeit_path(neuigkeit) %><%= link_to 'Destroy', neuigkeit, method: :delete, data: { confirm: 'Are you sure?' } %>
- -
- -<%= link_to 'New Neuigkeit', new_neuigkeit_path %> diff --git a/app/views/neuigkeiten/show.html.erb b/app/views/neuigkeiten/show.html.erb index 8d5e5c0..e2162ef 100755 --- a/app/views/neuigkeiten/show.html.erb +++ b/app/views/neuigkeiten/show.html.erb @@ -1,32 +1,23 @@ -
-
-
- <%= render 'rubriken/tabs' %> -

<%= notice %>

-
-
-
-
- <%= @neuigkeit.rubrik.name %> -
-
+<%= render 'rubriken/tabs' %> +

<%= notice %>

- <%= @neuigkeit.author.email.to_s unless @neuigkeit.try(:author).try(:email).to_s %> - <%= "am " + I18n.l(@neuigkeit.try(:datum).try(:to_date)) unless @neuigkeit.try(:datum).try(:to_date).nil? %> -
+ + <%= @neuigkeit.rubrik.name %> + + + <%= @neuigkeit.author.email.to_s unless @neuigkeit.try(:author).try(:email).to_s %> + <%= "am " + I18n.l(@neuigkeit.try(:datum).try(:to_date)) unless @neuigkeit.try(:datum).try(:to_date).nil? %> + +
+
+


<%= link_to image_tag(@neuigkeit.picture.big_thumb.url),@neuigkeit.picture.url %> +

-
-
-
-
-


<%= link_to image_tag(@neuigkeit.picture.big_thumb.url),@neuigkeit.picture.url %>

-
-
-

<%= link_to @neuigkeit.title,rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit) %>

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

-
-
+
+

<%= link_to @neuigkeit.title,rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit) %>

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

+
<%= render 'layouts/pretty_toolbar', :object=> @toolbar_elements %> diff --git a/app/views/rubriken/index.html.erb b/app/views/rubriken/index.html.erb index 4fab085..bc7a2f5 100755 --- a/app/views/rubriken/index.html.erb +++ b/app/views/rubriken/index.html.erb @@ -2,10 +2,9 @@

<%= I18n.t("rubrik.title")%>

    -<% @neuigkeiten.each do |n| %> - -
  • <%= render n %>
  • -<% end %> + <% @neuigkeiten.each do |n| %> +
  • <%= render n %>
  • + <% end %>
diff --git a/app/views/rubriken/show.html.erb b/app/views/rubriken/show.html.erb index 18d9977..0c36e27 100755 --- a/app/views/rubriken/show.html.erb +++ b/app/views/rubriken/show.html.erb @@ -1,37 +1,34 @@ <%= render 'tabs' %> -

<%= notice %>

-
- -

<%= @rubrik.name %>

+ +

<%= @rubrik.name %>

- <%= @rubrik.desc %>

-Moderatoren: -<% @moderatoren.each do |m|%> -<%= m.email%>, -<% end%> -
-
+Moderatoren: + + <% @moderatoren.each do |m|%> + <%= m.email%>, + <% end%> + -<% @rubrik.neuigkeiten.each_slice(2) do |row| %> -
-<% row.each do |neuigkeit| %> -
-<%= render neuigkeit %> -
-<% end %> -
+<% @rubrik.neuigkeiten.each_slice(1) do |row| %> +
    + <% row.each do |neuigkeit| %> +
  • + <%= render neuigkeit %> +
  • + <% end %> +
<% end %> -
- -<%= link_to 'Verwalten', verwalten_rubrik_path(@rubrik) %> | -<%= link_to ''.html_safe+"Neuer Artikel", new_rubrik_neuigkeit_path(@rubrik) %> -
+ + <%= link_to 'Verwalten', verwalten_rubrik_path(@rubrik) %> | + <%= link_to ''.html_safe+"Neuer Artikel", new_rubrik_neuigkeit_path(@rubrik) %> + + <%= toolbar_html(@toolbar_elements)%> diff --git a/config/locales/de.yml b/config/locales/de.yml index d46a555..b08d2ca 100755 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -7,7 +7,7 @@ de: edit: "Bearbeiten" actions: "Aktionen" delete: "Löschen" - + verwalten: "Verwalten" home: mtitle: "Menu" willkommen: "Willkommen bei der Fachschaft Elektrotechnik" diff --git a/config/routes.rb b/config/routes.rb index 1bf686b..cf4b575 100755 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,4 @@ Fetsite::Application.routes.draw do - devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" } resources :home, :only=>[:index] #get 'home',:controller=>home,:action=>:index,:as=>"home_index" @@ -7,11 +6,9 @@ resources :users, :only => [:index] 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' - get 'config/get_git_update',:controller=>:config,:action=>:get_git_update, :as=>'config_getgitupdate' - get 'config/get_git_update',:controller=>:config,:action=>:get_git_update - end + + end devise_for :users