AutoCommit Mon Aug 10 17:03:04 CEST 2015
This commit is contained in:
@@ -14,7 +14,7 @@ class NeuigkeitenController < ApplicationController
|
||||
def show
|
||||
@neuigkeit = Neuigkeit.find(params[:id])
|
||||
@rubrik=@neuigkeit.rubrik
|
||||
@questions = @neuigkeit.questions.accessible_by?(:show, current_ability)
|
||||
@questions = @neuigkeit.questions.accessible_by(current_ability,:show)
|
||||
if can?(:shownonpublic, Rubrik)
|
||||
@rubriken = Rubrik.all
|
||||
else
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
module ApplicationHelper
|
||||
def cache_array_key(array)
|
||||
def cache_array_key(array,prefix="")
|
||||
return "empty_array" if array.nil? or array.empty?
|
||||
array.map{|c| c.id}.join('_')+"_"+array.max{|c|c.updated_at.to_i}.updated_at.try(:utc).to_s+"_"+I18n.locale.to_s
|
||||
prefix+array.map{|c| c.id}.join('_')+"_"+array.max{|c|c.updated_at.to_i}.updated_at.try(:utc).to_s+"_"+I18n.locale.to_s
|
||||
# array.map{|c| c.id}.join('')+"_"+array.map{|c|c.try(:updated_at).try(:utc).to_s}.join('') +"_"+I18n.locale.to_s
|
||||
|
||||
end
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<% if defined?(wrap_in) && !wrap_in.blank? %>
|
||||
|
||||
<% unless defined?(wrap_in) && !wrap_in.blank?
|
||||
wrap_in=:div
|
||||
end
|
||||
%>
|
||||
<%= content_tag wrap_in do %>
|
||||
|
||||
<% cache("neuigkeit_" + neuigkeit.id.to_s + "_" + I18n.locale.to_s+neuigkeit.updated_at.try(:utc).try(:to_s)) do %>
|
||||
@@ -12,19 +14,7 @@
|
||||
|
||||
<% end %>
|
||||
<% end %>
|
||||
<% else %>
|
||||
|
||||
<% cache("neuigkeit_"+neuigkeit.id.to_s+"_"+I18n.locale.to_s+neuigkeit.updated_at.try(:utc).try(:to_s)) do %>
|
||||
|
||||
<% c =[:linkbox] %>
|
||||
<% c << "color-"+neuigkeit.rubrik.color.to_s+"-dark" unless neuigkeit.rubrik.color.nil? %>
|
||||
<% c << "unpublished" unless neuigkeit.published? %>
|
||||
<%= link_to [neuigkeit.rubrik,neuigkeit], {class: c} do %>
|
||||
<%= render :partial=>"neuigkeiten/compact",:locals=> {:neuigkeit=> neuigkeit} %>
|
||||
<% end %>
|
||||
<% end %>
|
||||
|
||||
|
||||
<% end %>
|
||||
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
<% end%>
|
||||
|
||||
|
||||
<%= new_question_for(neuigkeit_view) %>
|
||||
|
||||
<%= render_attachments_for(neuigkeit_view) %>
|
||||
|
||||
<%= render 'layouts/pretty_toolbar', :object=> @toolbar_elements %>
|
||||
|
||||
@@ -2,8 +2,10 @@
|
||||
<title>Fetsite - <%= @neuigkeit.title %> (<%= @neuigkeit.rubrik.name %>)</title>
|
||||
<% set_meta_tags :author => fetprofile_path(@neuigkeit.author.fetprofile) unless @neuigkeit.author.fetprofile.nil? %>
|
||||
<% unless @neuigkeit.picture_robust.url.nil? %>
|
||||
<% picture_url=URI(root_url)
|
||||
picture_url.path=@neuigkeit.picture_robust.url(:locale=>nil, :theme=>nil) %>
|
||||
<%
|
||||
picture_url=URI(root_url)
|
||||
picture_url.path=@neuigkeit.picture_robust.url(:locale=>nil, :theme=>nil)
|
||||
%>
|
||||
<% end %>
|
||||
<% set_meta_tags :og =>
|
||||
{
|
||||
@@ -20,6 +22,7 @@
|
||||
<%= 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;
|
||||
@@ -34,8 +37,9 @@
|
||||
<%= notice %>
|
||||
</p>
|
||||
<%= render partial: "neuigkeit_view", object: @neuigkeit %>
|
||||
</div>
|
||||
<% @neuigkeit.questions.each do |q| %>
|
||||
|
||||
|
||||
<% @questions.each do |q| %>
|
||||
<%= render q if can? :show, q %>
|
||||
<% end %>
|
||||
|
||||
@@ -43,12 +47,11 @@
|
||||
</div>
|
||||
<div class="fb-like" data-href"<%= rubrik_neuigkeit_url(@rubrik,@neuigkeit,{themes: nil, locale: nil})%>" data-layout="standard" data-action="like" data-show-faces="true" data-share="true"></div>
|
||||
|
||||
<% if can? :find_link , @neuigkeit %>
|
||||
<a id="findlink-open" href="#"><%= fa_icon("link")%> Neue Verknüpfungen </a>
|
||||
<% end %>
|
||||
|
||||
<%= link_to fa_icon("link") + "Neue Verknüpfung" , "#", id: "findlink-open" if can? :find_link, @neuigkeit %>
|
||||
<% cache(cache_array_key(@neuigkeit.nlinks, "NLinks")) do %>
|
||||
<%= render partial: 'neuigkeiten/nlink_list_whole', :object=>@neuigkeit.nlinks %>
|
||||
|
||||
<% end %>
|
||||
|
||||
<div id="findlink-body" class="ui-dialog" style="">
|
||||
<% if can? :find_link, @neuigkeit %>
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<b>Typ:</b>
|
||||
<%= @survey_question.typ %>
|
||||
</p>
|
||||
|
||||
<%= render @survey_question.parent unless @survey_question.parent.nil?|| !(@survey_question.parent.class == Neuigkeit) %>
|
||||
<%= render @survey_question %>
|
||||
|
||||
<%= render_comments_for(@survey_question) %>
|
||||
|
||||
Reference in New Issue
Block a user