Merge branch 'master' of https://github.com/andreassteph/fetsite into andi_spinnt

This commit is contained in:
Thomas Blazek
2015-02-25 10:37:12 +01:00
60 changed files with 585 additions and 210 deletions

View File

@@ -117,6 +117,8 @@ gem 'whenever'
gem 'yaml_db' gem 'yaml_db'
gem 'etherpad-lite' gem 'etherpad-lite'
gem 'opengraph_parser'
# Image gallery # Image gallery
gem 'blueimp-gallery' gem 'blueimp-gallery'
gem 'blueimp-gallery-rails' gem 'blueimp-gallery-rails'

View File

@@ -126,6 +126,6 @@ $box-background: white;
@import 'extra'; @import 'extra';
body { body {
background: url('http://www.fet.at/stvn.jpg') fixed no-repeat; background: $color_schema_1_dark;
background-size:100%; background-size:100%;
} }

View File

@@ -13,6 +13,15 @@ class AttachmentsController < ApplicationController
# GET /attachments/1 # GET /attachments/1
# GET /attachments/1.json # GET /attachments/1.json
def set_titlepic
@attachment = Attachment.find(params[:id])
if @attachment.image?
@attachment.flag_titlepic = params[:titlepic]
@attachment.thema.titlepics << @attachment
@attachment.save
end
redirect_to @attachment.thema
end
def show def show
@attachment = Attachment.find(params[:id]) @attachment = Attachment.find(params[:id])
@@ -27,7 +36,7 @@ class AttachmentsController < ApplicationController
def new def new
@attachment = Attachment.new @attachment = Attachment.new
@thema = Thema.find(params[:thema_id]) @thema = Thema.find(params[:thema_id])
@attachment.thema = @thema @attachment.thema = @thema
respond_to do |format| respond_to do |format|
format.html # new.html.erb format.html # new.html.erb

View File

@@ -1,5 +1,6 @@
class FotosController < ApplicationController class FotosController < ApplicationController
before_filter {@toolbar_elements=[]} before_filter {@toolbar_elements=[]}
load_and_authorize_resource
# GET /fotos # GET /fotos
# GET /fotos.json # GET /fotos.json
def index def index
@@ -17,7 +18,13 @@ class FotosController < ApplicationController
@foto = Foto.find(params[:id]) @foto = Foto.find(params[:id])
respond_to do |format| respond_to do |format|
format.html # show.html.erb format.html {
if params[:plain]
render "show", layout: false
else
redirect_to gallery_path(@foto.gallery,:params=>{fotoid: @foto.id})
end
}
format.json { render json: @foto } format.json { render json: @foto }
end end
end end

View File

@@ -27,9 +27,18 @@ class GalleriesController < ApplicationController
end end
@page = params[:page].nil? ? 1 : params[:page].to_i @page = params[:page].nil? ? 1 : params[:page].to_i
# @fotos = Foto.where(:gallery_id => params[:id]).limit(@pppage_array[@pppage]).offset(@pppage_array[@pppage]*(@page-1)) # @fotos = Foto.where(:gallery_id => params[:id]).limit(@pppage_array[@pppage]).offset(@pppage_array[@pppage]*(@page-1))
@fotos = Foto.where(:gallery_id => params[:id]) @fotos = Foto.where(:gallery_id => params[:id])
if @fotos.nil? || @fotos.empty? unless params[:fotoid].nil?
foto_ind = @fotos.find_index(Foto.find(params[:fotoid]))
# @page=(@fotos.count/foto_ind).to_i+1
@openfotoid=params[:fotoid]
else
@openfotoid=0
end
if @fotos.nil? || @fotos.empty?
@fotos_p = [] @fotos_p = []
@fotos_n = [] @fotos_n = []
@pages = 1 @pages = 1

View File

@@ -8,6 +8,7 @@ class HomeController < ApplicationController
else else
@starttopic=@themen = nil @starttopic=@themen = nil
end end
@stickythemen = Thema.where(:sticky_startpage=>true)
end end
def dev def dev
@@ -23,10 +24,20 @@ class HomeController < ApplicationController
end end
def admin def admin
authorize! :doadmin, User authorize! :doadmin, User
t=YAML.load_file("#{::Rails.root.to_s}/config/contact_topic.yml")
@kontaktthemen = Thema.where(:id=>t)
end end
def log
authorize! :doadmin, User
lines = params[:lines]
if Rails.env == "production"
@logs = `tail -n #{lines} log/production.log | grep -v 'actionpack\\|railties\\|activesupport\\|::Translation'`
else
@logs = `tail -n #{lines} log/development.log | grep -v 'actionpack\\|railties\\|activesupport\\|::Translation'`
end
end
def startdev def startdev
render 'setup_fetsite_dev' render 'setup_fetsite_dev'
end end
@@ -71,7 +82,14 @@ class HomeController < ApplicationController
end end
end end
def choose_contact_topics def choose_contact_topics
File.open("config/contact_topic.yml",'w'){|f| f.write(params[:themen].to_yaml)} t=YAML.load_file("#{::Rails.root.to_s}/config/contact_topic.yml")
unless params[:themen].nil?
t=([t].flatten+params[:themen]).uniq
end
unless params[:rmthema].nil?
t=t-[params[:rmthema]]
end
File.open("config/contact_topic.yml",'w'){|f| f.write(t.to_yaml)}
redirect_to admin_home_index_path redirect_to admin_home_index_path
end end

View File

@@ -6,9 +6,9 @@ class MeetingsController < ApplicationController
unless parent.nil? unless parent.nil?
#authorize! :show, parent #authorize! :show, parent
if params[:filter]=="upcomming" if params[:filter]=="upcomming"
@meetings=parent.meetings.includes(:calentry).where("calentries.start>?",1.hour.ago) @meetings=parent.meetings.upcomming
else else
@meetings=parent.meetings @meetings=parent.meetings
end end
@parent=parent @parent=parent
end end

View File

@@ -1,2 +1,76 @@
class MeetingtypsController < ApplicationController class MeetingtypsController < ApplicationController
load_and_authorize_resource
def index
@meetingtyps=Meetingtyp.all
end
def show
redirect_to action: :index
end
def edit
@meetingtyp = Meetingtyp.find(params[:id])
end
def new
@meetingtyp=Meetingtyp.new
end
def create_protocol_and_agenda
@meetingtyp = Meetingtyp.find(params[:id])
if @meetingtyp.agenda.nil?
d=Document.new
d.typ=11
d.name="Agendavorlage"
d.save
@meetingtyp.agenda=d
end
if @meetingtyp.protocol.nil?
d=Document.new
d.typ=10
d.name="Protokollvorlage"
d.save
@meetingtyp.protocol=d
end
redirect_to action: :index
end
def create
@meetingtyp = Meetingtyp.new(params[:meetingtyp])
@meetingtyp.assign_attributes(params[:meetingtyp])
respond_to do |format|
if @meetingtyp.save
format.html { redirect_to @meetingtyp, notice: 'Meeting was successfully created.' }
#format.json { render json: @meeting, status: :created, location: @meeting }
format.js
else
format.html { render action: "new" }
# format.json { render json: @meeting.errors, status: :unprocessable_entity }
format.js { render action: "new" }
end
end
end
def update
@meetingtyp = Meetingtyp.find(params[:id])
respond_to do |format|
if @meetingtyp.update_attributes(params[:meetingtyp])
format.html { redirect_to @meetingtyp, notice: 'Meeting was successfully updated.' }
# format.json { head :no_content }
format.js
else
format.html { render action: "edit" }
# format.json { render json: @meeting.errors, status: :unprocessable_entity }
format.js { render action: "edit" }
end
end
end
def destroy
@meetingtyp = Meeting.find(params[:id])
@meetingtyp.destroy
respond_to do |format|
format.html { redirect_to action: :index}
end
end
end end

View File

@@ -69,14 +69,14 @@ class NeuigkeitenController < ApplicationController
@neuigkeit = Neuigkeit.find(params[:id]) @neuigkeit = Neuigkeit.find(params[:id])
unless @neuigkeit.picture.url.nil? unless @neuigkeit.picture.url.nil?
picture_url=URI(root_url) picture_url=URI(root_url)
picture_url.path=@neuigkeit.picture.url picture_url.path=@neuigkeit.picture.url(:locale=>nil, :theme=>nil)
end end
unless @neuigkeit.published? unless @neuigkeit.published?
redirect_to [@neuigkeit.rubrik,@neuigkeit], notice: 'Neuigkeit muss veröffentlicht sein um sie auf Facebook zu posten.' redirect_to [@neuigkeit.rubrik,@neuigkeit], notice: 'Neuigkeit muss veröffentlicht sein um sie auf Facebook zu posten.'
else else
page=YAML.load_file("#{::Rails.root.to_s}/config/page.yml") page=YAML.load_file("#{::Rails.root.to_s}/config/page.yml")
# page.feed!(:access_token=>page.access_token, :message=>@neuigkeit.text_first_words, :name=>@neuigkeit.title, :link=>rubrik_neuigkeit_url(@neuigkeit.rubrik, @neuigkeit)+".html", :picture=>@neuigkeit.picture.url) # page.feed!(:access_token=>page.access_token, :message=>@neuigkeit.text_first_words, :name=>@neuigkeit.title, :link=>rubrik_neuigkeit_url(@neuigkeit.rubrik, @neuigkeit)+".html", :picture=>@neuigkeit.picture.url)
page.feed!(:access_token=>page.access_token, :message=>@neuigkeit.text_first_words, :name=>@neuigkeit.title, :link=>rubrik_neuigkeit_url(@neuigkeit.rubrik, @neuigkeit)+".html", :picture=>picture_url) page.feed!(:access_token=>page.access_token, :message=>@neuigkeit.text_first_words, :name=>@neuigkeit.title, :link=>rubrik_neuigkeit_url(@neuigkeit.rubrik, @neuigkeit)+".html")# , :picture=>picture_url)
redirect_to [@neuigkeit.rubrik,@neuigkeit], notice: 'Neuigkeit auf Facebook gepostet' redirect_to [@neuigkeit.rubrik,@neuigkeit], notice: 'Neuigkeit auf Facebook gepostet'
end end

View File

@@ -2,15 +2,18 @@ class RubrikenController < ApplicationController
before_filter {@toolbar_elements=[]} before_filter {@toolbar_elements=[]}
load_and_authorize_resource load_and_authorize_resource
def index def index
if can?(:showintern, Rubrik) # if can?(:showintern, Rubrik)
@rubriken = Rubrik.all # @rubriken = Rubrik.all
@neuigkeiten = Neuigkeit.page(params[:page]).per(3) # @neuigkeiten = Neuigkeit.page(params[:page]).per(3)
else # else
@rubriken = Rubrik.where(:public=>true) # @rubriken = Rubrik.where(:public=>true)
@neuigkeiten = Neuigkeit.public.published.page(params[:page]).per(3) # @neuigkeiten = Neuigkeit.public.published.page(params[:page]).per(3)
end # end
@calentries= (@rubriken.map {|r| r.calendar}).collect(&:calentries).flatten @rubriken= Rubrik.accessible_by(current_ability, :show)
@neuigkeiten = Neuigkeit.accessible_by(current_ability, :show).page(params[:page]).per(3)
@calentries= (@rubriken.map {|r| r.calendar}).collect(&:calentries).flatten.select {|c| c.object !=nil}
respond_to do |format| respond_to do |format|
format.html format.html
format.js {render action: :show} format.js {render action: :show}
@@ -21,20 +24,13 @@ class RubrikenController < ApplicationController
end end
def show def show
if can?(:shownonpublic, Rubrik) @rubriken= Rubrik.accessible_by(current_ability, :show)
@rubriken = Rubrik.all
else
@rubriken = Rubrik.where(:public=>true)
end
@rubrik = Rubrik.find(params[:id]) @rubrik = Rubrik.find(params[:id])
@moderatoren=User.with_role(:newsmoderator,@rubrik) @moderatoren=User.with_role(:newsmoderator,@rubrik)
@calentries= @rubrik.calendar.calentries
if can?(:showunpublished, Neuigkeit) @calentries= @rubrik.calendar.calentries.select {|c| c.object !=nil}
@neuigkeiten = @rubrik.neuigkeiten.page(params[:page]).per(3) @neuigkeiten = @rubrik.neuigkeiten.accessible_by(current_ability, :show).page(params[:page]).per(3)
else
@neuigkeiten = @rubrik.neuigkeiten.published.page(params[:page]).per(3)
end
@toolbar_elements << {:text=>I18n.t('neuigkeit.new.title'), :path=> new_rubrik_neuigkeit_path(@rubrik),:hicon=>'icon-plus-sign'} if can? :verwalten, @rubrik @toolbar_elements << {:text=>I18n.t('neuigkeit.new.title'), :path=> new_rubrik_neuigkeit_path(@rubrik),:hicon=>'icon-plus-sign'} if can? :verwalten, @rubrik
@toolbar_elements << {:text=>I18n.t('common.verwalten'), :path=>verwalten_rubrik_path(@rubrik),:icon=>:pencil} if can? :verwalten, @rubrik @toolbar_elements << {:text=>I18n.t('common.verwalten'), :path=>verwalten_rubrik_path(@rubrik),:icon=>:pencil} if can? :verwalten, @rubrik
@@ -47,7 +43,6 @@ class RubrikenController < ApplicationController
def new def new
@rubrik = Rubrik.new @rubrik = Rubrik.new
end end
def edit def edit

View File

@@ -3,7 +3,11 @@ class ThemenController < ApplicationController
# GET /themen # GET /themen
# GET /themen.json # GET /themen.json
load_and_authorize_resource load_and_authorize_resource
def index
@themen = Thema.accessible_by(current_ability,:show)
@themen_drafts = Thema.accessible_by(current_ability,:show).where(:isdraft=>true)
end
def show def show
@thema = Thema.find(params[:id]) @thema = Thema.find(params[:id])
@fragen=@thema.fragen @fragen=@thema.fragen
@@ -14,7 +18,7 @@ class ThemenController < ApplicationController
respond_to do |format| respond_to do |format|
format.html { format.html {
redirect_to :controller=>'themengruppen', :id=>@thema.themengruppe.id, :action=>:show, :anchor=> "thema_"+params[:id].to_s # redirect_to :controller=>'themengruppen', :id=>@thema.themengruppe.id, :action=>:show, :anchor=> "thema_"+params[:id].to_s
} }
format.js format.js
end end

View File

@@ -3,7 +3,7 @@ class ThemengruppenController < ApplicationController
# GET /themengruppen.json # GET /themengruppen.json
load_and_authorize_resource load_and_authorize_resource
def index def index
@themengruppen = Themengruppe.where(:public=>true).order(:priority).reverse @themengruppen = Themengruppe.accessible_by(current_ability, :show).public.order(:priority).reverse_order
@toolbar_elements = [] @toolbar_elements = []
@toolbar_elements << {:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.new'), :path=>new_themengruppe_path()} if can? :new, Themengruppe @toolbar_elements << {:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.new'), :path=>new_themengruppe_path()} if can? :new, Themengruppe
@toolbar_elements << {:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.manage_all'), :path=>verwalten_all_themengruppen_path()} if can? :verwalten_all, Themengruppe @toolbar_elements << {:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.manage_all'), :path=>verwalten_all_themengruppen_path()} if can? :verwalten_all, Themengruppe
@@ -14,7 +14,7 @@ class ThemengruppenController < ApplicationController
end end
end end
def faqs def faqs
@themengruppen = Themengruppe.order("themengruppen.priority").includes(:themen,{themen: :fragen}).order("themen.priority") @themengruppen = Themengruppe.accessible_by(current_ability, :show).order("themengruppen.priority").includes(:themen,{themen: :fragen}).order("themen.priority")
end end
@@ -22,11 +22,8 @@ class ThemengruppenController < ApplicationController
# GET /themengruppen/1.json # GET /themengruppen/1.json
def show def show
@themengruppe = Themengruppe.find(params[:id]) @themengruppe = Themengruppe.find(params[:id])
if can? :showdraft , Thema @themen=@themengruppe.themen.accessible_by(current_ability, :show)
@themen = @themengruppe.themen
else
@themen = @themengruppe.themen.public
end
@toolbar_elements = [] @toolbar_elements = []
@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
@@ -53,7 +50,7 @@ class ThemengruppenController < ApplicationController
end end
def verwalten_all def verwalten_all
@themengruppen =Themengruppe.public.order(:priority).reverse @themengruppen =Themengruppe.public.order(:priority).reverse
@themengruppen_intern =Themengruppe.intern.order(:priority).reverse @themengruppen_intern =Themengruppe.intern.order(:priority).reverse
@toolbar_elements = [{:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.new'), :path=>new_themengruppe_path()}] @toolbar_elements = [{:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.new'), :path=>new_themengruppe_path()}]
end end
@@ -63,7 +60,6 @@ class ThemengruppenController < ApplicationController
@toolbar_elements =[] @toolbar_elements =[]
@toolbar_elements << {:text=>I18n.t('themengruppe.show'), :path=>themengruppe_path(@themengruppe)} if can? :show, @themengruppe @toolbar_elements << {:text=>I18n.t('themengruppe.show'), :path=>themengruppe_path(@themengruppe)} if can? :show, @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.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), :remote=>true} if can? :new, Thema @toolbar_elements << {:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('thema.add'), :path=>new_themengruppe_thema_path(@themengruppe), :remote=>true} if can? :new, Thema
@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 @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

View File

@@ -13,15 +13,17 @@ class UsersController < ApplicationController
redirect_to users_url redirect_to users_url
end end
def fb_set_default_publish_page def fb_set_default_publish_page
if params["page"].nil? || !(current_user.provider=="facebook") if Fetsite::Application.config.facebookconfig_enabled
redirect_to intern_home_index_path if params["page"].nil? || !(current_user.provider=="facebook")
else redirect_to intern_home_index_path
@fbu=FbGraph::User.new(current_user.uid.to_s).fetch(:access_token=>session["fbuser_access_token"]) else
File.open("config/page.yml",'w'){|f| f.write(@fbu.accounts(:access_token=>session["fbuser_access_token"]).select { |p| p.name == params["page"] }.first.to_yaml)} @fbu=FbGraph::User.new(current_user.uid.to_s).fetch(:access_token=>session["fbuser_access_token"])
logger.debug @fbu.to_s File.open("config/page.yml",'w'){|f| f.write(@fbu.accounts(:access_token=>session["fbuser_access_token"]).select { |p| p.name == params["page"] }.first.to_yaml)}
redirect_to admin_home_index_path logger.info @fbu.to_s
logger.info "FbGraph Access" + session["fbuser_access_token"]
redirect_to admin_home_index_path
end
end end
end end
def all_update def all_update

View File

@@ -94,4 +94,12 @@ end
end end
raw(html) raw(html)
end end
def absurl(path)
if path.nil?
return nil
end
url=URI(root_url)
url.path=path
return url
end
end end

View File

@@ -49,6 +49,7 @@ class Ability
can :manage, Themengruppe can :manage, Themengruppe
can :manage, Attachment can :manage, Attachment
end end
can [:update,:edit,:verwalten, :showdraft], Thema, :id=>Thema.with_role(:editor, user).pluck(:id)
unless user.has_role?("fetadmin") unless user.has_role?("fetadmin")
cannot :delete, Themengruppe cannot :delete, Themengruppe
cannot :delete, Thema cannot :delete, Thema
@@ -62,6 +63,7 @@ class Ability
end end
if( user.has_role?("fetuser") || user.has_role?("fetadmin")) if( user.has_role?("fetuser") || user.has_role?("fetadmin"))
can :manage, Gallery can :manage, Gallery
can :show, Foto
end end
unless user.has_role?("fetadmin") unless user.has_role?("fetadmin")
cannot :delete, Gallery cannot :delete, Gallery
@@ -91,6 +93,7 @@ class Ability
if loggedin if loggedin
end end
if( user.has_role?("fetuser") || user.has_role?("fetadmin")) if( user.has_role?("fetuser") || user.has_role?("fetadmin"))
can :showversions, Neuigkeit can :showversions, Neuigkeit
can :showintern, Neuigkeit can :showintern, Neuigkeit
can :showintern, Rubrik can :showintern, Rubrik

View File

@@ -12,12 +12,12 @@
class Attachment < ActiveRecord::Base class Attachment < ActiveRecord::Base
has_paper_trail has_paper_trail
attr_accessible :name, :datei, :datei_cache attr_accessible :name, :datei, :datei_cache,:flag_titlepic
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
belongs_to :parent, :polymorphic=>true
def image? def image?
# data_ext = datei.file.extension.downcase # data_ext = datei.file.extension.downcase

View File

@@ -15,7 +15,7 @@ class Gallery < ActiveRecord::Base
attr_accessible :datum, :desc, :name, :foto_ids attr_accessible :datum, :desc, :name, :foto_ids
has_many :fotos, :dependent => :destroy # Delete fotos if gallery is destroyed has_many :fotos, :dependent => :destroy # Delete fotos if gallery is destroyed
has_many :nlinks, as: :link has_many :nlinks, as: :link
# scope :search, ->(query) {where("name like ? or galleries.desc like ?", "%#{query}%", "%#{query}%")} default_scope order("galleries.datum").reverse_order
searchable do searchable do
text :desc text :desc
text :name, :boost=>3.0 text :name, :boost=>3.0

View File

@@ -10,7 +10,7 @@ class Meeting < ActiveRecord::Base
has_one :calentry, as: :object has_one :calentry, as: :object
has_one :calendar, :through=>:meetingtyp has_one :calendar, :through=>:meetingtyp
has_one :rubrik, :through=>:meetingtyp has_one :rubrik, :through=>:meetingtyp
scope :upcomming, includes(:calentry).where("calentries.start>?",1.hour.ago)
accepts_nested_attributes_for :calentry accepts_nested_attributes_for :calentry
# validate :agenda, :presence=>true # validate :agenda, :presence=>true
# validate :protocol, :presence=>true # validate :protocol, :presence=>true
@@ -50,26 +50,32 @@ class Meeting < ActiveRecord::Base
end end
def create_protocol def create_protocol
if self.protocol.nil? if self.protocol.nil?
d=Document.new d=Document.new
d.typ=10 d.typ=10
d.name="Protokoll" d.name="Protokoll"
d.save unless self.meetingtyp.protocol.nil?
self.protocol=d d.text=self.meetingtyp.protocol.text
end end
d.save
self.protocol=d
end
end end
def create_calentry def create_calentry
if self.calentry.nil? if self.calentry.nil?
ce =Calentry.new ce =Calentry.new
ce.typ=2 ce.typ=2
self.calentry=ce self.calentry=ce
end end
end end
def create_agenda def create_agenda
if self.agenda.nil? if self.agenda.nil?
d=Document.new d=Document.new
d.typ=11 d.typ=11
d.name="Agenda" d.name="Agenda"
unless self.meetingtyp.agenda.nil?
d.text=self.meetingtyp.agenda.text
end
d.save d.save
self.agenda=d self.agenda=d
end end

View File

@@ -1,7 +1,12 @@
class Meetingtyp < ActiveRecord::Base class Meetingtyp < ActiveRecord::Base
attr_accessible :agendaintern, :desc, :name, :protocolintern attr_accessible :agendaintern, :desc, :name, :protocolintern, :rubrik_id
belongs_to :rubrik belongs_to :rubrik
validate :rubrik, :presence=>true validate :rubrik, :presence=>true
has_many :meetings has_many :meetings
has_one :calendar, through: :rubrik has_one :calendar, through: :rubrik
has_one :protocol, :class_name=>'Document', :conditions=>{:typ=>10}, :as=>:parent
has_one :agenda , :as=>:parent, :conditions=>{:typ=>11}, :class_name=>'Document'
def text
self.name
end
end end

View File

@@ -33,7 +33,7 @@ class Neuigkeit < ActiveRecord::Base
scope :intern, ->{includes(:rubrik).where("rubriken.public"=>false)} scope :intern, ->{includes(:rubrik).where("rubriken.public"=>false)}
# scope :search, ->(query) {where("text like ? or title like ?", "%#{query}%", "%#{query}%")} # scope :search, ->(query) {where("text like ? or title like ?", "%#{query}%", "%#{query}%")}
LINKTYPES=["Thema", "Gallery", "Lva","Studium","Fetprofile", "Gremium"] LINKTYPES=["Thema", "Themengruppe", "Gallery", "Lva","Studium","Fetprofile", "Gremium"]
accepts_nested_attributes_for :calentries, :allow_destroy=>true , :reject_if=> lambda{|a| a[:start].blank?} accepts_nested_attributes_for :calentries, :allow_destroy=>true , :reject_if=> lambda{|a| a[:start].blank?}
before_validation :sanitize before_validation :sanitize
@@ -64,6 +64,18 @@ class Neuigkeit < ActiveRecord::Base
def name def name
self.title self.title
end end
def load_from_facebook(link)
event=FbGraph::Event.new(link).fetch(:access_token=>"CAABtfB8SO7kBADyHVHnWHqsxsU1bqqmeDdZCp7V1KF9G4o3oFHcZBq0IB8X3ird4muVIPuWKZB8jL1o9JCON60Lmnvk8rkZA2dyZAuU95dC0SWzOEnhtAEkyzZCN6hkKXdl87o38OloLBivc2kjJYmpUVKzdZAD5ywxKG7Hv5FWxXf6amWA782JSmcxgWsRDH4ZAZBXsUrhpnILNOVoKSBf1mGyfrFiPvA3QZD")
self.title=event.name
self.text=event.description
unless event.start_time.nil?
ce=Calentry.new(:start=>event.start_time, :ende=>event.end_time , :typ=>1)
ce.ende=ce.start if ce.ende.nil?
self.calentries<< ce
ce.save
end
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

@@ -13,7 +13,7 @@
require 'uri' require 'uri'
class Thema < ActiveRecord::Base class Thema < ActiveRecord::Base
include Rails.application.routes.url_helpers include Rails.application.routes.url_helpers
attr_accessible :text, :title, :themengruppe_id,:isdraft, :hidelink, :hideattachment attr_accessible :text, :title, :themengruppe_id,:isdraft, :hidelink, :hideattachment, :sticky_startpage,:sticky_intern
has_many :fragen has_many :fragen
has_many :attachments has_many :attachments
belongs_to :themengruppe, :foreign_key => "themengruppe_id" belongs_to :themengruppe, :foreign_key => "themengruppe_id"
@@ -22,21 +22,23 @@ include Rails.application.routes.url_helpers
validates :themengruppe, :presence => true validates :themengruppe, :presence => true
validates :title, :presence => true validates :title, :presence => true
validates :text, :presence => true validates :text, :presence => true
has_many :titlepics, :as=>:parent, :class_name=>'Attachment', :conditions=>{:flag_titlepic=>true}
has_many :meetings, :as=>:parent has_many :meetings, :as=>:parent
has_many :documents, :as=>:parent has_many :documents, :as=>:parent
scope :public, where(:isdraft=>false).includes(:themengruppe).where("themengruppen.public"=>true) scope :public, where(:isdraft=>false).includes(:themengruppe).where("themengruppen.public"=>true)
default_scope order("themen.priority").reverse_order default_scope order("themen.priority").reverse_order
# scope :search, ->(query) {where("themen.text like ? or themen.title like ?", "%#{query}%", "%#{query}%")} # scope :search, ->(query) {where("themen.text like ? or themen.title like ?", "%#{query}%", "%#{query}%")}
resourcify
searchable do searchable do
text :text text :text
text :title, :boost=>4.0 text :title, :boost=>4.0
end end
scope :outdated, -> {includes(:translations).where("thema_translations.updated_at<?",2.month.ago).where("thema_translations.locale"=>I18n.t.locale) scope :outdated, -> {includes(:translations).where("thema_translations.updated_at<?",7.month.ago).where("thema_translations.locale"=>I18n.t.locale)
} }
translates :title,:text, :versioning =>true, :fallbacks_for_empty_translations => true translates :title,:text, :versioning =>true, :fallbacks_for_empty_translations => true
def is_outdated? def is_outdated?
unless translation.try(:updated_at).nil? unless translation.try(:updated_at).nil?
translation.updated_at < 2.month.ago translation.updated_at < 7.month.ago
else else
false false
end end

View File

@@ -8,6 +8,8 @@
format =:default format =:default
end %> end %>
<%= calentry.text %> <%= calentry.text %>
<% if !(defined? manage) || manage %>
<%= link_to "edit", edit_calentry_path(calentry),:remote=>true if can? :edit, calentry %> <%= link_to "edit", edit_calentry_path(calentry),:remote=>true if can? :edit, calentry %>
<%= link_to 'Delete', calentry, method: :delete, data: { confirm: 'Are you sure?' } , remote: true if can? :delete, calentry %> <%= link_to 'Delete', calentry, method: :delete, data: { confirm: 'Are you sure?' } , remote: true if can? :delete, calentry %>
<% end %>
</div> </div>

View File

@@ -1,31 +1,14 @@
<div class="container-fluid"> <%= image_tag @foto.datei.resized.url, :style=>"margin: auto;
position: absolute;
left: 0;
<div class="row-fluid"> right: 0;
<div class="span12"> bottom: 0;
<%= link_to image_tag(@foto.datei.resized.url), gallery_foto_path(@foto.gallery, ((@foto.gallery.fotos[@foto.gallery.fotos.index(@foto)+1].nil?) ? (@foto.gallery.fotos[0].try(:id).to_i) : @foto.gallery.fotos[@foto.gallery.fotos.index(@foto)+1].try(:id).to_i) ) %> top: 0;" %>
</div> <% #, gallery_foto_path(@foto.gallery, ((@foto.gallery.fotos[@foto.gallery.fotos.index(@foto)+1].nil?) ? (@foto.gallery.fotos[0].try(:id).to_i) : @foto.gallery.fotos[@foto.gallery.fotos.index(@foto)+1].try(:id).to_i) ) %>
</div> <div style="position:absolute; bottom:0">
<%= link_to ff_icon('icon-circle-arrow-down').html_safe, @foto.datei.url,
<div class="row-fluid"> :class=>"btn",title: I18n.t('fotos.download')+': '+@foto.title,:target=>:blank, :style=>"" %>
<div class="span9">
<h2><%= @foto.title %></h2>
<p><%= @foto.desc %></p>
</div>
<div class="span3">
<p>
<%= link_to 'last' , gallery_foto_path(@foto.gallery, @foto.gallery.fotos[@foto.gallery.fotos.index(@foto)-1].try(:id).to_i) unless @foto.gallery.fotos.index(@foto)==0 %>
<%= link_to 'next' , gallery_foto_path(@foto.gallery, @foto.gallery.fotos[@foto.gallery.fotos.index(@foto)+1].try(:id).to_i) unless @foto.gallery.fotos[@foto.gallery.fotos.index(@foto)+1].nil? %>
<%= link_to 'Edit', edit_foto_path(@foto) %> |
<%= link_to 'Back', gallery_path(@foto.gallery) %>
</p>
</div>
</div>
<div class="row-fluid">
<div class="span12">
<p id="notice"><%= notice %></p> <p id="notice"><%= notice %></p>
</div> </div>
</div>
</div>

View File

@@ -1,18 +1,26 @@
<%= content_for :header do %>
<title>Fet - Fotos: <%= @gallery.name %></title>
<% end %>
<div itemscope itemtype="http://schema.org/ImageGallery">
<p id="notice"><%= notice %></p> <p id="notice"><%= notice %></p>
<div> <div>
<small class="pull-left"><%= @gallery.fotos.size.to_s + " " + I18n.t('fotos.bilder')%> </small> <small class="pull-left"><%= @gallery.fotos.size.to_s + " " + I18n.t('fotos.bilder')%> </small>
<small class="pull-right"><%=I18n.l(@gallery.try(:datum).try(:to_date)) unless @gallery.try(:datum).try(:to_date).nil? %></small></br> <small class="pull-right" itemprop="dateCreated" datetime="<%= @gallery.try(:datum).try(:to_date) unless @gallery.try(:datum).try(:to_date).nil?%>"><%=I18n.l(@gallery.try(:datum).try(:to_date)) unless @gallery.try(:datum).try(:to_date).nil? %></small></br>
<h1> <h1 itemprop="name">
<%= @gallery.name %> <%= @gallery.name %>
</h1> </h1>
</div> </div>
<meta itemprop="sameAs" content="<%= gallery_path(@gallery) %>"/>
<p> <p itemprop="description">
<%= @gallery.desc %> <%= @gallery.desc %>
</p> </p>
<style>
.blueimp-gallery > .slides > .slide > .text-content {
overflow: auto;
text-align: left;
}
</style>
<div class="fluid-row"> <div class="fluid-row">
<div class="span9"> <!-- pagination--> <div class="span9"> <!-- pagination-->
<div class="pagination pull_left" style="margin:0px 0px 0px 0px"> <div class="pagination pull_left" style="margin:0px 0px 0px 0px">
@@ -78,8 +86,17 @@
<% @fotos_p.each do |f| %> <% @fotos_p.each do |f| %>
<div class="left"> <div class="left">
<div id="links"> <div id="links">
<a href="<%= f.datei.resized.url%>" title="<%=f.title%>" data-gallery> <a href="<%= f.datei.resized.url%>" title="<%=f.title%>" data-gallery>
<%=image_tag(f.datei.thumb.url,{:class=>"img-polaroid img-rounded"}) %></a> <%=image_tag(f.datei.thumb.url,{:class=>"img-polaroid img-rounded"}) %></a>
<div <% if (@openfotoid.to_i==f.id) %> itemprop="primaryImageOfPage"<% else %> itemprop="hasPart" <% end %> itemscope itemtype="http://schema.org/ImageObject">
<a href="<%= gallery_foto_path(f.gallery, f,:params=>{plain: true}) %>" data-type="text/html" title="<%=f.title%>" data-gallery <% if (@openfotoid.to_i==f.id) %>id="openpic" <% end %>>
<%= image_tag(f.datei.thumb.url,{:class=>"img-polaroid img-rounded"}) %>
<meta itemprop="thumbnailUrl" content="<%= f.datei.thumb.url %>"/>
<meta itemprop="dateModified" content="<%= f.updated_at %>"/>
<meta itemprop="image" content="<%= f.datei.url %>"/>
<meta itemprop="sameAs" content="<%= gallery_foto_path(f.gallery, f,:params=>{:plain=>nil, :theme=>nil})%>"/>
</a>
</div>
</div> </div>
<%= link_to ff_icon('icon-circle-arrow-down').html_safe, f.datei.url, <%= link_to ff_icon('icon-circle-arrow-down').html_safe, f.datei.url,
:class=>"btn-small",title: I18n.t('fotos.download')+': '+f.title, rel: 'tooltip' %> :class=>"btn-small",title: I18n.t('fotos.download')+': '+f.title, rel: 'tooltip' %>
@@ -112,5 +129,29 @@
</div> </div>
<%= @pppage_array[@pppage] %> <%= @pppage_array[@pppage] %>
<%= javascript_include_tag "blueimp-gallery-all" %> <%= javascript_include_tag "blueimp-gallery-all" %>
<script>
blueimp.Gallery.prototype.textFactory = function (obj, callback) {
var $element = $('<div>')
.addClass('slide-content')
.attr('title', obj.title);
$.get(obj.href)
.done(function (result) {
$element.html(result);
callback({
type: 'load',
target: $element[0]
});
})
.fail(function () {
callback({
type: 'error',
target: $element[0]
});
});
return $element[0];
};
$('#openpic').click()
</script>
</div>

View File

@@ -7,7 +7,7 @@
<%= link_to I18n.t("beispiel.add"), new_beispiel_path, :class=>"linkbox"%> <%= link_to I18n.t("beispiel.add"), new_beispiel_path, :class=>"linkbox"%>
</div> </div>
</div> </div>
<ul class="unstyled linkbox-list" style="margin-top:5px;margin-bottom:5px;"> <ul class="unstyled linklist">
<% @beispiele.each do |b| %> <% @beispiele.each do |b| %>
<li> <li>
<%= link_to b.lva, {:class=> :linkbox} do %> <%= link_to b.lva, {:class=> :linkbox} do %>

View File

@@ -1,20 +1,30 @@
<p><%= link_to "Grant extra FB privileges", user_omniauth_authorize_path(:facebook,:params=>{scope:"manage_pages,publish_actions,email"}) %> <h1>Administration</h1>
</p>
<p> <p>
<%= link_to "user", users_path %> <%= link_to "user", users_path %>
</p> </p>
<% if Fetsite::Application.config.facebookconfig_enabled %>
<h2>Facebook Konfiguration</h2>
<p><%= link_to "Grant extra FB privileges", user_omniauth_authorize_path(:facebook,:params=>{scope:"manage_pages,publish_actions,email"}), :confirm=>"Wirklich?" %>
</p>
<p> <p>
<%= @fbu.to_yaml.to_s %> <%= @fbu.to_yaml.to_s %>
<%= semantic_form_for :set_page, url: fb_set_default_publish_page_user_path(current_user), html:{method: :get} do |f| %> <%= semantic_form_for :set_page, url: fb_set_default_publish_page_user_path(current_user), html:{method: :get} do |f| %>
<%= f.input :page , :input_html => { :name => 'page' }%> <%= f.input :page , :input_html => { :name => 'page' }%>
<% end %>
<%= semantic_form_for :set_thema, url: choose_contact_topics_home_index_path, html:{method: :get} do |f| %>
<%= f.input :themen, :input_html=> {:name=>'themen'}, :as=>:select ,:multiple=>true,:collection =>Thema.all%>
<%= f.actions do %>
<%= f.action :submit, :as => :button, :label=> I18n.t("common.save" ) %> <%= f.action :submit, :as => :button, :label=> I18n.t("common.save" ) %>
<% end %> <% end %>
<% end %> <% end %>
<h2>Kontaktseite, Themen:</h2>
<% @kontaktthemen.each do |tt| %>
<%= render tt %>
<%= link_to "rm" ,choose_contact_topics_home_index_path(:params=>{:rmthema=>tt.id}) %>
<% end %>
<%= semantic_form_for :set_thema, url: choose_contact_topics_home_index_path, html:{method: :get} do |f| %>
<%= f.input :themen, :input_html=> {:name=>'themen'}, :as=>:select ,:multiple=>true,:collection =>Thema.all,:value=>10 %>
<%= f.actions do %>
<%= f.action :submit, :as => :button, :label=> "Hinzufuegen" %>
<% end %>
<% end %>
</p> </p>

View File

@@ -1,3 +1,12 @@
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/de_DE/sdk.js#xfbml=1&appId=120379864660921&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="content-wrap content-column" style="max-width:100em;"> <div class="content-wrap content-column" style="max-width:100em;">
<h1><%= I18n.t('home.willkommen') %></h1> <h1><%= I18n.t('home.willkommen') %></h1>
<%= render partial: "themen/small", object: @starttopic %> <%= render partial: "themen/small", object: @starttopic %>
@@ -24,6 +33,14 @@
</ul> </ul>
<% @stickythemen.each do |t1| %>
<li>
<%= link_to t1 do %>
<%= render partial: "themen/nlink", object: t %>
<%= end %>
</li>
<% end %>
<!-- <div class="alert"> <!-- <div class="alert">
<h2>Beta Test</h2> <h2>Beta Test</h2>
<p>Die Webseite befindet sich derzeit in einem Entwicklungsstadium, <p>Die Webseite befindet sich derzeit in einem Entwicklungsstadium,
@@ -48,6 +65,7 @@
</p> </p>
<%= render 'beispiele' %> <%= render 'beispiele' %>
<div class="fb-like-box" data-href="https://www.facebook.com/FachschaftET" data-colorscheme="light" data-show-faces="true" data-header="true" data-stream="false" data-show-border="true"></div>
</div> </div>
<div class="span7"> <div class="span7">
<ul class="unstyled linkbox-list" style="margin:5px;"> <ul class="unstyled linkbox-list" style="margin:5px;">

View File

@@ -0,0 +1 @@
<pre><%= @logs %></pre>

View File

@@ -3,7 +3,7 @@
<head> <head>
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="logo2014_64.png"> <link rel="shortcut icon" href="<%= absurl("/logo2014_64.png")%>">
<!--<link rel="shortcut icon" href="http://www.fet.at/favicon.ico">--> <!--<link rel="shortcut icon" href="http://www.fet.at/favicon.ico">-->
<!----> <!---->

View File

@@ -1,5 +1,8 @@
<div class="lva-semester" style="overflow:auto;">
<div class="lva-semester"> <span>
<%=lva.lvanr.to_s %> <b><%= link_to lva.full_name, lva_path(lva)%></b> <%= lva.ects %> ECTS / <%= lva.stunden %> Std<br> <%=lva.lvanr.to_s %> <b><%= link_to lva.full_name, lva_path(lva)%></b>
</span>
<span style="float:right;">
<%= lva.ects %> ECTS / <%= lva.stunden %> Std
</span>
</div> </div>

View File

@@ -5,7 +5,7 @@
<%= link_to "ankündigen", announce_meeting_path(meeting), remote: true if meeting.neuigkeit.nil? %> <%= link_to "ankündigen", announce_meeting_path(meeting), remote: true if meeting.neuigkeit.nil? %>
<%= link_to "edit", edit_meeting_path(meeting), remote: true %> <%= link_to "edit", edit_meeting_path(meeting), remote: true %>
<%= link_to 'Delete', meeting, method: :delete, data: { confirm: 'Are you sure?' } , remote: true if can? :delete, meeting %> <%= link_to 'Delete', meeting, method: :delete, data: { confirm: 'Are you sure?' } , remote: true if can? :delete, meeting %>
<%= render meeting.calentry unless meeting.calentry.nil? %> <%= render meeting.calentry, locals: {manage: 0} unless meeting.calentry.nil? %>
<%= link_to "Agenda" , create_agenda_meeting_path(meeting), :remote=>true if meeting.agenda.nil? %> <%= link_to "Agenda" , create_agenda_meeting_path(meeting), :remote=>true if meeting.agenda.nil? %>
<%= link_to "Protokoll" , create_protocol_meeting_path(meeting),:remote=>true if meeting.protocol.nil? %> <%= link_to "Protokoll" , create_protocol_meeting_path(meeting),:remote=>true if meeting.protocol.nil? %>
<%= render meeting.agenda unless meeting.agenda.nil? %> <%= render meeting.agenda unless meeting.agenda.nil? %>

View File

@@ -9,7 +9,7 @@
<%= f.semantic_fields_for :calentry, @meeting.calentry do |ff| %> <%= f.semantic_fields_for :calentry, @meeting.calentry do |ff| %>
<%= ff.input :start, :as => :datetimepicker %> <%= ff.input :start, :as => :datetimepicker %>
<%= ff.input :ende, :as => :datetimepicker %> <%= ff.input :ende, :as => :datetimepicker %>
<%= ff.input :typ %> <%= ff.input :typ, :as=>:hidden %>
<% ff.input :object_id, :as=>:hidden %> <% ff.input :object_id, :as=>:hidden %>
<% ff.input :object_type %> <% ff.input :object_type %>
@@ -20,4 +20,4 @@
<%= f.action :submit, :as => :input_ %> <%= f.action :submit, :as => :input_ %>
<% end %> <% end %>
<%= @meeting.calentry.to_yaml %>

View File

@@ -1,4 +1,6 @@
$("#<%= @meeting.divid %>").html("<%=escape_javascript( render :partial=>"nested_form" ,:object=>@meeting)%>"); $("#<%= @meeting.divid %>").html("<%=escape_javascript( render :partial=>"nested_form" ,:object=>@meeting)%>");
$('.datetimepicker').datetimepicker({format: 'd.m.Y H:i', startDate: (!($(this).attr("value")==undefined))? $(this).attr("value"): ""})

View File

@@ -1,3 +1,5 @@
$("#<%= Meeting.new_divid_for(@parent) %>").replaceWith("<div id=\"<%= Meeting.new_divid_for(@parent) %>\"><%=escape_javascript( render :partial=>"nested_form" ,:object=>@meeting) %></div>"); $("#<%= Meeting.new_divid_for(@parent) %>").replaceWith("<div id=\"<%= Meeting.new_divid_for(@parent) %>\"><%=escape_javascript( render :partial=>"nested_form" ,:object=>@meeting) %></div>");
$('.datetimepicker').datetimepicker({format: 'd.m.Y H:i', startDate: (!($(this).attr("value")==undefined))? $(this).attr("value"): ""})

View File

@@ -0,0 +1,12 @@
<%= semantic_form_for [@meetingtyp] do |f| %>
<%= f.inputs do %>
<%= f.input :name, :placeholder=> "Name" %>
<%= f.input :rubrik %>
<%= f.input :agendaintern %>
<%= f.input :protocolintern %>
<% end %>
<%= f.actions do %>
<%= f.action :submit, :as => :input %>
<% end %>
<% end %>

View File

@@ -0,0 +1,5 @@
<%= meetingtyp.name %> <%= link_to "edit", edit_meetingtyp_path(meetingtyp) %>
<%= link_to "create" , create_protocol_and_agenda_meetingtyp_path(meetingtyp) %>
<%= render meetingtyp.protocol unless meetingtyp.protocol.nil? %>
<%= render meetingtyp.agenda unless meetingtyp.agenda.nil? %>

View File

@@ -0,0 +1 @@
<%= render "form" %>

View File

@@ -0,0 +1,6 @@
<ul>
<% @meetingtyps.each do |mt| %>
<li><%= render mt %> </li>
<% end %>
</ul>
<%= link_to "New" , new_meetingtyp_path %>

View File

@@ -0,0 +1 @@
<%= render "form" %>

View File

@@ -1,6 +1,8 @@
<span itemprop="memberOf" itemscope itemtype="http://schema.org/Organization">
<%= membership.stop.nil? ? I18n.t("gremium.seit")+" " : I18n.t("gremium.von")+" " %> <%= membership.stop.nil? ? I18n.t("gremium.seit")+" " : I18n.t("gremium.von")+" " %>
<%=membership.start.to_s %> <%=membership.start.to_s %>
<%= " "+I18n.t("gremium.bis")+" "+membership.stop.to_s unless membership.stop.nil? %> <%= " "+I18n.t("gremium.bis")+" "+membership.stop.to_s unless membership.stop.nil? %>
<%= Membership::TYPEN_g[membership.fetprofile.geschlecht.to_i][membership.typ.to_i] %> <%= Membership::TYPEN_g[membership.fetprofile.geschlecht.to_i][membership.typ.to_i] %> <span itemprop="name">
<%= membership.gremium.fall2 %> <%= membership.gremium.fall2 %></span>
<meta itemprop="sameAs" content="<%= gremium_path(membership.gremium, :theme=>nil)%>"/>
</span>

View File

@@ -1,4 +1,3 @@
<div class="media"> <div class="media">
<div class="pull-left" href="#"> <div class="pull-left" href="#">
<p><br><%= image_tag neuigkeit.picture.thumb.url unless neuigkeit.picture.url.nil? %> <p><br><%= image_tag neuigkeit.picture.thumb.url unless neuigkeit.picture.url.nil? %>

View File

@@ -3,7 +3,7 @@
<% set_meta_tags :author => fetprofile_path(@neuigkeit.author.fetprofile) unless @neuigkeit.author.fetprofile.nil? %> <% set_meta_tags :author => fetprofile_path(@neuigkeit.author.fetprofile) unless @neuigkeit.author.fetprofile.nil? %>
<% unless @neuigkeit.picture.url.nil? <% unless @neuigkeit.picture.url.nil?
picture_url=URI(root_url) picture_url=URI(root_url)
picture_url.path=@neuigkeit.picture.url picture_url.path=@neuigkeit.picture.url(:locale=>nil, :theme=>nil)
end end
%> %>
<% set_meta_tags :og => { <% set_meta_tags :og => {
@@ -14,42 +14,64 @@ end
:url=>neuigkeit_url(:theme=>nil) :url=>neuigkeit_url(:theme=>nil)
} }
%> %>
<% set_meta_tags :og=>{:article=> {:published_time=>I18n.l(@neuigkeit.try(:datum).try(:to_date)) }} unless @neuigkeit.try(:datum).try(:to_date).nil? %>
<%= display_meta_tags %> <%= display_meta_tags %>
<% end %> <% end %>
<%= render 'rubriken/tabs' %> <%= render 'rubriken/tabs' %>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/de_DE/sdk.js#xfbml=1&appId=120379864660921&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="content-column content-wrap"> <div class="content-column content-wrap">
<p id="notice"><%= notice %></p> <p id="notice"><%= notice %></p>
<div class="contentbox"> <div class="contentbox" itemscope itemtype="http://schema.org/Article">
<span> <meta itemprop="about" content="<%= @neuigkeit.text_first_words %>"/>
<%= ff_icon(@neuigkeit.rubrik.icon) unless @neuigkeit.rubrik.icon.nil? or @neuigkeit.rubrik.icon.empty? %>&nbsp;<%= @neuigkeit.rubrik.name %> <meta itemprop="sameAs" content="<%= neuigkeit_url(@neuigkeit,:theme=>nil)%>"/>
</span> <div class="row-fluid">
<span class="pull-right"> <span itemprop="articleSection">
<%= @neuigkeit.author.email.to_s unless @neuigkeit.try(:author).try(:email).to_s %> <%= ff_icon(@neuigkeit.rubrik.icon) unless @neuigkeit.rubrik.icon.nil? or @neuigkeit.rubrik.icon.empty? %>&nbsp;<%= @neuigkeit.rubrik.name %>
<%= @neuigkeit.author.text+ " "+ I18n.t("neuigkeit.am")+" " + I18n.l(@neuigkeit.try(:datum).try(:to_date)) unless @neuigkeit.try(:datum).try(:to_date).nil? %> </span>
</span> <span class="pull-right">
<div class="media"> <span itemprop="author"><%= @neuigkeit.author.email.to_s unless @neuigkeit.try(:author).try(:email).to_s %>
<% unless @neuigkeit.picture.big_thumb.to_s.empty? %> <%= @neuigkeit.author.text %></span><% unless @neuigkeit.try(:datum).try(:to_date).nil? %><%= " "+ I18n.t("neuigkeit.am")+" " %><span itemprop="datePublished"><%= I18n.l(@neuigkeit.try(:datum).try(:to_date)) %>
<div class="pull-left" href="#"> </span>
<p><br><%= link_to image_tag(@neuigkeit.picture.big_thumb.url),@neuigkeit.picture.try(:url) %>
</p>
</div>
<% end %> <% end %>
<div class="media-body"> </div>
<h1> <% unless @neuigkeit.published? %>
<%= @neuigkeit.title%> <div class="sticker sticker-red"> Not Published</div> <% end %>
</h1>
<%= raw(@neuigkeit.text) %> <div class="media">
<p></p> <% unless @neuigkeit.picture.big_thumb.to_s.empty? %>
</div> <div class="pull-left" href="#">
</div> <p><br><%= link_to image_tag(@neuigkeit.picture.big_thumb.url),@neuigkeit.picture.try(:url) %>
<div id="calentries"> </p>
</div>
<% end %>
<div class="media-body">
<h1 itemprop="name">
<%= @neuigkeit.title%>
</h1>
<div itemprop="articleBody">
<%= raw(@neuigkeit.text) %>
</div>
<p></p>
</div>
</div>
<div id="calentries">
<% @calentries1.each do |ce|%> <% @calentries1.each do |ce|%>
<%= render ce unless ce.nil? %> <%= render ce unless ce.nil? %>
<% end %> <% end %>
</div> </div>
<div class="fb-like" data-href"<%= rubrik_neuigkeit_url(@rubrik,@neuigkeit)%>" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>
<% unless @neuigkeit.meeting.nil? %> <% unless @neuigkeit.meeting.nil? %>
<%= render @neuigkeit.meeting %> <%= render @neuigkeit.meeting %>
<% end%> <% end%>
@@ -74,6 +96,8 @@ Nach Element suchen:
<% end %> <% end %>
</div> </div>
<script> <script>
$(function(){ $(function(){
dialog = $( "#findlink-body" ).dialog({ dialog = $( "#findlink-body" ).dialog({

View File

@@ -5,8 +5,7 @@
<td><%= fa_icon "globe" if r.public%></td> <td><%= fa_icon "globe" if r.public%></td>
<td><%= r.name %></td> <td><%= r.name %></td>
<td> <td>
<%= n.title %> <%= link_to n.title, n %>
</td> </td>
<td> <td>
<%= unless n.datum.nil? <%= unless n.datum.nil?

View File

@@ -12,6 +12,9 @@
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Actions</a> <a class="dropdown-toggle" data-toggle="dropdown" href="#">Actions</a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li> <li>
<%= link_to ff_icon("icon-pencil")+"Make Titlepic", set_titlepic_thema_attachment_path(a.thema,a,:params=>{:titlepic=>true}) %>
</li>
<li>
<%= link_to ff_icon("icon-pencil")+"Edit", edit_thema_attachment_path(a.thema,a) %> <%= link_to ff_icon("icon-pencil")+"Edit", edit_thema_attachment_path(a.thema,a) %>
</li><li> </li><li>
<%= link_to "Delete Attachment", thema_attachment_path(a.thema,a), method: "DELETE", confirm: "Sure?" , class: "btn-danger " %> <%= link_to "Delete Attachment", thema_attachment_path(a.thema,a), method: "DELETE", confirm: "Sure?" , class: "btn-danger " %>

View File

@@ -1,3 +1,12 @@
<div>
<b>Titlepics</b>
<%= render :partial=>"attachments/form_bulk" %> <% @thema.titlepics.each do |tp| %>
<%= link_to image_tag(tp.datei.thumb.url) , set_titlepic_thema_attachment_path(tp.thema,tp,:params=>{:titlepic=>false}) %>
<% end %></div>
<b> List </b>
<%= render partial: "themen/attachment_list", object:@thema.attachments ,locals: {:editor => true}%> <%= render partial: "themen/attachment_list", object:@thema.attachments ,locals: {:editor => true}%>
<div>
<b>Form</b>
<%= render :partial=>"attachments/form_bulk" %>
</div>

View File

@@ -21,6 +21,8 @@
</div> </div>
<div class="span4"> <div class="span4">
<%= f.input :hideattachment %> <%= f.input :hideattachment %>
<%= f.input :sticky_intern %>
<%= f.input :sticky_startpage %>
</div> </div>

View File

@@ -1,7 +1,8 @@
<% if can? :show, small %> <% if can? :show, small %>
<a name="thema_<%=small.id%>" href="#<%=small.id%>"> <a name="thema_<%=small.id%>" href="#<%=small.id%>">
<h2><%= small.title %> <%= link_to fa_icon("pencil"), verwalten_thema_path(small) if can? :edit, small %> </h2> <h2><%= link_to small.title,small %> <%= link_to fa_icon("pencil"), verwalten_thema_path(small) if can? :edit, small %> </h2>
</a> </a>
<%= image_tag small.titlepics.first.datei.url unless small.titlepics.first.nil? %>
<% if small.is_outdated? %> <% if small.is_outdated? %>
<div class="sticker sticker-red"> <%= I18n.t("thema.outdated") %> <%= link_to"Als aktuell markieren",is_updated_thema_path(small), :class=>:btn if can? :is_updated, small%></div> <div class="sticker sticker-red"> <%= I18n.t("thema.outdated") %> <%= link_to"Als aktuell markieren",is_updated_thema_path(small), :class=>:btn if can? :is_updated, small%></div>
<% end %> <% end %>
@@ -26,8 +27,10 @@
<b>Treffen/Sitzungen</b> <b>Treffen/Sitzungen</b>
<%= link_to "Neues Meeting", new_meeting_path(:parent_id=>small.id, :parent_type=>"Thema"), :remote=>true %> <%= link_to "Neues Meeting", new_meeting_path(:parent_id=>small.id, :parent_type=>"Thema"), :remote=>true %>
<div id="<%= Meeting.new_divid_for(small) %>"></div> <div id="<%= Meeting.new_divid_for(small) %>"></div>
<%= link_to "All", meetings_path(:parent_id=>small.id, :parent_type=>"Thema"), :remote=>true %> <ul class="nav nav-tabs">
<%= link_to "upcomming", meetings_path(:parent_id=>small.id, :parent_type=>"Thema",:filter=>"upcomming"), :remote=>true %> <li><%= link_to "All", meetings_path(:parent_id=>small.id, :parent_type=>"Thema"), :remote=>true if small.meetings.accessible_by(current_ability).count >0 %></li>
<li><%= link_to "upcomming", meetings_path(:parent_id=>small.id, :parent_type=>"Thema",:filter=>"upcomming"), :remote=>true if small.meetings.accessible_by(current_ability).upcomming.count >0 %></li>
</ul>
<%= render :partial=>"meetings/meeting_list", object: small.meetings, locals: {parent: small} %> <%= render :partial=>"meetings/meeting_list", object: small.meetings, locals: {parent: small} %>
<% end %> <% end %>

View File

@@ -1,25 +1,12 @@
<h1>Listing themen</h1> <h1>Listing theme1n</h1><h2>drafts </h2>
<% @themen_drafts.each do |thema| %>
<table> <%= render partial:"themen/nlink", object: thema %>
<tr>
<th>Title</th>
<th>Text</th>
<th></th>
<th></th>
<th></th>
</tr>
<% @themen.each do |thema| %>
<tr>
<td><%= thema.title %></td>
<td><%= thema.text %></td>
<td><%= link_to 'Show', thema %></td>
<td><%= link_to 'Edit', edit_thema_path(thema) %></td>
<td><%= link_to 'Destroy', thema, method: :delete, data: { confirm: 'Are you sure?' } %></td>
</tr>
<% end %> <% end %>
</table>
<h2>All</h2>
<% @themen.each do |thema| %>
<%= render partial:"themen/nlink", object: thema %>
<% end %>
<br /> <br />
<%= link_to 'New Thema', new_thema_path %> <%= link_to 'New Thema', new_thema_path %>

View File

@@ -1,8 +1,54 @@
<p id="notice"><%= notice %></p> <%= content_for :header do %>
<%= link_to "Zurück", @thema.themengruppe %> <title><%= @thema.title.to_s + " (" + @thema.themengruppe.title.to_s + ")" %></title>
<br>
<div class="contentbox"> <%
<%= render :partial=>"themen/small", :object=>@thema %> mog = {
</div> :title => @thema.title.to_s + " (" + @thema.themengruppe.title.to_s + ")",
<%= render :partial=>'layouts/pretty_toolbar' %> :type => "article",
:description =>@thema.text_first_words,
:url=>thema_url(:theme=>nil)
}
%>
<%
unless @thema.titlepics.first.nil?
picture_url=URI(root_url)
picture_url.path=@thema.titlepics.first.datei.url(:locale=>nil, :theme=>nil)
mog[:image]= picture_url
end
%>
<%= display_meta_tags :og=> mog %>
<% end %>
<p id="notice"><%= notice %></p>
<% link_to "Zurück", @thema.themengruppe %>
<% thema=@thema %><div class="content-wrap content-column" >
<div class="contentbox">
<%= render :partial => 'themen/small', :object => thema %>
<ul class="unstyled">
<% unless thema.gremium.nil? %>
<li>
<%= link_to fa_icon("users 2x")+thema.gremium.name , thema.gremium,:class=>"linkbox" %>
</li>
<% end %>
<% thema.nlinks.each do |l| %>
<li>
<%= render l.neuigkeit if can? :show, l.neuigkeit%>
</li>
<% end %>
</ul>
</div>
<br>
<div class="">
<%= render @thema.themengruppe %>
</div>
</div>
<% # render :partial=>'layouts/pretty_toolbar' %>

View File

@@ -1 +1,14 @@
<h2><%= nlink.title %> </h2> <% themengruppe=nlink %>
<h3>
<% unless themengruppe.icon.nil? or themengruppe.icon.empty? %> <i class="<%= themengruppe.icon %>" style="font-size:1.5em;margin:0"></i>
<% end %>
<%= themengruppe.title%> </h3>
<p>
<%= if themengruppe.text.split.size > Themengruppe::WORD_COUNT
themengruppe.text.split[0..Themengruppe::WORD_COUNT].join(" ") + " ..."
else
themengruppe.text
end%>
</p>

View File

@@ -2,16 +2,17 @@
<div class="content-wrap content-column"> <div class="content-wrap content-column">
<% @themengruppen.each do |tg| %> <% @themengruppen.each do |tg| %>
<% if can?(:show, tg) %> <% themen = tg.themen.accessible_by(current_ability, :show).order(:priority).reverse_order.select{|t| !t.fragen.empty?} %>
<% if can?(:show, tg) && !themen.empty? %>
<div class="contentbox"> <div class="contentbox">
<a name="themengruppe_<%=tg.id.to_s%>"></a> <a name="themengruppe_<%=tg.id.to_s%>"></a>
<h2> <%= tg.title%></h2> <h2> <%= tg.title%></h2>
<ul> <ul>
<% tg.themen.order(:priority).reverse.each do |t| %> <% tg.themen.order(:priority).reverse.each do |t| %>
<% if can?(:show, t) %> <% if can?(:show, t) && !t.fragen.empty? %>
<li> <%= t.title %> <li> <%= t.title %>
<ul> <ul>
<% t.fragen.each do |f| %> <% t.fragen.order(:title).each do |f| %>
<li> <li>
<b> <%= f.title %>?</b> <b> <%= f.title %>?</b>
<p> <%= raw(f.text) %></p> <p> <%= raw(f.text) %></p>

View File

@@ -1,11 +1,20 @@
<div class="content-wrap content-column"> <div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/de_DE/sdk.js#xfbml=1&appId=120379864660921&version=v2.0";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>
<div class="content-wrap content-column" style="max-width:90em;">
<h1><%= I18n.t('home.willkommen') %></h1> <h1><%= I18n.t('home.willkommen') %></h1>
<%= raw(@starttopic.text) %> <%= raw(@starttopic.text) %>
<div class="container-fluid"> <div class="container-fluid">
<div class="row-fluid"> <div class="row-fluid">
<div class="span6"> <div class="span5">
<ul class="linklist"> <ul class="linklist">
<li> <li>
@@ -21,8 +30,19 @@
</li> </li>
<li><%= link_to ffi1_icon("books19")+"Beispielsammlung", studium_path(Studium.first, {:ansicht=>'semesteransicht'}) ,class: :btn ,class: :linkbox %></li> <li><%= link_to ffi1_icon("books19")+"Beispielsammlung", studium_path(Studium.first, {:ansicht=>'semesteransicht'}) ,class: :btn ,class: :linkbox %></li>
<li><%= link_to "Alte Beispielsammlung", "http://www.fet.at/alt/bin/view/Beispielsammlung/WebHome" ,class: :btn ,class: :linkbox %></li> <li><%= link_to "Alte Beispielsammlung", "http://www.fet.at/alt/bin/view/Beispielsammlung/WebHome" ,class: :btn ,class: :linkbox %></li>
</ul>
<ul class="linklist">
<% @stickythemen.each do |t1| %>
<li>
<%= link_to t1,:class=>:linkbox do %>
<%= render partial: "themen/nlink", object: t1 %>
<% end %>
</li>
<% end %>
</ul> </ul>
<!-- <div class="alert"> <!-- <div class="alert">
<h2>Beta Test</h2> <h2>Beta Test</h2>
@@ -46,24 +66,15 @@
</div>--> </div>-->
</p> </p>
<%= render 'beispiele' %> <%= render 'beispiele' %>
<div class="fb-like-box" data-href="https://www.facebook.com/FachschaftET" data-colorscheme="light" data-show-faces="true" data-header="true" data-stream="false" data-show-border="true"></div>
</div> </div>
<div class="span6"> <div class="span7">
<ul class="unstyled linkbox-list" style="max-width:70em"> <ul class="unstyled linklist">
<% @neuigkeiten.each do |n| %> <% @neuigkeiten.each do |n| %>
<li><%= render n if can?(:show, n) %> </li> <li><%= render n if can?(:show, n) %> </li>
<% end %> <% end %>
</ul> </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>
</div> </div>

View File

@@ -35,4 +35,6 @@ Fetsite::Application.configure do
# Expands the lines which load the assets # Expands the lines which load the assets
config.assets.debug = false config.assets.debug = false
config.facebookconfig_enabled=true
end end

View File

@@ -65,4 +65,7 @@ Fetsite::Application.configure do
# Log the query plan for queries taking more than this (works # Log the query plan for queries taking more than this (works
# with SQLite, MySQL, and PostgreSQL) # with SQLite, MySQL, and PostgreSQL)
# config.active_record.auto_explain_threshold_in_seconds = 0.5 # config.active_record.auto_explain_threshold_in_seconds = 0.5
config.facebookconfig_enabled=true
end end

View File

@@ -0,0 +1 @@
Rails.application.config.assets.precompile += ['blueimp-gallery-all.js']

View File

@@ -135,6 +135,7 @@
get 'linksnotimplemented' get 'linksnotimplemented'
get 'kontakt' get 'kontakt'
get 'choose_contact_topics' get 'choose_contact_topics'
get 'log'
end end
end end
@@ -157,7 +158,11 @@
get :documents get :documents
get :meetings get :meetings
end end
resources :attachments resources :attachments do
member do
get :set_titlepic
end
end
end end
resources :calendars resources :calendars
@@ -181,7 +186,11 @@
end end
resources :meetingtyps resources :meetingtyps do
member do
get :create_protocol_and_agenda
end
end
end end
end end
root :to => 'home#index' root :to => 'home#index'

View File

@@ -1,9 +1,10 @@
production: production:
solr: solr:
hostname: localhost hostname: localhost
port: 8983 port: 8080
log_level: WARNING log_level: WARNING
path: /solr/production path: /solr-4.10.2/default #production #ollection1 #production
# solr_home: solr
# read_timeout: 2 # read_timeout: 2
# open_timeout: 0.5 # open_timeout: 0.5

View File

@@ -0,0 +1,7 @@
class AddParentToAttachment < ActiveRecord::Migration
def change
change_table :attachments do |t|
t.references :parent, :polymorphic=>{:default=>'Thema'}
end
end
end

View File

@@ -0,0 +1,5 @@
class AddFlagsToAttachment < ActiveRecord::Migration
def change
add_column :attachments, :flag_titlepic, :boolean
end
end

View File

@@ -0,0 +1,9 @@
class AddStickyToThema < ActiveRecord::Migration
def change
add_column :themen, :sticky_startpage, :boolean
add_column :themen, :sticky_intern, :boolean
add_column :themengruppen, :sticky_startpage, :boolean
add_column :themengruppen, :sticky_intern, :boolean
add_column :galleries, :sticky_startpage, :boolean
end
end