verwaltung, formulare...
This commit is contained in:
@@ -15,16 +15,16 @@
|
||||
#
|
||||
|
||||
class Fetprofile < ActiveRecord::Base
|
||||
attr_accessible :active, :desc, :fetmailalias, :nachname, :picture, :short, :vorname,:memberships_attributes
|
||||
attr_accessible :active, :desc, :fetmailalias, :nachname, :picture, :short, :vorname,:memberships_attributes,:remove_picture,:picture_cache
|
||||
has_many :memberships
|
||||
has_many :gremien, :through=> :membership
|
||||
mount_uploader :picture, PictureUploader
|
||||
def name
|
||||
[vorname, nachname, "(",short,")"].join(" ")
|
||||
[vorname, nachname, "(",short,")"].join(" ")
|
||||
end
|
||||
accepts_nested_attributes_for :memberships
|
||||
scope :active, -> { where(:active=>true).order(:vorname) }
|
||||
def fetmail
|
||||
fetmailalias.empty? ? short + "@fet.at" : fetmailalias + "@fet.at"
|
||||
fetmailalias.empty? ? short + "@fet.at" : fetmailalias + "@fet.at"
|
||||
end
|
||||
end
|
||||
|
||||
@@ -12,15 +12,16 @@
|
||||
#
|
||||
|
||||
class Gremium < ActiveRecord::Base
|
||||
TYPEN={1=>"offiziell", 2=>"offiziell-temporär", 3 => "inoffiziell","inoffiziell-tempo"}
|
||||
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"}
|
||||
attr_accessible :desc, :name, :typ, :geschlecht,:thema_id
|
||||
has_many :memberships
|
||||
belongs_to :thema
|
||||
scope :tabs, { .where(:typ=> 1,:typ=>2)}
|
||||
scope :tabs, -> { where(:typ => [1,2]) }
|
||||
|
||||
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":"")
|
||||
Gremium::ART2FALL[self.geschlecht.to_i].to_s+" "+ self.name.to_s+ ((self.geschlecht.to_i==1||self.geschlecht.to_i==0)? "s":"")
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -33,7 +33,7 @@ class Neuigkeit < ActiveRecord::Base
|
||||
self.rubrik.public && self.datum >=Time.now.to_date
|
||||
end
|
||||
def publish
|
||||
self.datum = Time.now
|
||||
self.datum = Date.today
|
||||
end
|
||||
def reverse_publish
|
||||
self.datum = nil
|
||||
|
||||
Reference in New Issue
Block a user