forked from bofh/fetsite
Zeit formatiert
Datetimepicker fixed, Speichern und weiter
This commit is contained in:
@@ -97,7 +97,13 @@ class ThemenController < ApplicationController
|
||||
|
||||
respond_to do |format|
|
||||
if @thema.save
|
||||
format.html { redirect_to @thema, notice: I18n.t("thema.updated") }
|
||||
format.html {
|
||||
if params["button"]=="continue"
|
||||
render action: "edit", notice: I18n.t("thema.updated")
|
||||
else
|
||||
redirect_to @thema, notice: I18n.t("thema.updated")
|
||||
end
|
||||
}
|
||||
format.json { head :no_content }
|
||||
format.js
|
||||
else
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
class DatetimepickerInput < FormtasticBootstrap::Inputs::StringInput
|
||||
def input_html_options
|
||||
super
|
||||
super.merge(:class => "datetimepicker",:value=>builder.to_s)
|
||||
s=super
|
||||
value=builder.object.send(method)
|
||||
value=I18n.l(value) unless value.nil?
|
||||
super.merge(:class => "datetimepicker",:value=>value)
|
||||
end
|
||||
|
||||
def html_options
|
||||
@@ -13,7 +15,7 @@ class DatetimepickerInput < FormtasticBootstrap::Inputs::StringInput
|
||||
#super.merge(:class=>"datepicker",'date-date-format'.to_sym=>"%d.%m.%Y")
|
||||
end
|
||||
def controls_wrapper_html_options
|
||||
super.merge(:class=> " date input-append", 'data-date'.to_sym =>I18n.l(Date.today()).to_s, 'data-date-format'.to_sym=>I18n.t('date.formats.default-picker'), 'data-time-format'.to_sym=>"hh:mm" ,)
|
||||
super.merge(:class=> " date input-append", 'data-date'.to_sym =>I18n.l(Date.today()).to_s, 'data-date-format'.to_sym=>I18n.t('date.formats.default-picker'))
|
||||
end
|
||||
def to_html
|
||||
bootstrap_wrapping do
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<%= tinymce_assets %>
|
||||
|
||||
<div class="container-fluid">
|
||||
<%= semantic_form_for @thema, :remote=>remote do |f| %>
|
||||
<%= f.inputs do %>
|
||||
@@ -17,8 +18,8 @@
|
||||
</div>
|
||||
|
||||
<%= f.actions do %>
|
||||
<%= f.action :submit, :as => :button %>
|
||||
<%= f.action :submit, :as => :button, :label=> "&edit", :params=>{edit: true} %>
|
||||
<%= f.action :submit, :as => :button, :label=> I18n.t("thema.save" ) %>
|
||||
<%= f.action :submit, :as => :button, :label=> I18n.t("thema.savecont"), :button_html=>{:value=>"continue"} %>
|
||||
<%= f.action :cancel, :as => :link %>
|
||||
<% end %>
|
||||
<% end %><% end %>
|
||||
|
||||
@@ -23,10 +23,7 @@
|
||||
</div>
|
||||
</br>
|
||||
|
||||
<% unless @thema.id.nil? %>
|
||||
<% @att_elements = [{:icon=>:plus, :hicon=>'icon-plus', :text=>I18n.t('attachment.add'), :path=>new_thema_attachment_path(@thema),:remote=>true}] %>
|
||||
<div id="attachmentform">
|
||||
</div>
|
||||
<%= render :partial=>'layouts/pretty_toolbar', :object=>@att_elements %>
|
||||
<% end %>
|
||||
|
||||
|
||||
|
||||
<br/>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<div id="themaview">
|
||||
<h1>Editing thema</h1>
|
||||
<%= render 'form' , :locals=>{:remote=>false}, :remote=>false %>
|
||||
<h1><%= I18n.t("thema.edit")%></h1>
|
||||
<%= render 'form', :locals=>{:remote=>false}, :remote=>false %>
|
||||
</div>
|
||||
</br><%= link_to 'Back', @thema %>
|
||||
|
||||
@@ -14,6 +14,8 @@ de:
|
||||
edit: "Thema bearbeiten"
|
||||
remove: "Thema löschen"
|
||||
manage: "Thema verwalten"
|
||||
save: "Thema speichern"
|
||||
savecont: "Thema zwischenspeichern"
|
||||
created: "Thema erfolgreich erstellt"
|
||||
updated: "Thema erfolgreich gespeichert"
|
||||
sure: "Sicher, dass Sie dieses Thema löschen möchten?"
|
||||
@@ -42,8 +44,8 @@ de:
|
||||
text: "Antwort"
|
||||
thema: "Thema"
|
||||
hints:
|
||||
thema:
|
||||
title: "Überschrift"
|
||||
|
||||
|
||||
activerecord:
|
||||
errors:
|
||||
models:
|
||||
|
||||
Reference in New Issue
Block a user