diff --git a/Gemfile b/Gemfile index 34f2e41..6b7d562 100755 --- a/Gemfile +++ b/Gemfile @@ -91,6 +91,7 @@ gem 'bootstrap-addons-rails' gem "jquery-fileupload-rails" gem "jquery-ui-rails","~> 4.1.1" gem "font-awesome-rails" +gem "jquery-datetimepicker-rails" # gem "jquery-sortable-rails" gem "seed_dump", "~> 0.5.3" #gem "themes_for_rails" ,:git =>'git://github.com/tkriplean/themes_for_rails.git' diff --git a/app/assets/stylesheets/themes/blue1/application.css.scss b/app/assets/stylesheets/themes/blue1/application.css.scss index fe7a383..f4e4f19 100755 --- a/app/assets/stylesheets/themes/blue1/application.css.scss +++ b/app/assets/stylesheets/themes/blue1/application.css.scss @@ -12,6 +12,7 @@ *= require_self * require_tree . *= require jquery.fileupload-ui +*= require jquery.datetimepicker * require 'bootstrap' * require 'neuigkeiten' diff --git a/app/controllers/themen_controller.rb b/app/controllers/themen_controller.rb index a3aef45..a8d9aef 100644 --- a/app/controllers/themen_controller.rb +++ b/app/controllers/themen_controller.rb @@ -3,24 +3,12 @@ class ThemenController < ApplicationController # GET /themen.json load_and_authorize_resource - def index - @themen = Thema.all - - respond_to do |format| - format.html # index.html.erb - format.json { render json: @themen } - end - end - - # GET /themen/1 - # GET /themen/1.json def show @thema = Thema.find(params[:id]) - @fragen=@thema.fragen - @toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>"Verwalten", :path=>verwalten_thema_path(@thema)}] - @toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('thema.edit'), :path=>edit_thema_path(@thema)}] + @toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t("thema.manage"), :path=>verwalten_thema_path(@thema)}] + @toolbar_elements << [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('thema.edit'), :path=>edit_thema_path(@thema)}] @toolbar_elements << {:hicon=>'icon-remove-circle', :text=>I18n.t('thema.remove'), :path=>thema_path(@thema), :method=>:delete, :confirm=>I18n.t('thema.sure')} respond_to do |format| @@ -33,10 +21,7 @@ class ThemenController < ApplicationController def verwalten @thema = Thema.find(params[:id]) @attachment=Attachment.new - - @fragen=@thema.fragen - @toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>"Verwalten", :path=>verwalten_thema_path(@thema)}] @toolbar_elements = [{:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('thema.edit'), :path=>edit_thema_path(@thema)}] @toolbar_elements << {:hicon=>'icon-remove-circle', :text=>I18n.t('thema.remove'), :path=>thema_path(@thema), :method=>:delete, :confirm=>I18n.t('thema.sure')} @@ -57,7 +42,7 @@ class ThemenController < ApplicationController # GET /themen/1/edit def edit @thema = Thema.find(params[:id]) - + if @thema.is_wiki? redirect_to edit_wiki_path(Wiki.find(@thema.id)) return @@ -72,12 +57,11 @@ class ThemenController < ApplicationController # POST /themen.json def create @thema = Thema.new(params[:thema]) - - + respond_to do |format| if @thema.save @themen = @thema.themengruppe.themen.order(:priority).reverse - format.html { redirect_to @thema, notice: 'Thema was successfully created.' } + format.html { redirect_to @thema, notice: I18n.t("thema.created") } format.json { render json: @thema, status: :created, location: @thema } format.js {render action: "update"} else @@ -107,12 +91,13 @@ class ThemenController < ApplicationController # PUT /themen/1.json def update @thema = Thema.find(params[:id]) - @themen = @thema.themengruppe.themen.order(:priority).reverse + @themen = @thema.themengruppe.themen.order(:priority).reverse @thema.assign_attributes(params[:thema]) @thema.fix_links(request.host_with_port) + respond_to do |format| if @thema.save - format.html { redirect_to @thema, notice: 'Thema was successfully updated.' } + format.html { redirect_to @thema, notice: I18n.t("thema.updated") } format.json { head :no_content } format.js else @@ -128,7 +113,7 @@ class ThemenController < ApplicationController def destroy @thema = Thema.find(params[:id]) @thema.destroy - @themen = @thema.themengruppe.themen.order(:priority).reverse + @themen = @thema.themengruppe.themen.order(:priority).reverse respond_to do |format| format.html { redirect_to themengruppe_path(@thema.themengruppe) } format.json { head :no_content } diff --git a/app/controllers/themengruppen_controller.rb b/app/controllers/themengruppen_controller.rb index cdd6465..88dfc8d 100644 --- a/app/controllers/themengruppen_controller.rb +++ b/app/controllers/themengruppen_controller.rb @@ -5,7 +5,7 @@ class ThemengruppenController < ApplicationController def index @themengruppen = Themengruppe.where(:public=>true).order(:priority).reverse @toolbar_elements = [{:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.new'), :path=>new_themengruppe_path()}] - @toolbar_elements = [{:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('common.verwalten'), :path=>verwalten_all_themengruppen_path()}] + @toolbar_elements = [{:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('themengruppe.manage_all'), :path=>verwalten_all_themengruppen_path()}] respond_to do |format| format.html # index.html.erb diff --git a/app/views/fragen/_frage.html.erb b/app/views/fragen/_frage.html.erb index 1197db7..d7357a8 100644 --- a/app/views/fragen/_frage.html.erb +++ b/app/views/fragen/_frage.html.erb @@ -1,8 +1,8 @@

- <%= frage.title %>
+ <%= frage.title %>?
<%= raw(frage.text) %>
-<%= link_to 'Edit', edit_frage_path(frage),:remote=>true %> | -<%= link_to 'Destroy',frage, method: :delete, :remote=> true , data: { confirm: 'Are you sure?' } %> +<%= link_to 'Edit', edit_frage_path(frage),:remote=>true %> +<%= link_to 'Destroy',frage, method: :delete, :remote=> true , data: { confirm: I18n.t("frage.sure") } %>

diff --git a/app/views/neuigkeiten/_form.html.erb b/app/views/neuigkeiten/_form.html.erb index 480709e..72fced6 100755 --- a/app/views/neuigkeiten/_form.html.erb +++ b/app/views/neuigkeiten/_form.html.erb @@ -33,5 +33,5 @@ <% end %> <% end %> - + <%= tinymce %> diff --git a/app/views/themen/_form.html.erb b/app/views/themen/_form.html.erb index 6a77d03..cb241d7 100644 --- a/app/views/themen/_form.html.erb +++ b/app/views/themen/_form.html.erb @@ -1,33 +1,29 @@ <%= tinymce_assets %>
- - -<%= semantic_form_for @thema, :remote=>remote do |f| %> + <%= semantic_form_for @thema, :remote=>remote do |f| %> <%= f.inputs do %> -
-
- <%= f.input :title %> -
-
- <%= f.input :themengruppe %> -
-
-
- <%= f.input :text, :as=>:tinymce_text,:label=>false, :input_html=>{:rows=>20} %> -
-
- - -
- -<%= f.actions do %> -<%= f.action :submit, :as => :button %> - -<%= f.action :cancel, :as => :link %> -<% end %> -<% end %><% end %> - <%= tinymce %> -

Attachments:

-<%= render :partial => "themen/select", :object => @thema,:locals =>{ :editor => :true} %> +
+
+ <%= f.input :title %> +
+
+ <%= f.input :themengruppe %> +
+
+
+ <%= f.input :text, :as=>:tinymce_text,:label=>false, :input_html=>{:rows=>20} %> +
+
+
+ + <%= f.actions do %> + <%= f.action :submit, :as => :button %> + <%= f.action :submit, :as => :button, :label=> "&edit", :params=>{edit: true} %> + <%= f.action :cancel, :as => :link %> + <% end %> + <% end %><% end %> + <%= tinymce %> +

Attachments:

+ <%= render :partial => "themen/select", :object => @thema,:locals =>{ :editor => :true} %> diff --git a/app/views/themengruppen/_themengruppe.html.erb b/app/views/themengruppen/_themengruppe.html.erb index a565d37..5a760cf 100644 --- a/app/views/themengruppen/_themengruppe.html.erb +++ b/app/views/themengruppen/_themengruppe.html.erb @@ -26,7 +26,7 @@