This commit is contained in:
HausdorffHimself
2013-09-12 00:58:52 +02:00
13 changed files with 74 additions and 24 deletions

View File

@@ -99,3 +99,6 @@ box-shadow:none;
#contentdiv{
background: #FFFFFF
}
#contentdiv .container-fluid
{ padding:0;
}

View File

@@ -1,3 +1,7 @@
// Place all the styles related to the fetprofiles controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
ul.fetprofile_list li a {
display:block
}

View File

@@ -9,3 +9,6 @@ background: white;
padding:10px;
}
div .neuigkeit_block:hover {
box-shadow: 1px 1px 2px 2px lightgray;
}

View File

@@ -16,3 +16,9 @@ border-radius:2px;
border-color: blue;
margin: 5px;
}
a.studium {
display:block
}
a.studium:hover {
box-shadow: 1px 1px 2px 2px lightgray;
}

View File

@@ -5,7 +5,7 @@ class FetprofilesController < ApplicationController
@fetprofiles = Fetprofile.active.order(:vorname,:nachname)
@fetprofiles = Fetprofile.order(:vorname,:nachname) if params[:filter]== "all"
@gremientabs=Gremium.order(:typ)
@gremientabs=Gremium.tabs
respond_to do |format|
format.html # index.html.erb
format.json { render json: @fetprofiles }

View File

@@ -4,7 +4,7 @@ class GremienController < ApplicationController
before_filter {@toolbar_elements=[]}
def verwalten
@gremien = Gremium.all
@gremientabs=Gremium.all
@gremientabs=Gremium.tabs
@toolbar_elements << {:text=>I18n.t('common.new'),:path=>new_gremium_path() ,:icon=>:plus} if can? :new, Gremium
respond_to do |format|
format.html # index.html.erb
@@ -12,11 +12,18 @@ class GremienController < ApplicationController
end
end
def index
@gremien = Gremium.order(:typ).order(:name)
@gremientabs=Gremium.tabs
end
# GET /gremien/1
# GET /gremien/1.json
def show
@gremium = Gremium.find(params[:id])
@gremientabs=Gremium.order(:typ)
@gremientabs=Gremium.tabs
respond_to do |format|
format.html # show.html.erb
format.json { render json: @gremium }

View File

@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
# == Schema Information
#
# Table name: calentries
@@ -17,7 +18,7 @@ class Calentry < ActiveRecord::Base
validates :start, :presence => true
validates :typ, :presence => true
before_save :get_public
belongs_to :object, polymorphic: true
belongs_to :object, polymorphic: true # Objekt zu dem der Calentry gehört (derzeit ein Newsartikel)
validate do |entry|
if entry.ende.nil?
@@ -25,7 +26,6 @@ class Calentry < ActiveRecord::Base
end
end
resourcify
def get_public
self.public = (self.try(:object).nil?)? (self.calendars.public.count>0) : object.try(:public)
@@ -38,8 +38,12 @@ class Calentry < ActiveRecord::Base
start.to_date
end
def name
unless self.object.nil?
self.object.name
else
summary
end
end
scope :public, -> { where(:public => :true) }
scope :upcoming, -> { where("start >= ?" , Time.now).where("start <= ?", 8.days.from_now) }
end

View File

@@ -12,14 +12,14 @@
#
class Gremium < ActiveRecord::Base
TYPEN={1=>"offiziell", 2=>"offiziell-temporaer", 3 => "inoffiziell",4=>"inoffiziell-tempo"}
GESCHLECHT={0=>"saechlich", 1 => "maennlich", 2 => "weiblich"}
ART2FALL={0=>"des", 1=>"des",2=>"der"}
TYPEN={1=>"offiziell", 2=>"offiziell-temporär", 3 => "inoffiziell",4=>"inoffiziell-tempo"} # Kategorien, im Wesentlichen wichtig für Listung oder nicht Listung
GESCHLECHT={0=>"saechlich", 1 => "maennlich", 2 => "weiblich"} # Geschlecht des Gremiums zur richtige Deklination
ART2FALL={0=>"des", 1=>"des",2=>"der"} # Artikel 2.Fall abhängig vom Geschlecht
attr_accessible :desc, :name, :typ, :geschlecht,:thema_id
has_many :memberships
belongs_to :thema
scope :tabs, -> { where(:typ => [1,2]) }
has_many :memberships # Mitgliedschaften bei dem Gremium
belongs_to :thema # Gehört zu einem Thema
scope :tabs, -> { where(:typ => [1,3]).order(:typ).order(:name) } # Gremien die in Tabs angezeigt werden (Alle Anderen nur in der Liste
# Gremium im 2. Fall für die Konstruktion "Mitglied des ... / der ... "
def fall2
Gremium::ART2FALL[self.geschlecht.to_i].to_s+" "+ self.name.to_s+ ((self.geschlecht.to_i==1||self.geschlecht.to_i==0)? "s":"")
end

View File

@@ -1,7 +1,7 @@
<ul class="nav nav-tabs">
<li <%= (request.fullpath == fetprofiles_path(filter: "active")|| request.fullpath == fetprofiles_path) ? 'class="active"'.html_safe : ''%> >
<%= link_to "Aktive Mitglieder" , fetprofiles_path( filter: "active") %> </li>
<li><%= link_to "Alle Gremien und Gruppen", gremien_path %></li>
<% for g in @gremientabs %>
<li <%= (!@gremium.nil? && g == @gremium) ? 'class="active"'.html_safe : '' %> title="<%= g.name %>">
<%= link_to g.name, g %>

View File

@@ -5,19 +5,21 @@
<%= I18n.t 'fetprofiles.active' if params[:filter].nil? || params[:filter]== "active"
%>
</h1>
<ul class="unstyled">
<ul class="unstyled fetprofile_list">
<% @fetprofiles.each do |fetprofile| %>
<li>
<%= link_to fetprofile do %>
<div class="media">
<span class="pull-left">
<%= image_tag fetprofile.picture.portrait.url %>
</span>
<div class="">
<div class="media-body">
<h2><%= fetprofile.name %></h2>
<p><%= fetprofile.fetmail %></p>
<p><%= fetprofile.desc %></p>
</div>
</div>
<% end %>
</li>

View File

@@ -0,0 +1,13 @@
<%= render 'fetprofiles/tabs' %>
<h1>Alle Gremien</h1>
<ul class="unstyled fetprofile_list">
<% @gremien.each do |g| %>
<li>
<%= link_to g do %>
<h2><%= g.name %></h2>
<p><%= g.desc %></p>
<% end %>
</li>
<% end %>
</ul>

View File

@@ -1,6 +1,14 @@
<div class="studium">
<h2><%= link_to studium.name + " " + studium.zahl.to_s, studium_path(studium, :ansicht=>'semesteransicht')%></h2> <p><b><%= studium.typ%> </b></p>
<p><b><%=I18n.t("studien.desc")%>:</b><br>
<%= !(studium.desc.to_s == "") ? studium.desc.html_safe : I18n.t("keine.beschreibung")%></p>
<%= link_to studium_path(studium, :ansicht=>'semesteransicht') ,{:class=>"studium"} do %>
</div>
<h2>
<%= studium.name + " " + studium.zahl.to_s %>
</h2>
<p>
<b><%= studium.typ%> </b>
</p>
<p><b><%=I18n.t("studien.desc")%>:</b><br>
<%= !(studium.desc.to_s == "") ? studium.desc.html_safe : I18n.t("keine.beschreibung")%>
</p>
<% end %>

View File

@@ -35,7 +35,7 @@
resources :fotos
end
resources :gremien, :except=>[:index] do
resources :gremien do
collection do
get 'verwalten'
end