forked from bofh/fetsite
Merge branch 'master' of https://github.com/andreassteph/fetsite into andi_spinnt
This commit is contained in:
2
Gemfile
2
Gemfile
@@ -117,6 +117,8 @@ gem 'whenever'
|
||||
gem 'yaml_db'
|
||||
gem 'etherpad-lite'
|
||||
|
||||
gem 'opengraph_parser'
|
||||
|
||||
# Image gallery
|
||||
gem 'blueimp-gallery'
|
||||
gem 'blueimp-gallery-rails'
|
||||
@@ -126,6 +126,6 @@ $box-background: white;
|
||||
|
||||
@import 'extra';
|
||||
body {
|
||||
background: url('http://www.fet.at/stvn.jpg') fixed no-repeat;
|
||||
background: $color_schema_1_dark;
|
||||
background-size:100%;
|
||||
}
|
||||
|
||||
@@ -13,6 +13,15 @@ class AttachmentsController < ApplicationController
|
||||
|
||||
# GET /attachments/1
|
||||
# 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
|
||||
@attachment = Attachment.find(params[:id])
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
class FotosController < ApplicationController
|
||||
before_filter {@toolbar_elements=[]}
|
||||
load_and_authorize_resource
|
||||
# GET /fotos
|
||||
# GET /fotos.json
|
||||
def index
|
||||
@@ -17,7 +18,13 @@ class FotosController < ApplicationController
|
||||
@foto = Foto.find(params[:id])
|
||||
|
||||
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 }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -27,8 +27,17 @@ class GalleriesController < ApplicationController
|
||||
end
|
||||
|
||||
@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])
|
||||
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_n = []
|
||||
|
||||
@@ -8,6 +8,7 @@ class HomeController < ApplicationController
|
||||
else
|
||||
@starttopic=@themen = nil
|
||||
end
|
||||
@stickythemen = Thema.where(:sticky_startpage=>true)
|
||||
end
|
||||
def dev
|
||||
|
||||
@@ -23,10 +24,20 @@ class HomeController < ApplicationController
|
||||
end
|
||||
def admin
|
||||
authorize! :doadmin, User
|
||||
|
||||
t=YAML.load_file("#{::Rails.root.to_s}/config/contact_topic.yml")
|
||||
@kontaktthemen = Thema.where(:id=>t)
|
||||
|
||||
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
|
||||
render 'setup_fetsite_dev'
|
||||
end
|
||||
@@ -71,7 +82,14 @@ class HomeController < ApplicationController
|
||||
end
|
||||
end
|
||||
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
|
||||
end
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ class MeetingsController < ApplicationController
|
||||
unless parent.nil?
|
||||
#authorize! :show, parent
|
||||
if params[:filter]=="upcomming"
|
||||
@meetings=parent.meetings.includes(:calentry).where("calentries.start>?",1.hour.ago)
|
||||
@meetings=parent.meetings.upcomming
|
||||
else
|
||||
@meetings=parent.meetings
|
||||
end
|
||||
|
||||
@@ -1,2 +1,76 @@
|
||||
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
|
||||
|
||||
@@ -69,14 +69,14 @@ class NeuigkeitenController < ApplicationController
|
||||
@neuigkeit = Neuigkeit.find(params[:id])
|
||||
unless @neuigkeit.picture.url.nil?
|
||||
picture_url=URI(root_url)
|
||||
picture_url.path=@neuigkeit.picture.url
|
||||
picture_url.path=@neuigkeit.picture.url(:locale=>nil, :theme=>nil)
|
||||
end
|
||||
unless @neuigkeit.published?
|
||||
redirect_to [@neuigkeit.rubrik,@neuigkeit], notice: 'Neuigkeit muss veröffentlicht sein um sie auf Facebook zu posten.'
|
||||
else
|
||||
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=>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'
|
||||
end
|
||||
|
||||
@@ -2,15 +2,18 @@ class RubrikenController < ApplicationController
|
||||
before_filter {@toolbar_elements=[]}
|
||||
load_and_authorize_resource
|
||||
def index
|
||||
if can?(:showintern, Rubrik)
|
||||
@rubriken = Rubrik.all
|
||||
@neuigkeiten = Neuigkeit.page(params[:page]).per(3)
|
||||
else
|
||||
@rubriken = Rubrik.where(:public=>true)
|
||||
@neuigkeiten = Neuigkeit.public.published.page(params[:page]).per(3)
|
||||
end
|
||||
# if can?(:showintern, Rubrik)
|
||||
# @rubriken = Rubrik.all
|
||||
# @neuigkeiten = Neuigkeit.page(params[:page]).per(3)
|
||||
# else
|
||||
# @rubriken = Rubrik.where(:public=>true)
|
||||
# @neuigkeiten = Neuigkeit.public.published.page(params[:page]).per(3)
|
||||
# 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|
|
||||
format.html
|
||||
format.js {render action: :show}
|
||||
@@ -21,20 +24,13 @@ class RubrikenController < ApplicationController
|
||||
|
||||
end
|
||||
def show
|
||||
if can?(:shownonpublic, Rubrik)
|
||||
@rubriken = Rubrik.all
|
||||
else
|
||||
@rubriken = Rubrik.where(:public=>true)
|
||||
end
|
||||
|
||||
@rubriken= Rubrik.accessible_by(current_ability, :show)
|
||||
@rubrik = Rubrik.find(params[:id])
|
||||
@moderatoren=User.with_role(:newsmoderator,@rubrik)
|
||||
@calentries= @rubrik.calendar.calentries
|
||||
if can?(:showunpublished, Neuigkeit)
|
||||
@neuigkeiten = @rubrik.neuigkeiten.page(params[:page]).per(3)
|
||||
else
|
||||
@neuigkeiten = @rubrik.neuigkeiten.published.page(params[:page]).per(3)
|
||||
end
|
||||
|
||||
@calentries= @rubrik.calendar.calentries.select {|c| c.object !=nil}
|
||||
@neuigkeiten = @rubrik.neuigkeiten.accessible_by(current_ability, :show).page(params[:page]).per(3)
|
||||
|
||||
@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
|
||||
|
||||
@@ -47,7 +43,6 @@ class RubrikenController < ApplicationController
|
||||
|
||||
def new
|
||||
@rubrik = Rubrik.new
|
||||
|
||||
end
|
||||
|
||||
def edit
|
||||
|
||||
@@ -3,7 +3,11 @@ class ThemenController < ApplicationController
|
||||
# GET /themen
|
||||
# GET /themen.json
|
||||
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
|
||||
@thema = Thema.find(params[:id])
|
||||
@fragen=@thema.fragen
|
||||
@@ -14,7 +18,7 @@ class ThemenController < ApplicationController
|
||||
|
||||
respond_to do |format|
|
||||
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
|
||||
end
|
||||
|
||||
@@ -3,7 +3,7 @@ class ThemengruppenController < ApplicationController
|
||||
# GET /themengruppen.json
|
||||
load_and_authorize_resource
|
||||
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 << {: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
|
||||
@@ -14,7 +14,7 @@ class ThemengruppenController < ApplicationController
|
||||
end
|
||||
end
|
||||
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
|
||||
|
||||
@@ -22,11 +22,8 @@ class ThemengruppenController < ApplicationController
|
||||
# GET /themengruppen/1.json
|
||||
def show
|
||||
@themengruppe = Themengruppe.find(params[:id])
|
||||
if can? :showdraft , Thema
|
||||
@themen = @themengruppe.themen
|
||||
else
|
||||
@themen = @themengruppe.themen.public
|
||||
end
|
||||
@themen=@themengruppe.themen.accessible_by(current_ability, :show)
|
||||
|
||||
@toolbar_elements = []
|
||||
@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
|
||||
def verwalten_all
|
||||
@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()}]
|
||||
|
||||
end
|
||||
@@ -63,7 +60,6 @@ class ThemengruppenController < ApplicationController
|
||||
|
||||
@toolbar_elements =[]
|
||||
@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=>: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
|
||||
|
||||
@@ -13,15 +13,17 @@ class UsersController < ApplicationController
|
||||
redirect_to users_url
|
||||
end
|
||||
def fb_set_default_publish_page
|
||||
if Fetsite::Application.config.facebookconfig_enabled
|
||||
if params["page"].nil? || !(current_user.provider=="facebook")
|
||||
redirect_to intern_home_index_path
|
||||
else
|
||||
@fbu=FbGraph::User.new(current_user.uid.to_s).fetch(:access_token=>session["fbuser_access_token"])
|
||||
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)}
|
||||
logger.debug @fbu.to_s
|
||||
logger.info @fbu.to_s
|
||||
logger.info "FbGraph Access" + session["fbuser_access_token"]
|
||||
redirect_to admin_home_index_path
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
def all_update
|
||||
|
||||
@@ -94,4 +94,12 @@ end
|
||||
end
|
||||
raw(html)
|
||||
end
|
||||
def absurl(path)
|
||||
if path.nil?
|
||||
return nil
|
||||
end
|
||||
url=URI(root_url)
|
||||
url.path=path
|
||||
return url
|
||||
end
|
||||
end
|
||||
|
||||
@@ -49,6 +49,7 @@ class Ability
|
||||
can :manage, Themengruppe
|
||||
can :manage, Attachment
|
||||
end
|
||||
can [:update,:edit,:verwalten, :showdraft], Thema, :id=>Thema.with_role(:editor, user).pluck(:id)
|
||||
unless user.has_role?("fetadmin")
|
||||
cannot :delete, Themengruppe
|
||||
cannot :delete, Thema
|
||||
@@ -62,6 +63,7 @@ class Ability
|
||||
end
|
||||
if( user.has_role?("fetuser") || user.has_role?("fetadmin"))
|
||||
can :manage, Gallery
|
||||
can :show, Foto
|
||||
end
|
||||
unless user.has_role?("fetadmin")
|
||||
cannot :delete, Gallery
|
||||
@@ -91,6 +93,7 @@ class Ability
|
||||
if loggedin
|
||||
end
|
||||
if( user.has_role?("fetuser") || user.has_role?("fetadmin"))
|
||||
|
||||
can :showversions, Neuigkeit
|
||||
can :showintern, Neuigkeit
|
||||
can :showintern, Rubrik
|
||||
|
||||
@@ -12,12 +12,12 @@
|
||||
|
||||
class Attachment < ActiveRecord::Base
|
||||
has_paper_trail
|
||||
attr_accessible :name, :datei, :datei_cache
|
||||
attr_accessible :name, :datei, :datei_cache,:flag_titlepic
|
||||
belongs_to :thema
|
||||
mount_uploader :datei, AttachmentUploader
|
||||
validates :thema, :presence => true
|
||||
validates :name, :presence => true
|
||||
|
||||
belongs_to :parent, :polymorphic=>true
|
||||
def image?
|
||||
|
||||
# data_ext = datei.file.extension.downcase
|
||||
|
||||
@@ -15,7 +15,7 @@ class Gallery < ActiveRecord::Base
|
||||
attr_accessible :datum, :desc, :name, :foto_ids
|
||||
has_many :fotos, :dependent => :destroy # Delete fotos if gallery is destroyed
|
||||
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
|
||||
text :desc
|
||||
text :name, :boost=>3.0
|
||||
|
||||
@@ -10,7 +10,7 @@ class Meeting < ActiveRecord::Base
|
||||
has_one :calentry, as: :object
|
||||
has_one :calendar, :through=>:meetingtyp
|
||||
has_one :rubrik, :through=>:meetingtyp
|
||||
|
||||
scope :upcomming, includes(:calentry).where("calentries.start>?",1.hour.ago)
|
||||
accepts_nested_attributes_for :calentry
|
||||
# validate :agenda, :presence=>true
|
||||
# validate :protocol, :presence=>true
|
||||
@@ -53,6 +53,9 @@ class Meeting < ActiveRecord::Base
|
||||
d=Document.new
|
||||
d.typ=10
|
||||
d.name="Protokoll"
|
||||
unless self.meetingtyp.protocol.nil?
|
||||
d.text=self.meetingtyp.protocol.text
|
||||
end
|
||||
d.save
|
||||
self.protocol=d
|
||||
end
|
||||
@@ -60,16 +63,19 @@ class Meeting < ActiveRecord::Base
|
||||
end
|
||||
def create_calentry
|
||||
if self.calentry.nil?
|
||||
ce =Calentry.new
|
||||
ce.typ=2
|
||||
self.calentry=ce
|
||||
end
|
||||
end
|
||||
ce =Calentry.new
|
||||
ce.typ=2
|
||||
self.calentry=ce
|
||||
end
|
||||
end
|
||||
def create_agenda
|
||||
if self.agenda.nil?
|
||||
d=Document.new
|
||||
d.typ=11
|
||||
d.name="Agenda"
|
||||
unless self.meetingtyp.agenda.nil?
|
||||
d.text=self.meetingtyp.agenda.text
|
||||
end
|
||||
d.save
|
||||
self.agenda=d
|
||||
end
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
class Meetingtyp < ActiveRecord::Base
|
||||
attr_accessible :agendaintern, :desc, :name, :protocolintern
|
||||
attr_accessible :agendaintern, :desc, :name, :protocolintern, :rubrik_id
|
||||
belongs_to :rubrik
|
||||
validate :rubrik, :presence=>true
|
||||
has_many :meetings
|
||||
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
|
||||
|
||||
@@ -33,7 +33,7 @@ class Neuigkeit < ActiveRecord::Base
|
||||
scope :intern, ->{includes(:rubrik).where("rubriken.public"=>false)}
|
||||
|
||||
# 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?}
|
||||
before_validation :sanitize
|
||||
|
||||
@@ -64,6 +64,18 @@ class Neuigkeit < ActiveRecord::Base
|
||||
def name
|
||||
self.title
|
||||
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
|
||||
md = /<p>(?<text>[^\<\>]*)/.match Sanitize.clean(self.text,:elements=>['p'])
|
||||
words=md[:text].split(" ") unless md.nil?
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
require 'uri'
|
||||
class Thema < ActiveRecord::Base
|
||||
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 :attachments
|
||||
belongs_to :themengruppe, :foreign_key => "themengruppe_id"
|
||||
@@ -22,21 +22,23 @@ include Rails.application.routes.url_helpers
|
||||
validates :themengruppe, :presence => true
|
||||
validates :title, :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 :documents, :as=>:parent
|
||||
scope :public, where(:isdraft=>false).includes(:themengruppe).where("themengruppen.public"=>true)
|
||||
default_scope order("themen.priority").reverse_order
|
||||
# scope :search, ->(query) {where("themen.text like ? or themen.title like ?", "%#{query}%", "%#{query}%")}
|
||||
resourcify
|
||||
searchable do
|
||||
text :text
|
||||
text :title, :boost=>4.0
|
||||
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
|
||||
def is_outdated?
|
||||
unless translation.try(:updated_at).nil?
|
||||
translation.updated_at < 2.month.ago
|
||||
translation.updated_at < 7.month.ago
|
||||
else
|
||||
false
|
||||
end
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
format =:default
|
||||
end %>
|
||||
<%= calentry.text %>
|
||||
<% if !(defined? manage) || manage %>
|
||||
<%= 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 %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
@@ -1,31 +1,14 @@
|
||||
|
||||
<div class="container-fluid">
|
||||
|
||||
|
||||
<div class="row-fluid">
|
||||
<div class="span12">
|
||||
<%= 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) ) %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row-fluid">
|
||||
<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">
|
||||
<%= image_tag @foto.datei.resized.url, :style=>"margin: auto;
|
||||
position: absolute;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
top: 0;" %>
|
||||
<% #, 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 style="position:absolute; bottom:0">
|
||||
<%= link_to ff_icon('icon-circle-arrow-down').html_safe, @foto.datei.url,
|
||||
:class=>"btn",title: I18n.t('fotos.download')+': '+@foto.title,:target=>:blank, :style=>"" %>
|
||||
<p id="notice"><%= notice %></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -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>
|
||||
<div>
|
||||
<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>
|
||||
<h1>
|
||||
<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 itemprop="name">
|
||||
<%= @gallery.name %>
|
||||
</h1>
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<meta itemprop="sameAs" content="<%= gallery_path(@gallery) %>"/>
|
||||
<p itemprop="description">
|
||||
<%= @gallery.desc %>
|
||||
</p>
|
||||
|
||||
|
||||
<style>
|
||||
.blueimp-gallery > .slides > .slide > .text-content {
|
||||
overflow: auto;
|
||||
text-align: left;
|
||||
}
|
||||
</style>
|
||||
<div class="fluid-row">
|
||||
<div class="span9"> <!-- pagination-->
|
||||
<div class="pagination pull_left" style="margin:0px 0px 0px 0px">
|
||||
@@ -80,6 +88,15 @@
|
||||
<div id="links">
|
||||
<a href="<%= f.datei.resized.url%>" title="<%=f.title%>" data-gallery>
|
||||
<%=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>
|
||||
<%= 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' %>
|
||||
@@ -112,5 +129,29 @@
|
||||
</div>
|
||||
<%= @pppage_array[@pppage] %>
|
||||
<%= 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>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<%= link_to I18n.t("beispiel.add"), new_beispiel_path, :class=>"linkbox"%>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="unstyled linkbox-list" style="margin-top:5px;margin-bottom:5px;">
|
||||
<ul class="unstyled linklist">
|
||||
<% @beispiele.each do |b| %>
|
||||
<li>
|
||||
<%= link_to b.lva, {:class=> :linkbox} do %>
|
||||
|
||||
@@ -1,20 +1,30 @@
|
||||
<p><%= link_to "Grant extra FB privileges", user_omniauth_authorize_path(:facebook,:params=>{scope:"manage_pages,publish_actions,email"}) %>
|
||||
</p>
|
||||
<h1>Administration</h1>
|
||||
<p>
|
||||
<%= link_to "user", users_path %>
|
||||
</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>
|
||||
<%= @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| %>
|
||||
<%= 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" ) %>
|
||||
<% 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>
|
||||
|
||||
@@ -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;">
|
||||
<h1><%= I18n.t('home.willkommen') %></h1>
|
||||
<%= render partial: "themen/small", object: @starttopic %>
|
||||
@@ -24,6 +33,14 @@
|
||||
|
||||
|
||||
</ul>
|
||||
<% @stickythemen.each do |t1| %>
|
||||
<li>
|
||||
<%= link_to t1 do %>
|
||||
<%= render partial: "themen/nlink", object: t %>
|
||||
<%= end %>
|
||||
</li>
|
||||
<% end %>
|
||||
|
||||
<!-- <div class="alert">
|
||||
<h2>Beta Test</h2>
|
||||
<p>Die Webseite befindet sich derzeit in einem Entwicklungsstadium,
|
||||
@@ -48,6 +65,7 @@
|
||||
</p>
|
||||
|
||||
<%= 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 class="span7">
|
||||
<ul class="unstyled linkbox-list" style="margin:5px;">
|
||||
|
||||
1
app/views/home/log.html.erb
Normal file
1
app/views/home/log.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
<pre><%= @logs %></pre>
|
||||
@@ -3,7 +3,7 @@
|
||||
|
||||
<head>
|
||||
<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">-->
|
||||
<!---->
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
|
||||
<div class="lva-semester">
|
||||
<%=lva.lvanr.to_s %> <b><%= link_to lva.full_name, lva_path(lva)%></b> <%= lva.ects %> ECTS / <%= lva.stunden %> Std<br>
|
||||
|
||||
<div class="lva-semester" style="overflow:auto;">
|
||||
<span>
|
||||
<%=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>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<%= 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 '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 "Protokoll" , create_protocol_meeting_path(meeting),:remote=>true if meeting.protocol.nil? %>
|
||||
<%= render meeting.agenda unless meeting.agenda.nil? %>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
<%= f.semantic_fields_for :calentry, @meeting.calentry do |ff| %>
|
||||
<%= ff.input :start, :as => :datetimepicker %>
|
||||
<%= ff.input :ende, :as => :datetimepicker %>
|
||||
<%= ff.input :typ %>
|
||||
<%= ff.input :typ, :as=>:hidden %>
|
||||
<% ff.input :object_id, :as=>:hidden %>
|
||||
<% ff.input :object_type %>
|
||||
|
||||
@@ -20,4 +20,4 @@
|
||||
<%= f.action :submit, :as => :input_ %>
|
||||
|
||||
<% end %>
|
||||
<%= @meeting.calentry.to_yaml %>
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
$("#<%= @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"): ""})
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -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>");
|
||||
|
||||
$('.datetimepicker').datetimepicker({format: 'd.m.Y H:i', startDate: (!($(this).attr("value")==undefined))? $(this).attr("value"): ""})
|
||||
|
||||
|
||||
12
app/views/meetingtyps/_form.html.erb
Normal file
12
app/views/meetingtyps/_form.html.erb
Normal 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 %>
|
||||
5
app/views/meetingtyps/_meetingtyp.html.erb
Normal file
5
app/views/meetingtyps/_meetingtyp.html.erb
Normal 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? %>
|
||||
1
app/views/meetingtyps/edit.html.erb
Normal file
1
app/views/meetingtyps/edit.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
<%= render "form" %>
|
||||
6
app/views/meetingtyps/index.html.erb
Normal file
6
app/views/meetingtyps/index.html.erb
Normal file
@@ -0,0 +1,6 @@
|
||||
<ul>
|
||||
<% @meetingtyps.each do |mt| %>
|
||||
<li><%= render mt %> </li>
|
||||
<% end %>
|
||||
</ul>
|
||||
<%= link_to "New" , new_meetingtyp_path %>
|
||||
1
app/views/meetingtyps/new.html.erb
Normal file
1
app/views/meetingtyps/new.html.erb
Normal file
@@ -0,0 +1 @@
|
||||
<%= render "form" %>
|
||||
@@ -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.start.to_s %>
|
||||
<%= " "+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.gremium.fall2 %>
|
||||
<%= Membership::TYPEN_g[membership.fetprofile.geschlecht.to_i][membership.typ.to_i] %> <span itemprop="name">
|
||||
<%= membership.gremium.fall2 %></span>
|
||||
<meta itemprop="sameAs" content="<%= gremium_path(membership.gremium, :theme=>nil)%>"/>
|
||||
</span>
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
<div class="media">
|
||||
<div class="pull-left" href="#">
|
||||
<p><br><%= image_tag neuigkeit.picture.thumb.url unless neuigkeit.picture.url.nil? %>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<% set_meta_tags :author => fetprofile_path(@neuigkeit.author.fetprofile) unless @neuigkeit.author.fetprofile.nil? %>
|
||||
<% unless @neuigkeit.picture.url.nil?
|
||||
picture_url=URI(root_url)
|
||||
picture_url.path=@neuigkeit.picture.url
|
||||
picture_url.path=@neuigkeit.picture.url(:locale=>nil, :theme=>nil)
|
||||
end
|
||||
%>
|
||||
<% set_meta_tags :og => {
|
||||
@@ -14,42 +14,64 @@ end
|
||||
: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 %>
|
||||
<% end %>
|
||||
|
||||
<%= 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">
|
||||
<p id="notice"><%= notice %></p>
|
||||
<div class="contentbox">
|
||||
<span>
|
||||
<p id="notice"><%= notice %></p>
|
||||
<div class="contentbox" itemscope itemtype="http://schema.org/Article">
|
||||
<meta itemprop="about" content="<%= @neuigkeit.text_first_words %>"/>
|
||||
<meta itemprop="sameAs" content="<%= neuigkeit_url(@neuigkeit,:theme=>nil)%>"/>
|
||||
<div class="row-fluid">
|
||||
<span itemprop="articleSection">
|
||||
<%= ff_icon(@neuigkeit.rubrik.icon) unless @neuigkeit.rubrik.icon.nil? or @neuigkeit.rubrik.icon.empty? %> <%= @neuigkeit.rubrik.name %>
|
||||
</span>
|
||||
<span class="pull-right">
|
||||
<%= @neuigkeit.author.email.to_s unless @neuigkeit.try(:author).try(:email).to_s %>
|
||||
<%= @neuigkeit.author.text+ " "+ I18n.t("neuigkeit.am")+" " + I18n.l(@neuigkeit.try(:datum).try(:to_date)) unless @neuigkeit.try(:datum).try(:to_date).nil? %>
|
||||
</span>
|
||||
<div class="media">
|
||||
</span>
|
||||
<span class="pull-right">
|
||||
<span itemprop="author"><%= @neuigkeit.author.email.to_s unless @neuigkeit.try(:author).try(:email).to_s %>
|
||||
<%= @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)) %>
|
||||
</span>
|
||||
<% end %>
|
||||
</div>
|
||||
<% unless @neuigkeit.published? %>
|
||||
<div class="sticker sticker-red"> Not Published</div> <% end %>
|
||||
|
||||
<div class="media">
|
||||
<% unless @neuigkeit.picture.big_thumb.to_s.empty? %>
|
||||
<div class="pull-left" href="#">
|
||||
<p><br><%= link_to image_tag(@neuigkeit.picture.big_thumb.url),@neuigkeit.picture.try(:url) %>
|
||||
</p>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
<div class="media-body">
|
||||
<h1>
|
||||
<h1 itemprop="name">
|
||||
<%= @neuigkeit.title%>
|
||||
</h1>
|
||||
<div itemprop="articleBody">
|
||||
<%= raw(@neuigkeit.text) %>
|
||||
</div>
|
||||
<p></p>
|
||||
</div>
|
||||
</div>
|
||||
<div id="calentries">
|
||||
</div>
|
||||
<div id="calentries">
|
||||
<% @calentries1.each do |ce|%>
|
||||
<%= render ce unless ce.nil? %>
|
||||
<% end %>
|
||||
</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? %>
|
||||
<%= render @neuigkeit.meeting %>
|
||||
<% end%>
|
||||
@@ -74,6 +96,8 @@ Nach Element suchen:
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
$(function(){
|
||||
dialog = $( "#findlink-body" ).dialog({
|
||||
|
||||
@@ -5,8 +5,7 @@
|
||||
<td><%= fa_icon "globe" if r.public%></td>
|
||||
<td><%= r.name %></td>
|
||||
<td>
|
||||
<%= n.title %>
|
||||
|
||||
<%= link_to n.title, n %>
|
||||
</td>
|
||||
<td>
|
||||
<%= unless n.datum.nil?
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
<a class="dropdown-toggle" data-toggle="dropdown" href="#">Actions</a>
|
||||
<ul class="dropdown-menu">
|
||||
<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) %>
|
||||
</li><li>
|
||||
<%= link_to "Delete Attachment", thema_attachment_path(a.thema,a), method: "DELETE", confirm: "Sure?" , class: "btn-danger " %>
|
||||
|
||||
@@ -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}%>
|
||||
<div>
|
||||
<b>Form</b>
|
||||
<%= render :partial=>"attachments/form_bulk" %>
|
||||
</div>
|
||||
|
||||
@@ -21,6 +21,8 @@
|
||||
</div>
|
||||
<div class="span4">
|
||||
<%= f.input :hideattachment %>
|
||||
<%= f.input :sticky_intern %>
|
||||
<%= f.input :sticky_startpage %>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
<% if can? :show, small %>
|
||||
<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>
|
||||
<%= image_tag small.titlepics.first.datei.url unless small.titlepics.first.nil? %>
|
||||
<% 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>
|
||||
<% end %>
|
||||
@@ -26,8 +27,10 @@
|
||||
<b>Treffen/Sitzungen</b>
|
||||
<%= link_to "Neues Meeting", new_meeting_path(:parent_id=>small.id, :parent_type=>"Thema"), :remote=>true %>
|
||||
<div id="<%= Meeting.new_divid_for(small) %>"></div>
|
||||
<%= link_to "All", meetings_path(:parent_id=>small.id, :parent_type=>"Thema"), :remote=>true %>
|
||||
<%= link_to "upcomming", meetings_path(:parent_id=>small.id, :parent_type=>"Thema",:filter=>"upcomming"), :remote=>true %>
|
||||
<ul class="nav nav-tabs">
|
||||
<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} %>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -1,25 +1,12 @@
|
||||
<h1>Listing themen</h1>
|
||||
|
||||
<table>
|
||||
<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>
|
||||
<h1>Listing theme1n</h1><h2>drafts </h2>
|
||||
<% @themen_drafts.each do |thema| %>
|
||||
<%= render partial:"themen/nlink", object: thema %>
|
||||
<% end %>
|
||||
</table>
|
||||
|
||||
<h2>All</h2>
|
||||
<% @themen.each do |thema| %>
|
||||
<%= render partial:"themen/nlink", object: thema %>
|
||||
<% end %>
|
||||
<br />
|
||||
|
||||
<%= link_to 'New Thema', new_thema_path %>
|
||||
|
||||
@@ -1,8 +1,54 @@
|
||||
<p id="notice"><%= notice %></p>
|
||||
<%= link_to "Zurück", @thema.themengruppe %>
|
||||
<br>
|
||||
<div class="contentbox">
|
||||
<%= render :partial=>"themen/small", :object=>@thema %>
|
||||
</div>
|
||||
<%= render :partial=>'layouts/pretty_toolbar' %>
|
||||
<%= content_for :header do %>
|
||||
<title><%= @thema.title.to_s + " (" + @thema.themengruppe.title.to_s + ")" %></title>
|
||||
|
||||
<%
|
||||
mog = {
|
||||
:title => @thema.title.to_s + " (" + @thema.themengruppe.title.to_s + ")",
|
||||
: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' %>
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -2,16 +2,17 @@
|
||||
<div class="content-wrap content-column">
|
||||
|
||||
<% @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">
|
||||
<a name="themengruppe_<%=tg.id.to_s%>"></a>
|
||||
<h2> <%= tg.title%></h2>
|
||||
<ul>
|
||||
<% tg.themen.order(:priority).reverse.each do |t| %>
|
||||
<% if can?(:show, t) %>
|
||||
<% if can?(:show, t) && !t.fragen.empty? %>
|
||||
<li> <%= t.title %>
|
||||
<ul>
|
||||
<% t.fragen.each do |f| %>
|
||||
<% t.fragen.order(:title).each do |f| %>
|
||||
<li>
|
||||
<b> <%= f.title %>?</b>
|
||||
<p> <%= raw(f.text) %></p>
|
||||
|
||||
@@ -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>
|
||||
<%= raw(@starttopic.text) %>
|
||||
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="row-fluid">
|
||||
<div class="span6">
|
||||
<div class="span5">
|
||||
|
||||
<ul class="linklist">
|
||||
<li>
|
||||
@@ -21,8 +30,19 @@
|
||||
|
||||
</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>
|
||||
|
||||
|
||||
</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>
|
||||
<!-- <div class="alert">
|
||||
<h2>Beta Test</h2>
|
||||
@@ -46,24 +66,15 @@
|
||||
</div>-->
|
||||
|
||||
</p>
|
||||
|
||||
<%= 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 class="span6">
|
||||
<ul class="unstyled linkbox-list" style="max-width:70em">
|
||||
<div class="span7">
|
||||
<ul class="unstyled linklist">
|
||||
<% @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>
|
||||
|
||||
@@ -35,4 +35,6 @@ Fetsite::Application.configure do
|
||||
|
||||
# Expands the lines which load the assets
|
||||
config.assets.debug = false
|
||||
|
||||
config.facebookconfig_enabled=true
|
||||
end
|
||||
|
||||
@@ -65,4 +65,7 @@ Fetsite::Application.configure do
|
||||
# Log the query plan for queries taking more than this (works
|
||||
# with SQLite, MySQL, and PostgreSQL)
|
||||
# config.active_record.auto_explain_threshold_in_seconds = 0.5
|
||||
|
||||
config.facebookconfig_enabled=true
|
||||
|
||||
end
|
||||
|
||||
1
config/initializers/assets.rb
Normal file
1
config/initializers/assets.rb
Normal file
@@ -0,0 +1 @@
|
||||
Rails.application.config.assets.precompile += ['blueimp-gallery-all.js']
|
||||
@@ -135,6 +135,7 @@
|
||||
get 'linksnotimplemented'
|
||||
get 'kontakt'
|
||||
get 'choose_contact_topics'
|
||||
get 'log'
|
||||
end
|
||||
end
|
||||
|
||||
@@ -157,7 +158,11 @@
|
||||
get :documents
|
||||
get :meetings
|
||||
end
|
||||
resources :attachments
|
||||
resources :attachments do
|
||||
member do
|
||||
get :set_titlepic
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
resources :calendars
|
||||
@@ -181,7 +186,11 @@
|
||||
end
|
||||
|
||||
|
||||
resources :meetingtyps
|
||||
resources :meetingtyps do
|
||||
member do
|
||||
get :create_protocol_and_agenda
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
root :to => 'home#index'
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
production:
|
||||
solr:
|
||||
hostname: localhost
|
||||
port: 8983
|
||||
port: 8080
|
||||
log_level: WARNING
|
||||
path: /solr/production
|
||||
path: /solr-4.10.2/default #production #ollection1 #production
|
||||
# solr_home: solr
|
||||
# read_timeout: 2
|
||||
# open_timeout: 0.5
|
||||
|
||||
|
||||
7
db/migrate/20150211180445_add_parent_to_attachment.rb
Normal file
7
db/migrate/20150211180445_add_parent_to_attachment.rb
Normal 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
|
||||
5
db/migrate/20150211180912_add_flags_to_attachment.rb
Normal file
5
db/migrate/20150211180912_add_flags_to_attachment.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddFlagsToAttachment < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :attachments, :flag_titlepic, :boolean
|
||||
end
|
||||
end
|
||||
9
db/migrate/20150219142123_add_sticky_to_thema.rb
Normal file
9
db/migrate/20150219142123_add_sticky_to_thema.rb
Normal 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
|
||||
Reference in New Issue
Block a user