AutoCommit Mon Jun 8 17:03:02 CEST 2015

This commit is contained in:
Andreas Stephanides
2015-06-08 17:03:02 +02:00
parent dc318e0efb
commit 45b5798e7d
14 changed files with 96 additions and 127 deletions

View File

@@ -6,8 +6,10 @@
div.sticker
{
width: 90%;
border-radius: 5px;
text-align: center;
padding: 5px
padding: 5px;
margin:auto;
}
div.sticker-red
{ background: red;

View File

@@ -104,6 +104,8 @@ class NeuigkeitenController < ApplicationController
def edit
@neuigkeit = Neuigkeit.find(params[:id])
@neuigkeit.no_fallbacks=true
@rubrik=@neuigkeit.rubrik
@calentries= @neuigkeit.calentries
@calentries<< Calentry.new

View File

@@ -1,2 +1,6 @@
module CalentriesHelper
def render_calentries_for(p)
calentry_list=p.calentries
render(partial: "calentries/calentry_list", object: calentry_list, locals:{parent: p})
end
end

View File

@@ -89,12 +89,16 @@ end
ApplicationController.helpers.fa_icon("calendar 2x") + self.text
end
def text
if (self.start.to_date - self.ende.to_date) < 1.day
format=:timeonly
if self.start.nil? || self.ende.nil?
"error"
else
format =:default
if (self.start.to_date - self.ende.to_date) < 1.day
format=:timeonly
else
format =:default
end
I18n.l(self.start) +" "+ I18n.t("cal.bis")+" "+ I18n.l(self.ende, :format=>format)
end
I18n.l(self.start) +" "+ I18n.t("cal.bis")+" "+ I18n.l(self.ende, :format=>format)
end
scope :public, -> { where(:public => :true) }
# scope :upcoming, -> { where("start >= ?" , Time.now).where("start <= ?", 28.days.from_now) }

View File

@@ -1 +1,5 @@
$("#<%= Attachment.parent_attachment_list_id(@parent) %>").replaceWith("<%= escape_javascript ( render partial:"attachments/attachment_list", object:@attachments, locals: {editor: true, parent: @parent} ) %>")
<% if @parent.is_a?(Neuigkeit) %>
<% @neuigkeit=@parent; @rubrik=@neuigkeit.rubrik %>
<%= render "neuigkeiten/show", object: @neuigkeit %>
<% end %>

View File

@@ -1,5 +1,4 @@
<div class="contentbox" id="calentry_<%= calentry.id%>">
<% image_tag("/iconnavy/time.png") %>
<%= calentry.icon_text %>
<% if !(defined? manage) || manage %>
<%= link_to "edit", edit_calentry_path(calentry),:remote=>true if can? :edit, calentry %>

View File

@@ -0,0 +1,6 @@
<div id="calentries_<%= parent.class.to_s + "_" + parent.id.to_s %>">
<% calentry_list.each do |ce|%>
<%= render ce unless ce.nil? %>
<% end %>
</div>
<div id="calentry_new_<%= parent.class.to_s + "_" + parent.id.to_s %>" ><%= link_to "new Calentry", new_calentry_path(:object_id=>@neuigkeit.id, :object_type=>"Neuigkeit"), :remote=>true if can? :edit, @neuigkeit %></div>

View File

@@ -1,3 +1,3 @@
$("#calentry_new").replaceWith("<div id=\"calentry_new\"><%=escape_javascript( render :partial=>"nested_form" ,:object=>@calentry) %></div>");
$("#calentry_new_<%= @calentry.object.class.to_s + "_" + @calentry.object.id.to_s %>").replaceWith("<div id=\"calentry_new_<%= @calentry.object.class.to_s + "_" + @calentry.object.id.to_s %>\"><%=escape_javascript( render :partial=>"nested_form" ,:object=>@calentry) %></div>");
$('.datetimepicker').datetimepicker({format: 'd.m.Y H:i', startDate: (!($(this).attr("value")==undefined))? $(this).attr("value"): ""})

View File

@@ -0,0 +1 @@
andreas@andreas-ThinkPad-S430.3674:1433770009

View File

@@ -1,3 +1,4 @@
<div id="neuigkeit_<%= neuigkeit_edit.id%>" class="contentbox" itemscope itemtype="http://schema.org/Article">
<div id="toolBar" ></div>
<%= semantic_form_for [@neuigkeit.rubrik,@neuigkeit] do |f| %>
@@ -6,7 +7,7 @@
<meta itemprop="sameAs" content="<%= neuigkeit_url(@neuigkeit,:theme=>nil)%>"/>
<meta itemprop="url" content="<%= neuigkeit_url(@neuigkeit,:theme=>nil)%>"/>
<div class="row-fluid">
<div class="media">
<span itemprop="articleSection">
<%= ff_icon(@neuigkeit.rubrik.icon) unless @neuigkeit.rubrik.icon.nil? or @neuigkeit.rubrik.icon.empty? %>&nbsp;<%= @neuigkeit.rubrik.name %>
</span>
@@ -33,23 +34,28 @@
</div>
<% end %>
<div class="media-body">
<h1 itemprop="name">
<%= @neuigkeit.title%> edit
<h1 itemprop="name" class="editable_simple" data-target="#neuigkeit_title">
<%= @neuigkeit.title%>
</h1>
<div itemprop="articleBody" class="editable" data-target="#neuigkeit_text">
<%= raw(@neuigkeit.text) %>
</div>
<%= f.input :text, :as=> :hidden %>
<%= f.input :title, :as=> :hidden %>
</div>
</div>
<div id="calentries">
<% unless @calentries1.nil? %>
<% @calentries1.each do |ce|%>
<%= render ce unless ce.nil? %>
<% end %>
<% unless neuigkeit_edit.calentries.nil? || neuigkeit_edit.calentries.empty? %>
<% neuigkeit_edit.calentries.each do |ce|%>
<%= render ce , object: ce unless ce.nil? %>
<% end %>
<% end %>
</div>
<%= f.actions do %>
<%= f.action :submit, :as => :input %>
<% end %>
<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>
<% unless @neuigkeit.meeting.nil? %>
<%= render @neuigkeit.meeting %>

View File

@@ -1,9 +1,9 @@
<div id="neuigkeit_<%= neuigkeit_view.id%>" class="contentbox" itemscope itemtype="http://schema.org/Article">
<div id="neuigkeit_<%= neuigkeit_view.id %>" class="contentbox" itemscope itemtype="http://schema.org/Article">
<meta itemprop="about" content="<%= @neuigkeit.text_first_words %>"/>
<meta itemprop="sameAs" content="<%= neuigkeit_url(@neuigkeit,:theme=>nil)%>"/>
<meta itemprop="url" content="<%= neuigkeit_url(@neuigkeit,:theme=>nil)%>"/>
<div class="row-fluid">
<div class="media">
<span itemprop="articleSection">
<%= ff_icon(@neuigkeit.rubrik.icon) unless @neuigkeit.rubrik.icon.nil? or @neuigkeit.rubrik.icon.empty? %>&nbsp;<%= @neuigkeit.rubrik.name %>
</span>
@@ -31,30 +31,23 @@
<% end %>
<div class="media-body">
<h1 itemprop="name">
<%= @neuigkeit.title%>
<%= @neuigkeit.title%> <%= link_to fa_icon("edit"), edit_rubrik_neuigkeit_path(@neuigkeit), remote: true if can? :edit, @neuigkeit %>
</h1>
<div itemprop="articleBody">
<%= raw(@neuigkeit.text) %>
</div>
</div>
</div>
<div id="calentries">
<% @calentries1.each do |ce|%>
<%= render ce unless ce.nil? %>
<% end %>
</div>
<%= render_calentries_for(@neuigkeit)%>
<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>
<% unless @neuigkeit.meeting.nil? %>
<%= render @neuigkeit.meeting %>
<% end%>
<div id="calentry_new" ><%= link_to "new Calentry", new_calentry_path(:object_id=>@neuigkeit.id, :object_type=>"Neuigkeit"), :remote=>true if can? :edit, @neuigkeit %>
</div>
<%= render_attachments_for(@neuigkeit) %>
<%= render 'layouts/pretty_toolbar', :object=> @toolbar_elements %>
<%= render partial: 'nlink_list_whole', :object=>@neuigkeit.nlinks %>
<% if can? :find_link , @neuigkeit %>
<a id="findlink-open" href="#"><%= fa_icon("link")%> Neue Verknüpfungen </a>
<% end %>
</div>

View File

@@ -0,0 +1 @@
$('#neuigkeit_<%= @neuigkeit.id %>').replaceWith("<%= escape_javascript( render partial:"neuigkeiten/neuigkeit_view", object: @neuigkeit )%>");

View File

@@ -1,29 +1,29 @@
<%= content_for :header do %>
<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)
end
%>
<% set_meta_tags :og => {
:image => picture_url.to_s,
:title => @neuigkeit.title.to_s + " (" + @neuigkeit.rubrik.name.to_s + ")",
:type => "article",
:description =>@neuigkeit.text_first_words,
:url=>neuigkeit_url(:theme=>nil)
}
%>
<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) %>
<% end %>
<% set_meta_tags :og =>
{
:image => picture_url.to_s,
:title => @neuigkeit.title.to_s + " (" + @neuigkeit.rubrik.name.to_s + ")",
:type => "article",
:description =>@neuigkeit.text_first_words,
:url=>neuigkeit_url(:theme=>nil)
}
%>
<%= display_meta_tags %>
<%= display_meta_tags %>
<% end %>
<%= render 'rubriken/tabs' %>
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/de_DE/sdk.js#xfbml=1&appId=120379864660921&version=v2.0";
@@ -31,96 +31,43 @@ end
}(document, 'script', 'facebook-jssdk'));</script>
<div class="content-column content-wrap">
<%= link_to "Refresh", neuigkeit_path(@neuigkeit), remote: true %>
<%= link_to "Edit", edit_rubrik_neuigkeit_path(@neuigkeit), remote: true if can? :edit, @neuigkeit %>
<%= link_to "Refresh", neuigkeit_path(@neuigkeit), remote: true %>
<p id="notice"><%= notice %></p>
<div id ="neuigkeit_<%= @neuigkeit.id %>"class="contentbox" itemscope itemtype="http://schema.org/Article">
<meta itemprop="about" content="<%= @neuigkeit.text_first_words %>"/>
<meta itemprop="sameAs" content="<%= neuigkeit_url(@neuigkeit,:theme=>nil)%>"/>
<meta itemprop="url" content="<%= neuigkeit_url(@neuigkeit,:theme=>nil)%>"/>
<div class="row-fluid">
<span itemprop="articleSection">
<%= ff_icon(@neuigkeit.rubrik.icon) unless @neuigkeit.rubrik.icon.nil? or @neuigkeit.rubrik.icon.empty? %>&nbsp;<%= @neuigkeit.rubrik.name %>
</span>
<span class="pull-right">
<span itemprop="author"><%= @neuigkeit.author.email.to_s unless @neuigkeit.try(:author).try(:email).to_s %>
<%= @neuigkeit.author.text %></span><% unless @neuigkeit.try(:datum).try(:to_date).nil? %><%= " "+ I18n.t("neuigkeit.am")+" " %><span itemprop="datePublished"><%= I18n.l(@neuigkeit.try(:datum).try(:to_date)) %>
</span>
<% end %>
</div>
<% unless @neuigkeit.published? %>
<div class="sticker sticker-red"> Not Published</div> <% end %>
<% unless @neuigkeit.origurl.nil? || @neuigkeit.origurl.empty? %>
<div class="alert"><%= link_to "Zitiert von "+ @neuigkeit.origurl, @neuigkeit.origurl %></div>
<% end %>
<div class="media">
<% unless @neuigkeit.picture_robust.big_thumb.to_s.empty? %>
<div class="pull-left" href="#">
<p><br><%= link_to image_tag(@neuigkeit.picture_robust.big_thumb.url),@neuigkeit.picture_robust.try(:url) %>
</p>
</div>
<% end %>
<div class="media-body">
<h1 itemprop="name">
<%= @neuigkeit.title%>
</h1>
<div itemprop="articleBody">
<%= raw(@neuigkeit.text) %>
</div>
<p></p>
</div>
</div>
<div id="calentries">
<% @calentries1.each do |ce|%>
<%= render ce unless ce.nil? %>
<% end %>
<%= render partial: "neuigkeit_view", object: @neuigkeit %>
</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>
<% unless @neuigkeit.meeting.nil? %>
<%= render @neuigkeit.meeting %>
<% end%>
<div id="calentry_new" ><%= link_to "new Calentry", new_calentry_path(:object_id=>@neuigkeit.id, :object_type=>"Neuigkeit"), :remote=>true if can? :edit, @neuigkeit %></div>
<%= %>
<%= render_attachments_for(@neuigkeit) %>
<%= render 'layouts/pretty_toolbar', :object=> @toolbar_elements %>
</div>
<%= render partial: 'nlink_list_whole', :object=>@neuigkeit.nlinks %>
<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>
<a id="findlink-open" href="#"><%= fa_icon("link")%> Neue Verknüpfungen </a>
<% end %>
</div>
<style>
</style>
<%= render partial: 'neuigkeiten/nlink_list_whole', :object=>@neuigkeit.nlinks %>
<div id="findlink-body"class="ui-dialog" style="">
<% if can? :find_link, @neuigkeit %>
Nach Element suchen:
<%= semantic_form_for :find_link, :url=>find_link_rubrik_neuigkeit_path(@rubrik,@neuigkeit), :html=>{:id=>"search_form", :method=>'get'} , :remote=> true do |f| %>
<%= f.input :query, :input_html => { :name => 'query' },:label=>false %>
<% end %>
<%= render partial: 'nlink_list_search_whole', object: @nlink_search %>
<% if can? :find_link, @neuigkeit %>
Nach Element suchen:
<%= semantic_form_for :find_link, :url=>find_link_rubrik_neuigkeit_path(@rubrik,@neuigkeit), :html=>{:id=>"search_form", :method=>'get'} , :remote=> true do |f| %>
<%= f.input :query, :input_html => { :name => 'query' },:label=>false %>
<% end %>
<%= render partial: 'nlink_list_search_whole', object: @nlink_search %>
<% end %>
<% end %>
</div>
<script>
$(function(){
dialog = $( "#findlink-body" ).dialog({
autoOpen: false,
width: 350,
modal: true,
title: "Neue Verknüpfung hinzufügen",
buttons: {
"Fertig": function() {
dialog.dialog( "close" );
autoOpen: false,
width: 350,
modal: true,
title: "Neue Verknüpfung hinzufügen",
buttons: {
"Fertig": function() {
dialog.dialog( "close" );
}
}
});
}
});
$("#findlink-open").on("click",function(){dialog.dialog("open")})
});
</script>

View File

@@ -1,3 +1,3 @@
$('#neuigkeit_<%= @neuigkeit.id %>').replaceWith("<%= escape_javascript( render partial:"neuigkeit_view", object: @neuigkeit )%>");
alert("reloaded<%= @neuigkeit.id %>");
<%= render "show" %>