annotations

This commit is contained in:
Andreas Stephanides
2013-08-23 12:01:14 +02:00
parent cfcf0be4d5
commit 6d925b1b3d
21 changed files with 274 additions and 48 deletions

View File

@@ -1,3 +1,14 @@
# == Schema Information
#
# Table name: attachments
#
# id :integer not null, primary key
# name :string(255)
# created_at :datetime not null
# updated_at :datetime not null
# thema_id :integer
#
class Attachment < ActiveRecord::Base
has_paper_trail
attr_accessible :name

View File

@@ -2,16 +2,13 @@
#
# Table name: beispiele
#
# id :integer not null, primary key
# name :string(255)
# desc :text
# lva_id :integer
# created_at :datetime not null
# updated_at :datetime not null
# file_file_name :string(255)
# file_content_type :string(255)
# file_file_size :integer
# file_updated_at :datetime
# id :integer not null, primary key
# name :string(255)
# desc :text
# lva_id :integer
# created_at :datetime not null
# updated_at :datetime not null
# beispieldatei :string(255)
#
class Beispiel < ActiveRecord::Base

View File

@@ -1,3 +1,15 @@
# == Schema Information
#
# Table name: calendars
#
# id :integer not null, primary key
# name :string(255)
# public :boolean
# created_at :datetime not null
# updated_at :datetime not null
# picture :string(255)
#
class Calendar < ActiveRecord::Base
attr_accessible :name, :public, :picture
has_and_belongs_to_many :calentries

View File

@@ -1,3 +1,16 @@
# == Schema Information
#
# Table name: calentries
#
# id :integer not null, primary key
# start :datetime
# ende :datetime
# summary :string(255)
# typ :integer
# created_at :datetime not null
# updated_at :datetime not null
#
class Calentry < ActiveRecord::Base
attr_accessible :ende, :start, :summary, :typ,:calendar_ids
has_and_belongs_to_many :calendars
@@ -8,6 +21,8 @@ class Calentry < ActiveRecord::Base
errors.add(:ende, "Es muss ein Endzeitpunkt vorhanden sein")
end
end
belongs_to :object, polymorphic: true
resourcify
def start_time
start

View File

@@ -1,3 +1,19 @@
# == Schema Information
#
# Table name: fetprofiles
#
# id :integer not null, primary key
# vorname :string(255)
# nachname :string(255)
# short :string(255)
# fetmailalias :string(255)
# desc :text
# picture :string(255)
# active :boolean
# created_at :datetime not null
# updated_at :datetime not null
#
class Fetprofile < ActiveRecord::Base
attr_accessible :active, :desc, :fetmailalias, :nachname, :picture, :short, :vorname
has_many :memberships

View File

@@ -1,3 +1,16 @@
# == Schema Information
#
# Table name: fetzneditions
#
# id :integer not null, primary key
# title :string(255)
# desc :text
# datum :date
# datei :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
class Fetznedition < ActiveRecord::Base
attr_accessible :datei, :datum, :desc, :title
end

View File

@@ -1,3 +1,16 @@
# == Schema Information
#
# Table name: fotos
#
# id :integer not null, primary key
# title :string(255)
# desc :text
# gallery_id :integer
# datei :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
class Foto < ActiveRecord::Base
attr_accessible :datei, :desc, :gallery_id, :title
belongs_to :gallery

View File

@@ -1,3 +1,15 @@
# == Schema Information
#
# Table name: fragen
#
# id :integer not null, primary key
# title :string(255)
# text :text
# created_at :datetime not null
# updated_at :datetime not null
# thema_id :integer
#
class Frage < ActiveRecord::Base
attr_accessible :text, :title, :thema_id
belongs_to :thema

View File

@@ -1,3 +1,15 @@
# == Schema Information
#
# Table name: galleries
#
# id :integer not null, primary key
# name :string(255)
# desc :text
# datum :date
# created_at :datetime not null
# updated_at :datetime not null
#
class Gallery < ActiveRecord::Base
attr_accessible :datum, :desc, :name
has_many :fotos

View File

@@ -1,3 +1,15 @@
# == Schema Information
#
# Table name: gremien
#
# id :integer not null, primary key
# name :string(255)
# desc :text
# typ :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
class Gremium < ActiveRecord::Base
attr_accessible :desc, :name, :typ
has_many :memberships

View File

@@ -1,3 +1,16 @@
# == Schema Information
#
# Table name: lecturers
#
# id :integer not null, primary key
# name :string(255)
# email :string(255)
# oid :integer
# picture :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
class Lecturer < ActiveRecord::Base
attr_accessible :email, :name, :oid, :picture, :remove_picture, :picture_cache, :lva_ids, :link
has_and_belongs_to_many :lvas

View File

@@ -1,4 +1,23 @@
# -*- coding: utf-8 -*-
# == Schema Information
#
# Table name: lvas
#
# id :integer not null, primary key
# name :string(255)
# desc :text
# ects :decimal(, )
# lvanr :string(255)
# stunden :decimal(, )
# created_at :datetime not null
# updated_at :datetime not null
# modul_id :integer
# semester_id :integer
# pruefungsinformation :text
# lernaufwand :text
# typ :string(255)
#
# == Schema Information
#
# Table name: lvas

View File

@@ -1,3 +1,17 @@
# == Schema Information
#
# Table name: memberships
#
# id :integer not null, primary key
# fetprofile_id :string(255)
# gremium_id :string(255)
# start :date
# stop :date
# typ :string(255)
# created_at :datetime not null
# updated_at :datetime not null
#
class Membership < ActiveRecord::Base
attr_accessible :fetprofile_id, :gremium_id, :start, :stop, :typ
belongs_to :fetprofile

View File

@@ -9,6 +9,7 @@
# rubrik_id :integer
# created_at :datetime not null
# updated_at :datetime not null
# author_id :integer
#
class Neuigkeit < ActiveRecord::Base
@@ -19,4 +20,6 @@ class Neuigkeit < ActiveRecord::Base
validates :rubrik, :presence=>true
validates :author, :presence=>true
translates :title,:text, :versioning=>true, :fallbacks_for_empty_translations => true
scope :published, -> {where("datum >= ?", Time.now.to_date)}
end

View File

@@ -1,4 +1,19 @@
# -*- coding: utf-8 -*-
# == Schema Information
#
# Table name: studien
#
# id :integer not null, primary key
# zahl :string(255)
# name :string(255)
# shortdesc :text
# desc :text
# typ :string(255)
# created_at :datetime not null
# updated_at :datetime not null
# abkuerzung :string(255)
#
# == Schema Information
#
# Table name: studien

View File

@@ -1,3 +1,15 @@
# == Schema Information
#
# Table name: themen
#
# id :integer not null, primary key
# title :string(255)
# text :text
# created_at :datetime not null
# updated_at :datetime not null
# themengruppe_id :integer
#
class Thema < ActiveRecord::Base
attr_accessible :text, :title, :themengruppe_id
has_many :fragen

View File

@@ -1,3 +1,14 @@
# == Schema Information
#
# Table name: themengruppen
#
# id :integer not null, primary key
# title :string(255)
# text :text
# created_at :datetime not null
# updated_at :datetime not null
#
class Themengruppe < ActiveRecord::Base
WORD_COUNT = 50
attr_accessible :text, :title

View File

@@ -21,11 +21,12 @@
<%= semantic_fields_for m do |mf| %>
<div class="row-fluid">
<div class="span1"></div>
<%= mf.inputs do %>
<div class="span3"><%= mf.input :start, :as=>:date %></div>
<div class="span3"><%= mf.input :stop %></div>
<div class="span3"><%= mf. input :gremium %></div>
<div class="span2"><%= mf.input :typ ,:as=>:radio, :collection=>{"mitglied"=>1, "ersatzmitglied"=>2} %></div>
<% end %>
</div>
<% end %>
<% end

View File

@@ -1,3 +1,4 @@
<h2><%= link_to neuigkeit.title,neuigkeit_path(neuigkeit) %></h2>
<%= if !neuigkeit.author.nil?
neuigkeit.author.email

View File

@@ -1,14 +1,30 @@
<ul class="breadcrumb">
<li><%= link_to "Neuigkeiten", rubriken_path %></li>
<li><span class="divider">/</span></li>
<li><%= link_to @neuigkeit.rubrik.name , rubrik_path(@neuigkeit.rubrik) %> </li>
</ul>
<p id="notice"><%= notice %></p>
<%= render @neuigkeit %>
<p>
<b>Datum:</b>
<%= @neuigkeit.datum %>
</p>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12">
<%= render 'rubriken/tabs' %>
<p id="notice"><%= notice %></p>
</div>
</div>
<div class="row-fluid">
<div class="span9">
<%= @neuigkeit.rubrik.name %>
</div>
<div class="span3"><p>
<%= @neuigkeit.try(:author).email.to_s %> am
<%= I18n.l @neuigkeit.datum.to_date %></p>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<div class="media">
<div class="pull-right" href="#">
<p><br><%= "FOTO" %></p>
</div>
<div class="media-body">
<h1><%= link_to @neuigkeit.title,neuigkeit_path(@neuigkeit) %></h1>
<%= raw(@neuigkeit.text) %>
</div>
</div>
</div>
<%= toolbar_html (@toolbar_elements) %>