community_engine 3.0.0 → 3.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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,15 @@
|
|
|
1
|
+
|
|
2
|
+
#fileupload.gal-holder
|
|
3
|
+
.gal-item
|
|
4
|
+
.fileupload-button.gal-upload-holder
|
|
5
|
+
= link_to I18n.t(:upload, :scope => [:ckeditor, :buttons]), 'javascript:void(0)', :class => "add"
|
|
6
|
+
.fileupload-list
|
|
7
|
+
= render :partial => 'ckeditor/shared/asset', :collection => @pictures
|
|
8
|
+
|
|
9
|
+
#pagination{style: 'clear:both;'}
|
|
10
|
+
= paginate @pictures
|
|
11
|
+
|
|
12
|
+
:javascript
|
|
13
|
+
#{Ckeditor::Utils.js_fileuploader('image')}
|
|
14
|
+
|
|
15
|
+
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
= content_tag(:div, id: dom_id(asset), class: "gal-item", data: {url: image_path(asset.photo.url)} ) do
|
|
2
|
+
.fileupload-file.gal-inner-holder
|
|
3
|
+
.img
|
|
4
|
+
= image_tag(asset.photo.url(:thumb), :title => asset.photo_file_name, :id => "photo-#{asset.id}")
|
|
5
|
+
.img-data
|
|
6
|
+
.img-name= asset.photo_file_name
|
|
7
|
+
.time-size
|
|
8
|
+
.time= asset.created_at
|
|
9
|
+
.fileupload-size.size= number_to_human_size(asset.photo_file_size) if asset.photo_file_size
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script id="fileupload_tmpl" type="text/x-jquery-tmpl">
|
|
2
|
+
<div id="asset_${id}" class="gal-item" data-url="${url_content}">
|
|
3
|
+
<div class="fileupload-file gal-inner-holder">
|
|
4
|
+
<div class="img"><img src="${url_thumb}" title="${filename}"></div>
|
|
5
|
+
<div class="img-data">
|
|
6
|
+
<div class="img-name">${filename}</div>
|
|
7
|
+
<div class="time-size">
|
|
8
|
+
<div class="time">${format_created_at}</div>
|
|
9
|
+
<div class="fileupload-size size">${size}</div>
|
|
10
|
+
</div>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
14
|
+
</script>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
$$('#
|
|
1
|
+
$$('#comment-#{@comment.id} .approve a').invoke('hide');
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
<% end %>
|
|
9
9
|
|
|
10
10
|
$('#newest_comment').after("<%= escape_javascript(render(:partial => 'comments/comment', :formats => [:html], :locals => {:comment => @comment})) %>");
|
|
11
|
-
|
|
11
|
+
CKEDITOR.instances.comment_comment.setData('')
|
|
12
12
|
$('#comment-<%= @comment.id.to_s %>').scrollTo();
|
|
13
13
|
<% end %>
|
|
14
14
|
|
|
@@ -3,7 +3,8 @@
|
|
|
3
3
|
<% else %>
|
|
4
4
|
$('#comment-<%= @comment.id %>').html("<%= escape_javascript(render :partial => 'comments/edit_form', :locals => {:comment => @comment}) %>");
|
|
5
5
|
$('#comment-<%= @comment.id %>').scrollTo();
|
|
6
|
-
|
|
6
|
+
$.remove_rte()
|
|
7
|
+
$.rte_comments()
|
|
7
8
|
<% end %>
|
|
8
9
|
|
|
9
10
|
if (typeof($.CE.commentUpdatedCallback) != 'undefined'){
|
|
@@ -2,6 +2,6 @@
|
|
|
2
2
|
%h3= :subscribe_to.l + ' ' + :events.l
|
|
3
3
|
%p= :subscribe_events_instructions.l
|
|
4
4
|
.icon_row
|
|
5
|
-
= link_to image_tag('
|
|
5
|
+
= link_to image_tag('icons/ical.gif'), ical_events_url(:protocol => 'webcal://', :format=>'ics')
|
|
6
6
|
= link_to image_tag("http://www.google.com/calendar/images/ext/gc_button1.gif"), "http://www.google.com/calendar/render?cid=#{ical_events_url(:format=>'ics')}", :target=>'_blank'
|
|
7
7
|
|
|
@@ -38,18 +38,22 @@
|
|
|
38
38
|
%td
|
|
39
39
|
- icon, color, post = icon_and_color_and_post_for topic
|
|
40
40
|
|
|
41
|
-
-
|
|
42
|
-
%span.badge
|
|
41
|
+
-if recent_topic_activity(topic)
|
|
42
|
+
%span.badge
|
|
43
43
|
=fa_icon "fire inverse"
|
|
44
44
|
%td
|
|
45
45
|
-if topic.sticky?
|
|
46
|
-
=:sticky.l
|
|
47
46
|
%strong
|
|
48
47
|
= link_to h(topic.title), forum_topic_path(@forum, topic), :class => "entry-title", :rel => "bookmark"
|
|
48
|
+
.pull-right
|
|
49
|
+
=fa_icon "thumb-tack fw"
|
|
49
50
|
-else
|
|
50
51
|
= link_to h(topic.title), forum_topic_path(@forum, topic), :class => "entry-title", :rel => "bookmark"
|
|
51
|
-
-
|
|
52
|
+
-if topic.paged?
|
|
52
53
|
%small= link_to :last.l, forum_topic_path(:forum_id => @forum, :id => topic, :page => topic.last_page)
|
|
54
|
+
-if topic.locked?
|
|
55
|
+
.pull-right
|
|
56
|
+
=fa_icon "lock fw"
|
|
53
57
|
%td= topic.sb_posts_count
|
|
54
58
|
%td= number_with_delimiter(topic.views)
|
|
55
59
|
%td
|
|
@@ -73,6 +73,10 @@
|
|
|
73
73
|
|
|
74
74
|
-content_for :end_javascript do
|
|
75
75
|
:javascript
|
|
76
|
+
$.ajax({
|
|
77
|
+
type: "PATCH",
|
|
78
|
+
url: "#{update_views_user_post_path(@post.user, @post)}",
|
|
79
|
+
});
|
|
76
80
|
$('.email').on('click', function(e){
|
|
77
81
|
e.preventDefault();
|
|
78
82
|
$.post("#{send_to_friend_user_post_path(:user_id => @user.id, :id => @post.id)}", function(response){
|
|
@@ -2,8 +2,7 @@ console.log("configuring " + $('edit_post'));
|
|
|
2
2
|
$('edit_post').observe("ajax:before", function () {
|
|
3
3
|
console.log("Submitting");
|
|
4
4
|
$('editbox_spinner').show();
|
|
5
|
-
|
|
6
|
-
console.log( "Returning " + tinyMCE.get('edit_post_body').save());
|
|
5
|
+
$.save_rte
|
|
7
6
|
console.log("saved");
|
|
8
7
|
return false;
|
|
9
8
|
});
|
|
@@ -11,4 +10,4 @@ console.log("Setting button " + $('cancelButton'));
|
|
|
11
10
|
$('cancelButton').observe('click', function () {
|
|
12
11
|
EditForm.cancel();
|
|
13
12
|
return false;
|
|
14
|
-
});
|
|
13
|
+
});
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
$('new_post').observe("ajax:before", function () {
|
|
2
2
|
console.log("Submitting");
|
|
3
3
|
$('editbox_spinner').show();
|
|
4
|
-
|
|
5
|
-
console.log( "Returning " + tinyMCE.get('edit_post_body').save());
|
|
6
|
-
console.log("saved");
|
|
4
|
+
$.save_rte
|
|
7
5
|
return false;
|
|
8
6
|
});
|
|
9
7
|
console.log("Setting button");
|
|
10
8
|
$('cancelButton').observe('click', function () {
|
|
11
9
|
$('reply').hide();
|
|
12
10
|
return false;
|
|
13
|
-
});
|
|
11
|
+
});
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
%tr
|
|
2
|
-
|
|
2
|
+
|
|
3
3
|
%td{:id=>"post-body-#{post.id}"}
|
|
4
4
|
.editable
|
|
5
5
|
- if logged_in?
|
|
@@ -10,23 +10,24 @@
|
|
|
10
10
|
%td.col-sm-3{:style => 'border-left:0'}
|
|
11
11
|
%ul.list-unstyled
|
|
12
12
|
-if post.user
|
|
13
|
-
%li= link_to avatar_for(post.user), post.user
|
|
13
|
+
%li= link_to avatar_for(post.user), post.user
|
|
14
14
|
%li= link_to truncate(h(post.username), :length => 15), user_path(post.user), :class => (post.topic.editable_by?(post.user) ? "admin" : nil)
|
|
15
15
|
%li
|
|
16
16
|
= :post.l.pluralize
|
|
17
17
|
%span.badge.badge-info
|
|
18
18
|
=post.user.sb_posts_count
|
|
19
19
|
-else
|
|
20
|
-
%li= image_tag(configatron.photo.missing_thumb, :class => 'thumbnail')
|
|
20
|
+
%li= image_tag(configatron.photo.missing_thumb, :class => 'thumbnail')
|
|
21
21
|
%li= truncate(h(post.username), :length => 15)
|
|
22
22
|
%li
|
|
23
23
|
%a{"href"=>"##{post.dom_id}", "rel"=>"bookmark"}
|
|
24
24
|
%abbr.updated{"title"=>"#{post.created_at.xmlschema}"}= time_ago_in_words(post.created_at)
|
|
25
|
-
|
|
26
|
-
- if
|
|
25
|
+
|
|
26
|
+
- if policy(post).update?
|
|
27
27
|
%li
|
|
28
|
-
= ajax_spinner_for "edit-post-#{post.id}"
|
|
28
|
+
= ajax_spinner_for "edit-post-#{post.id}"
|
|
29
29
|
= link_to :edit_post.l, edit_forum_topic_sb_post_path(@forum, @topic, post), :class => 'edit-via-ajax', :id => "edit-post-#{post.id}"
|
|
30
|
+
|
|
30
31
|
- if admin? && post.user && !post.user.admin?
|
|
31
32
|
%li{"class"=>"make-moderator-#{post.user_id}"}
|
|
32
33
|
= render :partial => '/moderators/toggle', :locals => {:user => post.user, :forum => @forum}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<% if @post.new_record? %>
|
|
2
2
|
reply = $('.reply');
|
|
3
|
-
reply.prepend(
|
|
3
|
+
reply.prepend("<%=raw escape_javascript(render 'shared/messages') %>");
|
|
4
4
|
message = reply.find('.alert')
|
|
5
5
|
message.scrollTo();
|
|
6
6
|
<% else %>
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
editable.switchClass('alert alert-info','normal', 3000,'easeInCubic');
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
CKEDITOR.instances.sb_post_body.setData('')
|
|
22
22
|
|
|
23
23
|
reply.addClass('hide');
|
|
24
24
|
<% end %>
|
|
25
25
|
|
|
26
|
-
<% if configatron.has_key?(:recaptcha_pub_key) %>
|
|
26
|
+
<% if !logged_in? && configatron.has_key?(:recaptcha_pub_key) %>
|
|
27
27
|
if($('dynamic_recaptcha')){
|
|
28
|
-
Recaptcha.create('
|
|
28
|
+
Recaptcha.create('<%= configatron.recaptcha_pub_key %>', $('dynamic_recaptcha') )
|
|
29
29
|
}
|
|
30
30
|
<% end %>
|
|
@@ -5,7 +5,8 @@ editable = post.find('.editable');
|
|
|
5
5
|
editable.addClass('hide');
|
|
6
6
|
editor.html("<%= escape_javascript(render :partial => 'sb_posts/edit', :locals => {:post => @post}) %>");
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
$.remove_rte()
|
|
9
|
+
$.rte_posts();
|
|
9
10
|
|
|
10
11
|
post.scrollTo();
|
|
11
12
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
-if logged_in?
|
|
2
2
|
- if !current_page?(users_path) && (params[:controller] == 'users' && !@user.nil? && @user == current_user)
|
|
3
3
|
- css_class = 'active'
|
|
4
|
-
- else
|
|
4
|
+
- else
|
|
5
5
|
- css_class = 'inactive'
|
|
6
6
|
%li{:class => 'dropdown ' + css_class}
|
|
7
|
-
%a.dropdown-toggle{:href=>dashboard_user_path(current_user), 'data-target'=> '#', 'data-toggle' => 'dropdown'}
|
|
7
|
+
%a.dropdown-toggle{:href=>dashboard_user_path(current_user), 'data-target'=> '#', 'data-toggle' => 'dropdown', "data-no-turbolink" => true}
|
|
8
8
|
=:logged_in.l + ' ' + current_user.login
|
|
9
9
|
%b.caret
|
|
10
|
-
%ul.dropdown-menu
|
|
10
|
+
%ul.dropdown-menu{"data-no-turbolink" => true}
|
|
11
11
|
-if current_user.admin?
|
|
12
12
|
%li= link_to :admin_dashboard.l, admin_dashboard_path
|
|
13
13
|
%li.divider
|
|
@@ -25,4 +25,4 @@
|
|
|
25
25
|
%li= link_to :log_out.l, logout_path
|
|
26
26
|
-else
|
|
27
27
|
%li= link_to(:log_in.l, login_path)
|
|
28
|
-
%li= link_to(:sign_up.l, signup_path)
|
|
28
|
+
%li= link_to(:sign_up.l, signup_path)
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
%p
|
|
5
5
|
=:dont_have_an_account.l
|
|
6
6
|
%br
|
|
7
|
-
= link_to :click_here_to_sign_up.l,
|
|
7
|
+
= link_to :click_here_to_sign_up.l, signup_path
|
|
8
8
|
%p
|
|
9
9
|
=:forgot_your_password.l
|
|
10
10
|
%br
|
|
@@ -12,4 +12,4 @@
|
|
|
12
12
|
%p
|
|
13
13
|
=:forgot_your_username.l
|
|
14
14
|
%br
|
|
15
|
-
= link_to :click_here_to_retrieve_it.l, forgot_username_url
|
|
15
|
+
= link_to :click_here_to_retrieve_it.l, forgot_username_url
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
%ul.list-unstyled
|
|
9
9
|
- @tags.each do |tag|
|
|
10
10
|
%li= link_to h(tag.name), tag_path(tag)
|
|
11
|
-
|
|
11
|
+
|
|
12
12
|
-if @related_tags.to_a.size > 0
|
|
13
13
|
-widget do
|
|
14
14
|
%h3=:related_tags.l
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
%p
|
|
18
18
|
= link_to fa_icon('plus-circle', :text => :all_tags.l), tags_path
|
|
19
19
|
|
|
20
|
-
.clearfix
|
|
20
|
+
.clearfix
|
|
21
21
|
- if @posts.any?
|
|
22
|
-
-unless params[:type]
|
|
22
|
+
-unless params[:type]
|
|
23
23
|
%h2=:posts.l
|
|
24
24
|
%ul
|
|
25
25
|
- @posts.each do |post|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
- if @topic.locked?
|
|
19
19
|
%h2= :locked2.l
|
|
20
20
|
|
|
21
|
-
- if
|
|
21
|
+
- if policy(@topic).update?
|
|
22
22
|
%p
|
|
23
23
|
= link_to :back.l, @forum, :class => 'btn btn-default'
|
|
24
24
|
= link_to :edit.l, edit_forum_topic_path(@forum, @topic), :class => "btn btn-warning"
|
|
@@ -42,6 +42,6 @@
|
|
|
42
42
|
%ul.list-unstyled
|
|
43
43
|
%li= link_to(:assume_user_id.l, assume_user_path(@user), {:method => :post} )
|
|
44
44
|
%li= link_to(:delete_this_user.l, user_path(@user), {:method => :delete, data: { confirm: :are_you_sure_you_want_to_permanently_delete_this_user.l }} )
|
|
45
|
-
%li= link_to("#{:toggle.l} #{:featured_writer.l}".html_safe, toggle_featured_user_path(@user), {:method => :
|
|
46
|
-
%li= link_to("#{:assign_role.l}: #{@user.moderator? ? :member.l : :moderator.l}".html_safe, toggle_moderator_user_path(@user), {:method => :
|
|
45
|
+
%li= link_to("#{:toggle.l} #{:featured_writer.l}".html_safe, toggle_featured_user_path(@user), {:method => :patch} )
|
|
46
|
+
%li= link_to("#{:assign_role.l}: #{@user.moderator? ? :member.l : :moderator.l}".html_safe, toggle_moderator_user_path(@user), {:method => :patch} )
|
|
47
47
|
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
=:after_signing_up_youll_receive_an_e_mail_confirmation_message.l
|
|
13
13
|
%p
|
|
14
14
|
=:click_the_activation_link_in_the_e_mail_to_log_in.l
|
|
15
|
-
%p= link_to :already_have_an_account.l,
|
|
15
|
+
%p= link_to :already_have_an_account.l, login_path
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
= bootstrap_form_for @user, :layout => :horizontal do |f|
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
%dd
|
|
66
66
|
= truncate_words(comment.comment, 10).html_safe
|
|
67
67
|
%br
|
|
68
|
-
= link_to "» ".html_safe + :view_comment.l, user_photo_path(@user, comment.commentable) + "#
|
|
68
|
+
= link_to "» ".html_safe + :view_comment.l, user_photo_path(@user, comment.commentable) + "#comment-#{comment.id}"
|
|
69
69
|
|
|
70
70
|
- unless @photos.empty?
|
|
71
71
|
.clearfix
|
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
%li= :see_you_back_here_in_a_short_while.l
|
|
6
6
|
|
|
7
7
|
%h2= :no_activation_email.l
|
|
8
|
-
= button_to :resend_my_activation_e_mail.l,
|
|
8
|
+
= button_to :resend_my_activation_e_mail.l, resend_activation_path(@user.to_param), :class => 'btn btn-primary'
|
data/community_engine.gemspec
CHANGED
|
@@ -6,7 +6,7 @@ require 'community_engine/version'
|
|
|
6
6
|
Gem::Specification.new do |s|
|
|
7
7
|
s.name = "community_engine"
|
|
8
8
|
s.version = CommunityEngine::Version::STRING
|
|
9
|
-
s.summary = "CommunityEngine for Rails 4"
|
|
9
|
+
s.summary = "CommunityEngine for Rails 4.1"
|
|
10
10
|
s.description = "CommunityEngine is a free, open-source social network platform for Ruby on Rails applications. Drop it into your new or existing application, and you’ll instantly have all the features of a basic community site."
|
|
11
11
|
s.homepage = "http://www.communityengine.org"
|
|
12
12
|
|
|
@@ -24,18 +24,20 @@ Gem::Specification.new do |s|
|
|
|
24
24
|
s.files = `git ls-files`.split("\n") rescue ''
|
|
25
25
|
s.test_files = `git ls-files -- {test}/*`.split("\n")
|
|
26
26
|
|
|
27
|
+
s.add_dependency "activeadmin", "~> 1.0.0.pre2"
|
|
28
|
+
s.add_dependency "pundit", "0.3.0"
|
|
27
29
|
s.add_dependency "actionpack-action_caching", ">= 0"
|
|
28
30
|
s.add_dependency "actionpack-page_caching", ">= 0"
|
|
29
31
|
s.add_dependency "acts_as_commentable", "~> 4.0.2"
|
|
30
32
|
s.add_dependency "acts_as_list", ">= 0.3.0"
|
|
31
|
-
s.add_dependency "acts-as-taggable-on", '~>
|
|
32
|
-
s.add_dependency "authlogic", "
|
|
33
|
-
s.add_dependency "aws-sdk", "
|
|
33
|
+
s.add_dependency "acts-as-taggable-on", '~> 3.4.4'
|
|
34
|
+
s.add_dependency "authlogic", "~> 3.4.6"
|
|
35
|
+
s.add_dependency "aws-sdk", "< 2.0"
|
|
34
36
|
s.add_dependency "bcrypt", ">= 0"
|
|
35
37
|
s.add_dependency "cocaine", "~> 0.5.1"
|
|
36
38
|
s.add_dependency "configatron", "~> 4.2.0"
|
|
37
39
|
s.add_dependency "dynamic_form", ">= 0"
|
|
38
|
-
s.add_dependency "friendly_id", "~> 5.
|
|
40
|
+
s.add_dependency "friendly_id", "~> 5.1.0"
|
|
39
41
|
s.add_dependency "haml", ">= 0"
|
|
40
42
|
s.add_dependency "hpricot", ">= 0"
|
|
41
43
|
s.add_dependency "htmlentities", ">= 0"
|
|
@@ -43,13 +45,13 @@ Gem::Specification.new do |s|
|
|
|
43
45
|
s.add_dependency "koala", "~> 1.6.0"
|
|
44
46
|
s.add_dependency "omniauth", "~> 1.1.4"
|
|
45
47
|
s.add_dependency "rails_autolink", ">= 0"
|
|
46
|
-
s.add_dependency "paperclip", "~> 3.
|
|
47
|
-
s.add_dependency "power_enum", "~> 2.
|
|
48
|
+
s.add_dependency "paperclip", "~> 4.3.0"
|
|
49
|
+
s.add_dependency "power_enum", "~> 2.7"
|
|
48
50
|
s.add_dependency "rack", ">= 1.5.2"
|
|
49
|
-
s.add_dependency "rails", "~> 4.
|
|
51
|
+
s.add_dependency "rails", "~> 4.1.0"
|
|
50
52
|
s.add_dependency "rails-observers", ">= 0"
|
|
51
53
|
s.add_dependency "rakismet", ">= 0"
|
|
52
|
-
s.add_dependency "ransack", "~> 1.
|
|
54
|
+
s.add_dependency "ransack", "~> 1.7.0"
|
|
53
55
|
s.add_dependency "recaptcha", ">= 0"
|
|
54
56
|
s.add_dependency "ri_cal", ">= 0"
|
|
55
57
|
s.add_dependency "sanitize", ">= 2.0.6"
|
|
@@ -58,8 +60,9 @@ Gem::Specification.new do |s|
|
|
|
58
60
|
s.add_dependency "font-awesome-rails", ">= 0"
|
|
59
61
|
s.add_dependency "jquery-rails", ">= 0"
|
|
60
62
|
s.add_dependency "jquery-ui-rails", "~> 5.0.0"
|
|
63
|
+
s.add_dependency "jquery-turbolinks"
|
|
64
|
+
s.add_dependency "turbolinks"
|
|
61
65
|
s.add_dependency "sass-rails", "~> 4.0.0"
|
|
62
66
|
s.add_dependency "sprockets", "~> 2.10.0"
|
|
63
|
-
s.add_dependency "
|
|
67
|
+
s.add_dependency "ckeditor", "~> 4.1.1"
|
|
64
68
|
end
|
|
65
|
-
|
|
@@ -0,0 +1,239 @@
|
|
|
1
|
+
module ActiveAdmin
|
|
2
|
+
class BaseController
|
|
3
|
+
include AuthenticatedSystem
|
|
4
|
+
end
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
ActiveAdmin.setup do |config|
|
|
8
|
+
# == Site Title
|
|
9
|
+
#
|
|
10
|
+
# Set the title that is displayed on the main layout
|
|
11
|
+
# for each of the active admin pages.
|
|
12
|
+
#
|
|
13
|
+
config.site_title = configatron.community_name
|
|
14
|
+
|
|
15
|
+
# Set the link url for the title. For example, to take
|
|
16
|
+
# users to your main site. Defaults to no link.
|
|
17
|
+
#
|
|
18
|
+
# config.site_title_link = "/"
|
|
19
|
+
|
|
20
|
+
# Set an optional image to be displayed for the header
|
|
21
|
+
# instead of a string (overrides :site_title)
|
|
22
|
+
#
|
|
23
|
+
# Note: Aim for an image that's 21px high so it fits in the header.
|
|
24
|
+
#
|
|
25
|
+
# config.site_title_image = "logo.png"
|
|
26
|
+
|
|
27
|
+
# == Default Namespace
|
|
28
|
+
#
|
|
29
|
+
# Set the default namespace each administration resource
|
|
30
|
+
# will be added to.
|
|
31
|
+
#
|
|
32
|
+
# eg:
|
|
33
|
+
# config.default_namespace = :hello_world
|
|
34
|
+
#
|
|
35
|
+
# This will create resources in the HelloWorld module and
|
|
36
|
+
# will namespace routes to /hello_world/*
|
|
37
|
+
#
|
|
38
|
+
# To set no namespace by default, use:
|
|
39
|
+
# config.default_namespace = false
|
|
40
|
+
#
|
|
41
|
+
# Default:
|
|
42
|
+
# config.default_namespace = :admin
|
|
43
|
+
#
|
|
44
|
+
# You can customize the settings for each namespace by using
|
|
45
|
+
# a namespace block. For example, to change the site title
|
|
46
|
+
# within a namespace:
|
|
47
|
+
#
|
|
48
|
+
# config.namespace :admin do |admin|
|
|
49
|
+
# admin.site_title = "Custom Admin Title"
|
|
50
|
+
# end
|
|
51
|
+
#
|
|
52
|
+
# This will ONLY change the title for the admin section. Other
|
|
53
|
+
# namespaces will continue to use the main "site_title" configuration.
|
|
54
|
+
|
|
55
|
+
# == User Authentication
|
|
56
|
+
#
|
|
57
|
+
# Active Admin will automatically call an authentication
|
|
58
|
+
# method in a before filter of all controller actions to
|
|
59
|
+
# ensure that there is a currently logged in admin user.
|
|
60
|
+
#
|
|
61
|
+
# This setting changes the method which Active Admin calls
|
|
62
|
+
# within the application controller.
|
|
63
|
+
config.authentication_method = :login_required
|
|
64
|
+
|
|
65
|
+
# == User Authorization
|
|
66
|
+
#
|
|
67
|
+
# Active Admin will automatically call an authorization
|
|
68
|
+
# method in a before filter of all controller actions to
|
|
69
|
+
# ensure that there is a user with proper rights. You can use
|
|
70
|
+
# CanCanAdapter or make your own. Please refer to documentation.
|
|
71
|
+
config.authorization_adapter = ActiveAdmin::PunditAdapter
|
|
72
|
+
|
|
73
|
+
# In case you prefer Pundit over other solutions you can here pass
|
|
74
|
+
# the name of default policy class. This policy will be used in every
|
|
75
|
+
# case when Pundit is unable to find suitable policy.
|
|
76
|
+
config.pundit_default_policy = "ApplicationPolicy"
|
|
77
|
+
|
|
78
|
+
# You can customize your CanCan Ability class name here.
|
|
79
|
+
# config.cancan_ability_class = "Ability"
|
|
80
|
+
|
|
81
|
+
# You can specify a method to be called on unauthorized access.
|
|
82
|
+
# This is necessary in order to prevent a redirect loop which happens
|
|
83
|
+
# because, by default, user gets redirected to Dashboard. If user
|
|
84
|
+
# doesn't have access to Dashboard, he'll end up in a redirect loop.
|
|
85
|
+
# Method provided here should be defined in application_controller.rb.
|
|
86
|
+
config.on_unauthorized_access = :access_denied
|
|
87
|
+
|
|
88
|
+
# == Current User
|
|
89
|
+
#
|
|
90
|
+
# Active Admin will associate actions with the current
|
|
91
|
+
# user performing them.
|
|
92
|
+
#
|
|
93
|
+
# This setting changes the method which Active Admin calls
|
|
94
|
+
# (within the application controller) to return the currently logged in user.
|
|
95
|
+
config.current_user_method = :current_user
|
|
96
|
+
|
|
97
|
+
# == Logging Out
|
|
98
|
+
#
|
|
99
|
+
# Active Admin displays a logout link on each screen. These
|
|
100
|
+
# settings configure the location and method used for the link.
|
|
101
|
+
#
|
|
102
|
+
# This setting changes the path where the link points to. If it's
|
|
103
|
+
# a string, the strings is used as the path. If it's a Symbol, we
|
|
104
|
+
# will call the method to return the path.
|
|
105
|
+
#
|
|
106
|
+
# Default:
|
|
107
|
+
config.logout_link_path = :logout_path
|
|
108
|
+
|
|
109
|
+
# This setting changes the http method used when rendering the
|
|
110
|
+
# link. For example :get, :delete, :put, etc..
|
|
111
|
+
#
|
|
112
|
+
# Default:
|
|
113
|
+
# config.logout_link_method = :get
|
|
114
|
+
|
|
115
|
+
# == Root
|
|
116
|
+
#
|
|
117
|
+
# Set the action to call for the root path. You can set different
|
|
118
|
+
# roots for each namespace.
|
|
119
|
+
#
|
|
120
|
+
# Default:
|
|
121
|
+
# config.root_to = 'dashboard#index'
|
|
122
|
+
|
|
123
|
+
# == Admin Comments
|
|
124
|
+
#
|
|
125
|
+
# This allows your users to comment on any resource registered with Active Admin.
|
|
126
|
+
#
|
|
127
|
+
# You can completely disable comments:
|
|
128
|
+
config.comments = false
|
|
129
|
+
#
|
|
130
|
+
# You can disable the menu item for the comments index page:
|
|
131
|
+
# config.show_comments_in_menu = false
|
|
132
|
+
#
|
|
133
|
+
# You can change the name under which comments are registered:
|
|
134
|
+
config.comments_registration_name = 'AdminComment'
|
|
135
|
+
|
|
136
|
+
# == Batch Actions
|
|
137
|
+
#
|
|
138
|
+
# Enable and disable Batch Actions
|
|
139
|
+
#
|
|
140
|
+
config.batch_actions = true
|
|
141
|
+
|
|
142
|
+
# == Controller Filters
|
|
143
|
+
#
|
|
144
|
+
# You can add before, after and around filters to all of your
|
|
145
|
+
# Active Admin resources and pages from here.
|
|
146
|
+
#
|
|
147
|
+
# config.before_filter :do_something_awesome
|
|
148
|
+
|
|
149
|
+
# == Setting a Favicon
|
|
150
|
+
#
|
|
151
|
+
# config.favicon = '/assets/favicon.ico'
|
|
152
|
+
|
|
153
|
+
# == Removing Breadcrumbs
|
|
154
|
+
#
|
|
155
|
+
# Breadcrumbs are enabled by default. You can customize them for individual
|
|
156
|
+
# resources or you can disable them globally from here.
|
|
157
|
+
#
|
|
158
|
+
# config.breadcrumb = false
|
|
159
|
+
|
|
160
|
+
# == Register Stylesheets & Javascripts
|
|
161
|
+
#
|
|
162
|
+
# We recommend using the built in Active Admin layout and loading
|
|
163
|
+
# up your own stylesheets / javascripts to customize the look
|
|
164
|
+
# and feel.
|
|
165
|
+
#
|
|
166
|
+
# To load a stylesheet:
|
|
167
|
+
# config.register_stylesheet 'my_stylesheet.css'
|
|
168
|
+
#
|
|
169
|
+
# You can provide an options hash for more control, which is passed along to stylesheet_link_tag():
|
|
170
|
+
# config.register_stylesheet 'my_print_stylesheet.css', media: :print
|
|
171
|
+
#
|
|
172
|
+
# To load a javascript file:
|
|
173
|
+
# config.register_javascript 'my_javascript.js'
|
|
174
|
+
|
|
175
|
+
# == CSV options
|
|
176
|
+
#
|
|
177
|
+
# Set the CSV builder separator
|
|
178
|
+
# config.csv_options = { col_sep: ';' }
|
|
179
|
+
#
|
|
180
|
+
# Force the use of quotes
|
|
181
|
+
# config.csv_options = { force_quotes: true }
|
|
182
|
+
|
|
183
|
+
# == Menu System
|
|
184
|
+
#
|
|
185
|
+
# You can add a navigation menu to be used in your application, or configure a provided menu
|
|
186
|
+
#
|
|
187
|
+
# To change the default utility navigation to show a link to your website & a logout btn
|
|
188
|
+
#
|
|
189
|
+
# config.namespace :admin do |admin|
|
|
190
|
+
# admin.build_menu :utility_navigation do |menu|
|
|
191
|
+
# menu.add label: "My Great Website", url: "http://www.mygreatwebsite.com", html_options: { target: :blank }
|
|
192
|
+
# admin.add_logout_button_to_menu menu
|
|
193
|
+
# end
|
|
194
|
+
# end
|
|
195
|
+
#
|
|
196
|
+
# If you wanted to add a static menu item to the default menu provided:
|
|
197
|
+
#
|
|
198
|
+
# config.namespace :admin do |admin|
|
|
199
|
+
# admin.build_menu :default do |menu|
|
|
200
|
+
# menu.add label: "My Great Website", url: "http://www.mygreatwebsite.com", html_options: { target: :blank }
|
|
201
|
+
# end
|
|
202
|
+
# end
|
|
203
|
+
|
|
204
|
+
# == Download Links
|
|
205
|
+
#
|
|
206
|
+
# You can disable download links on resource listing pages,
|
|
207
|
+
# or customize the formats shown per namespace/globally
|
|
208
|
+
#
|
|
209
|
+
# To disable/customize for the :admin namespace:
|
|
210
|
+
#
|
|
211
|
+
# config.namespace :admin do |admin|
|
|
212
|
+
#
|
|
213
|
+
# # Disable the links entirely
|
|
214
|
+
# admin.download_links = false
|
|
215
|
+
#
|
|
216
|
+
# # Only show XML & PDF options
|
|
217
|
+
# admin.download_links = [:xml, :pdf]
|
|
218
|
+
#
|
|
219
|
+
# # Enable/disable the links based on block
|
|
220
|
+
# # (for example, with cancan)
|
|
221
|
+
# admin.download_links = proc { can?(:view_download_links) }
|
|
222
|
+
#
|
|
223
|
+
# end
|
|
224
|
+
|
|
225
|
+
# == Pagination
|
|
226
|
+
#
|
|
227
|
+
# Pagination is enabled by default for all resources.
|
|
228
|
+
# You can control the default per page count for all resources here.
|
|
229
|
+
#
|
|
230
|
+
# config.default_per_page = 30
|
|
231
|
+
|
|
232
|
+
# == Filters
|
|
233
|
+
#
|
|
234
|
+
# By default the index screen includes a "Filters" sidebar on the right
|
|
235
|
+
# hand side with a filter for each attribute of the registered model.
|
|
236
|
+
# You can enable or disable them for all resources here.
|
|
237
|
+
#
|
|
238
|
+
# config.filters = true
|
|
239
|
+
end
|