GitHub Account angelegt

This commit is contained in:
Andreas Stephanides
2013-02-12 02:05:12 +01:00
commit 3d11400d5e
216 changed files with 5031 additions and 0 deletions

22
.gitattributes vendored Normal file
View File

@@ -0,0 +1,22 @@
# Auto detect text files and perform LF normalization
* text=auto
# Custom for Visual Studio
*.cs diff=csharp
*.sln merge=union
*.csproj merge=union
*.vbproj merge=union
*.fsproj merge=union
*.dbproj merge=union
# Standard to msysgit
*.doc diff=astextplain
*.DOC diff=astextplain
*.docx diff=astextplain
*.DOCX diff=astextplain
*.dot diff=astextplain
*.DOT diff=astextplain
*.pdf diff=astextplain
*.PDF diff=astextplain
*.rtf diff=astextplain
*.RTF diff=astextplain

15
.gitignore vendored Normal file
View File

@@ -0,0 +1,15 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.
#
# If you find yourself ignoring temporary files generated by your text editor
# or operating system, you probably want to add a global ignore instead:
# git config --global core.excludesfile ~/.gitignore_global
# Ignore bundler config
/.bundle
# Ignore the default SQLite database.
/db/*.sqlite3
# Ignore all logfiles and tempfiles.
/log/*.log
/tmp

19
.project Normal file
View File

@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>fetsite</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>com.aptana.ide.core.unifiedBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>com.aptana.projects.webnature</nature>
<nature>org.radrails.rails.core.railsnature</nature>
<nature>com.aptana.ruby.core.rubynature</nature>
</natures>
</projectDescription>

55
Gemfile Normal file
View File

@@ -0,0 +1,55 @@
source 'https://rubygems.org'
gem 'rails', '3.2.9'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
gem 'sqlite3'
gem 'execjs'
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'bootstrap-sass','~> 2.2.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
gem 'therubyracer', :platforms => :ruby
gem 'uglifier', '>= 1.0.3'
end
gem 'jquery-rails'
# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'
# To use Jbuilder templates for JSON
# gem 'jbuilder'
# Use unicorn as the app server
# gem 'unicorn'
# Deploy with Capistrano
# gem 'capistrano'
# To use debugger
# gem 'debugger'
# Formbuilder for easier form generation
gem 'formtastic'
gem 'formtastic-bootstrap'
gem "tinymce-rails"
gem "globalize3"
gem "paper_trail"
gem "devise"
gem "rolify"
gem "cancan"

150
Gemfile.lock Normal file
View File

@@ -0,0 +1,150 @@
GEM
remote: https://rubygems.org/
specs:
actionmailer (3.2.9)
actionpack (= 3.2.9)
mail (~> 2.4.4)
actionpack (3.2.9)
activemodel (= 3.2.9)
activesupport (= 3.2.9)
builder (~> 3.0.0)
erubis (~> 2.7.0)
journey (~> 1.0.4)
rack (~> 1.4.0)
rack-cache (~> 1.2)
rack-test (~> 0.6.1)
sprockets (~> 2.2.1)
activemodel (3.2.9)
activesupport (= 3.2.9)
builder (~> 3.0.0)
activerecord (3.2.9)
activemodel (= 3.2.9)
activesupport (= 3.2.9)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
activeresource (3.2.9)
activemodel (= 3.2.9)
activesupport (= 3.2.9)
activesupport (3.2.9)
i18n (~> 0.6)
multi_json (~> 1.0)
arel (3.0.2)
bcrypt-ruby (3.0.1)
bcrypt-ruby (3.0.1-x86-mingw32)
bootstrap-sass (2.2.2.0)
sass (~> 3.2)
builder (3.0.4)
cancan (1.6.8)
coffee-rails (3.2.2)
coffee-script (>= 2.2.0)
railties (~> 3.2.0)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.4.0)
devise (2.2.1)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.1)
railties (~> 3.1)
warden (~> 1.2.1)
erubis (2.7.0)
execjs (1.4.0)
multi_json (~> 1.0)
formtastic (2.2.1)
actionpack (>= 3.0)
formtastic-bootstrap (2.0.0)
formtastic (~> 2.2)
formtastic-bootstrap
globalize3 (0.3.0)
activemodel (>= 3.0.0)
activerecord (>= 3.0.0)
paper_trail (~> 2)
hike (1.2.1)
i18n (0.6.1)
journey (1.0.4)
jquery-rails (2.1.4)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
mail (2.4.4)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.19)
multi_json (1.5.0)
orm_adapter (0.4.0)
paper_trail (2.7.0)
activerecord (~> 3.0)
railties (~> 3.0)
polyglot (0.3.3)
rack (1.4.3)
rack-cache (1.2)
rack (>= 0.4)
rack-ssl (1.3.2)
rack
rack-test (0.6.2)
rack (>= 1.0)
rails (3.2.9)
actionmailer (= 3.2.9)
actionpack (= 3.2.9)
activerecord (= 3.2.9)
activeresource (= 3.2.9)
activesupport (= 3.2.9)
bundler (~> 1.0)
railties (= 3.2.9)
railties (3.2.9)
actionpack (= 3.2.9)
activesupport (= 3.2.9)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
rake (10.0.3)
rdoc (3.9.4)
rolify (3.2.0)
sass (3.2.3)
sass-rails (3.2.5)
railties (~> 3.2.0)
sass (>= 3.1.10)
tilt (~> 1.3)
sprockets (2.2.2)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.6)
sqlite3 (1.3.6-x86-mingw32)
thor (0.16.0)
tilt (1.3.3)
tinymce-rails (3.5.8)
railties (>= 3.1.1)
treetop (1.4.12)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.35)
uglifier (1.3.0)
execjs (>= 0.3.0)
multi_json (~> 1.0, >= 1.0.2)
warden (1.2.1)
rack (>= 1.0)
PLATFORMS
x86-mingw32
DEPENDENCIES
bootstrap-sass (~> 2.2.0)
cancan
coffee-rails (~> 3.2.1)
devise
execjs
formtastic
formtastic-bootstrap
globalize3
jquery-rails
paper_trail
rails (= 3.2.9)
rolify
sass-rails (~> 3.2.3)
sqlite3
therubyracer
tinymce-rails
uglifier (>= 1.0.3)

261
README.rdoc Normal file
View File

@@ -0,0 +1,261 @@
== Welcome to Rails
Rails is a web-application framework that includes everything needed to create
database-backed web applications according to the Model-View-Control pattern.
This pattern splits the view (also called the presentation) into "dumb"
templates that are primarily responsible for inserting pre-built data in between
HTML tags. The model contains the "smart" domain objects (such as Account,
Product, Person, Post) that holds all the business logic and knows how to
persist themselves to a database. The controller handles the incoming requests
(such as Save New Account, Update Product, Show Post) by manipulating the model
and directing data to the view.
In Rails, the model is handled by what's called an object-relational mapping
layer entitled Active Record. This layer allows you to present the data from
database rows as objects and embellish these data objects with business logic
methods. You can read more about Active Record in
link:files/vendor/rails/activerecord/README.html.
The controller and view are handled by the Action Pack, which handles both
layers by its two parts: Action View and Action Controller. These two layers
are bundled in a single package due to their heavy interdependence. This is
unlike the relationship between the Active Record and Action Pack that is much
more separate. Each of these packages can be used independently outside of
Rails. You can read more about Action Pack in
link:files/vendor/rails/actionpack/README.html.
== Getting Started
1. At the command prompt, create a new Rails application:
<tt>rails new myapp</tt> (where <tt>myapp</tt> is the application name)
2. Change directory to <tt>myapp</tt> and start the web server:
<tt>cd myapp; rails server</tt> (run with --help for options)
3. Go to http://localhost:3000/ and you'll see:
"Welcome aboard: You're riding Ruby on Rails!"
4. Follow the guidelines to start developing your application. You can find
the following resources handy:
* The Getting Started Guide: http://guides.rubyonrails.org/getting_started.html
* Ruby on Rails Tutorial Book: http://www.railstutorial.org/
== Debugging Rails
Sometimes your application goes wrong. Fortunately there are a lot of tools that
will help you debug it and get it back on the rails.
First area to check is the application log files. Have "tail -f" commands
running on the server.log and development.log. Rails will automatically display
debugging and runtime information to these files. Debugging info will also be
shown in the browser on requests from 127.0.0.1.
You can also log your own messages directly into the log file from your code
using the Ruby logger class from inside your controllers. Example:
class WeblogController < ActionController::Base
def destroy
@weblog = Weblog.find(params[:id])
@weblog.destroy
logger.info("#{Time.now} Destroyed Weblog ID ##{@weblog.id}!")
end
end
The result will be a message in your log file along the lines of:
Mon Oct 08 14:22:29 +1000 2007 Destroyed Weblog ID #1!
More information on how to use the logger is at http://www.ruby-doc.org/core/
Also, Ruby documentation can be found at http://www.ruby-lang.org/. There are
several books available online as well:
* Programming Ruby: http://www.ruby-doc.org/docs/ProgrammingRuby/ (Pickaxe)
* Learn to Program: http://pine.fm/LearnToProgram/ (a beginners guide)
These two books will bring you up to speed on the Ruby language and also on
programming in general.
== Debugger
Debugger support is available through the debugger command when you start your
Mongrel or WEBrick server with --debugger. This means that you can break out of
execution at any point in the code, investigate and change the model, and then,
resume execution! You need to install ruby-debug to run the server in debugging
mode. With gems, use <tt>sudo gem install ruby-debug</tt>. Example:
class WeblogController < ActionController::Base
def index
@posts = Post.all
debugger
end
end
So the controller will accept the action, run the first line, then present you
with a IRB prompt in the server window. Here you can do things like:
>> @posts.inspect
=> "[#<Post:0x14a6be8
@attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>,
#<Post:0x14a6620
@attributes={"title"=>"Rails", "body"=>"Only ten..", "id"=>"2"}>]"
>> @posts.first.title = "hello from a debugger"
=> "hello from a debugger"
...and even better, you can examine how your runtime objects actually work:
>> f = @posts.first
=> #<Post:0x13630c4 @attributes={"title"=>nil, "body"=>nil, "id"=>"1"}>
>> f.
Display all 152 possibilities? (y or n)
Finally, when you're ready to resume execution, you can enter "cont".
== Console
The console is a Ruby shell, which allows you to interact with your
application's domain model. Here you'll have all parts of the application
configured, just like it is when the application is running. You can inspect
domain models, change values, and save to the database. Starting the script
without arguments will launch it in the development environment.
To start the console, run <tt>rails console</tt> from the application
directory.
Options:
* Passing the <tt>-s, --sandbox</tt> argument will rollback any modifications
made to the database.
* Passing an environment name as an argument will load the corresponding
environment. Example: <tt>rails console production</tt>.
To reload your controllers and models after launching the console run
<tt>reload!</tt>
More information about irb can be found at:
link:http://www.rubycentral.org/pickaxe/irb.html
== dbconsole
You can go to the command line of your database directly through <tt>rails
dbconsole</tt>. You would be connected to the database with the credentials
defined in database.yml. Starting the script without arguments will connect you
to the development database. Passing an argument will connect you to a different
database, like <tt>rails dbconsole production</tt>. Currently works for MySQL,
PostgreSQL and SQLite 3.
== Description of Contents
The default directory structure of a generated Ruby on Rails application:
|-- app
| |-- assets
| |-- images
| |-- javascripts
| `-- stylesheets
| |-- controllers
| |-- helpers
| |-- mailers
| |-- models
| `-- views
| `-- layouts
|-- config
| |-- environments
| |-- initializers
| `-- locales
|-- db
|-- doc
|-- lib
| `-- tasks
|-- log
|-- public
|-- script
|-- test
| |-- fixtures
| |-- functional
| |-- integration
| |-- performance
| `-- unit
|-- tmp
| |-- cache
| |-- pids
| |-- sessions
| `-- sockets
`-- vendor
|-- assets
`-- stylesheets
`-- plugins
app
Holds all the code that's specific to this particular application.
app/assets
Contains subdirectories for images, stylesheets, and JavaScript files.
app/controllers
Holds controllers that should be named like weblogs_controller.rb for
automated URL mapping. All controllers should descend from
ApplicationController which itself descends from ActionController::Base.
app/models
Holds models that should be named like post.rb. Models descend from
ActiveRecord::Base by default.
app/views
Holds the template files for the view that should be named like
weblogs/index.html.erb for the WeblogsController#index action. All views use
eRuby syntax by default.
app/views/layouts
Holds the template files for layouts to be used with views. This models the
common header/footer method of wrapping views. In your views, define a layout
using the <tt>layout :default</tt> and create a file named default.html.erb.
Inside default.html.erb, call <% yield %> to render the view using this
layout.
app/helpers
Holds view helpers that should be named like weblogs_helper.rb. These are
generated for you automatically when using generators for controllers.
Helpers can be used to wrap functionality for your views into methods.
config
Configuration files for the Rails environment, the routing map, the database,
and other dependencies.
db
Contains the database schema in schema.rb. db/migrate contains all the
sequence of Migrations for your schema.
doc
This directory is where your application documentation will be stored when
generated using <tt>rake doc:app</tt>
lib
Application specific libraries. Basically, any kind of custom code that
doesn't belong under controllers, models, or helpers. This directory is in
the load path.
public
The directory available for the web server. Also contains the dispatchers and the
default HTML files. This should be set as the DOCUMENT_ROOT of your web
server.
script
Helper scripts for automation and generation.
test
Unit and functional tests along with fixtures. When using the rails generate
command, template test files will be generated for you and placed in this
directory.
vendor
External libraries that the application depends on. Also includes the plugins
subdirectory. If the app has frozen rails, those gems also go here, under
vendor/rails/. This directory is in the load path.

7
Rakefile Normal file
View File

@@ -0,0 +1,7 @@
#!/usr/bin/env rake
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
require File.expand_path('../config/application', __FILE__)
Fetsite::Application.load_tasks

BIN
app/assets/images/edit.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 692 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
app/assets/images/rails.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

View 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

View 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/

View 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/

View 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/

View 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/

View 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/

View 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/

View 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/

View 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/

View 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
}

View File

View 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/

View 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;
}

View 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/

View 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/

View 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/

View 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;
}
}

View 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/

View 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/

View 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

View File

@@ -0,0 +1,6 @@
class HomeController < ApplicationController
def index
end
end

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View File

@@ -0,0 +1,6 @@
class UsersController < ApplicationController
def index
@users = User.all
end
end

View 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

View File

@@ -0,0 +1,2 @@
module LvasHelper
end

View File

@@ -0,0 +1,2 @@
module ModulgruppenHelper
end

View File

@@ -0,0 +1,2 @@
module ModulsHelper
end

View File

@@ -0,0 +1,2 @@
module NeuigkeitenHelper
end

View File

@@ -0,0 +1,2 @@
module RubrikenHelper
end

View File

@@ -0,0 +1,2 @@
module SemestersHelper
end

View File

@@ -0,0 +1,2 @@
module StudienHelper
end

View File

@@ -0,0 +1,2 @@
module StudmodsHelper
end

View 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
View File

View File

@@ -0,0 +1,3 @@
class Confirmmailer < ActionMailer::Base
default from: "from@example.com"
end

0
app/models/.gitkeep Normal file
View File

31
app/models/ability.rb Normal file
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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
View 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

View 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" %>

View File

@@ -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>

View File

@@ -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>

View 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>

View 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" %>

View 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" %>

View 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 %>

View 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" %>

View 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" %>

View 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 -%>

View 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" %>

View File

@@ -0,0 +1,2 @@
<p><%= t :hello %></p>
<p><%= t 'home.hallobeiderfet' %></p>

View 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>

View 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 %>

View 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 %>

View File

@@ -0,0 +1,6 @@
<h1>Editing lva</h1>
<%= render 'form' %>
<%= link_to 'Show', @lva %> |
<%= link_to 'Back', lvas_path %>

View 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 %>

View File

@@ -0,0 +1,5 @@
<h1>New lva</h1>
<%= render 'form' %>
<%= link_to 'Back', lvas_path %>

View 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 %>

View 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 %>

View 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>

View File

@@ -0,0 +1,6 @@
<h1>Editing modulgruppe</h1>
<%= render 'form' %>
<%= link_to 'Show', @modulgruppe %> |
<%= link_to 'Back', modulgruppen_path %>

View 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%>

View File

@@ -0,0 +1,5 @@
<h1>New modulgruppe</h1>
<%= render 'form' %>
<%= link_to 'Back', modulgruppen_path %>

View 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>

View 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 %>

View 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>

View 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>

View 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%>

View 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%>

View File

@@ -0,0 +1,5 @@
<h1>New modul</h1>
<%= render 'form' %>
<%= link_to 'Back', moduls_path %>

View 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) %>

View 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 %>

View File

@@ -0,0 +1,6 @@
<h1>Editing neuigkeit</h1>
<%= render 'form' %>
<%= link_to 'Show', @neuigkeit %> |
<%= link_to 'Back', neuigkeiten_path %>

View 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 %>

View File

@@ -0,0 +1,5 @@
<h1>New neuigkeit</h1>
<%= render 'form' %>
<%= link_to 'Back', neuigkeiten_path %>

View 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 %>

View 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 %>

Some files were not shown because too many files have changed in this diff Show More