community_engine 3.0.0 → 3.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -13
- data/.gitignore +4 -1
- data/.travis.yml +5 -2
- data/CHANGELOG.markdown +270 -0
- data/Gemfile +3 -0
- data/README.markdown +20 -21
- data/Rakefile +8 -6
- data/TODO.markdown +3 -0
- data/UPGRADING.markdown +46 -36
- data/app/assets/javascripts/active_admin.js.coffee +19 -0
- data/app/assets/javascripts/ckeditor/configs/ads.js.coffee +175 -0
- data/app/assets/javascripts/ckeditor/configs/comments.js.coffee +2 -0
- data/app/assets/javascripts/ckeditor/configs/posts.js.coffee +248 -0
- data/app/assets/javascripts/ckeditor/rte/rte.ads.js.coffee +7 -0
- data/app/assets/javascripts/ckeditor/rte/rte.comments.js.coffee +8 -0
- data/app/assets/javascripts/ckeditor/rte/rte.js.coffee +20 -0
- data/app/assets/javascripts/ckeditor/rte/rte.posts.js.coffee +14 -0
- data/app/assets/javascripts/community_engine.js +114 -123
- data/{vendor → app}/assets/javascripts/jcrop/jquery.Jcrop.js +0 -0
- data/{vendor → app}/assets/javascripts/jcrop/jquery.color.js +0 -0
- data/{vendor → app}/assets/javascripts/tag-it/tag-it.js +0 -0
- data/app/assets/stylesheets/active_admin.css.scss +27 -0
- data/{vendor → app}/assets/stylesheets/jcrop/Jcrop.gif +0 -0
- data/{vendor → app}/assets/stylesheets/jcrop/jquery.Jcrop.min.css +0 -0
- data/{vendor → app}/assets/stylesheets/tag-it/tag-it.css +0 -0
- data/{vendor → app}/assets/stylesheets/tag-it/tagit.ui-zendesk.css +0 -0
- data/app/controllers/activities_controller.rb +4 -4
- data/app/controllers/albums_controller.rb +13 -18
- data/app/controllers/authorizations_controller.rb +1 -1
- data/app/controllers/base_controller.rb +9 -32
- data/app/controllers/categories_controller.rb +1 -78
- data/app/controllers/clippings_controller.rb +3 -7
- data/app/controllers/comments_controller.rb +4 -24
- data/app/controllers/events_controller.rb +3 -12
- data/app/controllers/favorites_controller.rb +2 -2
- data/app/controllers/forums_controller.rb +5 -9
- data/app/controllers/invitations_controller.rb +1 -1
- data/app/controllers/messages_controller.rb +4 -8
- data/app/controllers/moderators_controller.rb +1 -1
- data/app/controllers/monitorships_controller.rb +1 -1
- data/app/controllers/pages_controller.rb +0 -62
- data/app/controllers/password_resets_controller.rb +2 -2
- data/app/controllers/photo_manager_controller.rb +3 -3
- data/app/controllers/photos_controller.rb +43 -14
- data/app/controllers/posts_controller.rb +7 -14
- data/app/controllers/rsvps_controller.rb +3 -3
- data/app/controllers/sb_posts_controller.rb +20 -20
- data/app/controllers/sessions_controller.rb +1 -1
- data/app/controllers/tags_controller.rb +4 -52
- data/app/controllers/topics_controller.rb +15 -10
- data/app/controllers/users_controller.rb +9 -16
- data/app/controllers/votes_controller.rb +2 -2
- data/app/helpers/base_helper.rb +4 -14
- data/app/models/acts_as_taggable_on/tag.rb +9 -41
- data/app/models/clipping.rb +1 -1
- data/app/models/forum.rb +2 -2
- data/app/models/photo.rb +1 -1
- data/app/models/post.rb +1 -1
- data/app/models/sb_post.rb +19 -15
- data/app/models/topic.rb +10 -10
- data/app/models/user.rb +1 -1
- data/app/policies/active_admin/page_policy.rb +11 -0
- data/app/policies/application_policy.rb +59 -0
- data/app/policies/post_policy.rb +13 -0
- data/app/policies/sb_post_policy.rb +15 -0
- data/app/policies/topic_policy.rb +23 -0
- data/app/views/ckeditor/pictures/index.html.haml +15 -0
- data/app/views/ckeditor/shared/_asset.html.haml +9 -0
- data/app/views/ckeditor/shared/_asset_tmpl.html.erb +14 -0
- data/app/views/comments/approve.js.haml +1 -1
- data/app/views/comments/create.js.erb +1 -1
- data/app/views/comments/edit.js.erb +2 -1
- data/app/views/events/_subscribe.html.haml +1 -1
- data/app/views/forums/show.html.haml +8 -4
- data/app/views/posts/show.html.haml +4 -0
- data/app/views/sb_posts/_edit_script.js.erb +2 -3
- data/app/views/sb_posts/_reply_script.js.erb +2 -4
- data/app/views/sb_posts/_sb_post.html.haml +7 -6
- data/app/views/sb_posts/create.js.erb +4 -4
- data/app/views/sb_posts/edit.js.erb +2 -1
- data/app/views/sessions/_menu_item.html.haml +4 -4
- data/app/views/shared/_end_javascript.html.haml +1 -2
- data/app/views/shared/_login_sidebar.html.haml +2 -2
- data/app/views/tags/show.html.haml +3 -3
- data/app/views/topics/show.html.haml +1 -1
- data/app/views/users/_profile_user_info_sidebar.html.haml +2 -2
- data/app/views/users/destroy.js.erb +3 -0
- data/app/views/users/new.html.haml +1 -1
- data/app/views/users/show.html.haml +1 -1
- data/app/views/users/signup_completed.html.haml +1 -1
- data/community_engine.gemspec +14 -11
- data/config/initializers/active_admin.rb +239 -0
- data/config/initializers/ckeditor.rb +8 -0
- data/config/initializers/ransack_bootstrap_fix.rb +25 -0
- data/config/locales/de-DE.yml +1 -0
- data/config/locales/en.yml +3 -0
- data/config/routes.rb +14 -19
- data/config/spring.rb +1 -0
- data/db/migrate/083_create_active_admin_comments.rb +19 -0
- data/lib/community_engine.rb +7 -3
- data/lib/community_engine/admin/ads.rb +3 -0
- data/lib/community_engine/admin/categories.rb +20 -0
- data/lib/community_engine/admin/comments.rb +4 -0
- data/lib/community_engine/admin/dashboard.rb +38 -0
- data/lib/community_engine/admin/events.rb +3 -0
- data/lib/community_engine/admin/forums.rb +3 -0
- data/lib/community_engine/admin/homepage_features.rb +25 -0
- data/lib/community_engine/admin/metro_areas.rb +4 -0
- data/lib/community_engine/admin/pages.rb +26 -0
- data/lib/community_engine/admin/posts.rb +92 -0
- data/lib/community_engine/admin/tags.rb +21 -0
- data/lib/community_engine/admin/users.rb +54 -0
- data/lib/community_engine/authenticated_system.rb +5 -20
- data/lib/community_engine/engine.rb +5 -0
- data/lib/community_engine/version.rb +1 -1
- data/lib/resource_feeder/atom.rb +2 -0
- data/lib/resource_feeder/rss.rb +2 -0
- data/lib/white_list.rb +6 -11
- data/test/fixtures/events.yml +10 -0
- data/test/fixtures/tags.yml +6 -5
- data/test/functional/activities_controller_test.rb +19 -19
- data/test/functional/admin/posts_controller_test.rb +16 -0
- data/test/functional/admin_controller_test.rb +82 -82
- data/test/functional/categories_controller_test.rb +0 -39
- data/test/functional/comments_controller_test.rb +14 -7
- data/test/functional/favorites_controller_test.rb +15 -16
- data/test/functional/pages_controller_test.rb +0 -71
- data/test/functional/posts_controller_test.rb +21 -2
- data/test/functional/sb_posts_controller_test.rb +3 -3
- data/test/functional/sessions_controller_test.rb +2 -2
- data/test/functional/tags_controller_test.rb +9 -20
- data/test/functional/users_controller_test.rb +0 -8
- data/test/functional/votes_controller_test.rb +1 -1
- data/test/testapp/config/spring.rb +1 -0
- data/test/testapp/db/schema.rb +16 -1
- data/test/unit/event_test.rb +1 -1
- metadata +204 -170
- data/CHANGELOG +0 -144
- data/app/controllers/admin_controller.rb +0 -80
- data/app/controllers/ads_controller.rb +0 -90
- data/app/controllers/homepage_features_controller.rb +0 -74
- data/app/controllers/metro_areas_controller.rb +0 -74
- data/app/controllers/statistics_controller.rb +0 -35
- data/app/views/admin/comments.html.haml +0 -53
- data/app/views/admin/events.html.haml +0 -26
- data/app/views/admin/messages.html.haml +0 -3
- data/app/views/admin/update.js.erb +0 -1
- data/app/views/admin/users.html.haml +0 -57
- data/app/views/ads/_form.html.haml +0 -21
- data/app/views/ads/edit.html.haml +0 -7
- data/app/views/ads/index.html.haml +0 -29
- data/app/views/ads/new.html.haml +0 -6
- data/app/views/ads/show.html.haml +0 -19
- data/app/views/categories/_form.html.haml +0 -8
- data/app/views/categories/edit.html.haml +0 -4
- data/app/views/categories/index.html.haml +0 -20
- data/app/views/categories/new.html.haml +0 -4
- data/app/views/homepage_features/_form.html.haml +0 -6
- data/app/views/homepage_features/edit.html.haml +0 -6
- data/app/views/homepage_features/index.html.haml +0 -24
- data/app/views/homepage_features/new.html.haml +0 -2
- data/app/views/homepage_features/show.html.haml +0 -27
- data/app/views/metro_areas/_form.html.haml +0 -6
- data/app/views/metro_areas/edit.html.haml +0 -8
- data/app/views/metro_areas/index.html.haml +0 -21
- data/app/views/metro_areas/new.html.haml +0 -6
- data/app/views/metro_areas/show.html.haml +0 -14
- data/app/views/pages/_form.html.haml +0 -18
- data/app/views/pages/edit.html.haml +0 -4
- data/app/views/pages/index.html.haml +0 -34
- data/app/views/pages/new.html.haml +0 -7
- data/app/views/shared/_admin_nav.html.haml +0 -17
- data/app/views/shared/_load_tinymce.js.erb +0 -15
- data/app/views/statistics/activities.xml.builder +0 -33
- data/app/views/statistics/index.html.haml +0 -48
- data/app/views/tags/edit.html.haml +0 -12
- data/app/views/tags/manage.html.haml +0 -30
- data/app/views/users/update.js.erb +0 -1
- data/test/functional/ads_controller_test.rb +0 -51
- data/test/functional/homepage_features_controller_test.rb +0 -69
- data/test/functional/metro_areas_controller_test.rb +0 -63
- data/test/functional/statistics_controller_test.rb +0 -18
- data/test/unit/acts_as_taggable_on/tag_test.rb +0 -22
- data/vendor/converted2.3plugins_to_lib_leftovers/acts_as_publishable/README +0 -3
- data/vendor/converted2.3plugins_to_lib_leftovers/acts_as_publishable/Rakefile +0 -22
- data/vendor/converted2.3plugins_to_lib_leftovers/acts_as_publishable/generators/publishing/publishing_generator.rb +0 -34
- data/vendor/converted2.3plugins_to_lib_leftovers/acts_as_publishable/generators/publishing/templates/migration.rb +0 -13
- data/vendor/converted2.3plugins_to_lib_leftovers/acts_as_publishable/install.rb +0 -3
- data/vendor/converted2.3plugins_to_lib_leftovers/acts_as_publishable/test/acts_as_publishable_test.rb +0 -8
- data/vendor/converted2.3plugins_to_lib_leftovers/acts_as_publishable/uninstall.rb +0 -1
- data/vendor/converted2.3plugins_to_lib_leftovers/resource_feeder/README +0 -4
- data/vendor/converted2.3plugins_to_lib_leftovers/resource_feeder/Rakefile +0 -22
- data/vendor/converted2.3plugins_to_lib_leftovers/resource_feeder/test/atom_feed_test.rb +0 -85
- data/vendor/converted2.3plugins_to_lib_leftovers/resource_feeder/test/rss_feed_test.rb +0 -61
- data/vendor/converted2.3plugins_to_lib_leftovers/resource_feeder/test/test_helper.rb +0 -60
- data/vendor/converted2.3plugins_to_lib_leftovers/white_list/README +0 -35
- data/vendor/converted2.3plugins_to_lib_leftovers/white_list/Rakefile +0 -22
- data/vendor/converted2.3plugins_to_lib_leftovers/white_list/test/white_list_test.rb +0 -120
@@ -0,0 +1,20 @@
|
|
1
|
+
$.remove_rte = ->
|
2
|
+
try
|
3
|
+
for i of CKEDITOR.instances
|
4
|
+
do (i) ->
|
5
|
+
CKEDITOR.instances[i].destroy(true) if CKEDITOR.instances[i]
|
6
|
+
catch error
|
7
|
+
console.log "Error: #{error}"
|
8
|
+
|
9
|
+
|
10
|
+
$.save_rte = ->
|
11
|
+
try
|
12
|
+
for i of CKEDITOR.instances
|
13
|
+
do (i) ->
|
14
|
+
CKEDITOR.instances[i].updateElement() if CKEDITOR.instances[i]
|
15
|
+
catch error
|
16
|
+
console.log "Error: #{error}"
|
17
|
+
|
18
|
+
|
19
|
+
$(document).on 'page:receive', ->
|
20
|
+
$.remove_rte()
|
@@ -0,0 +1,14 @@
|
|
1
|
+
$.rte_posts = ->
|
2
|
+
try
|
3
|
+
CKEDITOR.replaceAll (textarea, config) ->
|
4
|
+
config.customConfig = window['CKEDITOR_BASEPATH'] + '/configs/posts.js'
|
5
|
+
if $(textarea).hasClass("rich_text_editor") and $(textarea).attr("name") in ["post[raw_post]", 'page[body]', 'homepage_feature[description\]', 'user[description]', 'sb_post[body]']
|
6
|
+
true
|
7
|
+
else
|
8
|
+
false
|
9
|
+
catch error
|
10
|
+
console.log "Error: #{error}"
|
11
|
+
|
12
|
+
|
13
|
+
$(document).ready ->
|
14
|
+
$.rte_posts()
|
@@ -6,147 +6,138 @@
|
|
6
6
|
//= require jquery_ujs
|
7
7
|
//= require jquery-ui
|
8
8
|
//= require bootstrap-sprockets
|
9
|
+
//= require jquery.turbolinks
|
10
|
+
//= require turbolinks
|
9
11
|
//
|
10
12
|
///////////////////////////////////////////
|
11
13
|
// UTILITIES //
|
12
14
|
///////////////////////////////////////////
|
13
|
-
//= require
|
14
|
-
|
15
|
-
(function($){
|
16
|
-
|
17
|
-
$.CE = {};
|
18
|
-
|
19
|
-
jQuery.fn.RichTextEditor = function (options) {
|
20
|
-
$this = $(this);
|
21
|
-
// fix tinymce bug with html5 and required fields
|
22
|
-
if($this.is("[required]")){
|
23
|
-
options.oninit = function(editor){
|
24
|
-
$this.closest("form").find(":submit").on("click", function(){
|
25
|
-
editor.save();
|
26
|
-
});
|
27
|
-
}
|
28
|
-
}
|
29
|
-
$this.tinymce(options);
|
30
|
-
}
|
15
|
+
//= require ckeditor/init
|
16
|
+
//= require_directory ./ckeditor/rte
|
31
17
|
|
32
|
-
jQuery.fn.scrollTo = function () {
|
33
|
-
space_at_top = $('.navbar').height() + 20;
|
34
|
-
$('html,body').animate({scrollTop: $(this).offset().top - space_at_top},'slow');
|
35
|
-
}
|
36
18
|
|
37
|
-
|
38
|
-
updateElementFromUrl($(this), url_to_load);
|
39
|
-
setInterval(
|
40
|
-
function() {
|
41
|
-
$(this).updateFromUrl(url_to_load);
|
42
|
-
},
|
43
|
-
frequency
|
44
|
-
);
|
45
|
-
}
|
19
|
+
Turbolinks.enableProgressBar();
|
46
20
|
|
47
|
-
|
48
|
-
element = this;
|
49
|
-
$.get(url_to_load, function(data) {
|
50
|
-
$(element).html(data);
|
51
|
-
});
|
52
|
-
}
|
21
|
+
$.CE = {};
|
53
22
|
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
$.ajax({
|
59
|
-
type: 'POST',
|
60
|
-
data: {'_method': 'delete'},
|
61
|
-
beforeSend: function(xhr, settings) {
|
62
|
-
xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script);
|
63
|
-
},
|
64
|
-
url: $(this).attr('href') + '.js',
|
65
|
-
dataType: 'script',
|
66
|
-
success: function(response) {
|
67
|
-
if(response) {
|
68
|
-
console.log('Return script received.');
|
69
|
-
} else {
|
70
|
-
console.log('Failed to receive return script.');
|
71
|
-
}
|
72
|
-
},
|
73
|
-
error: logError
|
74
|
-
});
|
75
|
-
}
|
76
|
-
})
|
77
|
-
|
78
|
-
$(document).on('submit', '.submit-via-ajax', function(event){
|
79
|
-
event.preventDefault();
|
80
|
-
submitViaAjax($(this));
|
81
|
-
});
|
23
|
+
jQuery.fn.scrollTo = function () {
|
24
|
+
space_at_top = $('.navbar').height() + 20;
|
25
|
+
$('html,body').animate({scrollTop: $(this).offset().top - space_at_top},'slow');
|
26
|
+
}
|
82
27
|
|
83
|
-
|
84
|
-
|
85
|
-
|
28
|
+
jQuery.fn.keepUpdatedFromUrl = function (url_to_load, frequency) {
|
29
|
+
updateElementFromUrl($(this), url_to_load);
|
30
|
+
setInterval(
|
31
|
+
function() {
|
32
|
+
$(this).updateFromUrl(url_to_load);
|
33
|
+
},
|
34
|
+
frequency
|
35
|
+
);
|
36
|
+
}
|
86
37
|
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
$(
|
91
|
-
$.ajax({
|
92
|
-
type: $(this).attr('method'),
|
93
|
-
url: $(this).attr('href').replace('?', '.js?'),
|
94
|
-
dataType: 'script',
|
95
|
-
success: function(response) {
|
96
|
-
if(response) {
|
97
|
-
console.log('Return script received.');
|
98
|
-
} else {
|
99
|
-
console.log('Failed to receive return script.');
|
100
|
-
}
|
101
|
-
},
|
102
|
-
error: logError
|
103
|
-
});
|
38
|
+
jQuery.fn.updateFromUrl = function(url_to_load) {
|
39
|
+
element = this;
|
40
|
+
$.get(url_to_load, function(data) {
|
41
|
+
$(element).html(data);
|
104
42
|
});
|
43
|
+
}
|
105
44
|
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
$('#'+ $this.attr('id') + '_spinner').removeClass('hide');
|
111
|
-
if($this.is("input") || $this.is("button")) {
|
112
|
-
action = $this.closest('form').attr('action');
|
113
|
-
method = $this.closest('form').attr('method');
|
114
|
-
} else if ($this.is("a")) {
|
115
|
-
action = $this.attr('href');
|
116
|
-
method = $this.attr('data-method');
|
117
|
-
} else {
|
118
|
-
console.log('Could not identify element type.');
|
119
|
-
return false;
|
120
|
-
}
|
45
|
+
$(document).on('click', '.delete-via-ajax', function(event){
|
46
|
+
event.preventDefault();
|
47
|
+
if(confirm($(this).attr('data-manual-confirm'))) {
|
48
|
+
console.log('Attempting to delete via AJAX...');
|
121
49
|
$.ajax({
|
122
|
-
type:
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
if(response) {
|
127
|
-
$this.effect("pulsate", { times:1 }, 250);
|
128
|
-
$this.replaceWith(response);
|
129
|
-
$('#' + $this.attr('id')).effect("pulsate", { times:2 }, 500);
|
130
|
-
} else {
|
131
|
-
console.log('Failed to receive return script.');
|
132
|
-
}
|
50
|
+
type: 'POST',
|
51
|
+
data: {'_method': 'delete'},
|
52
|
+
beforeSend: function(xhr, settings) {
|
53
|
+
xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script);
|
133
54
|
},
|
134
|
-
|
55
|
+
url: $(this).attr('href') + '.js',
|
56
|
+
dataType: 'script',
|
57
|
+
success: function(response) {
|
58
|
+
if(response) {
|
59
|
+
console.log('Return script received.');
|
60
|
+
} else {
|
61
|
+
console.log('Failed to receive return script.');
|
62
|
+
}
|
63
|
+
},
|
64
|
+
error: logError
|
135
65
|
});
|
136
|
-
}
|
66
|
+
}
|
67
|
+
})
|
68
|
+
|
69
|
+
$(document).on('submit', '.submit-via-ajax', function(event){
|
70
|
+
event.preventDefault();
|
71
|
+
submitViaAjax($(this));
|
72
|
+
});
|
137
73
|
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
74
|
+
$('.submit-via-ajax').on('form-pre-serialize', function(e) {
|
75
|
+
$.save_rte();
|
76
|
+
});
|
77
|
+
|
78
|
+
$(document).on('click', '.edit-via-ajax', function(event){
|
79
|
+
event.preventDefault();
|
80
|
+
console.log('Attempting to retrieve edit form via AJAX...');
|
81
|
+
$('#'+ $(this).attr('id') + '_spinner').removeClass('hide');
|
82
|
+
$.ajax({
|
83
|
+
type: $(this).attr('method'),
|
84
|
+
url: $(this).attr('href').replace('?', '.js?'),
|
85
|
+
dataType: 'script',
|
86
|
+
success: function(response) {
|
87
|
+
if(response) {
|
88
|
+
console.log('Return script received.');
|
89
|
+
} else {
|
90
|
+
console.log('Failed to receive return script.');
|
91
|
+
}
|
92
|
+
},
|
93
|
+
error: logError
|
147
94
|
});
|
95
|
+
});
|
96
|
+
|
97
|
+
$(document).on('click', '.act-via-ajax', function(event){
|
98
|
+
event.preventDefault();
|
99
|
+
console.log('Attempting to act via AJAX...');
|
100
|
+
$this = $(this);
|
101
|
+
$('#'+ $this.attr('id') + '_spinner').removeClass('hide');
|
102
|
+
if($this.is("input") || $this.is("button")) {
|
103
|
+
action = $this.closest('form').attr('action');
|
104
|
+
method = $this.closest('form').attr('method');
|
105
|
+
} else if ($this.is("a")) {
|
106
|
+
action = $this.attr('href');
|
107
|
+
method = $this.attr('data-method');
|
108
|
+
} else {
|
109
|
+
console.log('Could not identify element type.');
|
110
|
+
return false;
|
111
|
+
}
|
112
|
+
$.ajax({
|
113
|
+
type: method,
|
114
|
+
url: action.replace('?', '.js?'),
|
115
|
+
dataType: 'js',
|
116
|
+
success: function(response) {
|
117
|
+
if(response) {
|
118
|
+
$this.effect("pulsate", { times:1 }, 250);
|
119
|
+
$this.replaceWith(response);
|
120
|
+
$('#' + $this.attr('id')).effect("pulsate", { times:2 }, 500);
|
121
|
+
} else {
|
122
|
+
console.log('Failed to receive return script.');
|
123
|
+
}
|
124
|
+
},
|
125
|
+
error: logError
|
126
|
+
});
|
127
|
+
});
|
128
|
+
|
129
|
+
$(document).on('click', '.check-all', function(e){
|
130
|
+
e.preventDefault();
|
131
|
+
first_val = $(this).closest('form').find(':checkbox').attr('checked');
|
132
|
+
if(first_val) {
|
133
|
+
new_val = false
|
134
|
+
} else {
|
135
|
+
new_val = 'checked'
|
136
|
+
}
|
137
|
+
$(this).closest('form').find(':checkbox').attr('checked', new_val);
|
138
|
+
});
|
139
|
+
|
148
140
|
|
149
|
-
})(jQuery);
|
150
141
|
|
151
142
|
|
152
143
|
function updateElementFromPost(element, url_to_load) {
|
File without changes
|
File without changes
|
File without changes
|
@@ -0,0 +1,27 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
// SASS variable overrides must be declared before loading up Active Admin's styles.
|
4
|
+
//
|
5
|
+
// To view the variables that Active Admin provides, take a look at
|
6
|
+
// `app/assets/stylesheets/active_admin/mixins/_variables.css.scss` in the
|
7
|
+
// Active Admin source.
|
8
|
+
//
|
9
|
+
// For example, to change the sidebar width:
|
10
|
+
// $sidebar-width: 242px;
|
11
|
+
|
12
|
+
// Active Admin's got SASS!
|
13
|
+
@import "active_admin/mixins";
|
14
|
+
@import "active_admin/base";
|
15
|
+
@import 'tag-it/tag-it';
|
16
|
+
@import 'tag-it/tagit.ui-zendesk';
|
17
|
+
|
18
|
+
// Overriding any non-variable SASS must be done after the fact.
|
19
|
+
// For example, to change the default status-tag color:
|
20
|
+
//
|
21
|
+
// .status_tag { background: #6090DB; }
|
22
|
+
|
23
|
+
|
24
|
+
.cke_chrome {
|
25
|
+
width: 79.5% !important;
|
26
|
+
overflow: hidden;
|
27
|
+
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,9 +1,9 @@
|
|
1
1
|
class ActivitiesController < BaseController
|
2
|
-
|
3
|
-
|
2
|
+
before_action :login_required, :except => :index
|
3
|
+
before_action :find_user, :only => :network
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
before_action :require_current_user, :except => [:index, :destroy]
|
6
|
+
before_action :require_ownership_or_moderator, :only => :destroy
|
7
7
|
|
8
8
|
|
9
9
|
def network
|
@@ -1,13 +1,8 @@
|
|
1
1
|
class AlbumsController < BaseController
|
2
2
|
include Viewable
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
uses_tiny_mce do
|
8
|
-
{:only => [:show], :options => configatron.simple_mce_options}
|
9
|
-
end
|
10
|
-
|
3
|
+
before_action :login_required, :except => [:show]
|
4
|
+
before_action :find_user, :only => [:new, :edit, :index]
|
5
|
+
before_action :require_current_user, :only => [:new, :edit, :update, :destroy, :create]
|
11
6
|
|
12
7
|
# GET /albums/1
|
13
8
|
# GET /albums/1.xml
|
@@ -15,13 +10,13 @@ class AlbumsController < BaseController
|
|
15
10
|
@album = Album.find(params[:id])
|
16
11
|
update_view_count(@album) if current_user && current_user.id != @album.user_id
|
17
12
|
@album_photos = @album.photos.page(params[:page]).per(10)
|
18
|
-
|
13
|
+
|
19
14
|
respond_to do |format|
|
20
15
|
format.html # show.html.erb
|
21
16
|
format.xml { render :xml => @album }
|
22
17
|
end
|
23
18
|
end
|
24
|
-
|
19
|
+
|
25
20
|
|
26
21
|
|
27
22
|
# GET /albums/new
|
@@ -45,18 +40,18 @@ class AlbumsController < BaseController
|
|
45
40
|
def create
|
46
41
|
@album = Album.new(album_params)
|
47
42
|
@album.user_id = current_user.id
|
48
|
-
|
43
|
+
|
49
44
|
respond_to do |format|
|
50
45
|
if @album.save
|
51
46
|
if params[:go_to] == 'only_create'
|
52
|
-
flash[:notice] = :album_was_successfully_created.l
|
53
|
-
format.html { redirect_to(user_photo_manager_index_path(current_user)) }
|
47
|
+
flash[:notice] = :album_was_successfully_created.l
|
48
|
+
format.html { redirect_to(user_photo_manager_index_path(current_user)) }
|
54
49
|
else
|
55
50
|
format.html { redirect_to(new_user_album_photo_path(current_user, @album)) }
|
56
51
|
end
|
57
52
|
else
|
58
53
|
format.html { render :action => 'new' }
|
59
|
-
end
|
54
|
+
end
|
60
55
|
end
|
61
56
|
end
|
62
57
|
|
@@ -82,7 +77,7 @@ class AlbumsController < BaseController
|
|
82
77
|
|
83
78
|
# DELETE /albums/1
|
84
79
|
# DELETE /albums/1.xml
|
85
|
-
def destroy
|
80
|
+
def destroy
|
86
81
|
@album = Album.find(params[:id])
|
87
82
|
@album.destroy
|
88
83
|
|
@@ -91,11 +86,11 @@ class AlbumsController < BaseController
|
|
91
86
|
format.xml { head :ok }
|
92
87
|
end
|
93
88
|
end
|
94
|
-
|
89
|
+
|
95
90
|
def add_photos
|
96
91
|
@album = Album.find(params[:id])
|
97
92
|
end
|
98
|
-
|
93
|
+
|
99
94
|
def photos_added
|
100
95
|
@album = Album.find(params[:id])
|
101
96
|
@album.photo_ids = params[:album][:photos_ids].uniq
|
@@ -108,5 +103,5 @@ class AlbumsController < BaseController
|
|
108
103
|
def album_params
|
109
104
|
params[:album].permit(:title, :description)
|
110
105
|
end
|
111
|
-
|
106
|
+
|
112
107
|
end
|