forked from bofh/fetsite
GitHub Account angelegt
This commit is contained in:
BIN
app/assets/images/edit.png
Normal file
BIN
app/assets/images/edit.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 692 B |
BIN
app/assets/images/fet_logo_2.png
Normal file
BIN
app/assets/images/fet_logo_2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 5.7 KiB |
BIN
app/assets/images/rails.png
Normal file
BIN
app/assets/images/rails.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 6.5 KiB |
17
app/assets/javascripts/application.js
Normal file
17
app/assets/javascripts/application.js
Normal file
@@ -0,0 +1,17 @@
|
||||
// This is a manifest file that'll be compiled into application.js, which will include all the files
|
||||
// listed below.
|
||||
//
|
||||
// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts,
|
||||
// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path.
|
||||
//
|
||||
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
|
||||
// the compiled file.
|
||||
//
|
||||
// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD
|
||||
// GO AFTER THE REQUIRES BELOW.
|
||||
//
|
||||
//= require jquery
|
||||
//= require jquery_ujs
|
||||
//= require_tree .
|
||||
//= require tinymce-jquery
|
||||
//= require bootstrap
|
||||
3
app/assets/javascripts/lvas.js.coffee
Normal file
3
app/assets/javascripts/lvas.js.coffee
Normal file
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
||||
3
app/assets/javascripts/modulgruppen.js.coffee
Normal file
3
app/assets/javascripts/modulgruppen.js.coffee
Normal file
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
||||
3
app/assets/javascripts/moduls.js.coffee
Normal file
3
app/assets/javascripts/moduls.js.coffee
Normal file
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
||||
3
app/assets/javascripts/neuigkeiten.js.coffee
Normal file
3
app/assets/javascripts/neuigkeiten.js.coffee
Normal file
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
||||
3
app/assets/javascripts/rubriken.js.coffee
Normal file
3
app/assets/javascripts/rubriken.js.coffee
Normal file
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
||||
3
app/assets/javascripts/semesters.js.coffee
Normal file
3
app/assets/javascripts/semesters.js.coffee
Normal file
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
||||
3
app/assets/javascripts/studia.js.coffee
Normal file
3
app/assets/javascripts/studia.js.coffee
Normal file
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
||||
3
app/assets/javascripts/studmods.js.coffee
Normal file
3
app/assets/javascripts/studmods.js.coffee
Normal file
@@ -0,0 +1,3 @@
|
||||
# Place all the behaviors and hooks related to the matching controller here.
|
||||
# All this logic will automatically be available in application.js.
|
||||
# You can use CoffeeScript in this file: http://jashkenas.github.com/coffee-script/
|
||||
35
app/assets/stylesheets/application.css.scss
Normal file
35
app/assets/stylesheets/application.css.scss
Normal file
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* This is a manifest file that'll be compiled into application.css, which will include all the files
|
||||
* listed below.
|
||||
*
|
||||
* Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets,
|
||||
* or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path.
|
||||
*
|
||||
* You're free to add application-wide styles to this file and they'll appear at the top of the
|
||||
* compiled file, but it's generally better to create a new file per style scope.
|
||||
*
|
||||
*= require_self
|
||||
*= require_tree .
|
||||
* require 'bootstrap'
|
||||
*/
|
||||
|
||||
@import 'bootstrap';
|
||||
@import 'bootstrap-responsive';
|
||||
h1
|
||||
{font-size: 23px}
|
||||
h2
|
||||
{font-size: 19px}
|
||||
body,html
|
||||
{padding:0;margin:0;}
|
||||
|
||||
div.header
|
||||
{display: block;
|
||||
background: url('/assets/fet_logo_2.png') rgb(200,200,200) no-repeat;
|
||||
background-position:15px center;
|
||||
height:60px;
|
||||
padding-left:160px;
|
||||
padding-top:0px;
|
||||
overflow:hidden
|
||||
}
|
||||
|
||||
|
||||
0
app/assets/stylesheets/layout.css.scss
Normal file
0
app/assets/stylesheets/layout.css.scss
Normal file
3
app/assets/stylesheets/lvas.css.scss
Normal file
3
app/assets/stylesheets/lvas.css.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the lvas controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
25
app/assets/stylesheets/modulgruppen.css.scss
Normal file
25
app/assets/stylesheets/modulgruppen.css.scss
Normal file
@@ -0,0 +1,25 @@
|
||||
// Place all the styles related to the modulgruppen controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
div.modulgruppe_phase_1, div.modulgruppe_phase_2, div.modulgruppe_phase_3
|
||||
{padding:10px;
|
||||
margin:2px;
|
||||
border-radius:10px;
|
||||
min-width:13em;
|
||||
}
|
||||
|
||||
div.modulgruppe_phase_1 , div.modulgruppe_phase_2
|
||||
{}
|
||||
|
||||
div.modulgruppe_phase_1
|
||||
{border: #91B4FF solid 2px;
|
||||
|
||||
}
|
||||
div.modulgruppe_phase_2
|
||||
{border: #FF7575 solid 2px;
|
||||
|
||||
}
|
||||
div.modulgruppe_phase_3
|
||||
{border: #41B300 solid 2px;
|
||||
|
||||
}
|
||||
3
app/assets/stylesheets/moduls.css.scss
Normal file
3
app/assets/stylesheets/moduls.css.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the moduls controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
3
app/assets/stylesheets/neuigkeiten.css.scss
Normal file
3
app/assets/stylesheets/neuigkeiten.css.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the neuigkeiten controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
4
app/assets/stylesheets/rubriken.css.scss
Normal file
4
app/assets/stylesheets/rubriken.css.scss
Normal file
@@ -0,0 +1,4 @@
|
||||
// Place all the styles related to the rubriken controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
|
||||
60
app/assets/stylesheets/scaffolds.css.scss
Normal file
60
app/assets/stylesheets/scaffolds.css.scss
Normal file
@@ -0,0 +1,60 @@
|
||||
body {
|
||||
background-color: #fff;
|
||||
color: #333;
|
||||
font-family: verdana, arial, helvetica, sans-serif;
|
||||
font-size: 13px;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
p, ol, ul, td {
|
||||
font-family: verdana, arial, helvetica, sans-serif;
|
||||
font-size: 13px;
|
||||
line-height: 18px;
|
||||
}
|
||||
|
||||
pre {
|
||||
background-color: #eee;
|
||||
padding: 10px;
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
|
||||
|
||||
div {
|
||||
&.field, &.actions {
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
#notice {
|
||||
color: green;
|
||||
}
|
||||
|
||||
.field_with_errors {
|
||||
padding: 2px;
|
||||
background-color: red;
|
||||
display: table;
|
||||
}
|
||||
|
||||
#error_explanation {
|
||||
width: 450px;
|
||||
border: 2px solid red;
|
||||
padding: 7px;
|
||||
padding-bottom: 0;
|
||||
margin-bottom: 20px;
|
||||
background-color: #f0f0f0;
|
||||
h2 {
|
||||
text-align: left;
|
||||
font-weight: bold;
|
||||
padding: 5px 5px 5px 15px;
|
||||
font-size: 12px;
|
||||
margin: -7px;
|
||||
margin-bottom: 0px;
|
||||
background-color: #c00;
|
||||
color: #fff;
|
||||
}
|
||||
ul li {
|
||||
|
||||
list-style: square;
|
||||
}
|
||||
}
|
||||
3
app/assets/stylesheets/semesters.css.scss
Normal file
3
app/assets/stylesheets/semesters.css.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the semesters controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
3
app/assets/stylesheets/studien.css.scss
Normal file
3
app/assets/stylesheets/studien.css.scss
Normal file
@@ -0,0 +1,3 @@
|
||||
// Place all the styles related to the studia controller here.
|
||||
// They will automatically be included in application.css.
|
||||
// You can use Sass (SCSS) here: http://sass-lang.com/
|
||||
18
app/controllers/application_controller.rb
Normal file
18
app/controllers/application_controller.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
class ApplicationController < ActionController::Base
|
||||
protect_from_forgery
|
||||
before_filter :set_i18n_locale_from_params
|
||||
protected
|
||||
def set_i18n_locale_from_params
|
||||
if params[:locale]
|
||||
if I18n.available_locales.include?(params[:locale].to_sym)
|
||||
I18n.locale=params[:locale].to_sym
|
||||
else
|
||||
flash.now[:notice]= "#{params[:locale]} translation not available"
|
||||
logger.error flash.now[:notice]
|
||||
end
|
||||
end
|
||||
end
|
||||
def default_url_options
|
||||
{locale: I18n.locale}
|
||||
end
|
||||
end
|
||||
6
app/controllers/home_controller.rb
Normal file
6
app/controllers/home_controller.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class HomeController < ApplicationController
|
||||
def index
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
84
app/controllers/lvas_controller.rb
Normal file
84
app/controllers/lvas_controller.rb
Normal file
@@ -0,0 +1,84 @@
|
||||
class LvasController < ApplicationController
|
||||
# GET /lvas
|
||||
# GET /lvas.json
|
||||
def index
|
||||
@lvas = Lva.all
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.json { render json: @lvas }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /lvas/1
|
||||
# GET /lvas/1.json
|
||||
def show
|
||||
@lva = Lva.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
format.html # show.html.erb
|
||||
format.json { render json: @lva }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /lvas/new
|
||||
# GET /lvas/new.json
|
||||
def new
|
||||
@lva = Lva.new
|
||||
modul=Modul.find(params[:modul_id])
|
||||
@lva.modul<<modul
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.json { render json: @lva }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /lvas/1/edit
|
||||
def edit
|
||||
@lva = Lva.find(params[:id])
|
||||
end
|
||||
|
||||
# POST /lvas
|
||||
# POST /lvas.json
|
||||
def create
|
||||
@lva = Lva.new(params[:lva])
|
||||
|
||||
respond_to do |format|
|
||||
if @lva.save
|
||||
format.html { redirect_to @lva, notice: 'Lva was successfully created.' }
|
||||
format.json { render json: @lva, status: :created, location: @lva }
|
||||
else
|
||||
format.html { render action: "new" }
|
||||
format.json { render json: @lva.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PUT /lvas/1
|
||||
# PUT /lvas/1.json
|
||||
def update
|
||||
@lva = Lva.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
if @lva.update_attributes(params[:lva])
|
||||
format.html { redirect_to @lva, notice: 'Lva was successfully updated.' }
|
||||
format.json { head :no_content }
|
||||
else
|
||||
format.html { render action: "edit" }
|
||||
format.json { render json: @lva.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /lvas/1
|
||||
# DELETE /lvas/1.json
|
||||
def destroy
|
||||
@lva = Lva.find(params[:id])
|
||||
@lva.destroy
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to lvas_url }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
end
|
||||
89
app/controllers/modulgruppen_controller.rb
Normal file
89
app/controllers/modulgruppen_controller.rb
Normal file
@@ -0,0 +1,89 @@
|
||||
class ModulgruppenController < ApplicationController
|
||||
# GET /modulgruppen
|
||||
# GET /modulgruppen.json
|
||||
|
||||
load_and_authorize_resource
|
||||
def index
|
||||
@modulgruppen = Modulgruppe.all
|
||||
if !params[:studium_id].nil?
|
||||
@studium=Studium.find(params[:studium_id])
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# GET /modulgruppen/1
|
||||
# GET /modulgruppen/1.json
|
||||
def show
|
||||
@modulgruppe = Modulgruppe.find(params[:id])
|
||||
if !params[:studium_id].nil?
|
||||
@studium=Studium.find(params[:studium_id])
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# GET /modulgruppen/new
|
||||
# GET /modulgruppen/new.json
|
||||
def new
|
||||
@modulgruppe = Modulgruppe.new
|
||||
if !params[:studium_id].nil?
|
||||
@studium=Studium.find(params[:studium_id])
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# GET /modulgruppen/1/edit
|
||||
def edit
|
||||
@modulgruppe = Modulgruppe.find(params[:id])
|
||||
if !params[:studium_id].nil?
|
||||
@studium=Studium.find(params[:studium_id])
|
||||
end
|
||||
end
|
||||
|
||||
# POST /modulgruppen
|
||||
# POST /modulgruppen.json
|
||||
def create
|
||||
@modulgruppe = Modulgruppe.new(params[:modulgruppe])
|
||||
if !params[:studium_id].nil?
|
||||
@studium=Studium.find(params[:studium_id])
|
||||
else
|
||||
@studium=Studium.find(params[:modulgruppe][:studium_id])
|
||||
end
|
||||
respond_to do |format|
|
||||
if @modulgruppe.save
|
||||
format.html { redirect_to @modulgruppe, notice: 'Modulgruppe was successfully created.' }
|
||||
format.json { render json: @modulgruppe, status: :created, location: @modulgruppe }
|
||||
else
|
||||
format.html { render action: "new" }
|
||||
format.json { render json: @modulgruppe.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PUT /modulgruppen/1
|
||||
# PUT /modulgruppen/1.json
|
||||
def update
|
||||
@modulgruppe = Modulgruppe.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
if @modulgruppe.update_attributes(params[:modulgruppe])
|
||||
format.html { redirect_to @modulgruppe, notice: 'Modulgruppe was successfully updated.' }
|
||||
format.json { head :no_content }
|
||||
else
|
||||
format.html { render action: "edit" }
|
||||
format.json { render json: @modulgruppe.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /modulgruppen/1
|
||||
# DELETE /modulgruppen/1.json
|
||||
def destroy
|
||||
@modulgruppe = Modulgruppe.find(params[:id])
|
||||
@modulgruppe.destroy
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to modulgruppen_url }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
end
|
||||
91
app/controllers/moduls_controller.rb
Normal file
91
app/controllers/moduls_controller.rb
Normal file
@@ -0,0 +1,91 @@
|
||||
class ModulsController < ApplicationController
|
||||
# GET /moduls
|
||||
# GET /moduls.json
|
||||
def index
|
||||
@moduls = Modul.all
|
||||
if !params[:studium_id].nil?
|
||||
@studium=Studium.find(params[:studium_id])
|
||||
end
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.json { render json: @moduls }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /moduls/1
|
||||
# GET /moduls/1.json
|
||||
def show
|
||||
@modul = Modul.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
format.html # show.html.erb
|
||||
format.json { render json: @modul }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /moduls/new
|
||||
# GET /moduls/new.json
|
||||
def new
|
||||
@modul = Modul.new
|
||||
modulgruppe=Modulgruppe.find(params[:modulgruppen_id])
|
||||
@modul.modulgruppen<<modulgruppe
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.json { render json: @modul }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /moduls/1/edit
|
||||
def edit
|
||||
@modul = Modul.find(params[:id])
|
||||
if !params[:studium_id].nil?
|
||||
@studium=Studium.find(params[:studium_id])
|
||||
end
|
||||
end
|
||||
|
||||
# POST /moduls
|
||||
# POST /moduls.json
|
||||
def create
|
||||
@modul = Modul.new(params[:modul])
|
||||
|
||||
|
||||
respond_to do |format|
|
||||
if @modul.save
|
||||
format.html { redirect_to modulgruppe_path(@modul.modulgruppen.first), notice: 'Modul was successfully created.' }
|
||||
format.json { render json: @modul, status: :created, location: @modul }
|
||||
else
|
||||
format.html { render action: "new" }
|
||||
format.json { render json: @modul.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
# PUT /moduls/1
|
||||
# PUT /moduls/1.json
|
||||
def update
|
||||
@modul = Modul.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
if @modul.update_attributes(params[:modul])
|
||||
format.html { redirect_to @modul, notice: 'Modul was successfully updated.' }
|
||||
format.json { head :no_content }
|
||||
else
|
||||
format.html { render action: "edit" }
|
||||
format.json { render json: @modul.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /moduls/1
|
||||
# DELETE /moduls/1.json
|
||||
def destroy
|
||||
@modul = Modul.find(params[:id])
|
||||
@modul.destroy
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to moduls_path() }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
end
|
||||
83
app/controllers/neuigkeiten_controller.rb
Normal file
83
app/controllers/neuigkeiten_controller.rb
Normal file
@@ -0,0 +1,83 @@
|
||||
class NeuigkeitenController < ApplicationController
|
||||
# GET /neuigkeiten
|
||||
# GET /neuigkeiten.json
|
||||
def index
|
||||
@neuigkeiten = Neuigkeit.all
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.json { render json: @neuigkeiten }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /neuigkeiten/1
|
||||
# GET /neuigkeiten/1.json
|
||||
def show
|
||||
@neuigkeit = Neuigkeit.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
format.html # show.html.erb
|
||||
format.json { render json: @neuigkeit }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /neuigkeiten/new
|
||||
# GET /neuigkeiten/new.json
|
||||
def new
|
||||
@neuigkeit = Neuigkeit.new
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.json { render json: @neuigkeit }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /neuigkeiten/1/edit
|
||||
def edit
|
||||
@neuigkeit = Neuigkeit.find(params[:id])
|
||||
end
|
||||
|
||||
# POST /neuigkeiten
|
||||
# POST /neuigkeiten.json
|
||||
def create
|
||||
@neuigkeit = Neuigkeit.new(params[:neuigkeit])
|
||||
|
||||
respond_to do |format|
|
||||
if @neuigkeit.save
|
||||
format.html { redirect_to @neuigkeit, notice: 'Neuigkeit was successfully created.' }
|
||||
format.json { render json: @neuigkeit, status: :created, location: @neuigkeit }
|
||||
else
|
||||
format.html { render action: "new" }
|
||||
format.json { render json: @neuigkeit.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PUT /neuigkeiten/1
|
||||
# PUT /neuigkeiten/1.json
|
||||
def update
|
||||
@neuigkeit = Neuigkeit.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
if @neuigkeit.update_attributes(params[:neuigkeit])
|
||||
format.html { redirect_to @neuigkeit, notice: 'Neuigkeit was successfully updated.' }
|
||||
format.json { head :no_content }
|
||||
else
|
||||
format.html { render action: "edit" }
|
||||
format.json { render json: @neuigkeit.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /neuigkeiten/1
|
||||
# DELETE /neuigkeiten/1.json
|
||||
def destroy
|
||||
@neuigkeit = Neuigkeit.find(params[:id])
|
||||
@neuigkeit.destroy
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to neuigkeiten_url }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
end
|
||||
93
app/controllers/rubriken_controller.rb
Normal file
93
app/controllers/rubriken_controller.rb
Normal file
@@ -0,0 +1,93 @@
|
||||
class RubrikenController < ApplicationController
|
||||
# GET /rubriken
|
||||
# GET /rubriken.json
|
||||
def index
|
||||
@rubriken = Rubrik.all
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.json { render json: @rubriken }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /rubriken/1
|
||||
# GET /rubriken/1.json
|
||||
def show
|
||||
@rubrik = Rubrik.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
format.html # show.html.erb
|
||||
format.json { render json: @rubrik }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /rubriken/new
|
||||
# GET /rubriken/new.json
|
||||
def new
|
||||
@rubrik = Rubrik.new
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.json { render json: @rubrik }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /rubriken/1/edit
|
||||
def edit
|
||||
@rubrik = Rubrik.find(params[:id])
|
||||
end
|
||||
|
||||
# POST /rubriken
|
||||
# POST /rubriken.json
|
||||
def create
|
||||
@rubrik = Rubrik.new(params[:rubrik])
|
||||
|
||||
respond_to do |format|
|
||||
if @rubrik.save
|
||||
format.html { redirect_to @rubrik, notice: 'Rubrik was successfully created.' }
|
||||
format.json { render json: @rubrik, status: :created, location: @rubrik }
|
||||
else
|
||||
format.html { render action: "new" }
|
||||
format.json { render json: @rubrik.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PUT /rubriken/1
|
||||
# PUT /rubriken/1.json
|
||||
|
||||
def addmoderator
|
||||
@rubrik = Rubrik.find(params[:id])
|
||||
if current_user.has_role?(:newsadmin,@rubrik) || current_user.has_role?(:newsadmin)
|
||||
User.find(params[:userid]).add_role(:newsmoderator, @rubrik)
|
||||
end
|
||||
respond_to do |format|
|
||||
format.html { redirect_to @rubrik }
|
||||
end
|
||||
end
|
||||
def update
|
||||
@rubrik = Rubrik.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
if @rubrik.update_attributes(params[:rubrik])
|
||||
format.html { redirect_to @rubrik, notice: 'Rubrik was successfully updated.' }
|
||||
format.json { head :no_content }
|
||||
else
|
||||
format.html { render action: "edit" }
|
||||
format.json { render json: @rubrik.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /rubriken/1
|
||||
# DELETE /rubriken/1.json
|
||||
def destroy
|
||||
@rubrik = Rubrik.find(params[:id])
|
||||
@rubrik.destroy
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to rubriken_url }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
end
|
||||
83
app/controllers/semesters_controller.rb
Normal file
83
app/controllers/semesters_controller.rb
Normal file
@@ -0,0 +1,83 @@
|
||||
class SemestersController < ApplicationController
|
||||
# GET /semesters
|
||||
# GET /semesters.json
|
||||
def index
|
||||
@semesters = Semester.all
|
||||
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.json { render json: @semesters }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /semesters/1
|
||||
# GET /semesters/1.json
|
||||
def show
|
||||
@semester = Semester.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
format.html # show.html.erb
|
||||
format.json { render json: @semester }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /semesters/new
|
||||
# GET /semesters/new.json
|
||||
def new
|
||||
@semester = Semester.new
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.json { render json: @semester }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /semesters/1/edit
|
||||
def edit
|
||||
@semester = Semester.find(params[:id])
|
||||
end
|
||||
|
||||
# POST /semesters
|
||||
# POST /semesters.json
|
||||
def create
|
||||
@semester = Semester.new(params[:semester])
|
||||
|
||||
respond_to do |format|
|
||||
if @semester.save
|
||||
format.html { redirect_to @semester, notice: 'Semester was successfully created.' }
|
||||
format.json { render json: @semester, status: :created, location: @semester }
|
||||
else
|
||||
format.html { render action: "new" }
|
||||
format.json { render json: @semester.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PUT /semesters/1
|
||||
# PUT /semesters/1.json
|
||||
def update
|
||||
@semester = Semester.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
if @semester.update_attributes(params[:semester])
|
||||
format.html { redirect_to @semester, notice: 'Semester was successfully updated.' }
|
||||
format.json { head :no_content }
|
||||
else
|
||||
format.html { render action: "edit" }
|
||||
format.json { render json: @semester.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /semesters/1
|
||||
# DELETE /semesters/1.json
|
||||
def destroy
|
||||
@semester = Semester.find(params[:id])
|
||||
@semester.destroy
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to semesters_url }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
end
|
||||
83
app/controllers/studien_controller.rb
Normal file
83
app/controllers/studien_controller.rb
Normal file
@@ -0,0 +1,83 @@
|
||||
class StudienController < ApplicationController
|
||||
# GET /studia
|
||||
# GET /studia.json
|
||||
def index
|
||||
@studien = Studium.all
|
||||
respond_to do |format|
|
||||
format.html # index.html.erb
|
||||
format.json { render json: @studien }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /studia/1
|
||||
# GET /studia/1.json
|
||||
def show
|
||||
|
||||
@studium= Studium.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
format.html # show.html.erb
|
||||
format.json { render json: @studium }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /studia/new
|
||||
# GET /studia/new.json
|
||||
def new
|
||||
@studium = Studium.new
|
||||
|
||||
respond_to do |format|
|
||||
format.html # new.html.erb
|
||||
format.json { render json: @studium }
|
||||
end
|
||||
end
|
||||
|
||||
# GET /studia/1/edit
|
||||
def edit
|
||||
@studium = Studium.find(params[:id])
|
||||
end
|
||||
|
||||
# POST /studia
|
||||
# POST /studia.json
|
||||
def create
|
||||
@studium = Studium.new(params[:studium])
|
||||
|
||||
respond_to do |format|
|
||||
if @studium.save
|
||||
format.html { redirect_to @studium, notice: 'Studium was successfully created.' }
|
||||
format.json { render json: @studium, status: :created, location: @studium }
|
||||
else
|
||||
format.html { render action: "new" }
|
||||
format.json { render json: @studium.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# PUT /studia/1
|
||||
# PUT /studia/1.json
|
||||
def update
|
||||
@studium = Studium.find(params[:id])
|
||||
|
||||
respond_to do |format|
|
||||
if @studium.update_attributes(params[:studium])
|
||||
format.html { redirect_to @studium, notice: 'Studium was successfully updated.' }
|
||||
format.json { head :no_content }
|
||||
else
|
||||
format.html { render action: "edit" }
|
||||
format.json { render json: @studium.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# DELETE /studia/1
|
||||
# DELETE /studia/1.json
|
||||
def destroy
|
||||
@studium = Studium.find(params[:id])
|
||||
@studium.destroy
|
||||
|
||||
respond_to do |format|
|
||||
format.html { redirect_to studien_url }
|
||||
format.json { head :no_content }
|
||||
end
|
||||
end
|
||||
end
|
||||
6
app/controllers/users_controller.rb
Normal file
6
app/controllers/users_controller.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class UsersController < ApplicationController
|
||||
def index
|
||||
@users = User.all
|
||||
|
||||
end
|
||||
end
|
||||
10
app/helpers/application_helper.rb
Normal file
10
app/helpers/application_helper.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
module ApplicationHelper
|
||||
def current_url(overwrite={})
|
||||
url_for :only_path => true, :params => params.merge(overwrite).except(:controller,:action)
|
||||
end
|
||||
def switch_locale_url(target_locale)
|
||||
current_url({:locale=>target_locale}) .sub "/"+I18n.locale.to_s+"/", "/"+target_locale.to_s+"/"
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
2
app/helpers/lvas_helper.rb
Normal file
2
app/helpers/lvas_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module LvasHelper
|
||||
end
|
||||
2
app/helpers/modulgruppen_helper.rb
Normal file
2
app/helpers/modulgruppen_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module ModulgruppenHelper
|
||||
end
|
||||
2
app/helpers/moduls_helper.rb
Normal file
2
app/helpers/moduls_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module ModulsHelper
|
||||
end
|
||||
2
app/helpers/neuigkeiten_helper.rb
Normal file
2
app/helpers/neuigkeiten_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module NeuigkeitenHelper
|
||||
end
|
||||
2
app/helpers/rubriken_helper.rb
Normal file
2
app/helpers/rubriken_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module RubrikenHelper
|
||||
end
|
||||
2
app/helpers/semesters_helper.rb
Normal file
2
app/helpers/semesters_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module SemestersHelper
|
||||
end
|
||||
2
app/helpers/studien_helper.rb
Normal file
2
app/helpers/studien_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module StudienHelper
|
||||
end
|
||||
2
app/helpers/studmods_helper.rb
Normal file
2
app/helpers/studmods_helper.rb
Normal file
@@ -0,0 +1,2 @@
|
||||
module StudmodsHelper
|
||||
end
|
||||
5
app/inputs/tinymce_text_input.rb
Normal file
5
app/inputs/tinymce_text_input.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class TinymceTextInput < FormtasticBootstrap::Inputs::TextInput
|
||||
def input_html_options
|
||||
super.merge(:class => "tinymce")
|
||||
end
|
||||
end
|
||||
0
app/mailers/.gitkeep
Normal file
0
app/mailers/.gitkeep
Normal file
3
app/mailers/confirmmailer.rb
Normal file
3
app/mailers/confirmmailer.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
class Confirmmailer < ActionMailer::Base
|
||||
default from: "from@example.com"
|
||||
end
|
||||
0
app/models/.gitkeep
Normal file
0
app/models/.gitkeep
Normal file
31
app/models/ability.rb
Normal file
31
app/models/ability.rb
Normal file
@@ -0,0 +1,31 @@
|
||||
class Ability
|
||||
include CanCan::Ability
|
||||
|
||||
def initialize(user)
|
||||
# Define abilities for the passed in user here. For example:
|
||||
#
|
||||
user ||= User.new # guest user (not logged in)
|
||||
# if user.admin?
|
||||
# can :manage, :all
|
||||
# else
|
||||
# can :read, :all
|
||||
# end
|
||||
can :read, Modulgruppe
|
||||
if user.has_role? "newsadmin"
|
||||
can :manage, Modulgruppe
|
||||
end
|
||||
# The first argument to `can` is the action you are giving the user permission to do.
|
||||
# If you pass :manage it will apply to every action. Other common actions here are
|
||||
# :read, :create, :update and :destroy.
|
||||
#
|
||||
# The second argument is the resource the user can perform the action on. If you pass
|
||||
# :all it will apply to every resource. Otherwise pass a Ruby class of the resource.
|
||||
#
|
||||
# The third argument is an optional hash of conditions to further filter the objects.
|
||||
# For example, here the user can only update published articles.
|
||||
#
|
||||
# can :update, Article, :published => true
|
||||
#
|
||||
# See the wiki for details: https://github.com/ryanb/cancan/wiki/Defining-Abilities
|
||||
end
|
||||
end
|
||||
7
app/models/lva.rb
Normal file
7
app/models/lva.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class Lva < ActiveRecord::Base
|
||||
has_paper_trail # Versionsver
|
||||
attr_accessible :desc, :ects, :lvanr, :name, :stunden, :modul_ids
|
||||
has_and_belongs_to_many :modul
|
||||
has_and_belongs_to_many :semester
|
||||
translates :desc, :fallbacks_for_empty_translations => true
|
||||
end
|
||||
9
app/models/modul.rb
Normal file
9
app/models/modul.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class Modul < ActiveRecord::Base
|
||||
attr_accessible :desc,:name, :depend, :studium_id, :modulgruppe_ids
|
||||
|
||||
has_and_belongs_to_many :lvas
|
||||
has_and_belongs_to_many :modulgruppen
|
||||
|
||||
translates :desc,:depend, :versioning =>true, :fallbacks_for_empty_translations => true
|
||||
|
||||
end
|
||||
11
app/models/modulgruppe.rb
Normal file
11
app/models/modulgruppe.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class Modulgruppe < ActiveRecord::Base
|
||||
attr_accessible :name, :phase, :typ,:desc, :studium_id
|
||||
belongs_to :studium, :foreign_key => "studium_id"
|
||||
has_and_belongs_to_many :moduls
|
||||
resourcify
|
||||
validates :studium, :presence=>true
|
||||
validates :name, :presence=>true,:uniqueness =>{:scope => :studium, :message => "Nur einmal je Studium erlaubt"}
|
||||
validates :phase, :numericality => { :only_integer => true },:inclusion => {:in => [1, 2, 3, 4], :message => "%{value} is not valid, choose phase 1 to 4"}, :presence=>true
|
||||
validates :typ, :inclusion => {:in => ["Pflicht","Vertiefungspflicht","Wahl"] }
|
||||
translates :name,:desc, :versioning =>true,:fallbacks_for_empty_translations => true
|
||||
end
|
||||
5
app/models/neuigkeit.rb
Normal file
5
app/models/neuigkeit.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class Neuigkeit < ActiveRecord::Base
|
||||
attr_accessible :datum, :text, :title
|
||||
belongs_to :author, :class_name =>'User'
|
||||
belongs_to :rubrik
|
||||
end
|
||||
6
app/models/role.rb
Normal file
6
app/models/role.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class Role < ActiveRecord::Base
|
||||
has_and_belongs_to_many :users, :join_table => :users_roles
|
||||
belongs_to :resource, :polymorphic => true
|
||||
|
||||
scopify
|
||||
end
|
||||
10
app/models/rubrik.rb
Normal file
10
app/models/rubrik.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class Rubrik < ActiveRecord::Base
|
||||
attr_accessible :desc, :name, :prio
|
||||
has_many :neuigkeiten
|
||||
def moderator
|
||||
end
|
||||
|
||||
def moderator=(id)
|
||||
User.find(id).add_role(:newsmoderator, self)
|
||||
end
|
||||
end
|
||||
4
app/models/semester.rb
Normal file
4
app/models/semester.rb
Normal file
@@ -0,0 +1,4 @@
|
||||
class Semester < ActiveRecord::Base
|
||||
has_and_belongs_to_many :lvas
|
||||
attr_accessible :name, :nummer, :ss, :ws
|
||||
end
|
||||
6
app/models/studium.rb
Normal file
6
app/models/studium.rb
Normal file
@@ -0,0 +1,6 @@
|
||||
class Studium < ActiveRecord::Base
|
||||
attr_accessible :desc, :name, :typ, :zahl
|
||||
has_many :modulgruppen, inverse_of: :studium, :class_name => "Modulgruppe"
|
||||
validates :zahl, :uniqueness => true
|
||||
translates :desc,:shortdesc, :versioning =>true,:fallbacks_for_empty_translations => true
|
||||
end
|
||||
13
app/models/user.rb
Normal file
13
app/models/user.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
class User < ActiveRecord::Base
|
||||
rolify
|
||||
# Include default devise modules. Others available are:
|
||||
# :token_authenticatable, :confirmable,
|
||||
# :lockable, :timeoutable and :omniauthable
|
||||
devise :database_authenticatable, :registerable,:confirmable,
|
||||
:recoverable, :rememberable, :trackable, :validatable
|
||||
|
||||
# Setup accessible (or protected) attributes for your model
|
||||
attr_accessible :email, :password, :password_confirmation, :remember_me
|
||||
# attr_accessible :title, :body
|
||||
|
||||
end
|
||||
12
app/views/devise/confirmations/new.html.erb
Normal file
12
app/views/devise/confirmations/new.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<h2>Resend confirmation instructions</h2>
|
||||
|
||||
<%= form_for(resource, :as => resource_name, :url => confirmation_path(resource_name), :html => { :method => :post }) do |f| %>
|
||||
<%= devise_error_messages! %>
|
||||
|
||||
<div><%= f.label :email %><br />
|
||||
<%= f.email_field :email, :autofocus => true %></div>
|
||||
|
||||
<div><%= f.submit "Resend confirmation instructions" %></div>
|
||||
<% end %>
|
||||
|
||||
<%= render "devise/shared/links" %>
|
||||
@@ -0,0 +1,5 @@
|
||||
<p>Welcome <%= @email %>!</p>
|
||||
|
||||
<p>You can confirm your account email through the link below:</p>
|
||||
|
||||
<p><%= link_to 'Confirm my account', confirmation_url(@resource, :confirmation_token => @resource.confirmation_token) %></p>
|
||||
@@ -0,0 +1,8 @@
|
||||
<p>Hello <%= @resource.email %>!</p>
|
||||
|
||||
<p>Someone has requested a link to change your password. You can do this through the link below.</p>
|
||||
|
||||
<p><%= link_to 'Change my password', edit_password_url(@resource, :reset_password_token => @resource.reset_password_token) %></p>
|
||||
|
||||
<p>If you didn't request this, please ignore this email.</p>
|
||||
<p>Your password won't change until you access the link above and create a new one.</p>
|
||||
7
app/views/devise/mailer/unlock_instructions.html.erb
Normal file
7
app/views/devise/mailer/unlock_instructions.html.erb
Normal file
@@ -0,0 +1,7 @@
|
||||
<p>Hello <%= @resource.email %>!</p>
|
||||
|
||||
<p>Your account has been locked due to an excessive number of unsuccessful sign in attempts.</p>
|
||||
|
||||
<p>Click the link below to unlock your account:</p>
|
||||
|
||||
<p><%= link_to 'Unlock my account', unlock_url(@resource, :unlock_token => @resource.unlock_token) %></p>
|
||||
16
app/views/devise/passwords/edit.html.erb
Normal file
16
app/views/devise/passwords/edit.html.erb
Normal file
@@ -0,0 +1,16 @@
|
||||
<h2>Change your password</h2>
|
||||
|
||||
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
|
||||
<%= devise_error_messages! %>
|
||||
<%= f.hidden_field :reset_password_token %>
|
||||
|
||||
<div><%= f.label :password, "New password" %><br />
|
||||
<%= f.password_field :password, :autofocus => true %></div>
|
||||
|
||||
<div><%= f.label :password_confirmation, "Confirm new password" %><br />
|
||||
<%= f.password_field :password_confirmation %></div>
|
||||
|
||||
<div><%= f.submit "Change my password" %></div>
|
||||
<% end %>
|
||||
|
||||
<%= render "devise/shared/links" %>
|
||||
12
app/views/devise/passwords/new.html.erb
Normal file
12
app/views/devise/passwords/new.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<h2>Forgot your password?</h2>
|
||||
|
||||
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
|
||||
<%= devise_error_messages! %>
|
||||
|
||||
<div><%= f.label :email %><br />
|
||||
<%= f.email_field :email, :autofocus => true %></div>
|
||||
|
||||
<div><%= f.submit "Send me reset password instructions" %></div>
|
||||
<% end %>
|
||||
|
||||
<%= render "devise/shared/links" %>
|
||||
29
app/views/devise/registrations/edit.html.erb
Normal file
29
app/views/devise/registrations/edit.html.erb
Normal file
@@ -0,0 +1,29 @@
|
||||
<h2>Edit <%= resource_name.to_s.humanize %></h2>
|
||||
|
||||
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
|
||||
<%= devise_error_messages! %>
|
||||
|
||||
<div><%= f.label :email %><br />
|
||||
<%= f.email_field :email, :autofocus => true %></div>
|
||||
|
||||
<% if resource.class.reconfirmable && resource.unconfirmed_email.present? %>
|
||||
<div>Currently waiting confirmation for: <%= resource.unconfirmed_email %></div>
|
||||
<% end %>
|
||||
|
||||
<div><%= f.label :password %> <i>(leave blank if you don't want to change it)</i><br />
|
||||
<%= f.password_field :password, :autocomplete => "off" %></div>
|
||||
|
||||
<div><%= f.label :password_confirmation %><br />
|
||||
<%= f.password_field :password_confirmation %></div>
|
||||
|
||||
<div><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br />
|
||||
<%= f.password_field :current_password %></div>
|
||||
|
||||
<div><%= f.submit "Update" %></div>
|
||||
<% end %>
|
||||
|
||||
<h3>Cancel my account</h3>
|
||||
|
||||
<p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :data => { :confirm => "Are you sure?" }, :method => :delete %>.</p>
|
||||
|
||||
<%= link_to "Back", :back %>
|
||||
18
app/views/devise/registrations/new.html.erb
Normal file
18
app/views/devise/registrations/new.html.erb
Normal file
@@ -0,0 +1,18 @@
|
||||
<h2>Sign up</h2>
|
||||
|
||||
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
|
||||
<%= devise_error_messages! %>
|
||||
|
||||
<div><%= f.label :email %><br />
|
||||
<%= f.email_field :email, :autofocus => true %></div>
|
||||
|
||||
<div><%= f.label :password %><br />
|
||||
<%= f.password_field :password %></div>
|
||||
|
||||
<div><%= f.label :password_confirmation %><br />
|
||||
<%= f.password_field :password_confirmation %></div>
|
||||
|
||||
<div><%= f.submit "Sign up" %></div>
|
||||
<% end %>
|
||||
|
||||
<%= render "devise/shared/links" %>
|
||||
17
app/views/devise/sessions/new.html.erb
Normal file
17
app/views/devise/sessions/new.html.erb
Normal file
@@ -0,0 +1,17 @@
|
||||
<h2>Sign in</h2>
|
||||
|
||||
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
|
||||
<div><%= f.label :email %><br />
|
||||
<%= f.email_field :email, :autofocus => true %></div>
|
||||
|
||||
<div><%= f.label :password %><br />
|
||||
<%= f.password_field :password %></div>
|
||||
|
||||
<% if devise_mapping.rememberable? -%>
|
||||
<div><%= f.check_box :remember_me %> <%= f.label :remember_me %></div>
|
||||
<% end -%>
|
||||
|
||||
<div><%= f.submit "Sign in" %></div>
|
||||
<% end %>
|
||||
|
||||
<%= render "devise/shared/links" %>
|
||||
25
app/views/devise/shared/_links.erb
Normal file
25
app/views/devise/shared/_links.erb
Normal file
@@ -0,0 +1,25 @@
|
||||
<%- if controller_name != 'sessions' %>
|
||||
<%= link_to "Sign in", new_session_path(resource_name) %><br />
|
||||
<% end -%>
|
||||
|
||||
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
||||
<%= link_to "Sign up", new_registration_path(resource_name) %><br />
|
||||
<% end -%>
|
||||
|
||||
<%- if devise_mapping.recoverable? && controller_name != 'passwords' %>
|
||||
<%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
|
||||
<% end -%>
|
||||
|
||||
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
||||
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
|
||||
<% end -%>
|
||||
|
||||
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
|
||||
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
|
||||
<% end -%>
|
||||
|
||||
<%- if devise_mapping.omniauthable? %>
|
||||
<%- resource_class.omniauth_providers.each do |provider| %>
|
||||
<%= link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider) %><br />
|
||||
<% end -%>
|
||||
<% end -%>
|
||||
12
app/views/devise/unlocks/new.html.erb
Normal file
12
app/views/devise/unlocks/new.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<h2>Resend unlock instructions</h2>
|
||||
|
||||
<%= form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %>
|
||||
<%= devise_error_messages! %>
|
||||
|
||||
<div><%= f.label :email %><br />
|
||||
<%= f.email_field :email, :autofocus => true %></div>
|
||||
|
||||
<div><%= f.submit "Resend unlock instructions" %></div>
|
||||
<% end %>
|
||||
|
||||
<%= render "devise/shared/links" %>
|
||||
2
app/views/home/index.html.erb
Normal file
2
app/views/home/index.html.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
<p><%= t :hello %></p>
|
||||
<p><%= t 'home.hallobeiderfet' %></p>
|
||||
24
app/views/layouts/application.html.erb
Normal file
24
app/views/layouts/application.html.erb
Normal file
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>Fetsite</title>
|
||||
<%= stylesheet_link_tag "application", :media => "all" %>
|
||||
<%= javascript_include_tag "application" %>
|
||||
<%= csrf_meta_tags %>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="header">
|
||||
<h1 style="display:block;float:none">Fachschaft Elektrotechnik</h1>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="row-fluid">
|
||||
<div class="span2">
|
||||
<div id="menudiv"><%= render :template => 'layouts/menu' %></div>
|
||||
</div> <div class="span10">
|
||||
|
||||
<%= yield %>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
24
app/views/layouts/menu.html.erb
Normal file
24
app/views/layouts/menu.html.erb
Normal file
@@ -0,0 +1,24 @@
|
||||
<%= t 'home.mtitle'%>
|
||||
<ul class="nav nav-pills nav-stacked">
|
||||
<li><%= link_to I18n.t(:home,:scope=>'home' ), home_index_url %>
|
||||
</li>
|
||||
<li><%= link_to I18n.t(:news,:scope=>'home' ),rubriken_path %></li>
|
||||
<li><%= link_to I18n.t(:info,:scope=>'home' ) %></li>
|
||||
<li><%= link_to I18n.t(:studien,:scope=>'home' ), studien_path %>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<% if user_signed_in? %>
|
||||
<li>Logged in as : <%= current_user.email %>
|
||||
<%= link_to('Logout', destroy_user_session_path, :method => :delete) %>
|
||||
</li>
|
||||
<% else %>
|
||||
<li>
|
||||
<%= link_to('Login', new_user_session_path) %>
|
||||
</li>
|
||||
<% end %>
|
||||
<%if I18n.locale == :en %>
|
||||
<%= link_to "Deutsch" ,switch_locale_url(:de)%>
|
||||
<% elsif I18n.locale == :de %>
|
||||
<%= link_to "English" ,switch_locale_url(:en)%>
|
||||
<%end %>
|
||||
18
app/views/lvas/_form.html.erb
Normal file
18
app/views/lvas/_form.html.erb
Normal file
@@ -0,0 +1,18 @@
|
||||
<%= semantic_form_for @lva do |f| %>
|
||||
<%= f.inputs do %>
|
||||
<%= f.input :modul %>
|
||||
<%= f.input :name %>
|
||||
<%= f.input :ects %>
|
||||
<%= f.input :stunden %>
|
||||
|
||||
<%= f.input :desc %>
|
||||
|
||||
<%= f.input :lvanr %>
|
||||
|
||||
|
||||
<% end %>
|
||||
|
||||
<%= f.actions do %>
|
||||
<%= f.action :submit, :as => :input %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
6
app/views/lvas/edit.html.erb
Normal file
6
app/views/lvas/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing lva</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Show', @lva %> |
|
||||
<%= link_to 'Back', lvas_path %>
|
||||
31
app/views/lvas/index.html.erb
Normal file
31
app/views/lvas/index.html.erb
Normal file
@@ -0,0 +1,31 @@
|
||||
<h1>Listing lvas</h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Desc</th>
|
||||
<th>Ects</th>
|
||||
<th>Lvanr</th>
|
||||
<th>Stunden</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
<% @lvas.each do |lva| %>
|
||||
<tr>
|
||||
<td><%= lva.name %></td>
|
||||
<td><%= lva.desc %></td>
|
||||
<td><%= lva.ects %></td>
|
||||
<td><%= lva.lvanr %></td>
|
||||
<td><%= lva.stunden %></td>
|
||||
<td><%= link_to 'Show', lva %></td>
|
||||
<td><%= link_to 'Edit', edit_lva_path(lva) %></td>
|
||||
<td><%= link_to 'Destroy', lva, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
|
||||
<%= link_to 'New Lva', new_lva_path %>
|
||||
5
app/views/lvas/new.html.erb
Normal file
5
app/views/lvas/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New lva</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Back', lvas_path %>
|
||||
20
app/views/lvas/show.html.erb
Normal file
20
app/views/lvas/show.html.erb
Normal file
@@ -0,0 +1,20 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<p> <%= @lva.lvanr %>
|
||||
<b>
|
||||
<%= @lva.name %> (<%= @lva.ects %> ECTS/ <%= @lva.stunden %> Std)</b><%= link_to image_tag('edit.png'), edit_lva_path(@lva) %> |
|
||||
</p>
|
||||
<p>
|
||||
<%= @lva.desc %>
|
||||
</p>
|
||||
|
||||
<% @lva.modul.each do |modul| %>
|
||||
<%= link_to modul.name , modul_path(modul)%> <br>
|
||||
<% modul.modulgruppen.each do |g| %>
|
||||
<% link =g.studium.name + " - " +g.name %>
|
||||
<%= link_to link , modulgruppe_path(g)%><br>
|
||||
<%end%>
|
||||
<%end%>
|
||||
|
||||
|
||||
<%= link_to 'Back', lvas_path %>
|
||||
13
app/views/modulgruppen/_form.html.erb
Normal file
13
app/views/modulgruppen/_form.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<%= semantic_form_for @modulgruppe do |f| %>
|
||||
<%= f.inputs do %>
|
||||
<%= f.input :studium_id, :as =>:select, :collection => Studium.all %>
|
||||
<%= f.input :typ ,:as => :radio, :collection=>["Pflicht","Vertiefungspflicht","Wahl"]%>
|
||||
<%= f.input :phase,:as => :radio,:collection=>1..3 %>
|
||||
<%= f.input :name %>
|
||||
<%= f.input :desc,:input_html=>{:rows=> 3 }%>
|
||||
<% end %>
|
||||
|
||||
<%= f.actions do %>
|
||||
<%= f.action :submit, :as => :input %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
8
app/views/modulgruppen/_modulgruppe.html.erb
Normal file
8
app/views/modulgruppen/_modulgruppe.html.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<div class="modulgruppe_phase_<%= modulgruppe.phase %>">
|
||||
<h2><%= link_to modulgruppe.name, modulgruppe_path(modulgruppe) %><%= link_to image_tag('edit.png').html_safe+"Edit", edit_modulgruppe_path(modulgruppe),:class=>"btn" %></h2>
|
||||
<%= modulgruppe.desc%>
|
||||
|
||||
<%= render :partial=>'moduls/kurz', :collection=>modulgruppe.moduls, :as=>:modul%>
|
||||
<br>
|
||||
</div>
|
||||
|
||||
6
app/views/modulgruppen/edit.html.erb
Normal file
6
app/views/modulgruppen/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing modulgruppe</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Show', @modulgruppe %> |
|
||||
<%= link_to 'Back', modulgruppen_path %>
|
||||
30
app/views/modulgruppen/index.html.erb
Normal file
30
app/views/modulgruppen/index.html.erb
Normal file
@@ -0,0 +1,30 @@
|
||||
<h1>Listing modulgruppen</h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Type</th>
|
||||
<th>Phase</th>
|
||||
<th>Studium</th>
|
||||
<th>Name</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
<% @modulgruppen.each do |modulgruppe| %>
|
||||
<tr>
|
||||
<td><%= modulgruppe.typ %></td>
|
||||
<td><%= modulgruppe.phase %></td>
|
||||
<td><%= modulgruppe.studium.name %></td>
|
||||
<td><%= modulgruppe.name %></td>
|
||||
<td><%= link_to 'Show', modulgruppe %></td>
|
||||
<td><%= link_to 'Edit', edit_modulgruppe_path(modulgruppe) %></td>
|
||||
<td><%= link_to 'Destroy', modulgruppe, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
<% if !@studium.nil? %>
|
||||
<%= link_to 'New Modulgruppe', new_modulgruppe_path %>
|
||||
<% end%>
|
||||
5
app/views/modulgruppen/new.html.erb
Normal file
5
app/views/modulgruppen/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New modulgruppe</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Back', modulgruppen_path %>
|
||||
27
app/views/modulgruppen/show.html.erb
Normal file
27
app/views/modulgruppen/show.html.erb
Normal file
@@ -0,0 +1,27 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
<div class ="modulgruppe_phase_<%= @modulgruppe.phase %>">
|
||||
<h1>
|
||||
<%= @modulgruppe.name %>
|
||||
</h1>
|
||||
<p>
|
||||
<b><%= link_to "Studium: "+@modulgruppe.studium.name, studium_path(@modulgruppe.studium) %></b>
|
||||
|
||||
</p><p>
|
||||
<b><%= I18n.t "modulgruppe.typ"%>:</b>
|
||||
<%= @modulgruppe.typ %>
|
||||
</p>
|
||||
|
||||
|
||||
<% @modulgruppe.moduls.each do |modul| %>
|
||||
<%= render modul%>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
<span class="label">Default</span>
|
||||
<div class="btn-group">
|
||||
<%= link_to 'Add Modul', new_modul_path(:modulgruppen_id =>@modulgruppe.id) %>
|
||||
<%= link_to 'Studium', studium_path(@modulgruppe.studium),:class =>"btn" %>
|
||||
<%= link_to 'Edit', edit_modulgruppe_path(@modulgruppe),:class =>"btn" %>
|
||||
<%= link_to 'Back', modulgruppen_path,:class =>"btn" %>
|
||||
</div>
|
||||
14
app/views/moduls/_form.html.erb
Normal file
14
app/views/moduls/_form.html.erb
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
<%= semantic_form_for @modul do |f| %>
|
||||
<%= f.inputs do %>
|
||||
<%= f.input :modulgruppen,:as => :select, :collection => Hash[Modulgruppe.all.map{|m| [m.studium.name + " " + m.name,m.id]}] %>
|
||||
<%= f.input :name ,:hint=>true%>
|
||||
<%= f.input :desc, :as=>:tinymce_text %>
|
||||
<%= f.input :depend %>
|
||||
<% end %>
|
||||
|
||||
<%= f.actions do %>
|
||||
<%= f.action :submit, :as => :input %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<%= tinymce %>
|
||||
9
app/views/moduls/_kurz.html.erb
Normal file
9
app/views/moduls/_kurz.html.erb
Normal file
@@ -0,0 +1,9 @@
|
||||
<div style="border: solid 1px; padding:2px;margin-top:5px;"><p>
|
||||
<b><%= link_to "Modul "+ modul.name , modul_path(modul) %> <%= link_to image_tag("edit.png"), edit_modul_path(modul) %></b>
|
||||
</p>
|
||||
<p >
|
||||
<%= raw(modul.desc) %>
|
||||
</p>
|
||||
|
||||
</div>
|
||||
|
||||
13
app/views/moduls/_modul.html.erb
Normal file
13
app/views/moduls/_modul.html.erb
Normal file
@@ -0,0 +1,13 @@
|
||||
<div style="border: solid 1px; padding:2px"><p>
|
||||
<b><%= link_to "Modul "+ modul.name , modul_path(modul) %> <%= link_to image_tag("edit.png"), edit_modul_path(modul) %></b>
|
||||
</p>
|
||||
<p>
|
||||
<%= raw(modul.desc) %>
|
||||
</p>
|
||||
LVAs:
|
||||
<ul>
|
||||
<% modul.lvas.each do |lva| %>
|
||||
<li><%= link_to lva.lvanr+" "+ lva.name, lva %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
</div>
|
||||
8
app/views/moduls/edit.html.erb
Normal file
8
app/views/moduls/edit.html.erb
Normal file
@@ -0,0 +1,8 @@
|
||||
<h1><%= I18n.t "moduls.edit.title"%></h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Show', modul_path( @modul) %> |
|
||||
<% if !@studium.nil? %>
|
||||
<%= link_to 'Back', moduls_path(@modul) %>
|
||||
<% end%>
|
||||
26
app/views/moduls/index.html.erb
Normal file
26
app/views/moduls/index.html.erb
Normal file
@@ -0,0 +1,26 @@
|
||||
<h1>Listing moduls</h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Desc</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
<% @moduls.each do |modul| %>
|
||||
<tr>
|
||||
<td><%= modul.name %></td>
|
||||
<td><%= modul.desc %></td>
|
||||
<td><%= link_to 'Show', modul_path(modul) %></td>
|
||||
<td><%= link_to 'Edit', edit_modul_path(modul) %></td>
|
||||
<td><%= link_to 'Destroy', [modul], method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
<% if !@studium.nil? %>
|
||||
<%= link_to 'New Modul', new_modul_path() %>
|
||||
<% end%>
|
||||
5
app/views/moduls/new.html.erb
Normal file
5
app/views/moduls/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New modul</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Back', moduls_path %>
|
||||
11
app/views/moduls/show.html.erb
Normal file
11
app/views/moduls/show.html.erb
Normal file
@@ -0,0 +1,11 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<%= render @modul %>
|
||||
|
||||
<% @modul.modulgruppen.each do |g| %>
|
||||
<% link = g.studium.name + " - " +g.name %>
|
||||
<%= link_to g.studium.name , studium_path(g.studium)%> <br />
|
||||
<%= link_to link , modulgruppe_path(g)%><br />
|
||||
<%end%>
|
||||
|
||||
<%= link_to 'Add LVA', new_lva_path(:modul_id =>@modul.id) %>
|
||||
11
app/views/neuigkeiten/_form.html.erb
Normal file
11
app/views/neuigkeiten/_form.html.erb
Normal file
@@ -0,0 +1,11 @@
|
||||
<%= semantic_form_for @neuigkeit do |f| %>
|
||||
<%= f.inputs do %>
|
||||
<%= f.input :title, :placeholder=>"Titel" %>
|
||||
<%= f.input :text %>
|
||||
<%= f.input :datum %>
|
||||
<% end %>
|
||||
|
||||
<%= f.actions do %>
|
||||
<%= f.action :submit, :as => :input %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
6
app/views/neuigkeiten/edit.html.erb
Normal file
6
app/views/neuigkeiten/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing neuigkeit</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Show', @neuigkeit %> |
|
||||
<%= link_to 'Back', neuigkeiten_path %>
|
||||
27
app/views/neuigkeiten/index.html.erb
Normal file
27
app/views/neuigkeiten/index.html.erb
Normal file
@@ -0,0 +1,27 @@
|
||||
<h1>Listing neuigkeiten</h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Title</th>
|
||||
<th>Text</th>
|
||||
<th>Datum</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
<% @neuigkeiten.each do |neuigkeit| %>
|
||||
<tr>
|
||||
<td><%= neuigkeit.title %></td>
|
||||
<td><%= neuigkeit.text %></td>
|
||||
<td><%= neuigkeit.datum %></td>
|
||||
<td><%= link_to 'Show', neuigkeit %></td>
|
||||
<td><%= link_to 'Edit', edit_neuigkeit_path(neuigkeit) %></td>
|
||||
<td><%= link_to 'Destroy', neuigkeit, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
|
||||
<%= link_to 'New Neuigkeit', new_neuigkeit_path %>
|
||||
5
app/views/neuigkeiten/new.html.erb
Normal file
5
app/views/neuigkeiten/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New neuigkeit</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Back', neuigkeiten_path %>
|
||||
20
app/views/neuigkeiten/show.html.erb
Normal file
20
app/views/neuigkeiten/show.html.erb
Normal file
@@ -0,0 +1,20 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<p>
|
||||
<b>Title:</b>
|
||||
<%= @neuigkeit.title %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Text:</b>
|
||||
<%= @neuigkeit.text %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Datum:</b>
|
||||
<%= @neuigkeit.datum %>
|
||||
</p>
|
||||
|
||||
|
||||
<%= link_to 'Edit', edit_neuigkeit_path(@neuigkeit) %> |
|
||||
<%= link_to 'Back', neuigkeiten_path %>
|
||||
11
app/views/rubriken/_form.html.erb
Normal file
11
app/views/rubriken/_form.html.erb
Normal file
@@ -0,0 +1,11 @@
|
||||
<%= semantic_form_for @rubrik do |f| %>
|
||||
<%= f.inputs do %>
|
||||
<%= f.input :name %>
|
||||
<%= f.input :desc %>
|
||||
<%= f.input :prio %>
|
||||
<% end %>
|
||||
|
||||
<%= f.actions do %>
|
||||
<%= f.action :submit, :as => :input %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
6
app/views/rubriken/edit.html.erb
Normal file
6
app/views/rubriken/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing rubrik</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Show', @rubrik %> |
|
||||
<%= link_to 'Back', rubriken_path %>
|
||||
27
app/views/rubriken/index.html.erb
Normal file
27
app/views/rubriken/index.html.erb
Normal file
@@ -0,0 +1,27 @@
|
||||
<h1>Listing rubriken</h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Desc</th>
|
||||
<th>Prio</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
<% @rubriken.each do |rubrik| %>
|
||||
<tr>
|
||||
<td><%= rubrik.name %></td>
|
||||
<td><%= rubrik.desc %></td>
|
||||
<td><%= rubrik.prio %></td>
|
||||
<td><%= link_to 'Show', rubrik %></td>
|
||||
<td><%= link_to 'Edit', edit_rubrik_path(rubrik) %></td>
|
||||
<td><%= link_to 'Destroy', rubrik, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
|
||||
<%= link_to 'New Rubrik', new_rubrik_path %>
|
||||
5
app/views/rubriken/new.html.erb
Normal file
5
app/views/rubriken/new.html.erb
Normal file
@@ -0,0 +1,5 @@
|
||||
<h1>New rubrik</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Back', rubriken_path %>
|
||||
25
app/views/rubriken/show.html.erb
Normal file
25
app/views/rubriken/show.html.erb
Normal file
@@ -0,0 +1,25 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
|
||||
<p>
|
||||
<b>Name:</b>
|
||||
<%= @rubrik.name %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Desc:</b>
|
||||
<%= @rubrik.desc %>
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<b>Prio:</b>
|
||||
<%= @rubrik.prio %>
|
||||
</p>
|
||||
<%= semantic_form_for @rubrik, :url=> url_for(:action => 'addmoderator') do |f| %>
|
||||
<%= f.inputs do %>
|
||||
<%= f.input :moderator, :as => :select, :collection => Hash[User.all.map{|b| [b.email,b.id]}] %>
|
||||
<% end %>
|
||||
<%= f.action :submit %>
|
||||
<% end %>
|
||||
|
||||
<%= link_to 'Edit', edit_rubrik_path(@rubrik) %> |
|
||||
<%= link_to 'Back', rubriken_path %>
|
||||
12
app/views/semesters/_form.html.erb
Normal file
12
app/views/semesters/_form.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<%= semantic_form_for @semester do |f| %>
|
||||
<%= f.inputs do %>
|
||||
<%= f.input :name %>
|
||||
<%= f.input :nummer %>
|
||||
<%= f.input :ws %>
|
||||
<%= f.input :ss %>
|
||||
<% end %>
|
||||
|
||||
<%= f.actions do %>
|
||||
<%= f.action :submit, :as => :input %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
6
app/views/semesters/edit.html.erb
Normal file
6
app/views/semesters/edit.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<h1>Editing semester</h1>
|
||||
|
||||
<%= render 'form' %>
|
||||
|
||||
<%= link_to 'Show', @semester %> |
|
||||
<%= link_to 'Back', semesters_path %>
|
||||
29
app/views/semesters/index.html.erb
Normal file
29
app/views/semesters/index.html.erb
Normal file
@@ -0,0 +1,29 @@
|
||||
<h1>Listing semesters</h1>
|
||||
|
||||
<table>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Nummer</th>
|
||||
<th>Ws</th>
|
||||
<th>Ss</th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
<th></th>
|
||||
</tr>
|
||||
|
||||
<% @semesters.each do |semester| %>
|
||||
<tr>
|
||||
<td><%= semester.name %></td>
|
||||
<td><%= semester.nummer %></td>
|
||||
<td><%= semester.ws %></td>
|
||||
<td><%= semester.ss %></td>
|
||||
<td><%= link_to 'Show', semester %></td>
|
||||
<td><%= link_to 'Edit', edit_semester_path(semester) %></td>
|
||||
<td><%= link_to 'Destroy', semester, method: :delete, data: { confirm: 'Are you sure?' } %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<br />
|
||||
|
||||
<%= link_to 'New Semester', new_semester_path %>
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user