forked from bofh/fetsite
Merge branch 'master' of https://github.com/fetsite/fetsite
Conflicts: app/assets/javascripts/application.js
This commit is contained in:
3
Gemfile
3
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'
|
||||
|
||||
133
Gemfile.lock
133
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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
|
||||
@@ -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,9 +17,12 @@ 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 << {: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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
</p>
|
||||
|
||||
<div class="accordion" id="accordion1">
|
||||
<% @themengruppe.themen.each do |thema| %>
|
||||
<% @themen.each do |thema| %>
|
||||
<div class="accordion-group">
|
||||
<div class="accordion-heading">
|
||||
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion1" href="#collapse<%=thema.id%>">
|
||||
|
||||
0
app/views/themengruppen/sort_themen.js.erb
Normal file
0
app/views/themengruppen/sort_themen.js.erb
Normal file
1
app/views/themengruppen/sort_themengruppen.js.erb
Normal file
1
app/views/themengruppen/sort_themengruppen.js.erb
Normal file
@@ -0,0 +1 @@
|
||||
alert("tt")
|
||||
57
app/views/themengruppen/verwalten.html.erb
Normal file
57
app/views/themengruppen/verwalten.html.erb
Normal file
@@ -0,0 +1,57 @@
|
||||
<style>
|
||||
#themen { list-style-type: none; margin: 0; padding: 0; margin-bottom: 15px;zoom: 1; }
|
||||
#themen li { margin: 0 5px 5px 5px; padding: 5px; font-size: 1.2em; width: 95%; }
|
||||
</style>
|
||||
<ul id="themen" class="sort" >
|
||||
<% @themen.each do |thema| %>
|
||||
<li id="themen_<%= thema.id %>" class="sort" ><div class="contentbox" ><h2><%= thema.title %></h2> </div></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<script>
|
||||
|
||||
$( document ).ready(function(){
|
||||
$("#themen").sortable({
|
||||
cursor: 'crosshair',
|
||||
drag:true,
|
||||
update: function(){
|
||||
$.ajax({
|
||||
url: '<%= themengruppe_sort_themen_path(@themengruppe) %>',
|
||||
type: 'post',
|
||||
data: $('#themen').sortable('serialize'),
|
||||
handle: ".contentbox",
|
||||
dataType: 'script',
|
||||
complete: function(request){
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
<!--
|
||||
$( document ).ready(function(){
|
||||
$("#themen").sortable({
|
||||
axis: 'y',
|
||||
drag:true,
|
||||
dropOnEmpty: false,
|
||||
handle: '.handle',
|
||||
cursor: 'crosshair',
|
||||
items: 'li',
|
||||
opacity: 0.4,
|
||||
scroll: true,
|
||||
update: function(){
|
||||
$.ajax({
|
||||
url: '/books/sort',
|
||||
type: 'post',
|
||||
data: $('#themen').sortable('serialize'),
|
||||
dataType: 'script',
|
||||
complete: function(request){
|
||||
$('#themen').effect('highlight');
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
-->
|
||||
@@ -4,7 +4,7 @@
|
||||
<%= @themengruppe.text %>
|
||||
</p>
|
||||
<ul class="unstyled linkbox-list" >
|
||||
<% @themengruppe.themen.each do |thema| %>
|
||||
<% @themen.each do |thema| %>
|
||||
<li>
|
||||
<div class="contentbox">
|
||||
<a href="#<%=thema.id%>">
|
||||
|
||||
27
app/views/themes/2003/themengruppen/verwalten_all.html.erb
Normal file
27
app/views/themes/2003/themengruppen/verwalten_all.html.erb
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
<ul id="themengruppen" class="sort" >
|
||||
<% @themengruppen.each do |themengruppe| %>
|
||||
<li id="themengruppen_<%= themengruppe.id %>" class="sort" style="background:white;display:block;" ><%= themengruppe.title %>-<%= themengruppe.priority %></li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
||||
<script>
|
||||
|
||||
$( document ).ready(function(){
|
||||
$("#themengruppen").sortable({
|
||||
cursor: 'crosshair',
|
||||
drag:true,
|
||||
update: function(){
|
||||
$.ajax({
|
||||
url: '<%= sort_themengruppen_themengruppen_path() %>',
|
||||
type: 'post',
|
||||
data: $('#themengruppen').sortable('serialize'),
|
||||
dataType: 'script',
|
||||
complete: function(request){
|
||||
alert("complete");
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -42,6 +42,11 @@ Fetsite::Application.configure do
|
||||
# Use a different cache store in production
|
||||
# config.cache_store = :mem_cache_store
|
||||
|
||||
|
||||
|
||||
config.consider_all_requests_local = true
|
||||
config.action_controller.perform_caching = false
|
||||
|
||||
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
||||
# config.action_controller.asset_host = "http://assets.example.com"
|
||||
|
||||
|
||||
@@ -104,10 +104,15 @@ end
|
||||
|
||||
resources :beispiele
|
||||
resources :themen do
|
||||
|
||||
resources :attachments
|
||||
end
|
||||
|
||||
resources :themengruppen do
|
||||
get :verwalten
|
||||
get :verwalten_all,:on=>:collection
|
||||
post :sort_themen
|
||||
post :sort_themengruppen, :on=>:collection
|
||||
resources :themen, :only=>[:new, :show]
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user