diff --git a/Gemfile b/Gemfile index fb8b9bc..334c1b6 100755 --- a/Gemfile +++ b/Gemfile @@ -5,7 +5,7 @@ gem 'sprockets', '2.2.2' gem 'webrick', '1.3.1' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' - gem 'mysql2' + gem 'mysql2', '~>0.3.10' gem 'sqlite3' gem 'execjs', '~>1.4.0' diff --git a/MyText, b/MyText, deleted file mode 100644 index e69de29..0000000 diff --git a/Nachname, b/Nachname, deleted file mode 100644 index e69de29..0000000 diff --git a/Short, b/Short, deleted file mode 100644 index e69de29..0000000 diff --git a/Vorname, b/Vorname, deleted file mode 100644 index e69de29..0000000 diff --git a/app/assets/stylesheets/infoscreenframe.css b/app/assets/stylesheets/infoscreenframe.css new file mode 100644 index 0000000..919656e --- /dev/null +++ b/app/assets/stylesheets/infoscreenframe.css @@ -0,0 +1,134 @@ +html { + background-color: #fff; + overflow: hidden; +} + +body { + display: flex; + flex-flow: wrap; + height: 100vh; + justify-content: space-between; + flex-direction: column; +} + +.header { + height: 200px; + width: 100% +} + +svg { + padding-top: 2em; +} + +.impulsPath { + fill: none; + stroke: #04669c; + stroke-miterlimit: 1; + stroke-width: 6px; + stroke-dasharray: 1946.243; + stroke-dashoffset: 0; + stroke-linejoin: round; + stroke-linecap: round; + animation: dash 10s ease-out infinite; + animation-direction: normal; +} + +.FET-logotext-stroke { + fill: #fff; +} + +#FET-logotext { + opacity: 0; + animation: logotext 10s ease-in infinite; + +} + + +.content-area { + + height: auto; + width: 100%; +} + +.footer { + width: 100%; + height: 150px; + background-color: #04669c; + padding-bottom: 10px; + display: flex; + flex-wrap: nowrap; + justify-content: space-between; + color: #fff; + flex-basis: bottom; +} + +.footer h3, +p { + margin: 0; + padding: 0 20px; + font-family: Helvetica, Arial; + letter-spacing: 0.1em; +} + +.footer h3 { + padding-top: 20px; +} + +.footer .adress { + margin: auto; + text-align: left; +} + +.footer .contact { + margin: auto; + text-align: center; +} + +.footer .servicecontainer{ + display: inline-flex; + margin: auto; + +} +.footer .servicecontainer .servicetime { + margin: auto; + text-align: right; +} + +.footer .servicecontainer .servicetime #time { + font-size: 0.7em +} + +.footer .servicecontainer .servicestatus{ + margin: auto; + width:20px; + height: 100% + padding-right: 30px; + background-color: #fff; +} + + + + +/*K E Y F R A M E S*/ + +@keyframes dash { + from { + stroke-dashoffset: 1946.243; + opacity: 0; + stroke-width: 0.5; + } + to { + opacity: 1; + stroke-dashoffset: 0; + stroke-width: 5px; + } +} + +@keyframes logotext { + from { + opacity: 0; + } + to { + opacity: 1; + } +} diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index ecca38e..bb0be2b 100755 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -8,7 +8,7 @@ class HomeController < ApplicationController params[:month]= Date.today.month if params[:month].nil? params[:year]= Date.today.year if params[:year].nil? - + @calentries= (@rubriken.map {|r| r.calendar}).collect(&:calentries).flatten.select {|c| c.object !=nil} @starttopic= @themen = Thema.where(:id=>t).first @@ -21,7 +21,7 @@ class HomeController < ApplicationController end def infoscreen - authorize! :infoscreen, User + authorize! :infoscreen, User @neuigkeiten = Neuigkeit.accessible_by(current_ability, :show).where(flag_infoscreen: true) render layout: false end @@ -29,7 +29,7 @@ class HomeController < ApplicationController t=YAML.load_file("#{::Rails.root.to_s}/config/contact_topic.yml") @themen = Thema.where(:id=>t) end - def treeview + def treeview authorize! :doadmin, User @themengruppen = Themengruppe.order(:priority).reverse @themengruppen += Themengruppe.intern.order(:priority).reverse @@ -54,7 +54,7 @@ class HomeController < ApplicationController else @logs = `tail -n #{lines} log/development.log | grep -v 'actionpack\\|railties\\|activesupport\\|::Translation'` end - + end def startdev render 'setup_fetsite_dev' @@ -64,7 +64,7 @@ class HomeController < ApplicationController end def search - + unless params['query'].nil? || params['query'].empty? @results = Sunspot.search Neuigkeit,Rubrik, Fetprofile, Thema, Themengruppe, Lva, Studium, Modul, Modulgruppe, Gremium, Document do fulltext params['query'] @@ -88,7 +88,7 @@ class HomeController < ApplicationController # @themen=Thema.search(params['query']).public # end @themen=[] - + else @neuigkeiten=[] @fetprofiles=[] @@ -110,10 +110,10 @@ class HomeController < ApplicationController unless params[:themen].nil? t=([t].flatten+params[:themen]).uniq end - unless params[:rmthema].nil? + unless params[:rmthema].nil? t=t-[params[:rmthema]] end - File.open("config/contact_topic.yml",'w'){|f| f.write(t.to_yaml)} + File.open("config/contact_topic.yml",'w'){|f| f.write(t.to_yaml)} redirect_to admin_home_index_path end diff --git a/app/controllers/rubriken_controller.rb b/app/controllers/rubriken_controller.rb index 966edf1..6a059e7 100755 --- a/app/controllers/rubriken_controller.rb +++ b/app/controllers/rubriken_controller.rb @@ -16,7 +16,7 @@ class RubrikenController < ApplicationController @rubriken= Rubrik.accessible_by(current_ability, :show) @neuigkeiten = Neuigkeit.accessible_by(current_ability, :list).page(params[:page]).per(3) - @calentries= (@rubriken.map {|r| r.calendar.calentries.of_month(Date.new(params[:year],params[:month],1))}).flatten.select {|c| c.object !=nil} + @calentries= (@rubriken.map {|r| r.calendar.calentries.of_month(Date.new(params[:year].to_i,params[:month].to_i,1))}).flatten.select {|c| c.object !=nil} respond_to do |format| format.html format.js {render action: :show} diff --git a/app/models/document.rb b/app/models/document.rb index a789d95..ad4a713 100644 --- a/app/models/document.rb +++ b/app/models/document.rb @@ -10,7 +10,7 @@ class Document < ActiveRecord::Base has_paper_trail TYPS = { 1=>"fet_docs", 10=>"protocol", 11=> "agenda"} has_many :attachments, :as=>:parent - def long_name + def long_name if self.parent.class=="Meeting" ""+self.parent.text+ ""+ self.name else @@ -18,20 +18,20 @@ class Document < ActiveRecord::Base end end def self.new_divid_for(parent) - "document_new_parent_" + parent.class.to_s + "_" + parent.id.to_s + "document_new_parent_" + parent.class.to_s + "_" + parent.id.to_s end def divid "document_"+self.id.to_s end def self.ether - EtherpadLite.connect('http://www.fet.at/etherpad', File.new('/srv/etherpad/etherpad-lite/APIKEY.txt')) + EtherpadLite.connect('https://www.fet.at/etherpad', File.new('config/etherpad/APIKEY.txt'))#https://www.etherpad.fet.at end def create_pdf require "open3" - + #url=blank_document_url({id: self.id, host: host, port: port}) # url=Rails.application.routes.url_helpers.blank_document_url({id: self.id, host: host, port: port}) - + file = Tempfile.new(['document', '.pdf']) bin=Rails.application.config.pdf_bin sin,sout,serr=Open3.popen3("#{bin} --header-html \"file://#{Rails.root}/app/views/documents/header.html\" --footer-html \"file://#{Rails.root}/app/views/documents/footer.html\" --replace title1 \"#{self.name}\" - #{file.path}") @@ -71,6 +71,7 @@ class Document < ActiveRecord::Base def move_to_etherpad unless self.is_etherpad? || self.id.nil? self.etherpadkey="document_"+ self.id.to_s + if self.text.nill? self.ep_pad.html = '
'+"text"+'
' else @@ -91,7 +92,7 @@ class Document < ActiveRecord::Base end def read_from_etherpad self.text=ApplicationController.helpers.strip_control_chars( self.ep_pad.html) - + end def ep_pad self.ep_group.pad(self.etherpadkey) @@ -101,16 +102,16 @@ class Document < ActiveRecord::Base Document.ether.group(Document::TYPS[t]) end def text_stripped - ApplicationController.helpers.strip_control_chars(ApplicationController.helpers.strip_tags(text.to_s.gsub("<"," <").gsub(">","> ").to_s)) - + ApplicationController.helpers.strip_control_chars(ApplicationController.helpers.strip_tags(text.to_s.gsub("<"," <").gsub(">","> ").to_s)) + end searchable do text :text, stored: true do |d| d.text_stripped end - text :name, :boost=>4.0, :stored=> true - text :meeting, stored: true do |d| - (d.parent.is_a?(Meeting))? d.try(:parent).try(:text).to_s : "" + text :name, :boost=>4.0, :stored=> true + text :meeting, stored: true do |d| + (d.parent.is_a?(Meeting))? d.try(:parent).try(:text).to_s : "" end end def maketoc @@ -124,20 +125,20 @@ class Document < ActiveRecord::Base l=2 f=true; s=""*(l-h["level"]) if (h["level"]" if (h["level"]==l) and !f + s=s+" " if (h["level"]==l) and !f if (h["level"]>l) - s=s + ""*(l-2) if (l>2) s=s+"" self.toc=s end diff --git a/app/models/neuigkeit.rb b/app/models/neuigkeit.rb index 1529f2f..f7b705b 100755 --- a/app/models/neuigkeit.rb +++ b/app/models/neuigkeit.rb @@ -16,9 +16,9 @@ class Neuigkeit < ActiveRecord::Base attr_accessible :datum, :text, :title, :rubrik_id, :author_id,:picture,:picture_cache, :calentries_attributes, :flag_important belongs_to :author, :class_name =>'User' belongs_to :rubrik, :class_name =>'Rubrik', :foreign_key => "rubrik_id" - has_one :calendar, through: :rubrik + has_one :calendar, through: :rubrik has_many :calentries, as: :object, :dependent=> :destroy - has_many :nlinks, :dependent=> :destroy + has_many :nlinks, :dependent=> :destroy has_one :meeting has_many :attachments, :as=>:parent has_one :title_pic, :class_name=>"Attachment", :as=>:parent, :conditions=>["attachments.flag_titlepic =?", true] @@ -60,11 +60,11 @@ class Neuigkeit < ActiveRecord::Base end def read_attribute(name,options={}) if translated?(name) - a=super(name,options) - a=self.translation_for(options[:locale] || I18n.locale).read_attribute(name) if self.no_fallbacks - + a=super(name,options) + a=self.translation_for(options[:locale] || I18n.locale).read_attribute(name) if self.no_fallbacks + a - else + else super(name) end end @@ -91,7 +91,7 @@ class Neuigkeit < ActiveRecord::Base !self.meeting.nil? end def self.published - where("datum <= ? AND datum IS NOT NULL", Time.now.to_date) + where("datum <= ? AND datum IS NOT NULL", Time.now.to_date) end def datum_nilsave @@ -132,7 +132,17 @@ class Neuigkeit < ActiveRecord::Base "...." else words[0..100].join(" ")+ " ..." unless words.nil? - + + end + end + def text_infoscreen_words + md = /

(?[^\<\>]*)/.match Sanitize.clean(self.text,:elements=>['p']) + words=md[:text].split(" ") unless md.nil? + if words.nil? || words.empty? + "...." + else + words[0..1000].join(" ")+ " ..." unless words.nil? + end end def has_calentries? @@ -143,7 +153,7 @@ class Neuigkeit < ActiveRecord::Base end def relevant_calentry ce = self.calentries.min_by{|c| c.days_to_today * 1.3 * ((c.is_past?)? 2:1)} if self.is_event? - ce= self.meeting.calentry if self.has_meeting? + ce= self.meeting.calentry if self.has_meeting? ce end def update_cache @@ -151,8 +161,8 @@ class Neuigkeit < ActiveRecord::Base self.update_column(:cache_order, (self.meeting.calentry.start.to_date - Date.today).to_i.abs * 1.3) self.update_column(:cache_relevant_date, self.meeting.calentry.start.to_date) self.touch - else - if self.is_event? + else + if self.is_event? c = self.calentries.min_by{|c| c.days_to_today * 1.3 * ((c.is_past?)? 2:1)} self.update_column(:cache_order, c.days_to_today * 1.3 * ((c.is_past?)? 2:1)) self.update_column(:cache_relevant_date, (c.is_past?) ? c.ende.to_date : c.start.to_date) @@ -184,7 +194,7 @@ class Neuigkeit < ActiveRecord::Base end end searchable do - text :text + text :text text :datum text :title end diff --git a/app/views/devise/sessions/new.html.erb b/app/views/devise/sessions/new.html.erb index 3bda550..872da13 100755 --- a/app/views/devise/sessions/new.html.erb +++ b/app/views/devise/sessions/new.html.erb @@ -9,7 +9,7 @@

-<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %> + + <%= render "devise/shared/links" %> diff --git a/app/views/documents/write_etherpad.html.erb b/app/views/documents/write_etherpad.html.erb index 3c33eb4..09f5ac3 100644 --- a/app/views/documents/write_etherpad.html.erb +++ b/app/views/documents/write_etherpad.html.erb @@ -1 +1 @@ -<%= link_to "weiter" , "http://www.fet.at/etherpad/p/"+@document.ep_pad.id , target: :blank %> +<%= link_to "weiter" , "https://www.fet.at/etherpad/p/"+@document.ep_pad.id , target: :blank %> diff --git a/app/views/home/infoscreen.html.erb b/app/views/home/infoscreen.html.erb index bab06c5..db57e0d 100644 --- a/app/views/home/infoscreen.html.erb +++ b/app/views/home/infoscreen.html.erb @@ -3,84 +3,101 @@ <%= stylesheet_link_tag "themes/"+theme_name+"/application", :media => "all" unless theme_name.empty? %> <%= stylesheet_link_tag "application", :media=>"all" if theme_name.empty? %> + <%= stylesheet_link_tag "infoscreenframe.css" %> <%= javascript_include_tag "application" %> <%= javascript_include_tag "jmpress" %> -
-<% i=1 %> -<% @neuigkeiten.each do |n| %> -
<% @toolbar_elements=[];@questions=[] %> -
- -
-<% unless n.picture_robust.big_thumb.to_s.empty? %> -

-
<%= link_to image_tag(n.picture_robust.big_thumb),n.picture_robust.try(:url) %> -

-<% end %> -

- <% if n.has_calentries? %> -
- <%= fa_icon("calendar 2x") %> - <%= n.relevant_calentry.text %> -
- <% elsif n.has_meeting? %> -
- <%= fa_icon("calendar 2x") %> - <%= n.meeting.calentry.text unless n.meeting.calentry.nil? %> -
- - <% end %> -

-
- -
-

- <%= raw(n.title) %> <%#= link_to fa_icon("edit"), edit_rubrik_neuigkeit_path(n.rubrik, n), remote: true if can? :edit, n %> -

-
- <%= raw(n.text_first_words) %> +<%= content_tag(:iframe,'', width: "100%", height: "100%", name: "targetframe", allowTransparency:"true", scrolling:"no", frameborder:"0", src: "/iframe/infoscreenframe.html") %> <%#header picture/animation %> +
+ <% i=1 %> + <% @neuigkeiten.each do |n| %> +
+
+
+ <% unless n.picture_robust.big_thumb.to_s.empty? %> +

+
<%= link_to image_tag(n.picture_robust.big_thumb),n.picture_robust.try(:url) %>

+ <% end %> +

+ <% if n.has_calentries? %> +
+ <%= fa_icon("calendar 2x") %> + <%= n.relevant_calentry.text %> +
+ <% elsif n.has_meeting? %> +
+ <%= fa_icon("calendar 2x") %> + <%= n.meeting.calentry.text unless n.meeting.calentry.nil? %> +
-

+ <% end %> + +
+ +
+

+ <%= raw(n.title) %> <%#= link_to fa_icon("edit"), edit_rubrik_neuigkeit_path(n.rubrik, n), remote: true if can? :edit, n %> +

+
+ <%= raw(n.text_infoscreen_words) %> +
+
+
+
+ <% i = i+1 %> + <% end %> -
- -
-<% i = i+1 %> -<% end %> + -
-
-
-
- + diff --git a/Fetmailalias, b/config/etherpad/APIKEY.txt.example similarity index 100% rename from Fetmailalias, rename to config/etherpad/APIKEY.txt.example diff --git a/config/sunspot.yml b/config/sunspot.yml index 236e868..20d40e6 100644 --- a/config/sunspot.yml +++ b/config/sunspot.yml @@ -10,10 +10,15 @@ production: development: solr: - hostname: solr - port: 8983 + hostname: triton-amp.local + port: 8080 log_level: INFO path: /solr/mycore +# solr: +# hostname: localhost +# port: 8983 +# log_level: INFO +# path: /solr/mycore test: solr: diff --git a/initscript.sh b/initscript.sh index 7b8705d..97f2155 100755 --- a/initscript.sh +++ b/initscript.sh @@ -1,7 +1,7 @@ #! /bin/bash ruby_command="ruby" rake_command="rake" -bundler_command="bundler" +bundler_command="bundle" # Are the necessary programs installed? command -v $ruby_command >/dev/null 2>&1 || { echo >&2 "The given ruby command does not exist. Please change the command or install ruby"; exit 1; } @@ -17,11 +17,12 @@ cp -u config/omniauth_secrets.yml.example config/omniauth_secrets.yml touch config/crawl_config.yml echo "Bundle install..." # Run Bundler -$bundler_command install #|| {echo "Bundler failed. Please run \"$bundle\_command install\" seperately and debug the errors, before running this script again"; exit 1;} +$bundler_command install || { echo "Bundler failed. Please run \"$bundle\_command install\" seperately and debug the errors, before running this script again";exit 1; } echo "Migrate the database..." # Run the migration -$rake_command db:migrate #||{echo "Migration failed. Please run \"$rake\_command db:migrate\" seperately and debug the errors, before running this script again"; exit 1} +$rake_command db:migrate || { echo "Migration failed. Please run \"$rake\_command db:migrate\" seperately and debug the errors, before running this script again"; exit 1; } + echo "Start the sunspot server" # Run Sunspot @@ -35,7 +36,7 @@ if [ ! -f config/start_topic.yml ]; then echo "1" > config/start_topic.yml fi -# Generate fetadmin user "admin@fet.at", password: 12345678 +touch config/crawl_config.yml diff --git a/public/assets/infoscreen_header_provisorisch.png b/public/assets/infoscreen_header_provisorisch.png new file mode 100644 index 0000000..1f6f671 Binary files /dev/null and b/public/assets/infoscreen_header_provisorisch.png differ diff --git a/public/assets/infoscreenframe.css b/public/assets/infoscreenframe.css new file mode 100644 index 0000000..919656e --- /dev/null +++ b/public/assets/infoscreenframe.css @@ -0,0 +1,134 @@ +html { + background-color: #fff; + overflow: hidden; +} + +body { + display: flex; + flex-flow: wrap; + height: 100vh; + justify-content: space-between; + flex-direction: column; +} + +.header { + height: 200px; + width: 100% +} + +svg { + padding-top: 2em; +} + +.impulsPath { + fill: none; + stroke: #04669c; + stroke-miterlimit: 1; + stroke-width: 6px; + stroke-dasharray: 1946.243; + stroke-dashoffset: 0; + stroke-linejoin: round; + stroke-linecap: round; + animation: dash 10s ease-out infinite; + animation-direction: normal; +} + +.FET-logotext-stroke { + fill: #fff; +} + +#FET-logotext { + opacity: 0; + animation: logotext 10s ease-in infinite; + +} + + +.content-area { + + height: auto; + width: 100%; +} + +.footer { + width: 100%; + height: 150px; + background-color: #04669c; + padding-bottom: 10px; + display: flex; + flex-wrap: nowrap; + justify-content: space-between; + color: #fff; + flex-basis: bottom; +} + +.footer h3, +p { + margin: 0; + padding: 0 20px; + font-family: Helvetica, Arial; + letter-spacing: 0.1em; +} + +.footer h3 { + padding-top: 20px; +} + +.footer .adress { + margin: auto; + text-align: left; +} + +.footer .contact { + margin: auto; + text-align: center; +} + +.footer .servicecontainer{ + display: inline-flex; + margin: auto; + +} +.footer .servicecontainer .servicetime { + margin: auto; + text-align: right; +} + +.footer .servicecontainer .servicetime #time { + font-size: 0.7em +} + +.footer .servicecontainer .servicestatus{ + margin: auto; + width:20px; + height: 100% + padding-right: 30px; + background-color: #fff; +} + + + + +/*K E Y F R A M E S*/ + +@keyframes dash { + from { + stroke-dashoffset: 1946.243; + opacity: 0; + stroke-width: 0.5; + } + to { + opacity: 1; + stroke-dashoffset: 0; + stroke-width: 5px; + } +} + +@keyframes logotext { + from { + opacity: 0; + } + to { + opacity: 1; + } +} diff --git a/public/iframe/infoscreenframe.css b/public/iframe/infoscreenframe.css new file mode 100644 index 0000000..919656e --- /dev/null +++ b/public/iframe/infoscreenframe.css @@ -0,0 +1,134 @@ +html { + background-color: #fff; + overflow: hidden; +} + +body { + display: flex; + flex-flow: wrap; + height: 100vh; + justify-content: space-between; + flex-direction: column; +} + +.header { + height: 200px; + width: 100% +} + +svg { + padding-top: 2em; +} + +.impulsPath { + fill: none; + stroke: #04669c; + stroke-miterlimit: 1; + stroke-width: 6px; + stroke-dasharray: 1946.243; + stroke-dashoffset: 0; + stroke-linejoin: round; + stroke-linecap: round; + animation: dash 10s ease-out infinite; + animation-direction: normal; +} + +.FET-logotext-stroke { + fill: #fff; +} + +#FET-logotext { + opacity: 0; + animation: logotext 10s ease-in infinite; + +} + + +.content-area { + + height: auto; + width: 100%; +} + +.footer { + width: 100%; + height: 150px; + background-color: #04669c; + padding-bottom: 10px; + display: flex; + flex-wrap: nowrap; + justify-content: space-between; + color: #fff; + flex-basis: bottom; +} + +.footer h3, +p { + margin: 0; + padding: 0 20px; + font-family: Helvetica, Arial; + letter-spacing: 0.1em; +} + +.footer h3 { + padding-top: 20px; +} + +.footer .adress { + margin: auto; + text-align: left; +} + +.footer .contact { + margin: auto; + text-align: center; +} + +.footer .servicecontainer{ + display: inline-flex; + margin: auto; + +} +.footer .servicecontainer .servicetime { + margin: auto; + text-align: right; +} + +.footer .servicecontainer .servicetime #time { + font-size: 0.7em +} + +.footer .servicecontainer .servicestatus{ + margin: auto; + width:20px; + height: 100% + padding-right: 30px; + background-color: #fff; +} + + + + +/*K E Y F R A M E S*/ + +@keyframes dash { + from { + stroke-dashoffset: 1946.243; + opacity: 0; + stroke-width: 0.5; + } + to { + opacity: 1; + stroke-dashoffset: 0; + stroke-width: 5px; + } +} + +@keyframes logotext { + from { + opacity: 0; + } + to { + opacity: 1; + } +} diff --git a/public/iframe/infoscreenframe.html b/public/iframe/infoscreenframe.html new file mode 100644 index 0000000..a9878e5 --- /dev/null +++ b/public/iframe/infoscreenframe.html @@ -0,0 +1,104 @@ + + + + + + Infoscreen + + + + + + + + + + +
+ + + + + + + + + +
+
+ + + + + + + + + +
+ + + + + + + + diff --git a/test1 b/test1 deleted file mode 100644 index e69de29..0000000