diff --git a/Gemfile b/Gemfile index 3a8134f..67fb72a 100755 --- a/Gemfile +++ b/Gemfile @@ -86,6 +86,9 @@ gem 'rmagick' gem 'bootstrap-addons-rails' gem "jquery-fileupload-rails" +gem "jquery-ui-rails","~> 4.1.1" + +# gem "jquery-sortable-rails" gem "seed_dump", "~> 0.5.3" #gem "themes_for_rails" ,:git =>'git://github.com/tkriplean/themes_for_rails.git' #gem "themes_for_rails", :git=> 'git://github.com/lucasefe/themes_for_rails.git' diff --git a/Gemfile.lock b/Gemfile.lock index 33cdaa7..ec202a2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,3 +1,11 @@ +GIT + remote: git://github.com/airblade/paper_trail.git + revision: 802b7d4ead71703860fcb9befc2c9b2ee05a8b9f + specs: + paper_trail (3.0.0) + activerecord (>= 3.0, < 5.0) + activesupport (>= 3.0, < 5.0) + GEM remote: https://rubygems.org/ specs: @@ -28,43 +36,47 @@ GEM activesupport (3.2.9) i18n (~> 0.6) multi_json (~> 1.0) - annotate (2.5.0) - rake - arel (3.0.2) + annotate (2.6.1) + activerecord (>= 2.3.0) + rake (>= 0.8.7) + arel (3.0.3) awesome_nested_set (2.1.6) activerecord (>= 3.0.0) - bcrypt-ruby (3.0.1) + bcrypt-ruby (3.1.2) bootstrap-addons-rails (0.1.2) rails - bootstrap-sass (2.3.2.1) + bootstrap-sass (2.3.2.2) sass (~> 3.2) builder (3.0.4) - cancan (1.6.9) + cancan (1.6.10) carrierwave (0.9.0) activemodel (>= 3.2.0) activesupport (>= 3.2.0) json (>= 1.7) - cocaine (0.4.2) + climate_control (0.0.3) + activesupport (>= 3.0) + cocaine (0.5.3) + climate_control (>= 0.0.3, < 1.0) coffee-rails (3.2.2) coffee-script (>= 2.2.0) railties (~> 3.2.0) coffee-script (2.2.0) coffee-script-source execjs - coffee-script-source (1.4.0) - devise (2.2.3) + coffee-script-source (1.6.3) + devise (2.2.8) bcrypt-ruby (~> 3.0) orm_adapter (~> 0.1) railties (~> 3.1) warden (~> 1.2.1) - diff-lcs (1.2.4) + diff-lcs (1.2.5) erubis (2.7.0) execjs (1.4.0) multi_json (~> 1.0) - factory_girl (4.2.0) + factory_girl (4.3.0) activesupport (>= 3.0.0) - factory_girl_rails (4.2.1) - factory_girl (~> 4.2.0) + factory_girl_rails (4.3.0) + factory_girl (~> 4.3.0) railties (>= 3.0.0) faraday (0.8.8) multipart-post (~> 1.2.0) @@ -72,39 +84,41 @@ GEM actionpack (>= 3.0) formtastic-bootstrap (2.1.3) formtastic (~> 2.2) - git (1.2.5) - globalize3 (0.3.0) - activemodel (>= 3.0.0) - activerecord (>= 3.0.0) - paper_trail (~> 2) - haml (4.0.0) + git (1.2.6) + globalize (3.0.4) + activemodel (>= 3.0.0, < 4.0.0) + activerecord (>= 3.0.0, < 4.0.0) + globalize-versioning (0.1.0.alpha.1) + globalize (>= 3, < 5) + paper_trail (~> 3.0.0) + haml (4.0.5) tilt hashie (2.0.5) - hike (1.2.1) + hike (1.2.3) httpauth (0.2.0) - i18n (0.6.1) + i18n (0.6.9) journey (1.0.4) jquery-fileupload-rails (0.4.1) actionpack (>= 3.1) railties (>= 3.1) - jquery-rails (2.2.1) + jquery-rails (3.0.4) railties (>= 3.0, < 5.0) thor (>= 0.14, < 2.0) - json (1.7.7) + json (1.8.1) jwt (0.1.8) multi_json (>= 1.5) - libv8 (3.11.8.13) + libv8 (3.16.14.3) mail (2.4.4) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) - mime-types (1.21) + mime-types (1.25.1) mini_portile (0.5.2) - multi_json (1.5.1) + multi_json (1.8.2) multipart-post (1.2.0) - mysql2 (0.3.13) - net-ldap (0.2.2) - nokogiri (1.6.0) + mysql2 (0.3.14) + net-ldap (0.3.1) + nokogiri (1.6.1) mini_portile (~> 0.5.0) oauth2 (0.8.1) faraday (~> 0.8) @@ -115,25 +129,22 @@ GEM omniauth (1.1.4) hashie (>= 1.2, < 3) rack - omniauth-facebook (1.4.1) + omniauth-facebook (1.5.1) omniauth-oauth2 (~> 1.1.0) - omniauth-ldap (1.0.3) - net-ldap (~> 0.2.2) + omniauth-ldap (1.0.4) + net-ldap (~> 0.3.1) omniauth (~> 1.0) pyu-ruby-sasl (~> 0.0.3.1) rubyntlm (~> 0.1.1) omniauth-oauth2 (1.1.1) oauth2 (~> 0.8.0) omniauth (~> 1.0) - orm_adapter (0.4.0) - paper_trail (2.7.0) - activerecord (~> 3.0) - railties (~> 3.0) - paperclip (3.4.0) + orm_adapter (0.5.0) + paperclip (3.4.2) activemodel (>= 3.0.0) activerecord (>= 3.0.0) activesupport (>= 3.0.0) - cocaine (~> 0.4.0) + cocaine (~> 0.5.0) mime-types polyglot (0.3.3) pyu-ruby-sasl (0.0.3.3) @@ -159,18 +170,19 @@ GEM rake (>= 0.8.7) rdoc (~> 3.4) thor (>= 0.14.6, < 2.0) - rake (10.0.3) - rdoc (3.12.1) + rake (10.1.1) + rdoc (3.12.2) json (~> 1.4) - ref (1.0.2) + ref (1.0.5) rmagick (2.13.2) rolify (3.2.0) - rspec-core (2.14.4) - rspec-expectations (2.14.0) + rspec-core (2.14.7) + rspec-expectations (2.14.4) diff-lcs (>= 1.1.3, < 2.0) - rspec-mocks (2.14.1) - rspec-rails (2.14.0) + rspec-mocks (2.14.4) + rspec-rails (2.14.1) actionpack (>= 3.0) + activemodel (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) rspec-core (~> 2.14.0) @@ -179,7 +191,7 @@ GEM rubyntlm (0.1.1) sanitize (2.0.6) nokogiri (>= 1.4.4) - sass (3.2.5) + sass (3.2.13) sass-rails (3.2.6) railties (~> 3.2.0) sass (>= 3.1.10) @@ -187,29 +199,29 @@ GEM seed_dump (0.5.3) simple_calendar (0.1.9) rails (>= 3.0) - sprockets (2.2.2) + sprockets (2.2.1) hike (~> 1.2) multi_json (~> 1.0) rack (~> 1.0) tilt (~> 1.1, != 1.3.0) - sqlite3 (1.3.7) + sqlite3 (1.3.8) themes_for_rails (0.5.1) rails (>= 3.0.0) - therubyracer (0.11.3) - libv8 (~> 3.11.8.12) + therubyracer (0.12.0) + libv8 (~> 3.16.14.0) ref - thor (0.17.0) - tilt (1.3.3) + thor (0.18.1) + tilt (1.4.1) tinymce-rails (3.5.8) railties (>= 3.1.1) - treetop (1.4.12) + treetop (1.4.15) polyglot polyglot (>= 0.3.1) - tzinfo (0.3.35) - uglifier (1.3.0) + tzinfo (0.3.38) + uglifier (2.4.0) execjs (>= 0.3.0) - multi_json (~> 1.0, >= 1.0.2) - warden (1.2.1) + json (>= 1.8.0) + warden (1.2.3) rack (>= 1.0) PLATFORMS @@ -229,7 +241,8 @@ DEPENDENCIES formtastic (~> 2.2.1) formtastic-bootstrap (~> 2.1.3) git - globalize3 (~> 0.3.0) + globalize (~> 3.0.4) + globalize-versioning haml jquery-fileupload-rails jquery-rails @@ -237,7 +250,7 @@ DEPENDENCIES omniauth omniauth-facebook omniauth-ldap - paper_trail (>= 2.7.0) + paper_trail (>= 2.7.0)! paperclip (~> 3.4.0) rails (= 3.2.9) rmagick @@ -250,5 +263,5 @@ DEPENDENCIES sqlite3 themes_for_rails therubyracer - tinymce-rails (>= 3.5.8) + tinymce-rails (~> 3.5.8) uglifier (>= 1.0.3) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index eebecb5..3630db1 100755 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -12,6 +12,13 @@ // //= require jquery //= require jquery_ujs +<<<<<<< HEAD +======= +//= require jquery.ui.all +// require jquery.ui.draggable +// require jquery.ui.sortable +// require jquery.sortable +>>>>>>> bb8f427f953c2bcf84331b4eb1f8b5c7108e80e6 // require jquery-ui //= require_tree . //= require tinymce-jquery diff --git a/app/controllers/gremien_controller.rb b/app/controllers/gremien_controller.rb index 432cecc..966cc4c 100644 --- a/app/controllers/gremien_controller.rb +++ b/app/controllers/gremien_controller.rb @@ -17,7 +17,7 @@ class GremienController < ApplicationController if params[:filter].nil? @gremien = Gremium.where("CAST(typ AS INT) < 10").order(:typ).order(:name) else - @gremien = Gremium.order(:typ).order(:name).where("CAST(typ AS INT) == ?",params[:filter]) + @gremien = Gremium.order(:typ).order(:name).where("CAST(typ AS INT) = ?",params[:filter].to_i) end diff --git a/app/controllers/themengruppen_controller.rb b/app/controllers/themengruppen_controller.rb index 29ada1f..aba10ca 100644 --- a/app/controllers/themengruppen_controller.rb +++ b/app/controllers/themengruppen_controller.rb @@ -3,8 +3,9 @@ class ThemengruppenController < ApplicationController # GET /themengruppen.json load_and_authorize_resource def index - @themengruppen = Themengruppe.order(:title) + @themengruppen = Themengruppe.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()}] respond_to do |format| format.html # index.html.erb @@ -16,10 +17,13 @@ class ThemengruppenController < ApplicationController # GET /themengruppen/1.json def show @themengruppe = Themengruppe.find(params[:id]) + @themen = @themengruppe.themen.order(:priority).reverse + @toolbar_elements = [] @toolbar_elements << {:icon=>:plus, :hicon=>'icon-plus-sign', :text=>I18n.t('thema.add'), :path=>new_themengruppe_thema_path(@themengruppe)} if can? :new, Themengruppe @toolbar_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t('themengruppe.edit'), :path=>edit_themengruppe_path(@themengruppe)} if can? :edit, @themengruppe - @toolbar_elements << {:hicon=>'icon-remove-circle',:text=>I18n.t('themengruppe.remove'), :path=>themengruppe_path(@themengruppe), :method=>:delete,:confirm=>I18n.t('themengruppe.sure')} if can? :delete, @themengruppe + @toolbar_elements << {:icon=>:pencil, :hicon=>'icon-pencil', :text=>I18n.t("themengruppe.verwalten"), :path=>themengruppe_verwalten_path(@themengruppe)} if can? :edit, @themengruppe + @toolbar_elements << {:hicon=>'icon-remove-circle',:text=>I18n.t('themengruppe.remove'), :path=>themengruppe_path(@themengruppe), :method=>:delete,:confirm=>I18n.t('themengruppe.sure')} if can? :delete, @themengruppe respond_to do |format| @@ -43,6 +47,42 @@ class ThemengruppenController < ApplicationController def edit @themengruppe = Themengruppe.find(params[:id]) end + def verwalten_all + @themengruppen =Themengruppe.order(:priority).reverse + end + def verwalten + @themengruppe = Themengruppe.find(params[:themengruppe_id]) + @themen = @themengruppe.themen.order(:priority).reverse + end + + def sort_themengruppen + @params=params + i=1 + params['themengruppen'].reverse.each do |themengruppeid| + themengruppe=Themengruppe.find(themengruppeid) + themengruppe.priority=i + themengruppe.save + i=i+1 + end + respond_to do |format| + format.js + end + + end + + def sort_themen + @params=params + i=1 + params['themen'].reverse.each do |themaid| + thema=Thema.find(themaid) + thema.priority=i + thema.save + i=i+1 + end + respond_to do |format| + format.js + end + end # POST /themengruppen # POST /themengruppen.json diff --git a/app/views/themengruppen/show.html.erb b/app/views/themengruppen/show.html.erb index 4df5827..6da95cd 100644 --- a/app/views/themengruppen/show.html.erb +++ b/app/views/themengruppen/show.html.erb @@ -5,7 +5,7 @@

- <% @themengruppe.themen.each do |thema| %> + <% @themen.each do |thema| %>
diff --git a/app/views/themengruppen/sort_themen.js.erb b/app/views/themengruppen/sort_themen.js.erb new file mode 100644 index 0000000..e69de29 diff --git a/app/views/themengruppen/sort_themengruppen.js.erb b/app/views/themengruppen/sort_themengruppen.js.erb new file mode 100644 index 0000000..b6aee38 --- /dev/null +++ b/app/views/themengruppen/sort_themengruppen.js.erb @@ -0,0 +1 @@ +alert("tt") \ No newline at end of file diff --git a/app/views/themengruppen/verwalten.html.erb b/app/views/themengruppen/verwalten.html.erb new file mode 100644 index 0000000..b828f3e --- /dev/null +++ b/app/views/themengruppen/verwalten.html.erb @@ -0,0 +1,57 @@ + +
    +<% @themen.each do |thema| %> +
  • <%= thema.title %>

  • +<% end %> +
+ + + + diff --git a/app/views/themes/2003/themengruppen/show.html.erb b/app/views/themes/2003/themengruppen/show.html.erb index 9fc9187..ca514a6 100644 --- a/app/views/themes/2003/themengruppen/show.html.erb +++ b/app/views/themes/2003/themengruppen/show.html.erb @@ -4,7 +4,7 @@ <%= @themengruppe.text %>