diff --git a/.gitignore b/.gitignore index 0901348..a56c92f 100755 --- a/.gitignore +++ b/.gitignore @@ -51,4 +51,5 @@ Gemfile.lock /config/contact_topic.yml .#* .* -!/.gitignore \ No newline at end of file +!/.gitignore +*.pid \ No newline at end of file diff --git a/Gemfile b/Gemfile index a8dc2a8..fb8b9bc 100755 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,5 @@ source 'https://rubygems.org' - +gem 'rake', '~>11.0' gem 'rails', '3.2.13' gem 'sprockets', '2.2.2' gem 'webrick', '1.3.1' @@ -136,4 +136,4 @@ gem 'blueimp-gallery-rails' gem 'shareable' -gem 'sunspot_test' \ No newline at end of file +gem 'sunspot_test' diff --git a/README b/README new file mode 100644 index 0000000..9b1b424 --- /dev/null +++ b/README @@ -0,0 +1,25 @@ +SETUP: + +install ruby 2.1.10 + +install requirements +apt-get ... + + +mkdir /srv/fetsite +cd /srv/fetsite + +copy / fetch Gemfile + +make User fetsite + + +bundle install + +# Config Files kopieren: +cp /srv/fetsite/config/omniout_secrets.yml.example /srv/fetsite/config/omniout_secrets.yml +cp /srv/fetsite/config/omniout_secrets.yml.example /srv/fetsite/config/omniout_secrets.yml +touch crawler_config.yml + +# Datenbank erstellen +rake db:migrate \ No newline at end of file diff --git a/app/models/gremium.rb b/app/models/gremium.rb index 8ee1800..e7c4b1a 100644 --- a/app/models/gremium.rb +++ b/app/models/gremium.rb @@ -26,7 +26,7 @@ class Gremium < ActiveRecord::Base # has_many :members, through: :memberships searchable do text :desc - text :name, :boost=>4.0 + text :name end belongs_to :thema # Gehört zu einem Thema diff --git a/app/models/neuigkeit.rb b/app/models/neuigkeit.rb index 0db49de..1529f2f 100755 --- a/app/models/neuigkeit.rb +++ b/app/models/neuigkeit.rb @@ -186,6 +186,6 @@ class Neuigkeit < ActiveRecord::Base searchable do text :text text :datum - text :title, :boost=>3.0 + text :title end end diff --git a/app/models/rubrik.rb b/app/models/rubrik.rb index 50f2135..636f508 100755 --- a/app/models/rubrik.rb +++ b/app/models/rubrik.rb @@ -42,7 +42,7 @@ end searchable do text :desc - text :name, :boost=>4.0 + text :name end end diff --git a/app/models/studium.rb b/app/models/studium.rb index 1fd5866..b3763e6 100755 --- a/app/models/studium.rb +++ b/app/models/studium.rb @@ -89,7 +89,7 @@ class Studium < ActiveRecord::Base text :zahl text :typ text :abkuerzung - text :name, :boost=>3.0 + text :name end end diff --git a/app/models/thema.rb b/app/models/thema.rb index 1abc8b8..36cb2e5 100644 --- a/app/models/thema.rb +++ b/app/models/thema.rb @@ -47,7 +47,7 @@ class Thema < ActiveRecord::Base # make topic searchable searchable do text :text - text :title, :boost=>4.0 + text :title end resourcify diff --git a/app/models/themengruppe.rb b/app/models/themengruppe.rb index d37675a..8a27625 100644 --- a/app/models/themengruppe.rb +++ b/app/models/themengruppe.rb @@ -40,7 +40,7 @@ end searchable do text :text - text :title, :boost=>4.0 + text :title end end diff --git a/app/views/home/index.html.erb b/app/views/home/index.html.erb index 61a4ff1..83cf3db 100755 --- a/app/views/home/index.html.erb +++ b/app/views/home/index.html.erb @@ -25,7 +25,7 @@
  • <%= link_to ffi1_icon("quiz")+ I18n.t("themengruppe.faqs"), faqs_themengruppen_path,class: :linkbox %>
  • -
  • <%= link_to ffi1_icon("books19")+"Beispielsammlung", studium_path(Studium.first, {:ansicht=>'semesteransicht'}) ,class: :btn ,class: :linkbox %>
  • +
  • <%= link_to ffi1_icon("books19")+"Beispielsammlung", studium_path(Studium.first, {:ansicht=>'semesteransicht'}) ,class: :btn ,class: :linkbox unless Studium.first.nil? %>
  • <%= link_to "Alte Beispielsammlung", "http://www.fet.at/alt/bin/view/Beispielsammlung/WebHome" ,class: :btn ,class: :linkbox %>
  • diff --git a/app/views/themes/blue2/home/index.html.erb b/app/views/themes/blue2/home/index.html.erb index 0b9527b..89c88cc 100644 --- a/app/views/themes/blue2/home/index.html.erb +++ b/app/views/themes/blue2/home/index.html.erb @@ -9,7 +9,7 @@

    <%= I18n.t('home.willkommen') %>

    -<%= raw(@starttopic.text) %> +<%= raw(@starttopic.text) unless @starttopic.nil? %>
    @@ -26,7 +26,7 @@
  • <%= link_to ffi1_icon("quiz")+ I18n.t("themengruppe.faqs"), faqs_themengruppen_path,class: :linkbox %>
  • -
  • <%= link_to ffi1_icon("books19")+"Beispielsammlung", studium_path(Studium.first, {:ansicht=>'semesteransicht'}) ,class: :btn ,class: :linkbox %>
  • +
  • <%= link_to ffi1_icon("books19")+"Beispielsammlung", studium_path(Studium.first, {:ansicht=>'semesteransicht'}) ,class: :btn ,class: :linkbox if Studium.count > 0 %>
  • <%= link_to "Alte Beispielsammlung", "http://www.fet.at/alt/bin/view/Beispielsammlung/WebHome" ,class: :btn ,class: :linkbox %>
  • diff --git a/app/views/themes/blue2/layouts/application.html.erb b/app/views/themes/blue2/layouts/application.html.erb index c97572a..bf9ee0b 100755 --- a/app/views/themes/blue2/layouts/application.html.erb +++ b/app/views/themes/blue2/layouts/application.html.erb @@ -1,65 +1,66 @@ + - <%= stylesheet_link_tag "themes/"+theme_name+"/application", :media => "all" unless theme_name.empty? %> - <%= stylesheet_link_tag "application", :media=>"all" if theme_name.empty? %> - <%= javascript_include_tag "application" %> - <%= csrf_meta_tags %> - <% if content_for?(:header) %> - <%= yield :header %> - <% else %> - Fetsite - <% end %> + <%= stylesheet_link_tag "themes/"+theme_name+"/application", :media => "all" unless theme_name.empty? %> + <%= stylesheet_link_tag "application", :media=>"all" if theme_name.empty? %> + <%= javascript_include_tag "application" %> + <%= csrf_meta_tags %> + <% if content_for?(:header) %> + <%= yield :header %> + <% else %> + Fetsite + <% end %> -
    -
    -
    - <% cache("menu_u"+user_signed_in?.to_s+current_user.try(:id).to_s+"l"+I18n.locale.to_s+ can?(:seeintern, User).to_s+ can?(:index,Gallery).to_s+params[:theme].to_s, expires_in: 24.hours) do %> -
    -
    - <%= link_to home_index_path do %> - - <%= image_tag('/logo2014_64.png',{:style=>"float:left;height:50px",:height=>"50"}) %> - <% end %> -
    -
    - <%= image_tag('/logo2014_64.png',{:style=>"float:left;height:50px",:height=>"50"}) %> -
    -
    - Fachschaft Elektrotechnik -
    -
    - - -
    - <% end %> -
    +
    +
    +
    + <% cache("menu_u"+user_signed_in?.to_s+current_user.try(:id).to_s+"l"+I18n.locale.to_s+ can?(:seeintern, User).to_s+ can?(:index,Gallery).to_s+params[:theme].to_s, expires_in: 24.hours) do %> +
    +
    + <%= link_to home_index_path do %> + + <%= image_tag('/logo2014_64.png',{:style=>"float:left;height:50px",:height=>"50"}) %> + <% end %> +
    +
    + <%= image_tag('/logo2014_64.png',{:style=>"float:left;height:50px",:height=>"50"}) %> +
    +
    + Fachschaft Elektrotechnik +
    +
    + + +
    + <% end %> +
    +
    +
    +
    + <%= yield %> +
    +
    -
    -
    - <%= yield %> -
    -
    -
    - + diff --git a/config/locales/de.yml b/config/locales/de.yml index cd61ce0..5b9c0a2 100755 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -16,6 +16,7 @@ de: savecont: "Zwischenspeichern" intern: "Intern" manage: "Verwalten" + new: "Neu" home: sprache: "Deutsch" kontakt: "Kontakt" diff --git a/config/locales/fetprofile_public.de.yml b/config/locales/fetprofile_public.de.yml index 04d744c..e5d49d6 100644 --- a/config/locales/fetprofile_public.de.yml +++ b/config/locales/fetprofile_public.de.yml @@ -6,6 +6,7 @@ de: active_members: "Aktive Mitglieder" notactive_members: "Pension" new_profile: "Neues Profil anlegen" + new: "Neues Profil anlegen" gremium: new: "Neues Gremium" seit: "seit" diff --git a/config/sunspot.yml b/config/sunspot.yml index cef12a4..236e868 100644 --- a/config/sunspot.yml +++ b/config/sunspot.yml @@ -3,18 +3,18 @@ production: hostname: localhost port: 8080 log_level: WARNING - path: /solr-4.10.2/default #production #ollection1 #production + path: /solr/#/default #production #ollection1 #production # solr_home: solr # read_timeout: 2 # open_timeout: 0.5 development: solr: - hostname: localhost - port: 8982 + hostname: solr + port: 8983 log_level: INFO - path: /solr/development - + path: /solr/mycore + test: solr: hostname: localhost diff --git a/initscript.sh b/initscript.sh index efc4133..7b8705d 100755 --- a/initscript.sh +++ b/initscript.sh @@ -14,19 +14,20 @@ echo "Generating base configs..." # Generate clean config files if they don't exist cp -u config/database.yml.example config/database.yml 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 $rake_command sunspot:solr:stop &> /dev/null $rake_command sunspot:solr:start || exit 1 +bundle exec sunspot-solr start -p 8982 # Topic 1 is supposed to be the startpage topic if [ ! -f config/start_topic.yml ]; then diff --git a/test.tmp b/test.tmp new file mode 100644 index 0000000..9daeafb --- /dev/null +++ b/test.tmp @@ -0,0 +1 @@ +test diff --git a/test1 b/test1 new file mode 100644 index 0000000..e69de29