diff --git a/app/assets/stylesheets/formtastic-changes.css.scss b/app/assets/stylesheets/formtastic-changes.css.scss index ea322e8..608dce6 100644 --- a/app/assets/stylesheets/formtastic-changes.css.scss +++ b/app/assets/stylesheets/formtastic-changes.css.scss @@ -1,6 +1,9 @@ form.formtastic .stringish input { width:90%; } +form.formtastic select { +width:90% +} form.formtastic textarea { width:90%; height:20em; diff --git a/app/models/lva.rb b/app/models/lva.rb index 307133c..411d913 100755 --- a/app/models/lva.rb +++ b/app/models/lva.rb @@ -16,6 +16,7 @@ # class Lva < ActiveRecord::Base + ERLAUBTE_TYPEN = ['VO', 'UE', 'VU', 'LU', 'SE', 'andere']; has_paper_trail # Versionsverfolgung attr_accessible :desc, :ects, :lvanr, :name, :stunden, :modul_ids, :semester_ids, :pruefungsinformation, :lernaufwand, :typ has_and_belongs_to_many :modul # Gehört zu einem Modul @@ -27,9 +28,8 @@ class Lva < ActiveRecord::Base validates :lvanr,:format=>{ :with => /^[0-9][0-9][0-9]\.[0-9][0-9][0-9]$/}, :presence=>true, :uniqueness=>true # , :uniqueness=>true # LVA-Nummer muss das Format 000.000 besitzen (uniqueness?) oder 000 für nicht validates_presence_of :ects # ECTS vorhanden? - validates :name, :presence=>true - validates :name, :uniqueness=>true# Name Eingetragen? - validates :typ, :presence=>true + validates :name, :presence=>true, :uniqueness=>true# Name Eingetragen? + validates :typ, :presence=>true, :inclusion=> ERLAUBTE_TYPEN validates_presence_of :stunden # Stunden Eingetragen? validates_presence_of :modul # Zugehöriges Modul eingetragen? (zumindest eines) def add_semesters diff --git a/app/views/lvas/_form.html.erb b/app/views/lvas/_form.html.erb index 5aa9135..ec38a70 100755 --- a/app/views/lvas/_form.html.erb +++ b/app/views/lvas/_form.html.erb @@ -8,9 +8,8 @@