forked from bofh/fetsite
neuigkeiten form
This commit is contained in:
@@ -36,7 +36,7 @@ class NeuigkeitenController < ApplicationController
|
|||||||
if params[:calentry_id].nil?
|
if params[:calentry_id].nil?
|
||||||
ce = Calentry.new(:start=>Time.now, :ende=>1.hour.from_now, :typ=>1, :calendar=>@neuigkeit.rubrik.calendar)
|
ce = Calentry.new(:start=>Time.now, :ende=>1.hour.from_now, :typ=>1, :calendar=>@neuigkeit.rubrik.calendar)
|
||||||
else
|
else
|
||||||
ce=Calentry.find(params[:calentry_id])
|
ce = Calentry.find(params[:calentry_id])
|
||||||
end
|
end
|
||||||
@calentry=ce
|
@calentry=ce
|
||||||
ce.object=@neuigkeit
|
ce.object=@neuigkeit
|
||||||
@@ -148,10 +148,10 @@ private
|
|||||||
def load_toolbar_elements
|
def load_toolbar_elements
|
||||||
@neuigkeit=Neuigkeit.find(params[:id])
|
@neuigkeit=Neuigkeit.find(params[:id])
|
||||||
@toolbar_elements=[]
|
@toolbar_elements=[]
|
||||||
@toolbar_elements << {:hicon=>'icon-plus', :text=> I18n.t('neuigkeit.publish'),:path => publish_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:confirm=>'Sure?' } if can?(:publish, @neuigkeit) && !@neuigkeit.published?
|
@toolbar_elements << {:hicon=>'icon-plus', :text=> I18n.t('neuigkeit.publish'),:path => publish_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:confirm=> I18n.t('neuigkeit.publish_sure') } if can?(:publish, @neuigkeit) && !@neuigkeit.published?
|
||||||
@toolbar_elements << {:hicon=>'icon-facebook', :text=> I18n.t('neuigkeit.publish')+" to facebook",:path => publish_to_facebook_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:confirm=>'Sure?' } if can?(:publish, @neuigkeit)
|
@toolbar_elements << {:hicon=>'icon-facebook', :text=> I18n.t('neuigkeit.publishfb'),:path => publish_to_facebook_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:confirm=>I18n.t('neuigkeit.publishfb_sure') } if can?(:publish, @neuigkeit) && @neuigkeit.published?
|
||||||
|
|
||||||
@toolbar_elements << {:hicon=>'icon-minus', :text=> I18n.t('neuigkeit.unpublish'),:path => unpublish_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:confirm=>'Sure?' } if can?(:unpublish, @neuigkeit) && @neuigkeit.published?
|
@toolbar_elements << {:hicon=>'icon-minus', :text=> I18n.t('neuigkeit.unpublish'),:path => unpublish_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:confirm=> I18n.t('neuigkeit.unpublish_sure') } if can?(:unpublish, @neuigkeit) && @neuigkeit.published?
|
||||||
|
|
||||||
|
|
||||||
@toolbar_elements << {:text=>I18n.t('common.edit'),:path=>edit_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:icon=>:pencil} if can? :edit, @neuigkeit.rubrik
|
@toolbar_elements << {:text=>I18n.t('common.edit'),:path=>edit_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit),:icon=>:pencil} if can? :edit, @neuigkeit.rubrik
|
||||||
|
|||||||
@@ -1,14 +1,14 @@
|
|||||||
<%= tinymce_assets %>
|
<%= tinymce_assets %>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<%= semantic_form_for [@neuigkeit.rubrik,@neuigkeit] do |f| %>
|
<%= semantic_form_for [@neuigkeit.rubrik,@neuigkeit] do |f| %>
|
||||||
<%= f.inputs do %>
|
<%= f.inputs do %>
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span12">
|
<div class="span12">
|
||||||
<%= f.input :title, :placeholder=> "Titel" %>
|
<%= f.input :title, :placeholder=> "Titel" %>
|
||||||
<%= f.input :text, :as=> :tinymce_text %>
|
<%= f.input :text, :as=> :tinymce_text %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span6">
|
<div class="span6">
|
||||||
<% f.input :datum, :as=> :datepicker %>
|
<% f.input :datum, :as=> :datepicker %>
|
||||||
<%= f.input :rubrik, :as=> :radio, :collection=>Rubrik.all %>
|
<%= f.input :rubrik, :as=> :radio, :collection=>Rubrik.all %>
|
||||||
@@ -16,22 +16,25 @@
|
|||||||
<div class="span6">
|
<div class="span6">
|
||||||
<%= f.input :author, :as=> :select %>
|
<%= f.input :author, :as=> :select %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<div class="span12">
|
<div class="span12">
|
||||||
<%= f.input :picture, :as=> :file %>
|
<%= f.input :picture, :as=> :file %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= f.semantic_fields_for :calentries , @calentries do |calentry| %>
|
<%= f.semantic_fields_for :calentries , @calentries do |calentry| %>
|
||||||
<%= render 'calentries/nested_fields', :f => calentry %>
|
<%= render 'calentries/nested_fields', :f => calentry %>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<%= f.actions do %>
|
<%= f.actions do %>
|
||||||
<%= f.action :submit, :as => :input %>
|
<%= f.action :submit, :as => :input %>
|
||||||
<% end %>
|
<% end %>
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
<script>$('.datetimepicker').datetimepicker({format: 'd.m.Y H:i'})</script>
|
<script>
|
||||||
|
$(document).ready(function(){
|
||||||
|
$('.datetimepicker').map($(this).datetimepicker({format: 'd.m.Y H:i', startDate: (!($(this).attr("value")==undefined))? $(this).attr("value"): ""}))
|
||||||
|
})</script>
|
||||||
<%= tinymce %>
|
<%= tinymce %>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
<li>
|
<li>
|
||||||
<%= link_to nlink_list_search.title, nlink_list_search %>
|
<%= link_to nlink_list_search.title, nlink_list_search %>
|
||||||
<%= link_to "add:"+nlink_list_search.title, create_link_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit, :link_id=>nlink_list_search.id, :link_type=>nlink_list_search.class.to_s) %>
|
<%= link_to "add:"+nlink_list_search.title, create_link_rubrik_neuigkeit_path(@neuigkeit.rubrik,@neuigkeit, :link_id=>nlink_list_search.id, :link_type=>nlink_list_search.class.to_s) %>
|
||||||
<div class="contentbox" >
|
<div class="contentbox" >
|
||||||
<% p = nlink_list_search.class.to_s.downcase.pluralize+"/nlink" %>
|
<% p = nlink_list_search.class.to_s.downcase.pluralize+"/nlink" %>
|
||||||
<%= render :partial=>p, :object=>nlink_list_search %>
|
<%= render :partial=>p, :object=>nlink_list_search %>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
<h1>Editing neuigkeit</h1>
|
<h1><%= I18n.t("neuigkeit.edit") %></h1>
|
||||||
<%= %>
|
<%= %>
|
||||||
<%= render 'form' %>
|
<%= render 'form' %>
|
||||||
<%= render 'layouts/pretty_toolbar' %>
|
<%= render 'layouts/pretty_toolbar' %>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
<%= render 'layouts/pretty_toolbar', :object=> @toolbar_elements %>
|
<%= render 'layouts/pretty_toolbar', :object=> @toolbar_elements %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<%= I18n.t("neuigekeit.sieheauch") %>
|
<%= I18n.t("neuigkeit.sieheauch") %>
|
||||||
<ul class="unstyled">
|
<ul class="unstyled">
|
||||||
<div id="nlink_list">
|
<div id="nlink_list">
|
||||||
<%= render partial: "nlink_list", collection: @neuigkeit.nlinks %>
|
<%= render partial: "nlink_list", collection: @neuigkeit.nlinks %>
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
|
|
||||||
$("#themaview").html("<%= escape_javascript(raw("<h2>Bearbeiten</h2>")+render(:partial=>"themen/small", :object=>@thema) )%>");
|
$("#themaview").html("<%= escape_javascript(raw("<h2>"+I18n.t("thema.edit")+"</h2>")+render(:partial=>"themen/small", :object=>@thema) )%>");
|
||||||
|
|
||||||
$("#themen").html("<%= escape_javascript(render(:partial=>"themen/verw_liste", :object=>@themen) )%>");
|
$("#themen").html("<%= escape_javascript(render(:partial=>"themen/verw_liste", :object=>@themen) )%>");
|
||||||
|
|||||||
@@ -3,9 +3,13 @@ de:
|
|||||||
# -------- Interne Strings ---------
|
# -------- Interne Strings ---------
|
||||||
neuigkeit:
|
neuigkeit:
|
||||||
publish: "Neuigkeit veröffentlichen"
|
publish: "Neuigkeit veröffentlichen"
|
||||||
|
publish_sure: "Achtung! Das Veröffentlichen sollte nicht mehr rückgängiggemacht werden. Die Neuigkeit ist für die Öffentlichkeit sichtbar! Bist du sicher, dass du die Nachricht veröffentlichen willst?"
|
||||||
publishfb: "Neuigkeit auf Facebook veröffentlichen"
|
publishfb: "Neuigkeit auf Facebook veröffentlichen"
|
||||||
|
publishfb_sure: "Sicher, dass diese Neuigkeit auf Facebook veröffentlicht werden soll? Diese Aktion kann nicht rückgängig gemacht werden!"
|
||||||
republish: "Neuigkeit erneut veröffentlichen"
|
republish: "Neuigkeit erneut veröffentlichen"
|
||||||
unpublish: "Veröffentlichung rückgängig"
|
unpublish: "Veröffentlichung rückgängig"
|
||||||
|
unpublish_sure: "Veröffentlichen rückgängig machen? Dieser Vorgang beeinflusst nicht die Veröffentlichung auf Facebook"
|
||||||
|
edit: "Artikel bearbeiten"
|
||||||
new:
|
new:
|
||||||
title: "Neuer Artikel"
|
title: "Neuer Artikel"
|
||||||
rubrik:
|
rubrik:
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ de:
|
|||||||
thema:
|
thema:
|
||||||
add: "Thema hinzufügen"
|
add: "Thema hinzufügen"
|
||||||
edit: "Thema bearbeiten"
|
edit: "Thema bearbeiten"
|
||||||
|
show: "Thema anzeigen"
|
||||||
remove: "Thema löschen"
|
remove: "Thema löschen"
|
||||||
manage: "Thema verwalten"
|
manage: "Thema verwalten"
|
||||||
save: "Thema speichern"
|
save: "Thema speichern"
|
||||||
|
|||||||
@@ -17,3 +17,19 @@ plugins:
|
|||||||
- heading
|
- heading
|
||||||
heading_clear_tag: p
|
heading_clear_tag: p
|
||||||
width: "100%"
|
width: "100%"
|
||||||
|
formats:
|
||||||
|
boldred: {inline: "b", styles: {color: "red"}}
|
||||||
|
setup : function(fn) {
|
||||||
|
// Add a custom button
|
||||||
|
fn.addButton('firstname', {
|
||||||
|
title : 'Member First Name',
|
||||||
|
image : 'resources/scripts/tiny_mce/themes/advanced/img/firstname.gif',
|
||||||
|
onclick : function() {
|
||||||
|
// Add you own code to execute something on click
|
||||||
|
fn.focus();
|
||||||
|
fn.selection.setContent('{firstname}');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user