This commit is contained in:
2014-06-12 11:16:40 +02:00
67 changed files with 793 additions and 145 deletions

View File

@@ -72,8 +72,9 @@ gem 'paperclip' ,'~>3.4.0'
gem 'git' gem 'git'
gem 'haml' gem 'haml'
#gem 'RedCloth' gem 'RedCloth'
#gem 'gollum' gem 'wikicloth'
gem 'gollum-lib'
gem 'awesome_nested_set' gem 'awesome_nested_set'
gem 'annotate', ">=2.5.0" gem 'annotate', ">=2.5.0"
gem 'carrierwave', "~>0.9.0" gem 'carrierwave', "~>0.9.0"

View File

@@ -9,6 +9,7 @@ GIT
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
RedCloth (4.2.9)
actionmailer (3.2.13) actionmailer (3.2.13)
actionpack (= 3.2.13) actionpack (= 3.2.13)
mail (~> 2.5.3) mail (~> 2.5.3)
@@ -53,6 +54,7 @@ GEM
activemodel (>= 3.2.0) activemodel (>= 3.2.0)
activesupport (>= 3.2.0) activesupport (>= 3.2.0)
json (>= 1.7) json (>= 1.7)
charlock_holmes (0.6.9.4)
climate_control (0.0.3) climate_control (0.0.3)
activesupport (>= 3.0) activesupport (>= 3.0)
cocaine (0.5.3) cocaine (0.5.3)
@@ -73,6 +75,7 @@ GEM
erubis (2.7.0) erubis (2.7.0)
execjs (1.4.0) execjs (1.4.0)
multi_json (~> 1.0) multi_json (~> 1.0)
expression_parser (0.9.0)
factory_girl (4.3.0) factory_girl (4.3.0)
activesupport (>= 3.0.0) activesupport (>= 3.0.0)
factory_girl_rails (4.3.0) factory_girl_rails (4.3.0)
@@ -87,12 +90,25 @@ GEM
formtastic-bootstrap (2.1.3) formtastic-bootstrap (2.1.3)
formtastic (~> 2.2) formtastic (~> 2.2)
git (1.2.6) git (1.2.6)
github-markup (0.7.5)
gitlab-grit (2.6.0)
charlock_holmes (~> 0.6.9)
diff-lcs (~> 1.1)
mime-types (~> 1.15)
posix-spawn (~> 0.3.6)
globalize (3.0.4) globalize (3.0.4)
activemodel (>= 3.0.0, < 4.0.0) activemodel (>= 3.0.0, < 4.0.0)
activerecord (>= 3.0.0, < 4.0.0) activerecord (>= 3.0.0, < 4.0.0)
globalize-versioning (0.1.0.alpha.1) globalize-versioning (0.1.0.alpha.1)
globalize (>= 3, < 5) globalize (>= 3, < 5)
paper_trail (~> 3.0.0) paper_trail (~> 3.0.0)
gollum-lib (2.0.0)
github-markup (>= 0.7.5, < 1.0.0)
gitlab-grit (= 2.6.0)
nokogiri (~> 1.6.0)
rouge (~> 1.3.1)
sanitize (~> 2.0.6)
stringex (~> 2.1.0)
haml (4.0.5) haml (4.0.5)
tilt tilt
hashie (2.0.5) hashie (2.0.5)
@@ -150,6 +166,7 @@ GEM
cocaine (~> 0.5.0) cocaine (~> 0.5.0)
mime-types mime-types
polyglot (0.3.3) polyglot (0.3.3)
posix-spawn (0.3.8)
pyu-ruby-sasl (0.0.3.3) pyu-ruby-sasl (0.0.3.3)
rack (1.4.5) rack (1.4.5)
rack-cache (1.2) rack-cache (1.2)
@@ -177,8 +194,10 @@ GEM
rdoc (3.12.2) rdoc (3.12.2)
json (~> 1.4) json (~> 1.4)
ref (1.0.5) ref (1.0.5)
rinku (1.7.3)
rmagick (2.13.2) rmagick (2.13.2)
rolify (3.2.0) rolify (3.2.0)
rouge (1.3.4)
rspec-core (2.14.7) rspec-core (2.14.7)
rspec-expectations (2.14.4) rspec-expectations (2.14.4)
diff-lcs (>= 1.1.3, < 2.0) diff-lcs (>= 1.1.3, < 2.0)
@@ -208,6 +227,7 @@ GEM
rack (~> 1.0) rack (~> 1.0)
tilt (~> 1.1, != 1.3.0) tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.8) sqlite3 (1.3.8)
stringex (2.1.2)
themes_for_rails (0.5.1) themes_for_rails (0.5.1)
rails (>= 3.0.0) rails (>= 3.0.0)
therubyracer (0.12.0) therubyracer (0.12.0)
@@ -226,11 +246,17 @@ GEM
json (>= 1.8.0) json (>= 1.8.0)
warden (1.2.3) warden (1.2.3)
rack (>= 1.0) rack (>= 1.0)
webrick (1.3.1)
wikicloth (0.8.1)
builder
expression_parser
rinku
PLATFORMS PLATFORMS
ruby ruby
DEPENDENCIES DEPENDENCIES
RedCloth
annotate (>= 2.5.0) annotate (>= 2.5.0)
awesome_nested_set awesome_nested_set
bootstrap-addons-rails bootstrap-addons-rails
@@ -247,6 +273,7 @@ DEPENDENCIES
git git
globalize (~> 3.0.4) globalize (~> 3.0.4)
globalize-versioning globalize-versioning
gollum-lib
haml haml
jquery-fileupload-rails jquery-fileupload-rails
jquery-rails jquery-rails
@@ -271,3 +298,5 @@ DEPENDENCIES
therubyracer therubyracer
tinymce-rails (~> 3.5.8) tinymce-rails (~> 3.5.8)
uglifier (>= 1.0.3) uglifier (>= 1.0.3)
webrick (= 1.3.1)
wikicloth

View File

@@ -18,7 +18,7 @@ def get_theme
params[:theme] params[:theme]
else else
"2003" "blue1"
end end
end end
def default_url_options def default_url_options

View File

@@ -46,19 +46,29 @@ class AttachmentsController < ApplicationController
# POST /attachments.json # POST /attachments.json
def create def create
@attachment = Attachment.new(params[:attachment]) @attachment = Attachment.new(params[:attachment])
@thema = Thema.find(params[:thema_id]) @thema = Thema.find_by_id(params[:thema_id])
@attachment.thema_id = @thema.id # logger.info "gg"
@action="create" @attachment.thema = @thema
logger.info "#{@attachment.inspect}" @attachment.name=@attachment.datei.filename
@action="create"
# logger.info "sdf"
respond_to do |format| respond_to do |format|
if @attachment.save if @attachment.save
format.html { redirect_to @thema, notice: 'Attachment was successfully created.' } format.html {
format.json { render json: @thema, status: :created, location: @thema } render :json => [@attachment.to_jq_upload].to_json,
format.js { } :content_type => 'text/html',
:layout => false
}
# format.html { redirect_to @thema, notice: 'Attachment was successfully created.' }
format.json { render json: {files: [@attachment.to_jq_upload]}, status: :created, location: [@thema, @attachment]}
else else
format.html { render action: "new" } format.html { render action: "new" }
format.json { render json: @attachment.errors, status: :unprocessable_entity } format.json { render json: @attachment.errors, status: :unprocessable_entity }
format.js { render action: "new.js.erb"}
end end
end end
end end

View File

@@ -12,9 +12,12 @@ class FetprofilesController < ApplicationController
@gremientabs = Gremium.tabs @gremientabs = Gremium.tabs
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb
format.json { render json: @fetprofiles } end
end
end end
def internlist
@fetprofiles = Fetprofile.order(:vorname,:nachname)
end
# GET /fetprofiles/1 # GET /fetprofiles/1
# GET /fetprofiles/1.json # GET /fetprofiles/1.json

View File

@@ -7,6 +7,8 @@ class GremienController < ApplicationController
@gremien = Gremium.all @gremien = Gremium.all
@gremientabs=Gremium.tabs @gremientabs=Gremium.tabs
@toolbar_elements << {:text=>I18n.t('gremium.new'),:path=>new_gremium_path() ,:icon=>:plus} if can? :new, Gremium @toolbar_elements << {:text=>I18n.t('gremium.new'),:path=>new_gremium_path() ,:icon=>:plus} if can? :new, Gremium
@toolbar_elements << {:text=>I18n.t('profile.new'),:path=>new_fetprofile_path() ,:icon=>:plus} if can? :new, Fetprofile
respond_to do |format| respond_to do |format|
format.html # index.html.erb format.html # index.html.erb
format.json { render json: @gremien } format.json { render json: @gremien }

View File

@@ -12,6 +12,7 @@ class HomeController < ApplicationController
def intern def intern
authorize! :seeintern, User authorize! :seeintern, User
@neuigkeiten = Neuigkeit.intern.recent @neuigkeiten = Neuigkeit.intern.recent
@themengruppen=Themengruppe.intern
end end
def startdev def startdev
render 'setup_fetsite_dev' render 'setup_fetsite_dev'

View File

@@ -8,7 +8,7 @@ class RubrikenController < ApplicationController
@rubriken = Rubrik.where(:public=>true) @rubriken = Rubrik.where(:public=>true)
end end
@neuigkeiten = @rubriken.collect(&:neuigkeiten).map(&:recent).flatten @neuigkeiten = @rubriken.collect(&:neuigkeiten).map(&:recent).flatten
@calentries= @rubriken.collect(&:calendar).collect(&:calentries).flatten @calentries= @rubriken.collect(&:calentries).flatten
end end
def intern def intern

View File

@@ -32,6 +32,9 @@ class ThemenController < ApplicationController
end end
def verwalten def verwalten
@thema = Thema.find(params[:id]) @thema = Thema.find(params[:id])
@attachment=Attachment.new
@fragen=@thema.fragen @fragen=@thema.fragen
@toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>"Verwalten", :path=>verwalten_thema_path(@thema)}] @toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>"Verwalten", :path=>verwalten_thema_path(@thema)}]
@@ -54,6 +57,10 @@ class ThemenController < ApplicationController
# GET /themen/1/edit # GET /themen/1/edit
def edit def edit
@thema = Thema.find(params[:id]) @thema = Thema.find(params[:id])
unless ( @thema.wikiname.nil? || @thema.wikiname.empty? )
redirect_to edit_wiki_path(Wiki.find(@thema.id))
return
end
respond_to do |format| respond_to do |format|
format.html format.html
format.js format.js
@@ -88,6 +95,7 @@ class ThemenController < ApplicationController
def attachments def attachments
@thema = Thema.find(params[:id]) @thema = Thema.find(params[:id])
@attachments=@thema.attachments @attachments=@thema.attachments
@attachment=Attachment.new
respond_to do |format| respond_to do |format|
format.js format.js
end end

View File

@@ -24,10 +24,7 @@ class ThemengruppenController < ApplicationController
@themen = @themengruppe.themen.order(:priority).reverse @themen = @themengruppe.themen.order(:priority).reverse
@toolbar_elements = [] @toolbar_elements = []
@toolbar_elements << {:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('thema.add'), :path=>new_themengruppe_thema_path(@themengruppe)} if can? :new, Themengruppe
@toolbar_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('themengruppe.edit'), :path=>edit_themengruppe_path(@themengruppe)} if can? :edit, @themengruppe
@toolbar_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t("themengruppe.manage"), :path=>themengruppe_verwalten_path(@themengruppe)} if can? :edit, @themengruppe @toolbar_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t("themengruppe.manage"), :path=>themengruppe_verwalten_path(@themengruppe)} if can? :edit, @themengruppe
@toolbar_elements << {:hicon=>'icon-remove-circle',:text=>I18n.t('themengruppe.remove'), :path=>themengruppe_path(@themengruppe), :method=>:delete,:confirm=>I18n.t('themengruppe.sure')} if can? :delete, @themengruppe
respond_to do |format| respond_to do |format|
format.html # show.html.erb format.html # show.html.erb
@@ -52,10 +49,18 @@ class ThemengruppenController < ApplicationController
end end
def verwalten_all def verwalten_all
@themengruppen =Themengruppe.order(:priority).reverse @themengruppen =Themengruppe.order(:priority).reverse
end @toolbar_elements = [{:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.new'), :path=>new_themengruppe_path()}]
end
def verwalten def verwalten
@themengruppe = Themengruppe.find(params[:themengruppe_id]) @themengruppe = Themengruppe.find(params[:themengruppe_id])
@themen = @themengruppe.themen.order(:priority).reverse @themen = @themengruppe.themen.order(:priority).reverse
@toolbar_elements =[]
@toolbar_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('themengruppe.edit'), :path=>edit_themengruppe_path(@themengruppe)} if can? :edit, @themengruppe
@toolbar_elements << {:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('thema.add'), :path=>new_themengruppe_thema_path(@themengruppe)} if can? :new, Themengruppe
@toolbar_elements << {:hicon=>'icon-remove-circle',:text=>I18n.t('themengruppe.remove'), :path=>themengruppe_path(@themengruppe), :method=>:delete,:confirm=>I18n.t('themengruppe.sure')} if can? :delete, @themengruppe
end end
def sort_themengruppen def sort_themengruppen

View File

@@ -0,0 +1,46 @@
class WikisController < ApplicationController
load_and_authorize_resource
def show
@wiki = Wiki.find(params[:id])
@fragen = @wiki.fragen
@toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('wiki.edit'), :path=>verwalten_wiki_path(@wiki)}]
end
def wiki
@wiki = Wiki.find_or_init(params[:name])
@fragen = @wiki.fragen
@toolbar_elements = []
# @toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('wiki.edit'), :path=>verwalten_wiki_path(@wiki)}]
redirect_to wiki_path(@wiki)
end
def edit
@wiki = Wiki.find(params[:id])
respond_to do |format|
format.html
format.js
end
end
def update
@wiki = Wiki.find(params[:id])
@themen = @wiki.themengruppe.themen.order(:priority).reverse
@wiki.raw_data=params[:wiki][:raw_data]
respond_to do |format|
if @wiki.update_attributes(params[:wiki])
format.html { redirect_to verwalten_thema_path(@wiki), notice: 'Thema was successfully updated.' }
format.json { head :no_content }
format.js
else
format.html { render action: "edit" }
format.json { render json: @wiki.errors, status: :unprocessable_entity }
format.js { render action: "edit" }
end
end
end
end

View File

@@ -12,9 +12,22 @@
class Attachment < ActiveRecord::Base class Attachment < ActiveRecord::Base
has_paper_trail has_paper_trail
attr_accessible :name, :datei attr_accessible :name, :datei, :datei_cache
belongs_to :thema belongs_to :thema
mount_uploader :datei, AttachmentUploader mount_uploader :datei, AttachmentUploader
validates :thema, :presence => true validates :thema, :presence => true
validates :name, :presence => true validates :name, :presence => true
def to_jq_upload
{
"id" => read_attribute(:id),
"title" => read_attribute(:title),
"description" => read_attribute(:desc),
"name" => read_attribute(:title),
"size" => datei.size,
"url" => datei.url,
"thumbnail_url" => datei.thumb.url,
"delete_type" => "DELETE"
}
end
end end

View File

@@ -32,7 +32,7 @@ class Calentry < ActiveRecord::Base
resourcify resourcify
def get_public def get_public
self.public = (self.try(:object).nil?)? (self.calendar.try(:public)) : object.try(:public) self.public = (self.try(:object).nil?)? (self.calendar.try(:public?)) : object.try(:public?)
true true
end end
def start_time def start_time

View File

@@ -15,19 +15,27 @@
# #
class Fetprofile < ActiveRecord::Base class Fetprofile < ActiveRecord::Base
attr_accessible :active, :desc, :fetmailalias, :nachname, :picture, :short, :vorname, :memberships_attributes, :remove_picture, :picture_cache attr_accessible :active, :desc, :fetmailalias, :nachname, :picture, :short, :vorname, :memberships_attributes, :remove_picture, :picture_cache, :plz, :street, :city, :instant,:skype, :telnr, :hdynr, :birth_day, :birth_month, :birth_year,:geschlecht
has_many :memberships, dependent: :delete_all has_many :memberships, dependent: :delete_all
has_many :gremien, :through=> :membership has_many :gremien, :through=> :membership
mount_uploader :picture, PictureUploader mount_uploader :picture, PictureUploader
has_paper_trail has_paper_trail
validates :desc, :presence=>true validates :desc, :presence=>true
validates :nachname, length:{minimum: 3},:presence=>true validates :nachname, length:{minimum: 3},:presence=>true
validates :vorname, length:{minimum: 3},:presence=>true validates :vorname, length:{minimum: 3},:presence=>true
validate :validate_birthday
GESCHLECHT={0=>"gendered", 1=>"maennlich", 2=>"weiblich"}
has_many :users has_many :users
scope :search, ->(query) {where("nachname like ? or vorname like ? or short like ?", "%#{query}%", "%#{query}%", "%#{query}%")} scope :search, ->(query) {where("nachname like ? or vorname like ? or short like ?", "%#{query}%", "%#{query}%", "%#{query}%")}
accepts_nested_attributes_for :memberships, :reject_if=>lambda{|a| a[:typ].blank?|| a[:start].blank? ||a[:gremium_id].blank?}, :allow_destroy=>true accepts_nested_attributes_for :memberships, :reject_if=>lambda{|a| a[:typ].blank?|| a[:start].blank? ||a[:gremium_id].blank?}, :allow_destroy=>true
has_many :nlinks, as: :link has_many :nlinks, as: :link
def validate_birthday
unless Date.valid_date?(birth_year, birth_month, birth_day)
errors.add(:birth_month, "Invalides Datum")
errors.add(:birth_day, "Invalides Datum")
end
end
def title def title
self.name self.name
@@ -39,4 +47,15 @@ validates :desc, :presence=>true
def fetmail def fetmail
(fetmailalias.nil? || fetmailalias.empty?) ? short.to_s + "@fet.at" : fetmailalias.to_s + "@fet.at" (fetmailalias.nil? || fetmailalias.empty?) ? short.to_s + "@fet.at" : fetmailalias.to_s + "@fet.at"
end end
def adress
connector= (self.street.nil?||self.street.empty?||(self.city.empty? && self.plz.empty?)) ? '' : ', '
self.plz.to_s + ' ' + self.city.to_s + connector.to_s + self.street.to_s
end
def birthday
if self.birth_year.nil? || self.birth_year.zero?
Date.new( Date.today.year,self.birth_month,self.birth_day)
else
Date.new( self.birth_year,self.birth_month,self.birth_day)
end
end
end end

View File

@@ -14,8 +14,8 @@
class Gremium < ActiveRecord::Base class Gremium < ActiveRecord::Base
TYPEN={1=>"offiziell", 2=>"offiziell-temporär", 3 => "inoffiziell",4=>"inoffiziell-tempo", 11=> "berufungskommission",12=> "habilitationskommission" } # Kategorien, im Wesentlichen wichtig für Listung oder nicht Listung TYPEN={1=>"offiziell", 2=>"offiziell-temporär", 3 => "inoffiziell",4=>"inoffiziell-tempo", 11=> "berufungskommission",12=> "habilitationskommission" } # Kategorien, im Wesentlichen wichtig für Listung oder nicht Listung
GESCHLECHT={0=>"saechlich", 1 => "maennlich", 2 => "weiblich"} # Geschlecht des Gremiums zur richtige Deklination GESCHLECHT={0=>"saechlich", 1 => "maennlich", 2 => "weiblich"} # Geschlecht des Gremiums zur richtige Deklination
ART2FALL={0=>"des", 1=>"des",2=>"der"} # Artikel 2.Fall abhängig vom Geschlecht ART2FALL={0=>"des", 1=>"des",2=>"der"} # Artikel 2.Fall abhängig vom Geschlecht
ART4FALL={0=>"das", 1=>"den",2=>"die"} # Artikel 2.Fall abhängig vom Geschlecht ART4FALL={0=>"das", 1=>"den",2=>"die"} # Artikel 2.Fall abhängig vom Geschlecht
FILTER={11=>I18n.t("gremium.filter.berufung.title"),12=>I18n.t("gremium.filter.habil.title")} FILTER={11=>I18n.t("gremium.filter.berufung.title"),12=>I18n.t("gremium.filter.habil.title")}
TEXT={11=>I18n.t("gremium.filter.berufung.text"),12=>I18n.t("gremium.filter.habil.text")} TEXT={11=>I18n.t("gremium.filter.berufung.text"),12=>I18n.t("gremium.filter.habil.text")}

View File

@@ -58,12 +58,14 @@ class Lva < ActiveRecord::Base
validates_presence_of :modul # Zugehöriges Modul eingetragen? validates_presence_of :modul # Zugehöriges Modul eingetragen?
# (zumindest eines) # (zumindest eines)
def typ_n
typ=="andere" ? "" : typ
end
def title def title
self.name self.name
end end
def full_name def full_name
return self.typ + ' ' + self.name return self.typ_n + ' ' + self.name
end end
def add_semesters def add_semesters
# Diese Methode fügt die Instanz automatisch zu allen Studien als "Ohne Semesterempfehlung" (Semester 0) zu, bei denen die Instanz im Studium noch nicht vorkommt. # Diese Methode fügt die Instanz automatisch zu allen Studien als "Ohne Semesterempfehlung" (Semester 0) zu, bei denen die Instanz im Studium noch nicht vorkommt.

View File

@@ -14,6 +14,7 @@
class Membership < ActiveRecord::Base class Membership < ActiveRecord::Base
TYPEN={-2=>"VorsitzendeR", -1=>"stv VorsitzendeR", 0=>"2. stv VorsitzendeR", 1=>"Mitglied",2=> "Ersatzmitglied",3=>"VerantwortlicheR"} TYPEN={-2=>"VorsitzendeR", -1=>"stv VorsitzendeR", 0=>"2. stv VorsitzendeR", 1=>"Mitglied",2=> "Ersatzmitglied",3=>"VerantwortlicheR"}
TYPEN_g={0=>TYPEN, 1=>{ -2=>"Vorsitzender", -1=>"stv Vorsitzender", 0=>"2. stv Vorsitzender", 1=>"Mitglied",2=> "Ersatzmitglied",3=>"Verantwortlicher"},2=>{-2=>"Vorsitzende", -1=>"stv Vorsitzende", 0=>"2. stv Vorsitzende", 1=>"Mitglied",2=> "Ersatzmitglied",3=>"Verantwortliche"}}
attr_accessible :fetprofile_id, :gremium_id, :start, :stop, :typ attr_accessible :fetprofile_id, :gremium_id, :start, :stop, :typ
belongs_to :fetprofile belongs_to :fetprofile
belongs_to :gremium belongs_to :gremium

View File

@@ -12,7 +12,7 @@
# #
class Modul < ActiveRecord::Base class Modul < ActiveRecord::Base
attr_accessible :desc,:name, :depend, :studium_id, :modulgruppen attr_accessible :desc,:name, :depend, :studium_id, :modulgruppen, :modulgruppe_ids
has_and_belongs_to_many :lvas , :uniq=>true has_and_belongs_to_many :lvas , :uniq=>true
has_and_belongs_to_many :modulgruppen has_and_belongs_to_many :modulgruppen

View File

@@ -22,7 +22,9 @@ class Thema < ActiveRecord::Base
validates :text, :presence => true validates :text, :presence => true
scope :search, ->(query) {where("text like ? or title like ?", "%#{query}%", "%#{query}%")} scope :search, ->(query) {where("text like ? or title like ?", "%#{query}%", "%#{query}%")}
translates :title,:text, :versioning =>true, :fallbacks_for_empty_translations => true translates :title,:text, :versioning =>true, :fallbacks_for_empty_translations => true
def is_wiki?
wikiname.nil? || wikiname.empty?
end
def text_first_words def text_first_words
md = /<p>(?<text>[^\<\>]*)/.match Sanitize.clean(self.text,:elements=>['p']) md = /<p>(?<text>[^\<\>]*)/.match Sanitize.clean(self.text,:elements=>['p'])
words=md[:text].split(" ") unless md.nil? words=md[:text].split(" ") unless md.nil?

View File

@@ -10,7 +10,7 @@
class Themengruppe < ActiveRecord::Base class Themengruppe < ActiveRecord::Base
WORD_COUNT = 50 WORD_COUNT = 50
attr_accessible :text, :title, :picture, :priority attr_accessible :text, :title, :picture, :priority, :public
has_many :themen, class_name: 'Thema' has_many :themen, class_name: 'Thema'
has_many :fragen, through: :themen has_many :fragen, through: :themen
@@ -20,4 +20,17 @@ class Themengruppe < ActiveRecord::Base
validates :text, :presence => true validates :text, :presence => true
translates :title,:text, :versioning =>true, :fallbacks_for_empty_translations => true translates :title,:text, :versioning =>true, :fallbacks_for_empty_translations => true
scope :intern,-> {where(:public=>false)}
def self.find_wiki_default
where(:wiki_default=>true).first
end
def make_wiki_default
Themengruppe.where(:wiki_default=>:true).update_all(:wiki_default=>:false)
self.wiki_default=true;
self.save;
end
end end

73
app/models/wiki.rb Normal file
View File

@@ -0,0 +1,73 @@
class Wiki < Thema
validates :wikiname, :uniqueness=>true, :presence=>true
after_initialize :load_wiki
attr_accessible :wikiname, :wikiformat, :hidelink, :raw_data
WIKIFORMATS={nil=> :textile, 0 =>:textile, 1=> :mediawiki}
def self.find_or_init(name)
w = Wiki.where(:wikiname=>name).first
page = is_file_availaible(name)
if w.nil?
unless page.nil?
w=Wiki.new(:wikiname=>name, :title=>name, :wikiformat=>Wiki::WIKIFORMATS.invert[page.format], :hidelink=>true)
else
w=Wiki.new(:wikiname=>name, :title=>name, :wikiformat=>0, :hidelink=>true)
wiki = Gollum::Wiki.new("../wiki.git", :base_path => "/wiki")
page=wiki.write_page(name, :textile, "ioi", self.commit)
w.reload_page
end
w.themengruppe = Themengruppe.find_wiki_default
w.raw_data="Neues Wiki"
w.save
end
w
end
def raw_data
self.page.raw_data
end
def raw_data=(data)
self.get_page(self.wikiname)
self.wiki.update_page(self.page, self.wikiname, Wiki::WIKIFORMATS[self.wikiformat], data, self.commit)
self.text=self.page.formatted_data
end
def page
self.get_page(wikiname) if @page.nil?
@page
end
def wiki
@wiki
end
def reload_page
self.get_page(self.wikiname)
end
protected
def self.is_file_availaible(name)
wiki = Gollum::Wiki.new("../wiki.git", :base_path => "/wiki")
wiki.page(name)
end
def load_wiki
@wiki = Gollum::Wiki.new("../wiki.git", :base_path => "/wiki")
end
def get_page(name)
@page= @wiki.page(name)
@page=self.wiki.write_page(self.wikiname, Wiki::WIKIFORMATS[self.wikiformat]," ",self.commit) if @page.nil?
@page
end
def commit
{message: "RailsUpdate", name:"SomeUser", email: "ttt@t"}
end
def self.commit
{message: "RailsUpdate", name:"SomeUser", email: "ttt@t"}
end
end

View File

@@ -6,6 +6,9 @@ class AttachmentUploader < CarrierWave::Uploader::Base
include CarrierWave::RMagick include CarrierWave::RMagick
# include CarrierWave::RMagick # include CarrierWave::RMagick
# include CarrierWave::MiniMagick # include CarrierWave::MiniMagick
def root
Rails.root.join 'public/'
end
# Choose what kind of storage to use for this uploader: # Choose what kind of storage to use for this uploader:
storage :file storage :file
@@ -20,6 +23,9 @@ class AttachmentUploader < CarrierWave::Uploader::Base
version :thumb do version :thumb do
process :resize_to_fill => [64, 64] process :resize_to_fill => [64, 64]
end end
version :thumb_small do
process :resize_to_fill => [32, 32]
end
# Provide a default URL as a default if there hasn't been a file uploaded: # Provide a default URL as a default if there hasn't been a file uploaded:
# def default_url # def default_url

View File

@@ -1,9 +1,9 @@
<% data_ext = attachment.datei.file.extension.downcase %> <% data_ext = attachment.datei.file.extension.downcase %>
<%= attachment.name %> </br>
<% if (!["jpg","png","jpeg"].find_index(data_ext).nil?) %> <% if (!["jpg","png","jpeg"].find_index(data_ext).nil?) %>
<%= image_tag attachment.datei.thumb.url %> <%= image_tag attachment.datei.thumb.url %>
<% else %> <% else %>
<%= image_tag "pdf-logo.jpg" %> <%= image_tag "pdf-logo.jpg" %>
<% end %> <% end %>
<%= attachment.name %>

View File

@@ -0,0 +1,143 @@
<div class="container-fluid">
<%= semantic_form_for [@thema,@attachment], :remote=>true, :html => { :multipart => true, :id => "fileupload" } do |f| %>
<!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload -->
<div class="row-fluid">
<div class="span7">
<div class="fileupload-buttonbar">
<!-- The fileinput-button span is used to style the file input field as button -->
<span class="btn btn-success fileinput-button">
<i class="icon-plus icon-white"></i>
<span>Add files...</span>
<%= f.file_field :datei, :multiple=>true %>
<% f.input :thema %>
</span>
<button type="submit" class="btn btn-primary start">
<i class="icon-upload icon-white"></i>
<span>Start upload</span>
</button>
<button type="reset" class="btn btn-warning cancel">
<i class="icon-ban-circle icon-white"></i>
<span>Cancel upload</span>
</button>
<button type="button" class="btn btn-danger delete">
<i class="icon-trash icon-white"></i>
<span>Delete</span>
</button>
<input type="checkbox" class="toggle">
</div>
<div class="span5">
<!-- The global progress bar -->
<div class="progress progress-success progress-striped active fade">
<div class="bar" style="width:100%;"></div>
</div>
</div>
</div>
</div>
<!-- The loading indicator is shown during image processing -->
<div class="fileupload-loading"></div>
<br>
<!-- The table listing the files available for upload/download -->
<table class="table table-striped"><tbody class="files" data-toggle="modal-lva" data-target="#modal-lva"></tbody>
</table>
<% end %>
</div>
<script>
var fileUploadErrors = {
maxFileSize: 'File is too big',
minFileSize: 'File is too small',
acceptFileTypes: 'Filetype not allowed',
maxNumberOfFiles: 'Max number of files exceeded',
uploadedBytes: 'Uploaded bytes exceed file size',
emptyResult: 'Empty file upload result'
};
</script>
<!-- The template to display files available for upload -->
<script id="template-upload" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-upload fade">
<!--<td class="preview"><span class="fade"></span></td>-->
<td class="name"><span>{%=file.name %}</span></td>
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
{% if (file.error) { %}
<td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
{% } else if (o.files.valid && !i) { %}
<td>
<div class="progress progress-success progress-striped active"><div class="bar" style="width:0%;"></div></div>
</td>
<td class="start">{% if (!o.options.autoUpload) { %}
<button class="btn btn-primary">
<i class="icon-upload icon-white"></i>
<span>{%=locale.fileupload.start%}</span>
</button>
{% } %}</td>
{% } else { %}
<td colspan="2"></td>
{% } %}
<td class="cancel">{% if (!i) { %}
<button class="btn btn-warning">
<i class="icon-ban-circle icon-white"></i>
<span>{%=locale.fileupload.cancel%}</span>
</button>
{% } %}</td>
</tr>
{% } %}
</script>
<!-- The template to display files available for download -->
<script id="template-download" type="text/x-tmpl">
{% for (var i=0, file; file=o.files[i]; i++) { %}
<tr class="template-download fade">
{% if (file.error) { %}
<td></td>
<td class="name"><span>{%=file.name%}</span></td>
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
<td class="error" colspan="2"><span class="label label-important">{%=locale.fileupload.error%}</span> {%=locale.fileupload.errors[file.error] || file.error%}</td>
{% } else { %}
<!--<td class="preview">{% if (file.thumbnail_url) { %}
<a href="{%=file.url%}" title="{%=file.name%}" rel="lva" download="{%=file.name%}"><img src="{%=file.thumbnail_url%}"></a>
{% } %}</td>-->
<td class="name">
<a href="{%=file.url%}" title="{%=file.name%}" rel="{%=file.thumbnail_url&&'lva'%}" download="{%=file.name%}">{%=file.name%}</a>
</td>
<td class="size"><span>{%=o.formatFileSize(file.size)%}</span></td>
<td colspan="2"></td>
{% } %}
<td class="delete">
<button class="btn btn-danger" data-type="{%=file.delete_type%}" data-url="{%=file.delete_url%}">
<i class="icon-trash icon-white"></i>
<span>{%=locale.fileupload.destroy%}</span>
</button>
<input type="checkbox" name="delete" value="1">
</td>
</tr>
{% } %}
</script>
<script type="text/javascript" charset="utf-8">
$(function () {
// Initialize the jQuery File Upload widget:
$('#fileupload').fileupload();
//
// Load existing files:
$.getJSON($('#fileupload').prop('action'), function (files) {
var fu = $('#fileupload').data('blueimpFileupload'),
template;
fu._adjustMaxNumberOfFiles(-files.length);
console.log(files);
// no Download on Upload form
//template = fu._renderDownload(files)
//.appendTo($('#fileupload .files'));
// Force reflow:
fu._reflow = fu._transition && template.length &&
template[0].offsetWidth;
template.addClass('in');
$('#loading').remove();
});
$('#attachment_datei').attr('name', 'attachment[datei]');
$('#attachment_datei').fileupload();
});
</script>

View File

@@ -15,7 +15,7 @@
</div> </div>
</div> </div>
<div class="row-fluid"> <div class="row-fluid">
<div class="span4"> <%= f.input :active %></div> <div class="span4"> <%= f.input :active %> <%= f.input :geschlecht,:as=>:select, :collection=>Fetprofile::GESCHLECHT.invert %></div>
<div class="span4"> <div class="span4">
<%= image_tag(@fetprofile.picture.thumb.url) unless @fetprofile.picture.nil? %> <%= image_tag(@fetprofile.picture.thumb.url) unless @fetprofile.picture.nil? %>
<%= f.file_field :picture %> <%= f.file_field :picture %>
@@ -28,24 +28,35 @@
<div class="span4"> <%= f.input :fetmailalias %></div> <div class="span4"> <%= f.input :fetmailalias %></div>
</div> </div>
<% @memberships.each do |m| %> <div class="row-fluid">
<div class="span6">
Adresse:
<%= f.semantic_fields_for :memberships, m do |membership| %> <%=f.input :street %>
<%=f.input :plz %>
<div class="row-fluid"> <%=f.input :city %>
KOntakt:
<%=f.input :instant %>
<div class="span3"><%= membership.input :start, :as=>:datepicker, :prepend=>"von",:label=>false%></div> <%=f.input :skype %>
<div class="span3"><%= membership.input :stop, :as=>:datepicker,:label=>false, :prepend =>"bis" %></div> <%=f.input :telnr %>
<div class="span2"><%= membership.input :typ ,:as=>:select, :collection=>Membership::TYPEN.invert, :label=>false %></div> <%=f.input :hdynr %>
<div class="span3"><%= membership.input :gremium, :label=>false %>
</div> </div>
<div class="span1"><%= membership.check_box :_destroy %> <%= I18n.t 'common.delete' %></div> <div class="span6">
Geburtstag:
<%=f.input :birth_day %>
<%=f.input :birth_month %>
<%=f.input :birth_year %>
</div>
</div> </div>
<% end %> <div id="memberships_form_list">
<% end %> <% end %> <% @memberships.each do |m| %>
<%= render partial:"membership_fields", object: m , locals: {:f=>f} %>
<% end %>
</div>
<% end %>
<div class="row-fluid"> <div class="row-fluid">
<div class="span12"> <div class="span12">
<%= f.actions do %> <%= f.actions do %>

View File

@@ -0,0 +1,16 @@
<p>
<b>Geburtstag</b> <%= %>
</p>
<p>
<b>Adresse:</b>
<%= interninfo.plz %>
<%= interninfo.city %>,
<%= interninfo.street %>
</p>
<p>
<%= raw("<b>Telefon: </b>")+ interninfo.telnr + "<br>" unless interninfo.telnr.empty?%>
<%= raw("<b>Handy: </b>") +interninfo.hdynr unless interninfo.hdynr.empty? %><br>
<%= raw("<b>Skype: </b>") +interninfo.skype unless interninfo.skype.empty? %><br>
<%= raw("<b>Instant Messaging: </b>") +interninfo.instant unless interninfo.instant.empty? %><br>
</p>

View File

@@ -0,0 +1,12 @@
<tr>
<td> <%= link_to internrow.name, internrow %>
</td>
<td> <%= internrow.adress %></td>
<td>
<%= raw("Telefon: ")+ internrow.telnr + "<br>" unless internrow.telnr.nil? || internrow.telnr.empty?%>
<%= raw("Handy: ") +internrow.hdynr + raw("<br>") unless internrow.hdynr.nil? || internrow.hdynr.empty? %>
<%= raw("Skype: ") +internrow.skype + raw("<br>") unless internrow.skype.nil? || internrow.skype.empty? %>
<%= raw("Instant Messaging: ") +internrow.instant + raw("<br>") unless internrow.instant.nil? || internrow.instant.empty? %>
</td>
<td><%= internrow.fetmail %></td>
</tr>

View File

@@ -0,0 +1,13 @@
<%= f.semantic_fields_for :memberships, membership_fields do |membership| %>
<table><tr><td>
<%= membership.input :start, :as=>:datepicker, :prepend=>"von",:label=>false , :input_html => { :style => "width:6em"} %>
</td><td>
<%= membership.input :stop, :as=>:datepicker,:label=>false, :prepend =>"bis" , :input_html => { :style => "width:6em"}%></td><td>
<%= membership.input :typ ,:as=>:select, :collection=>Membership::TYPEN.invert, :label=>false , :input_html => { :style => "width:12em" }%></td><td>
<%= membership.input :gremium, :label=>false %>
</td><td>
<%= membership.check_box :_destroy %> <%= I18n.t 'common.delete' %></td></tr></table>
<% end %>

View File

@@ -0,0 +1,5 @@
<table style="width:100%" class="table table-striped">
<% @fetprofiles.each do |item| %>
<%= render partial: "internrow", object: item %>
<% end %>
</table>

View File

@@ -10,10 +10,15 @@
<p> <p>
<%= @fetprofile.fetmail %> <%= @fetprofile.fetmail %>
</p> </p>
<p> respond_to do |format|
format.html # index.html.erb
format.json { render json: @fetprofiles }
end
<p>
<%= @fetprofile.desc %> <%= @fetprofile.desc %>
</p> </p>
<%= render partial: "interninfo", object: @fetprofile if can?(:seeintern, @fetprofile) %>
<ul> <ul>
<% @memberships.each do |m| %> <% @memberships.each do |m| %>
<li> <li>

View File

@@ -10,3 +10,5 @@
<%= f.action :submit, :as => :input %> <%= f.action :submit, :as => :input %>
<% end %> <% end %>
<% end %> <% end %>
<%= tinymce %>

View File

@@ -10,3 +10,4 @@
<%= f.action :submit, :as => :input %> <%= f.action :submit, :as => :input %>
<% end %> <% end %>
<% end %> <% end %>
<%= tinymce %>

View File

@@ -7,35 +7,29 @@
<%= f.input :thema, :as=> :select, :collection => Thema.all %> <%= f.input :thema, :as=> :select, :collection => Thema.all %>
<% f.inputs :for => :memberships, :objects=>@memberships do |membership,i| %>
<div class="row-fluid">
<div class="span1"></div>
<div class="span3"><%= membership.input :start, :as=>:datepicker, :prepend=>"von",:label=>false%></div>
<div class="span3"><%= membership.input :stop, :as=>:datepicker,:label=>false, :prepend =>"bis" %></div>
<div class="span2"><%= membership.input :typ ,:as=>:select, :collection=>Membership::TYPEN.invert, :label=>false %></div>
<div class="span3"><%= membership.input :fetprofile, :as=>:select, :label=>false %></div>
</div>
<% end %>
<% @memberships.each do |m| %>
<% @memberships.each do |m| %>
<%= f.semantic_fields_for :memberships, m do |memberships_attributes| %> <%= f.semantic_fields_for :memberships, m do |memberships_attributes| %>
<div class="row-fluid"> <div class="row-fluid">
<div class="span1"></div> <div class="span1"></div>
<div class="span3"><%= memberships_attributes.input :start, :as=>:datepicker, :prepend=>"von",:label=>false%></div> <div class="span11">
<div class="span3"><%= memberships_attributes.input :stop, :as=>:datepicker,:label=>false, :prepend =>"bis" %></div> <table>
<div class="span2"><%= memberships_attributes.input :typ ,:as=>:select, :collection=>Membership::TYPEN.invert, :label=>false %></div> <tr><td><%= memberships_attributes.input :start, :as=>:datepicker, :prepend=>"von",:label=>false , :input_html => { :style => "width:6em" } ,:value=>Proc.new { |c| I18n.l(c) }%>
<div class="span3"><%= memberships_attributes.input :fetprofile, :as=>:select, :label=>false %></div> </td>
<td>
<%= memberships_attributes.input :stop, :as=>:datepicker,:label=>false, :prepend =>"bis" , :input_html => { :style => "width:6em"},:value_method=>Proc.new { |c| I18n.l(c) }%>
</td>
<td>
<%= memberships_attributes.input :typ ,:as=>:select, :collection=>Membership::TYPEN.invert, :label=>false, :input_html => { :style => "width:12em" } %>
</td>
<td><%= memberships_attributes.input :fetprofile, :as=>:select, :label=>false %></td>
</tr>
</table>
</div> </div>
</div>
<% end %>
<% end %>
<% end %> <% end %>
<% end %>
<% end %>
<%= f.actions do %> <%= f.actions do %>
<%= f.action :submit, :as => :input %> <%= f.action :submit, :as => :input %>
@@ -43,3 +37,9 @@
<% end %> <% end %>
<script>$('.datepicker').datepicker()</script> <script>$('.datepicker').datepicker()</script>
<%= tinymce %> <%= tinymce %>

View File

@@ -1,4 +1,5 @@
<h1>Listing gremien</h1> <h1>Listing gremien</h1>
<%= render 'layouts/pretty_toolbar' %>
<div class="container-fluid"> <div class="container-fluid">
<% @gremien.each do |gremium| %> <% @gremien.each do |gremium| %>
<div class="row-fluid"> <div class="row-fluid">
@@ -38,7 +39,7 @@
</table> </table>
<br /> <br />
<%= render 'layouts/pretty_toolbar' %>

View File

@@ -1,10 +1,31 @@
<h1> FET Intern NEU </h1> <h1> FET Intern NEU </h1>
<h2>Neuigkeiten</h2> <div class="container-fluid">
<ul class="unstyled linkbox-list" style="max-width:70em"> <div class="row-fluid">
<% @neuigkeiten.each do |n| %> <div class="span6">
<li><%= render n if can?(:show, n) %> </li> <%= link_to "Adressliste", internlist_fetprofiles_path %>
<% end %> <%= link_to "Internes Nachschlagewerk" %>
</ul> <ul class="unstyled linkbox-list">
<li>
<% @themengruppen.each do |themengruppe| %>
<div class="container-fluid">
<%= render themengruppe if can?(:show,themengruppe)%>
</div>
<% end %>
</li>
</ul>
</div>
<div class="span6">
<h2>Neuigkeiten</h2>
<ul class="unstyled linkbox-list">
<% @neuigkeiten.each do |n| %>
<li><%= render n if can?(:show, n) %></li>
<% end %>
</ul>
</div>
</div>
</div>
<h2></h2> <h2></h2>

View File

@@ -1,6 +1,6 @@
<p id="notice"><%= notice %></p> <p id="notice"><%= notice %></p>
<h1><%=lva.typ.to_s + ' ' + lva.name %></h1> <h1><%= lva.typ_n.to_s + ' ' + lva.name %></h1>
<h2>Prüfungsinformation</h2> <h2>Prüfungsinformation</h2>
<div class=""> <div class="">
<%= lva.pruefungsinformation.to_s.html_safe %> <%= lva.pruefungsinformation.to_s.html_safe %>

View File

@@ -3,11 +3,11 @@
<p id="notice"><%= notice %></p> <p id="notice"><%= notice %></p>
<div class="row-fluid"> <div class="row-fluid">
<div class="span8"> <div class="span8">
<h1><%=@lva.typ.to_s + ' ' + @lva.name %></h1> <h1><%= @lva.full_name %></h1>
<h2>Prüfungsinformation</h2> <h2>Prüfungsinformation</h2>
<div class=""> <div class="">
<%= @lva.pruefungsinformation.html_safe %> <%= @lva.pruefungsinformation.to_s.html_safe %>
</div> </div>
<h2>Lernaufwand</h2> <h2>Lernaufwand</h2>

View File

@@ -2,5 +2,5 @@
<%= membership.stop.nil? ? "seit " : "von " %> <%= membership.stop.nil? ? "seit " : "von " %>
<%=membership.start.to_s %> <%=membership.start.to_s %>
<%= " bis "+membership.stop.to_s unless membership.stop.nil? %> <%= " bis "+membership.stop.to_s unless membership.stop.nil? %>
<%= Membership::TYPEN[membership.typ.to_i] %> <%= Membership::TYPEN_g[membership.fetprofile.geschlecht.to_i][membership.typ.to_i] %>
<%= membership.gremium.fall2 %> <%= membership.gremium.fall2 %>

View File

@@ -15,8 +15,8 @@
<div class="span8"> <div class="span8">
<h2><%= sem.name %></h2> <h2><%= sem.name %></h2>
</div> </div>
<div class="span4"><div class="pull-right"><%= link_to I18n.t("lva.addrem"), edit_semester_path(sem), :class=>"btn-small"%> <div class="span4">
</div>
</div> </div>
</div> </div>
<% sem.lvas.each do |lva| %> <% sem.lvas.each do |lva| %>

View File

@@ -20,16 +20,17 @@
<% end %> <% end %>
<% @studium.semester.each do |sem| %> <% @studium.semester.each do |sem| %>
<div class="row-fluid"> <div class="row-fluid">
<div class="span12"> <div class="span12">
<div class="contentbox"> <div class="contentbox">
<div class="container-fluid"> <div class="container-fluid">
<div class="row-fluid"> <div class="row-fluid">
<div class="span8"> <div class="span8">
<h2><%= sem.name %></h2> <h2><%= sem.name %></h2>
</div> </div>
<div class="span4"><div class="pull-right"><%= link_to I18n.t("lva.addrem"), edit_semester_path(sem), :class=>"btn-small"%></div> <div class="span4">
<div class="pull-right"><!--<% link_to I18n.t("lva.addrem"), edit_semester_path(sem), :class=>"btn-small"%>--></div>
</div></div> </div></div>
<% sem.lvas.each do |lva| %> <% sem.lvas.each do |lva| %>
<div class="row-fluid"> <div class="row-fluid">

View File

@@ -2,11 +2,17 @@
<% attachment_list.each do |a| %> <% attachment_list.each do |a| %>
<tr> <tr>
<td> <td>
<%= link_to a.datei.url do %>
<%= render a %> <%= render a %>
<% end %>
</td> </td>
<% if editor %>
<td> <td>
<%= link_to "Edit", edit_thema_attachment_path(a.thema,a) %> <%= link_to "Edit", edit_thema_attachment_path(a.thema,a) %>
<%= link_to "Delete", thema_attachment_path(a.thema,a), method: "DELETE", confirm: "Sure?" %>
</td> </td>
<% end %>
</tr> </tr>
<% end %> <% end %>
</table> </table>

View File

@@ -0,0 +1,3 @@
<%= render :partial=>"attachments/form_bulk" %>
<%= render partial: "themen/attachment_list", object:@thema.attachments ,locals: {:editor => true}%>

View File

@@ -2,7 +2,7 @@
<div class="container-fluid"> <div class="container-fluid">
<%= semantic_form_for @thema, :remote=>true do |f| %> <%= semantic_form_for @thema, :remote=>remote do |f| %>
<%= f.inputs do %> <%= f.inputs do %>
<div class="row-fluid"> <div class="row-fluid">
<div class="span6"> <div class="span6">

View File

@@ -6,5 +6,5 @@
<div id="fragenform"> <div id="fragenform">
<%= render :partial=>'fragen/rform' %> <%= render :partial=>'fragen/rform' %>
</div> </div>
<% @frage_elements = [{:icon=>:plus, :hicon=>'icon-plus', :text=>I18n.t('frage.add'), :path=>new_frage_path}] %> <% # @frage_elements = [{:icon=>:plus, :hicon=>'icon-plus', :text=>I18n.t('frage.add'), :path=>new_frage_path}] %>
<%= render :partial=>'layouts/pretty_toolbar', :object=>@frage_elements %> <% # render :partial=>'layouts/pretty_toolbar', :object=>@frage_elements %>

View File

@@ -1,18 +1,22 @@
<a name="thema_<%=small.id%>" href="#<%=small.id%>"> <a name="thema_<%=small.id%>" href="#<%=small.id%>">
<h2><%= small.title %></h2> <h2><%= small.title %> <%= link_to fa_icon("pencil"), verwalten_thema_path(small) if can? :edit, small %></h2>
</a> </a>
<%= raw(small.text) %> <%= raw(small.text) %>
<br/> <br/>
<%= raw("<b>FAQs:</b>") unless small.fragen.empty? %>
<%= raw("<b>FAQs:</b>") unless small.fragen.empty? %>
<br/> <br/>
<% small.fragen.each do |frage| %> <% small.fragen.each do |frage| %>
<p> <p>
<b> <%= frage.title %> </b> <br/> <b> <%= frage.title %> </b> <br/>
<%= raw(frage.text) %> <%= raw(frage.text) %>
</p> </p>
<br/>
<% end %> <% end %>
<%= render partial: "themen/attachment_list", object: small.attachments, locals:{editor: false} unless small.attachments.empty? %>
<br/>
<% <%
@small_elements = [] @small_elements = []
@small_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('thema.edit'), :path=>small} if can? :edit, small @small_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('thema.edit'), :path=>small} if can? :edit, small

View File

@@ -1 +1 @@
$("#themaview").html("<%= escape_javascript(raw("<h2>"+I18n.t('thema.show')+"</h2>")+render(:partial=>"themen/attachment_list", :object=>@attachments) )%>"); $("#themaview").html("<%= escape_javascript(raw("<h2>"+I18n.t('thema.show')+"</h2>")+render(:partial=>"themen/attachment_verwalten") )%>");

View File

@@ -1,5 +1,5 @@
<div id="themaview"> <div id="themaview">
<h1>Editing thema</h1> <h1>Editing thema</h1>
<%= render 'form' %> <%= render 'form' , :locals=>{:remote=>false}, :remote=>false %>
</div> </div>
</br><%= link_to 'Back', @thema %> </br><%= link_to 'Back', @thema %>

View File

@@ -1 +1 @@
$("#themaview").html("<%= escape_javascript(raw("<h2>"+I18n.t('thema.edit')+"</h2>")+render(:partial=>"themen/form") )%>"); $("#themaview").html("<%= escape_javascript(raw("<h2>"+I18n.t('thema.edit')+"</h2>")+render(:partial=>"themen/form", :locals=>{:remote=>true}) )%>");

View File

@@ -5,5 +5,3 @@
<%= render :partial=>'layouts/pretty_toolbar' %> <%= render :partial=>'layouts/pretty_toolbar' %>
<%= link_to new_thema_attachment_path(@thema) ,:remote=>true do %> new Attachment <% end %>
<%= render :partial => "themen/select", :object => @thema, :locals=>{:editor => :false} %>

View File

@@ -1,6 +1,9 @@
<p id="notice"><%= notice %></p> <p id="notice"><%= notice %></p>
<h1><%= @thema.title %></h1> <h1><%= @thema.title %></h1>
<div class="container-fluid">
<div class="row-fluid">
<div class="span6">
<p> <p>
<%= raw(@thema.text) %> <%= raw(@thema.text) %>
</p> </p>
@@ -11,16 +14,22 @@
--> -->
<%= render :partial=>'layouts/pretty_toolbar' %> <%= render :partial=>'layouts/pretty_toolbar' %>
<h2><%= I18n.t('attachment.title')%>:</h2>
<div id="attachmentform">
</div>
<%= render partial: "attachment_verwalten" %>
<%= render :partial => "themen/select", :object => @thema, :locals=>{:editor => :false} %>
</div>
<div class="span6">
<%= render :partial=>'themen/fragen' %> <%= render :partial=>'themen/fragen' %>
<!-- <!--
<%= link_to 'Neue Frage', new_frage_path %> <br/> <%= link_to 'Neue Frage', new_frage_path %> <br/>
--> -->
<br/> <br/>
<h2><%= I18n.t('attachment.title')%>:</h2>
<div id="attachmentform">
</div>
<%= link_to new_thema_attachment_path(@thema) ,:remote=>true do %> new Attachment <% end %>
<%= render :partial => "themen/select", :object => @thema, :locals=>{:editor => :false} %>
<%= link_to I18n.t('common.back'), themengruppen_path, :class=>:btn %> <%= link_to I18n.t('common.back'), themengruppen_path, :class=>:btn %>
</div>
</div>
</div>

View File

@@ -2,6 +2,7 @@
<%= f.inputs do %> <%= f.inputs do %>
<%= f.input :title %> <%= f.input :title %>
<%= f.input :priority %> <%= f.input :priority %>
<%= f.input :public %>
<%= f.input :picture, :as => :file %> <%= f.input :picture, :as => :file %>
<%= f.input :text %> <%= f.input :text %>

View File

@@ -1,35 +1,28 @@
<div class="content-wrap content-column"> <div class="content-wrap content-column">
<p> <%= link_to "FAQS", faqs_themengruppen_path,class: :btn %></p> <%= render :partial=>'layouts/pretty_toolbar' %>
<ul class="unstyled linkbox-list"> <p>
<li> <%= link_to "FAQS", faqs_themengruppen_path,class: :btn %>
<% @themengruppen.each do |themengruppe| %> </p>
<ul class="unstyled linkbox-list">
<li>
<% @themengruppen.each do |themengruppe| %>
<div class="container-fluid"> <div class="container-fluid">
<%= render themengruppe %> <%= render themengruppe if can?(:show,themengruppe)%>
<br/>
<div class="row-fluid">
<!--
<%= link_to 'Edit', edit_themengruppe_path(themengruppe) %>
-->
</div>
</div> </div>
<% end %>
</li>
</ul>
<br/>
<% end %>
</li>
</ul>
<br/>
</div> </div>
<script class="hidden-phone"> <script class="hidden-phone">
<!-- make_equal_height(); <!-- make_equal_height();
--> -->
</script> </script>
<%= render :partial=>'layouts/pretty_toolbar' %>
<!-- <!--
<%= link_to 'New Themengruppe', new_themengruppe_path %> <%= link_to 'New Themengruppe', new_themengruppe_path %>
--> -->

View File

@@ -1,7 +1,10 @@
<div class="content-wrap content-column" > <div class="content-wrap content-column" >
<%= link_to fa_icon("arrow-circle-left 2x")+" Alle Themengruppen", themengruppen_path, :class=>"linkbox" %> <%= link_to fa_icon("arrow-circle-left 2x")+" Alle Themengruppen", themengruppen_path, :class=>"linkbox" %>
<%= link_to fa_icon("question 2x")+" Häufige Fragen", faqs_themengruppen_path(:anchor=>"themengruppe_"+@themengruppe.id.to_s), :class=>"linkbox" %> <%= link_to fa_icon("question 2x")+" Häufige Fragen", faqs_themengruppen_path(:anchor=>"themengruppe_"+@themengruppe.id.to_s), :class=>"linkbox" %>
<%= render :partial=>'layouts/pretty_toolbar' %>
<h1><%= @themengruppe.title %></h1> <h1><%= @themengruppe.title %></h1>
<p> <p>
<%= @themengruppe.text %> <%= @themengruppe.text %>
</p> </p>
@@ -10,13 +13,8 @@
<li> <li>
<div class="contentbox"> <div class="contentbox">
<%= render :partial => 'themen/small', :object => thema %> <%= render :partial => 'themen/small', :object => thema %>
tools:
<%
@small_elements2 = []
@small_elements2 << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('common.verwalten'), :path=>verwalten_thema_path(thema)} if can? :edit, thema
%>
<%= render :partial=>'layouts/pretty_toolbar', :object=>@small_elements2 unless @small_elements2.empty? %>
<ul class="unstyled"> <ul class="unstyled">
<% unless thema.gremium.nil? %> <% unless thema.gremium.nil? %>
@@ -37,5 +35,4 @@
<% end %> <% end %>
</ul> </ul>
<%= render :partial=>'layouts/pretty_toolbar' %>
</div> </div>

View File

@@ -2,6 +2,8 @@
#themen { list-style-type: none; margin: 0; padding: 0; margin-bottom: 15px;zoom: 1; } #themen { list-style-type: none; margin: 0; padding: 0; margin-bottom: 15px;zoom: 1; }
#themen li { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em; width: 95%; } #themen li { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em; width: 95%; }
</style> </style>
<%= render :partial=>'layouts/pretty_toolbar' %>
<div class="container-fluid"> <div class="container-fluid">
<div class="row-fluid"> <div class="row-fluid">
<div class="span4"> <div class="span4">

View File

@@ -1,4 +1,6 @@
<%= render :partial=>'layouts/pretty_toolbar' %>
<ul id="themengruppen" class="sort" > <ul id="themengruppen" class="sort" >
<% @themengruppen.each do |themengruppe| %> <% @themengruppen.each do |themengruppe| %>
<li id="themengruppen_<%= themengruppe.id %>" class="sort" style="background:white;display:block;" ><%= themengruppe.title %>-<%= themengruppe.priority %></li> <li id="themengruppen_<%= themengruppe.id %>" class="sort" style="background:white;display:block;" ><%= themengruppe.title %>-<%= themengruppe.priority %></li>
@@ -6,7 +8,6 @@
</ul> </ul>
<script> <script>
$( document ).ready(function(){ $( document ).ready(function(){
$("#themengruppen").sortable({ $("#themengruppen").sortable({
cursor: 'crosshair', cursor: 'crosshair',

View File

@@ -0,0 +1,56 @@
<div class="content-wrap content-column">
<h1><%= I18n.t('home.willkommen') %></h1></p>
<div class="container-fluid">
<div class="row-fluid">
<div class="span6">
<p>
<%= link_to I18n.t('home.login'), user_omniauth_authorize_path(:ldap) %>
</p>
<div class="alert">
<h2>Beta Test</h2>
<p>Die Webseite befindet sich derzeit in einem Entwicklungsstadium,
volle Funktionsfähigkeit ist noch nicht erreicht. Bitte Featurerequests und
Fehlermeldungen auf GitHub melden.
</p>
<p>
<%= link_to "Issues", "http://www.github.com/fetsite/fetsite/issues" %>
</p>
<p>
Bezüglich Design und Steuerung sind Vorschläge erwünscht.
</p>
<p><%= link_to "Steuerelemente und Komponenten", "http://getbootstrap.com/2.3.2/index.html" %></p>
<p>Um bei der Entwicklung mitzuhelfen braucht nur Ruby on Rails installiert werden</p>
<p><%= link_to "Getting Started" , startdev_home_index_path %></p>
<p> Das Kalender Feature wird überarbeitet, in Zukunft soll folgender Link nicht mehr funktionieren <%= link_to "Kalender", calendars_path %>
</p>
</div>
<%= link_to "Entwicklungsstatus" , dev_home_index_path %>
<p>
<%= link_to "FAQS", faqs_themengruppen_path,class: :btn %>
</p>
<%= render 'beispiele' %>
</div>
<div class="span6">
<ul class="unstyled linkbox-list" style="max-width:70em">
<% @neuigkeiten.each do |n| %>
<li><%= render n if can?(:show, n) %> </li>
<% end %>
</ul>
Verschiedene Styles
<ul>
<li> <%= link_to "Darkblue", home_index_path({:theme=>"darkblue"}) %></li>
<li> <%= link_to "Blue1", home_index_path({:theme=>"blue1"}) %></li>
<li> <%= link_to "2003", home_index_path({:theme=>"2003"}) %></li>
<li> <%= link_to "white_1", home_index_path({:theme=>"white_1"}) %></li>
</ul>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,38 @@
<%= tinymce_assets %>
<div class="container-fluid">
<%= semantic_form_for @wiki, :remote=>remote do |f| %>
<%= f.inputs do %>
<div class="row-fluid">
<div class="span6">
<%= f.input :title %>
</div>
<div class="span6">
<%= f.input :themengruppe %>
</div>
</div>
<div class="row-fluid">
<div class="span6">
<%= f.input :wikiformat, :as=>:select, :collection=>Wiki::WIKIFORMATS.invert %>
</div>
<div class="span6">
<%= f.input :hidelink, :as=>:boolean %>
<%= @wiki.wikiname %>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<%= f.input :raw_data, :label=>false,:as=>:text, :input_html=>{:rows=>20,:class=>"row-fluid"} %>
</div>
</div>
<%= f.actions do %>
<%= f.action :submit, :as => :button %>
<%= f.action :cancel, :as => :link %>
<% end %>
<% end %><% end %>
<%= tinymce %>
<h2>Attachments:</h2>

View File

@@ -0,0 +1,5 @@
<div id="themaview">
<h1>Editing thema</h1>
<%= render 'form', :remote=>false, :locals=>{:remote=>false} %>
</div>
</br><%= link_to 'Back', @thema %>

View File

@@ -0,0 +1 @@
$("#themaview").html("<%= escape_javascript(raw("<h2>"+I18n.t('wiki.edit')+"</h2>")+render(:partial=>"wikis/form", :locals=>{:remote=>true}) )%>");

View File

@@ -0,0 +1,9 @@
<p id="notice"><%= notice %></p>
<%= link_to "Zurück", @wiki.themengruppe %>
<br>
<%= debug @wiki %>
<%= render :partial=>"themen/small", :object=>@wiki %>
<%= render :partial=>'layouts/pretty_toolbar' %>

View File

@@ -0,0 +1,8 @@
verwalte ein wiki
<%= @wiki %>
<%= render :partial=>'layouts/pretty_toolbar' %>
<%= debug @wiki %>
<%= debug params %>

View File

@@ -1,5 +1,5 @@
Fetsite::Application.routes.draw do Fetsite::Application.routes.draw do
themes_for_rails themes_for_rails
devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" } devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks" }
resources :home, :only=>[:index] do resources :home, :only=>[:index] do
@@ -16,10 +16,24 @@
get 'users/:id/do_confirm', :controller=>:users, :action=>:do_confirm, :as=>'user_do_confirm' get 'users/:id/do_confirm', :controller=>:users, :action=>:do_confirm, :as=>'user_do_confirm'
get 'config',:controller=>:config,:action=>:index , :as => 'config' get 'config',:controller=>:config,:action=>:index , :as => 'config'
end end
devise_for :users , :controllers=>{:omniauth_callbacks=> "users/omniauth_callbacks"} devise_for :users , :controllers=>{:omniauth_callbacks=> "users/omniauth_callbacks"}
scope '(:locale)' do
scope '(t/:theme)' do
get "wiki/:name", action: :wiki, controller: :wikis
resources :wikis do
member do
get :verwalten
end
end
end
end
# end
# end
scope ':locale' do scope ':locale' do
scope '(t/:theme)' do scope '(t/:theme)' do
# Studien # Studien
@@ -57,6 +71,7 @@
resources :fetprofiles do resources :fetprofiles do
collection do collection do
get 'verwalten' get 'verwalten'
get 'internlist'
end end
resources :memberships, :only => [:new, :edit, :update,:destroy,:create] resources :memberships, :only => [:new, :edit, :update,:destroy,:create]
end end

View File

@@ -0,0 +1,15 @@
class AddAdressToFetprofile < ActiveRecord::Migration
def change
add_column :fetprofiles, :street, :string
add_column :fetprofiles, :plz, :string
add_column :fetprofiles, :telnr, :string
add_column :fetprofiles, :hdynr, :string
add_column :fetprofiles, :skype, :string
add_column :fetprofiles, :instant, :string
add_column :fetprofiles, :city, :string
add_column :fetprofiles, :birth_day, :integer
add_column :fetprofiles, :birth_month, :integer
add_column :fetprofiles, :birth_year, :integer
add_column :fetprofiles, :public_birthday, :boolean
end
end

View File

@@ -0,0 +1,5 @@
class AddPublicToThemengruppe < ActiveRecord::Migration
def change
add_column :themengruppen, :public, :boolean
end
end

View File

@@ -0,0 +1,7 @@
class AddWikiToThema < ActiveRecord::Migration
def change
add_column :themen, :wikiname, :string
add_column :themen, :wikiformat, :integer
add_column :themen, :hidelink, :boolea
end
end

View File

@@ -0,0 +1,5 @@
class AddWikiToThemengruppen < ActiveRecord::Migration
def change
add_column :themengruppen, :wiki_default, :boolean
end
end

View File

@@ -0,0 +1,5 @@
class AddSexToFetprofile < ActiveRecord::Migration
def change
add_column :fetprofiles, :geschlecht, :integer
end
end