diff --git a/app/models/neuigkeit.rb b/app/models/neuigkeit.rb index 18a0c8e..fe998f8 100755 --- a/app/models/neuigkeit.rb +++ b/app/models/neuigkeit.rb @@ -118,7 +118,7 @@ class Neuigkeit < ActiveRecord::Base self.update_column(:cache_relevant_date, (c.is_past?) ? c.ende.to_date : c.start.to_date) else unless self.datum.nil? - self.update_column(:cache_order, (self.datum.to_date - Date.today).to_i.abs) + self.update_column(:cache_order, (((self.datum.to_date - Date.today).to_i)/3).abs-1) self.update_column(:cache_relevant_date, self.datum.to_date) else self.update_column(:cache_order,0) diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 634688b..85b802e 100755 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -4,6 +4,10 @@ "> + + + + @@ -24,6 +28,7 @@
+ <% 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, expires_in: 24.hours) do %>
<%= link_to home_index_path do %> @@ -43,6 +48,7 @@
+ <% end %>
diff --git a/app/views/lvas/_lva_semester.html.erb b/app/views/lvas/_lva_semester.html.erb index f0c1bc6..bbdf7cc 100755 --- a/app/views/lvas/_lva_semester.html.erb +++ b/app/views/lvas/_lva_semester.html.erb @@ -1,6 +1,6 @@
- <%=lva.lvanr.to_s %> <%= link_to lva.full_name, lva_path(lva)%> + <%=lva.lvanr.to_s %> <%= link_to lva.full_name, lva_path(lva) %> <%= lva.ects %> ECTS / <%= lva.stunden %> Std diff --git a/app/views/lvas/show.html.erb b/app/views/lvas/show.html.erb index 96f0f5d..82c6a46 100755 --- a/app/views/lvas/show.html.erb +++ b/app/views/lvas/show.html.erb @@ -5,109 +5,111 @@ %> <%= display_meta_tags %> <% end %> - - - -
- <%= render 'studien/tabs'%> -

<%= notice %>

- -
-
- <%= render 'layouts/pretty_toolbar' %> +
+
+ <%= render 'studien/tabs'%> +

<%= notice %>

+ +
+
+ <%= render 'layouts/pretty_toolbar' %> +
-
-
-
-

<%= @lva.full_name %>

- - -

<%= I18n.t('lva.pruefungsinfo')%>

-
- <%= @lva.pruefungsinformation.to_s.html_safe %> -
- -

<%= I18n.t('lva.lernaufwand')%>

-
- <%= @lva.lernaufwand %> -
- -

<%= I18n.t('lva.desc')%>

-
- <%= @lva.desc.to_s.html_safe %> -
- -
-
-
-
    -
  • <%= I18n.t('lva.lvanr')%>: <%=@lva.lvanr %>
  • -
  • ECTS: <%=@lva.ects %>
  • -
  • <%= I18n.t('lva.stunden')%>: <%=@lva.stunden %>
  • -
-

<%= I18n.t('lva.module')%>

-
    - <% @lva.modul.each do |modul| %> -
  • <%= link_to modul.name , modul_path(modul)%> -
      - <% modul.modulgruppen.each do |g| %> - -
    • <%= link_to g.studium.title_context , studium_path(g.studium)%> (<%=link_to g.name, modulgruppe_path(g)%>)
    • - <% end %> -
    +
    +
    +

    <%= @lva.full_name %>

    + + -
    -
    -

    <%= I18n.t "lecturers.lecturers" %>

    - <% @lva.lecturers.each do |lec| %> - <%= render :partial=>'lecturers/lec_lva', :object=>lec %> +
    +

    <%= I18n.t('lva.pruefungsinfo')%>

    +
    + <%= @lva.pruefungsinformation.to_s.html_safe %> +
    +

    <%= I18n.t('lva.lernaufwand')%>

    +
    + <%= @lva.lernaufwand %> +
    + +

    <%= I18n.t('lva.desc')%>

    +
    + <%= @lva.desc.to_s.html_safe %> +
    +
    +
    +
    +
    +
      +
    • <%= I18n.t('lva.lvanr')%>: <%=@lva.lvanr %>
    • +
    • ECTS: <%=@lva.ects %>
    • +
    • <%= I18n.t('lva.stunden')%>: <%=@lva.stunden %>
    • +
    +

    <%= I18n.t('lva.module')%>

    +
      + <% @lva.modul.each do |modul| %> +
    • <%= link_to modul.name , modul_path(modul)%> +
        + <% modul.modulgruppen.each do |g| %> + +
      • <%= link_to g.studium.title_context , studium_path(g.studium)%> (<%=link_to g.name, modulgruppe_path(g)%>)
      • + <% end %> +
      +
    • + + <% end %> +
    +
    +
    +

    <%= I18n.t "lecturers.lecturers" %>

    + <% @lva.lecturers.each do |lec| %> + <%= render :partial=>'lecturers/lec_lva', :object=>lec %> + + <% end %> +
    +
    +
    + + +
    +
    + +

    <%= I18n.t("lva.bspe") %>

    +

    <%= I18n.t("lva.ratebsp")%> <%= link_to ffi1_icon("facebook1") + I18n.t('home.fblogin'), user_omniauth_authorize_path(:facebook) ,class: :linkbox %> +

    + <%= link_to t("beispiel.zip") , beispiel_sammlung_lva_path(@lva), class: :linkbox %> + <% @lva.beispiele.order(:datum).each do |b| %> + <% cache("beispiel_" +I18n.locale.to_s+b.id.to_s+can?(:delete,b).to_s+"_"+can?(:edit,b).to_s + "_" + b.updated_at.try(:utc).try(:to_s)) do %> + <%= render b%> + <% end %> <% end %>
    -
    -
-
-
- -

<%= I18n.t("lva.bspe") %>

-

<%= I18n.t("lva.ratebsp")%> <%= link_to ffi1_icon("facebook1") + I18n.t('home.fblogin'), user_omniauth_authorize_path(:facebook) ,class: :linkbox %> -

- <%= link_to t("beispiel.zip") , beispiel_sammlung_lva_path(@lva), class: :linkbox %> - <% @lva.beispiele.order(:datum).each do |b| %> - <% cache("beispiel_" +I18n.locale.to_s+b.id.to_s+can?(:delete,b).to_s+"_"+can?(:edit,b).to_s + "_" + b.updated_at.try(:utc).try(:to_s)) do %> - <%= render b%> - <% end %> - <% end %> -
-
- -
-
- <% unless @lva.nlinks.empty? %> -

<%= I18n.t("rubrik.title") %>

- <% @lva.nlinks.each do |l| %> - <%= render l.neuigkeit %> - <% end %> - <% end %>
-
-
-
- <%= render 'beispiele/form_bulk' %> +
+
+ <% unless @lva.nlinks.empty? %> +

<%= I18n.t("rubrik.title") %>

+ <% @lva.nlinks.each do |l| %> + <%= render l.neuigkeit %> + <% end %> + <% end %> + +
+ <% cache("lva_beispiel_form_bulk_"+@lva.id.to_s+I18n.locale.to_s+@lva.updated_at.to_i.to_s) do %> +
+
+ <%= render 'beispiele/form_bulk' %> +
+
+ <% end %> +
- - -
diff --git a/app/views/neuigkeiten/_compact.html.erb b/app/views/neuigkeiten/_compact.html.erb index d242424..b6c7336 100644 --- a/app/views/neuigkeiten/_compact.html.erb +++ b/app/views/neuigkeiten/_compact.html.erb @@ -1,23 +1,20 @@ -
- - - +


-<% unless neuigkeit.picture_robust.url.nil? %><%= image_tag neuigkeit.picture_robust.thumb.url %> +<% unless neuigkeit.picture_robust.url.nil? %><%= image_tag neuigkeit.picture_robust.thumb.url %> <% end %>

- <%= ff_icon(neuigkeit.rubrik.icon) unless neuigkeit.rubrik.icon.nil? or neuigkeit.rubrik.icon.empty? %> <%= neuigkeit.rubrik.name %> + <%= ff_icon(neuigkeit.rubrik.icon) unless neuigkeit.rubrik.icon.nil? or neuigkeit.rubrik.icon.empty? %> <%= neuigkeit.rubrik.name %> <% unless neuigkeit.has_calentries? %> <% unless neuigkeit.try(:datum).try(:to_date).nil? %> <%= I18n.t("neuigkeit.am") %> - -<% end %> <% else %> <% end %> + <%= I18n.l(neuigkeit.try(:datum).try(:to_date))%> +<% end %> <% else %> <% end %>
-

+

<%= neuigkeit.title%> -

+
<%= raw(neuigkeit.text_first_words) unless neuigkeit.text.nil?%>
<% if neuigkeit.has_calentries? %>