Merge branch 'master' of https://github.com/fetsite/fetsite
This commit is contained in:
@@ -99,3 +99,6 @@ box-shadow:none;
|
||||
#contentdiv{
|
||||
background: #FFFFFF
|
||||
}
|
||||
#contentdiv .container-fluid
|
||||
{ padding:0;
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
@@ -8,4 +8,7 @@ border: 1px solid #ccc;
|
||||
background: white;
|
||||
padding:10px;
|
||||
|
||||
}
|
||||
div .neuigkeit_block:hover {
|
||||
box-shadow: 1px 1px 2px 2px lightgray;
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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 }
|
||||
|
||||
@@ -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 }
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# == Schema Information
|
||||
#
|
||||
# Table name: calentries
|
||||
@@ -17,14 +18,13 @@ 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|
|
||||
validate do |entry|
|
||||
if entry.ende.nil?
|
||||
errors.add(:ende, "Es muss ein Endzeitpunkt vorhanden sein")
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
resourcify
|
||||
def get_public
|
||||
@@ -38,7 +38,11 @@ class Calentry < ActiveRecord::Base
|
||||
start.to_date
|
||||
end
|
||||
def name
|
||||
summary
|
||||
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) }
|
||||
|
||||
@@ -12,15 +12,15 @@
|
||||
#
|
||||
|
||||
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]) }
|
||||
|
||||
def fall2
|
||||
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
|
||||
|
||||
|
||||
@@ -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 %>
|
||||
|
||||
@@ -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>
|
||||
|
||||
13
app/views/gremien/index.html.erb
Normal file
13
app/views/gremien/index.html.erb
Normal 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>
|
||||
@@ -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>
|
||||
<%= link_to studium_path(studium, :ansicht=>'semesteransicht') ,{:class=>"studium"} do %>
|
||||
|
||||
<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>
|
||||
<%= !(studium.desc.to_s == "") ? studium.desc.html_safe : I18n.t("keine.beschreibung")%>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
resources :fotos
|
||||
end
|
||||
|
||||
resources :gremien, :except=>[:index] do
|
||||
resources :gremien do
|
||||
collection do
|
||||
get 'verwalten'
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user