forked from bofh/fetsite
Kleinigkeiten
This commit is contained in:
@@ -10,8 +10,9 @@ class LvasController < ApplicationController
|
||||
|
||||
def show
|
||||
@lva = Lva.find_by_id(params[:id])
|
||||
@toolbar_elements<<{:icon=>:pencil,:text =>I18n.t('common.edit'),:path => edit_lva_path(@lva)}
|
||||
@toolbar_elements<<{:icon=>:plus, :text => "Neues Beispiel", :path=> new_beispiel_path(:lva_id =>@lva.id)}
|
||||
|
||||
@toolbar_elements<<{:hicon=>'icon-plus-sign', :icon=>:plus, :text => "Neues Beispiel", :path=> new_beispiel_path(:lva_id =>@lva.id)}
|
||||
@toolbar_elements<<{:hicon=>'icon-pencil', :icon=>:pencil,:text =>I18n.t('common.edit'),:path => edit_lva_path(@lva)}
|
||||
end
|
||||
|
||||
# GET /lvas/new
|
||||
|
||||
@@ -50,14 +50,17 @@ class ModulgruppenController < ApplicationController
|
||||
|
||||
def create
|
||||
@modulgruppe = Modulgruppe.new(params[:modulgruppe])
|
||||
|
||||
if !params[:studium_id].nil?
|
||||
@studium=Studium.find_by_id(params[:studium_id])
|
||||
else
|
||||
@studium=Studium.find_by_id(params[:modulgruppe][:studium_id])
|
||||
end
|
||||
@modulgruppe.studium_id = params[:studium_id]
|
||||
respond_to do |format|
|
||||
|
||||
if @modulgruppe.save
|
||||
format.html { redirect_to @modulgruppe, notice: 'Modulgruppe was successfully created.' }
|
||||
format.html { redirect_to @studium, notice: 'Modulgruppe was successfully created.' }
|
||||
|
||||
else
|
||||
format.html { render action: "new" }
|
||||
|
||||
@@ -48,9 +48,10 @@ class StudienController < ApplicationController
|
||||
|
||||
def create
|
||||
@studium = Studium.new(params[:studium])
|
||||
@studium.batch_add_semester
|
||||
|
||||
respond_to do |format|
|
||||
if @studium.save
|
||||
@studium.batch_add_semester
|
||||
format.html { redirect_to url_for(@studium), notice: 'Studium was successfully created.' }
|
||||
else
|
||||
format.html { render action: "new" }
|
||||
|
||||
@@ -18,7 +18,7 @@ class Studium < ActiveRecord::Base
|
||||
|
||||
validates :typ, :inclusion => {:in => ["Bachelor","Master"] }
|
||||
validates :name, :uniqueness => true, :presence=>true
|
||||
validates :zahl, :format=>{:with=>/^0(33|66)[0-9]{3}$/}, :uniqueness => true
|
||||
validates :zahl, :presence=>true, :format=>{:with=>/^0(33|66)[0-9]{3}$/}, :uniqueness => true
|
||||
translates :desc,:shortdesc, :versioning =>true,:fallbacks_for_empty_translations => true
|
||||
|
||||
def batch_add_semester
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
|
||||
<p id="notice"><%= notice %></p>
|
||||
<p>
|
||||
<%= @lva.lvanr %>
|
||||
<b><%= @lva.name %> <%= @lva.ects %> ECTS/ <%= @lva.stunden %> Std</b>
|
||||
|
||||
<h2><%= @lva.lvanr %><%= @lva.name %> <%= @lva.ects %> ECTS/ <%= @lva.stunden %> Std</h2>
|
||||
|
||||
</p>
|
||||
<p>
|
||||
@@ -25,4 +25,4 @@
|
||||
|
||||
<% end %>
|
||||
</ul>
|
||||
<%= toolbar_html(@toolbar_elements) %>
|
||||
<%= render 'layouts/pretty_toolbar' %>
|
||||
|
||||
Reference in New Issue
Block a user