forked from bofh/fetsite
AutoCommit Mon Aug 10 17:03:04 CEST 2015
This commit is contained in:
@@ -14,7 +14,7 @@ class NeuigkeitenController < ApplicationController
|
|||||||
def show
|
def show
|
||||||
@neuigkeit = Neuigkeit.find(params[:id])
|
@neuigkeit = Neuigkeit.find(params[:id])
|
||||||
@rubrik=@neuigkeit.rubrik
|
@rubrik=@neuigkeit.rubrik
|
||||||
@questions = @neuigkeit.questions.accessible_by?(:show, current_ability)
|
@questions = @neuigkeit.questions.accessible_by(current_ability,:show)
|
||||||
if can?(:shownonpublic, Rubrik)
|
if can?(:shownonpublic, Rubrik)
|
||||||
@rubriken = Rubrik.all
|
@rubriken = Rubrik.all
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
module ApplicationHelper
|
module ApplicationHelper
|
||||||
def cache_array_key(array)
|
def cache_array_key(array,prefix="")
|
||||||
return "empty_array" if array.nil? or array.empty?
|
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
|
# array.map{|c| c.id}.join('')+"_"+array.map{|c|c.try(:updated_at).try(:utc).to_s}.join('') +"_"+I18n.locale.to_s
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,30 +1,20 @@
|
|||||||
<% 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 %>
|
||||||
|
<% 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 %>
|
||||||
|
|
||||||
<%= content_tag wrap_in do %>
|
<% end %>
|
||||||
|
|
||||||
<% 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 %>
|
|
||||||
<% 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 %>
|
||||||
|
|
||||||
|
|
||||||
<% end %>
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
<% end%>
|
<% end%>
|
||||||
|
|
||||||
|
|
||||||
<%= new_question_for(neuigkeit_view) %>
|
|
||||||
<%= render_attachments_for(neuigkeit_view) %>
|
<%= render_attachments_for(neuigkeit_view) %>
|
||||||
|
|
||||||
<%= render 'layouts/pretty_toolbar', :object=> @toolbar_elements %>
|
<%= render 'layouts/pretty_toolbar', :object=> @toolbar_elements %>
|
||||||
|
|||||||
@@ -2,8 +2,10 @@
|
|||||||
<title>Fetsite - <%= @neuigkeit.title %> (<%= @neuigkeit.rubrik.name %>)</title>
|
<title>Fetsite - <%= @neuigkeit.title %> (<%= @neuigkeit.rubrik.name %>)</title>
|
||||||
<% set_meta_tags :author => fetprofile_path(@neuigkeit.author.fetprofile) unless @neuigkeit.author.fetprofile.nil? %>
|
<% set_meta_tags :author => fetprofile_path(@neuigkeit.author.fetprofile) unless @neuigkeit.author.fetprofile.nil? %>
|
||||||
<% unless @neuigkeit.picture_robust.url.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 %>
|
<% end %>
|
||||||
<% set_meta_tags :og =>
|
<% set_meta_tags :og =>
|
||||||
{
|
{
|
||||||
@@ -20,6 +22,7 @@
|
|||||||
<%= render 'rubriken/tabs' %>
|
<%= render 'rubriken/tabs' %>
|
||||||
|
|
||||||
<div id="fb-root"></div>
|
<div id="fb-root"></div>
|
||||||
|
|
||||||
<script>(function(d, s, id) {
|
<script>(function(d, s, id) {
|
||||||
var js, fjs = d.getElementsByTagName(s)[0];
|
var js, fjs = d.getElementsByTagName(s)[0];
|
||||||
if (d.getElementById(id)) return;
|
if (d.getElementById(id)) return;
|
||||||
@@ -34,21 +37,21 @@
|
|||||||
<%= notice %>
|
<%= notice %>
|
||||||
</p>
|
</p>
|
||||||
<%= render partial: "neuigkeit_view", object: @neuigkeit %>
|
<%= render partial: "neuigkeit_view", object: @neuigkeit %>
|
||||||
</div>
|
|
||||||
<% @neuigkeit.questions.each do |q| %>
|
|
||||||
<%= render q if can? :show, q %>
|
<% @questions.each do |q| %>
|
||||||
<% end %>
|
<%= render q if can? :show, q %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</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>
|
<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 %>
|
<%= render partial: 'neuigkeiten/nlink_list_whole', :object=>@neuigkeit.nlinks %>
|
||||||
|
<% end %>
|
||||||
|
|
||||||
<div id="findlink-body" class="ui-dialog" style="">
|
<div id="findlink-body" class="ui-dialog" style="">
|
||||||
<% if can? :find_link, @neuigkeit %>
|
<% if can? :find_link, @neuigkeit %>
|
||||||
@@ -69,9 +72,9 @@ $(function(){
|
|||||||
buttons: {
|
buttons: {
|
||||||
"Fertig": function() {
|
"Fertig": function() {
|
||||||
dialog.dialog( "close" );
|
dialog.dialog( "close" );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
$("#findlink-open").on("click",function(){dialog.dialog("open")})
|
$("#findlink-open").on("click",function(){dialog.dialog("open")})
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<b>Typ:</b>
|
<b>Typ:</b>
|
||||||
<%= @survey_question.typ %>
|
<%= @survey_question.typ %>
|
||||||
</p>
|
</p>
|
||||||
|
<%= render @survey_question.parent unless @survey_question.parent.nil?|| !(@survey_question.parent.class == Neuigkeit) %>
|
||||||
<%= render @survey_question %>
|
<%= render @survey_question %>
|
||||||
|
|
||||||
<%= render_comments_for(@survey_question) %>
|
<%= render_comments_for(@survey_question) %>
|
||||||
|
|||||||
Reference in New Issue
Block a user