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
@@ -1,35 +0,0 @@
|
|
1
|
-
class StatisticsController < BaseController
|
2
|
-
before_filter :login_required
|
3
|
-
before_filter :admin_required
|
4
|
-
|
5
|
-
def index
|
6
|
-
@total_users = User.where('activated_at IS NOT NULL').count
|
7
|
-
@unactivated_users = User.where('activated_at IS NULL').count
|
8
|
-
|
9
|
-
@yesterday_new_users = find_new_users(1.day.ago.midnight, Date.today.midnight)
|
10
|
-
@today_new_users = find_new_users(Date.today.midnight, Date.today.tomorrow.midnight)
|
11
|
-
|
12
|
-
# Query returns a hash of user_id to number of activities for that user.
|
13
|
-
@active_users_count = Activity.group("user_id").having("count(created_at > ?) > 0", 1.month.ago).count.keys.size
|
14
|
-
|
15
|
-
@active_users = User.find_by_activity({:since => 1.month.ago})
|
16
|
-
|
17
|
-
@percent_reporting_zip = (User.where("zip IS NOT NULL").count / @total_users.to_f)*100
|
18
|
-
|
19
|
-
users_reporting_gender = User.where("gender IS NOT NULL").count
|
20
|
-
@percent_male = (User.where('gender = ?', User::MALE).count / users_reporting_gender.to_f) * 100
|
21
|
-
@percent_female = (User.where('gender = ?', User::FEMALE).count / users_reporting_gender.to_f) * 100
|
22
|
-
|
23
|
-
@featured_writers = User.find_featured
|
24
|
-
|
25
|
-
@posts = Post.includes(:user).where('? <= posts.published_at AND posts.published_at <= ? AND users.featured_writer = ?', Time.now.beginning_of_month, (Time.now.end_of_month + 1.day), true).includes(:users)
|
26
|
-
end
|
27
|
-
|
28
|
-
|
29
|
-
protected
|
30
|
-
def find_new_users(from, to, limit= nil)
|
31
|
-
User.active.where(:created_at => from..to)
|
32
|
-
end
|
33
|
-
|
34
|
-
|
35
|
-
end
|
@@ -1,53 +0,0 @@
|
|
1
|
-
-@page_title = 'Comments'
|
2
|
-
= render :partial => 'shared/admin_nav'
|
3
|
-
|
4
|
-
= bootstrap_form_for @search, :url => admin_comments_path, :layout => :horizontal do |f|
|
5
|
-
%h2=:search.l
|
6
|
-
= f.text_field :author_email_or_user_email_cont, :label => :email.l
|
7
|
-
|
8
|
-
= f.form_group :submit_group do
|
9
|
-
= f.primary :search.l
|
10
|
-
|
11
|
-
= bootstrap_form_tag :url => delete_selected_comments_path, :method => :delete, :id => 'comments' do
|
12
|
-
%table.table.table-bordered.table-striped
|
13
|
-
%tr
|
14
|
-
%th=:delete.l
|
15
|
-
%th=:author.l
|
16
|
-
%th{:width => "50%"}=:body_text.l
|
17
|
-
%th=:on_commentable.l
|
18
|
-
%th=:actions.l
|
19
|
-
- @comments.each do |comment|
|
20
|
-
%tr{:id => "comment-#{comment.id}"}
|
21
|
-
%td= check_box_tag "delete[]", comment.id
|
22
|
-
%td
|
23
|
-
.left
|
24
|
-
-if comment.user
|
25
|
-
= link_to h(comment.user.login), user_path(comment.user)
|
26
|
-
%br
|
27
|
-
%small= comment.user.email
|
28
|
-
-else
|
29
|
-
= link_to_unless(comment.author_url.blank?, h(comment.username), h(comment.author_url)){ h(comment.username) }
|
30
|
-
%br
|
31
|
-
%small=comment.author_email
|
32
|
-
%br
|
33
|
-
%small="(#{comment.author_url})"
|
34
|
-
%td{:style => 'overflow:hidden;'}
|
35
|
-
= comment.comment.html_safe
|
36
|
-
%td
|
37
|
-
-if comment.commentable_name.blank?
|
38
|
-
=link_to comment.commentable_type, commentable_url(comment)
|
39
|
-
-else
|
40
|
-
=link_to comment.commentable_name, commentable_url(comment)
|
41
|
-
%td
|
42
|
-
=link_to :delete.l, commentable_comment_path(comment.commentable_type, comment.commentable_id, comment), :method => :delete, 'data-manual-confirm' => "Are you sure you want to permanently delete this comment", :class => 'btn btn-danger delete-via-ajax', 'data-target' => "comment_#{comment.id}"
|
43
|
-
-if @comments.any?
|
44
|
-
%p
|
45
|
-
%a.btn.btn-default{:href=>"#", :onclick=>"checkboxes.each(function(e){ e.checked = (e.checked == 0 ? 1 : 0) }); return false;"} Toggle all
|
46
|
-
= submit_tag :delete_selected.l, :class => 'btn btn-danger'
|
47
|
-
|
48
|
-
= paginate @comments, :theme => 'bootstrap'
|
49
|
-
|
50
|
-
-content_for :end_javascript do
|
51
|
-
:javascript
|
52
|
-
var form = $('comments');
|
53
|
-
checkboxes = form.getInputs('checkbox');
|
@@ -1,26 +0,0 @@
|
|
1
|
-
|
2
|
-
= render :partial => 'shared/admin_nav'
|
3
|
-
-@page_title = :events.l
|
4
|
-
|
5
|
-
%table.table.table-bordered.table-striped
|
6
|
-
%tr
|
7
|
-
%th=:name.l
|
8
|
-
%th=:metro_area.l
|
9
|
-
%th=:when.l
|
10
|
-
%th=:actions.l
|
11
|
-
|
12
|
-
- for event in @events
|
13
|
-
%tr
|
14
|
-
%td= event.name
|
15
|
-
%td= event.try(:metro_area).try(:name)
|
16
|
-
%td=h event.time_and_date
|
17
|
-
%td
|
18
|
-
= link_to :show.l, event_path(event), :class => 'btn btn-default'
|
19
|
-
= link_to :clone.l, clone_event_path(event), :class => 'btn btn-success'
|
20
|
-
= link_to :edit.l, edit_event_path(event), :class => 'btn btn-warning'
|
21
|
-
= link_to :delete.l, event_path(event), data: { confirm: :are_you_sure.l }, :method => :delete, :class => 'btn btn-danger'
|
22
|
-
|
23
|
-
=paginate @events, :theme => 'bootstrap'
|
24
|
-
|
25
|
-
%p= link_to :new_event.l, new_event_path, :class => 'btn btn-success'
|
26
|
-
|
@@ -1 +0,0 @@
|
|
1
|
-
alert('This should not happen');
|
@@ -1,57 +0,0 @@
|
|
1
|
-
= render :partial => 'shared/admin_nav'
|
2
|
-
-@page_title = :members.l
|
3
|
-
-box do
|
4
|
-
= bootstrap_form_tag :url => admin_users_url, :class => 'MainForm', :method => :get do |f|
|
5
|
-
= f.text_field :login
|
6
|
-
= f.text_field :email
|
7
|
-
= f.primary :search_users.l
|
8
|
-
|
9
|
-
= paginate @users, :theme => 'bootstrap'
|
10
|
-
|
11
|
-
%br
|
12
|
-
= bootstrap_form_tag :url => delete_selected_users_path, :id => 'users' do
|
13
|
-
%table.table.table-bordered.table-striped
|
14
|
-
%tr
|
15
|
-
%th
|
16
|
-
-if configatron.has_key?(:akismet_key)
|
17
|
-
%th
|
18
|
-
%th
|
19
|
-
%th
|
20
|
-
%th=:login.l
|
21
|
-
%th=:e_mail.l
|
22
|
-
%th=:status.l
|
23
|
-
%th=:actions.l
|
24
|
-
|
25
|
-
- @users.each do |user|
|
26
|
-
%tr{:id => "user_#{user.id}"}
|
27
|
-
%td
|
28
|
-
= link_to fa_icon("trash-o"), user_path(user), :method => :delete, 'data-manual-confirm' => :are_you_sure_you_want_to_permanently_delete_this_user.l, :class => 'delete-via-ajax'
|
29
|
-
-if configatron.has_key?(:akismet_key)
|
30
|
-
%td
|
31
|
-
= link_to fa_icon("ban"), user_path(user, :spam => true), :method => :delete, :confirm => :are_you_sure_you_want_to_permanently_delete_this_user_and_mark_as_spam.l, :class => 'delete-via-ajax'
|
32
|
-
%td= check_box_tag "delete[]", user.id
|
33
|
-
|
34
|
-
%td
|
35
|
-
-if user.avatar
|
36
|
-
= image_tag user.avatar.photo.url(:thumb), :width => 25
|
37
|
-
%td
|
38
|
-
= link_to_if user.active?, user.login, user_path(user)
|
39
|
-
%td
|
40
|
-
= h user.email
|
41
|
-
%td
|
42
|
-
= user.active? ? :active.l : :inactive.l
|
43
|
-
%td
|
44
|
-
-if user.active?
|
45
|
-
= link_to :assume_id.l , assume_user_path(user), :method => 'post', :class => 'btn btn-default'
|
46
|
-
-else
|
47
|
-
= link_to :activate.l, admin_activate_user_path(:id => user), :class => 'btn btn-success'
|
48
|
-
|
49
|
-
-if @users.any?
|
50
|
-
-if configatron.has_key?(:akismet_key)
|
51
|
-
= check_box_tag :spam
|
52
|
-
=:delete_selected_mark_as_spam.l
|
53
|
-
%br
|
54
|
-
%a.btn.btn-default.check-all{:href=>"#"} Toggle all
|
55
|
-
= submit_tag :delete_selected.l, :class => 'btn btn-danger'
|
56
|
-
|
57
|
-
= paginate @users, :theme => 'bootstrap'
|
@@ -1,21 +0,0 @@
|
|
1
|
-
= bootstrap_form_for(@ad, :layout => :horizontal) do |f|
|
2
|
-
= f.text_field :name
|
3
|
-
= f.text_area :html, :class => "rich_text_editor"
|
4
|
-
= f.select :frequency, Ad.frequencies_for_select
|
5
|
-
= f.select :audience, Ad.audiences_for_select
|
6
|
-
|
7
|
-
= f.form_group :ad_time_constrained do
|
8
|
-
= f.check_box :published, :label => :published.l + '?'
|
9
|
-
= f.check_box :time_constrained, :label => :time_constrained.l + '?'
|
10
|
-
|
11
|
-
#time_constraints{"style"=>"display:#{ @ad.time_constrained? ? 'block' : 'none'}"}
|
12
|
-
= f.datetime_select :start_date
|
13
|
-
= f.datetime_select :end_date
|
14
|
-
|
15
|
-
-content_for :end_javascript do
|
16
|
-
:javascript
|
17
|
-
Event.observe("ad_time_constrained", "click", function(){$('time_constraints').toggle()})
|
18
|
-
|
19
|
-
= f.text_field :location
|
20
|
-
|
21
|
-
= f.primary :save.l
|
@@ -1,7 +0,0 @@
|
|
1
|
-
-@page_title = :editing_ad.l
|
2
|
-
%p
|
3
|
-
= link_to :back.l, ads_path, :class => 'btn btn-default'
|
4
|
-
= link_to :show.l, ad_path(@ad), :class => 'btn btn-primary'
|
5
|
-
= link_to :destroy.l, ad_path(@ad), data: { confirm: :are_you_sure.l }, :method => :delete, :class => 'btn btn-danger'
|
6
|
-
|
7
|
-
= render 'form'
|
@@ -1,29 +0,0 @@
|
|
1
|
-
-@page_title = :ads.l
|
2
|
-
= render :partial => 'shared/admin_nav'
|
3
|
-
|
4
|
-
%h2=:search.l
|
5
|
-
= bootstrap_form_for @search, :url => ads_path, :layout => :horizontal do |f|
|
6
|
-
= f.text_field :name_start, :label => :name.l
|
7
|
-
= f.text_field :location_cont, :label => :location.l
|
8
|
-
= f.form_group :submit_group do
|
9
|
-
= f.primary :search.l
|
10
|
-
|
11
|
-
%table.table.table-bordered.table-striped
|
12
|
-
%tr
|
13
|
-
%th=sort_link @search, :name, :name.l
|
14
|
-
%th=sort_link @search, :published, :published.l
|
15
|
-
%th=sort_link @search, :location, :location.l
|
16
|
-
%th=:actions.l
|
17
|
-
|
18
|
-
- for ad in @ads
|
19
|
-
%tr
|
20
|
-
%td= link_to h(ad.name), ad_path(ad)
|
21
|
-
%td= h ad.published?
|
22
|
-
%td= h ad.location
|
23
|
-
%td
|
24
|
-
= link_to :show.l, ad_path(ad), :class => 'btn btn-default'
|
25
|
-
= link_to :edit.l, edit_ad_path(ad), :class => 'btn btn-warning'
|
26
|
-
= link_to :delete.l, ad_path(ad), data: { confirm: :are_you_sure.l }, :method => :delete, :class => 'btn btn-danger'
|
27
|
-
|
28
|
-
= paginate @ads, :theme => 'bootstrap'
|
29
|
-
= link_to :new_ad.l, new_ad_path, :class => 'btn btn-success'
|
data/app/views/ads/new.html.haml
DELETED
@@ -1,19 +0,0 @@
|
|
1
|
-
-@page_title=@ad.name
|
2
|
-
%p
|
3
|
-
= link_to :back.l, ads_path, :class => 'btn btn-default'
|
4
|
-
= link_to :edit.l, edit_ad_path(@ad), :class => 'btn btn-warning'
|
5
|
-
= link_to :destroy.l, ad_path(@ad), data: { confirm: :are_you_sure.l }, :method => :delete, :class => 'btn btn-danger'
|
6
|
-
|
7
|
-
%dl.dl-horizontal
|
8
|
-
%dt=:name.l
|
9
|
-
%dd= h @ad.name
|
10
|
-
%dt=:html.l
|
11
|
-
%dd= raw @ad.html
|
12
|
-
%dt=:frequency.l
|
13
|
-
%dd= h @ad.frequency
|
14
|
-
%dt=:published.l
|
15
|
-
%dd= @ad.published?
|
16
|
-
%dt=:run.l
|
17
|
-
%dd= h @ad.time_constrained? ? "#{@ad.start_date.to_formatted_s(:long)} - #{@ad.end_date.to_formatted_s(:long)}" : 'n/a'
|
18
|
-
%dt=:location.l
|
19
|
-
%dd= h @ad.location
|
@@ -1,8 +0,0 @@
|
|
1
|
-
= bootstrap_form_for(@category, :layout => :horizontal) do |f|
|
2
|
-
= f.text_field :name
|
3
|
-
= f.text_area :tips, :rows => 3, :help => 'Encourages people to add to this category'
|
4
|
-
= f.text_field :new_post_text, :help => 'Text For New Post Link'
|
5
|
-
= f.text_field :nav_text, :help => 'Text for Nav Link'
|
6
|
-
|
7
|
-
= f.form_group :submit_group do
|
8
|
-
= f.primary :save.l
|
@@ -1,20 +0,0 @@
|
|
1
|
-
-@page_title=:categories.l
|
2
|
-
= render :partial => 'shared/admin_nav'
|
3
|
-
|
4
|
-
%table.table.table-bordered.table-striped
|
5
|
-
%tr
|
6
|
-
%th=:name.l
|
7
|
-
%th
|
8
|
-
\#
|
9
|
-
=:posts.l
|
10
|
-
%th=:actions.l
|
11
|
-
|
12
|
-
- for category in @categories
|
13
|
-
%tr
|
14
|
-
%td= category.name
|
15
|
-
%td= category.posts.size
|
16
|
-
%td
|
17
|
-
= link_to :show.l, category_path(category), :class => 'btn btn-default'
|
18
|
-
= link_to :edit.l, edit_category_path(category), :class => 'btn btn-warning'
|
19
|
-
= link_to :delete.l, category_path(category), data: { confirm: :are_you_sure.l }, :method => :delete, :class => 'btn btn-danger'
|
20
|
-
= link_to :new_category.l, new_category_path, :class => 'btn btn-success'
|
@@ -1,6 +0,0 @@
|
|
1
|
-
= bootstrap_form_for(@homepage_feature, :html => {:multipart => true}, :layout => :horizontal) do |f|
|
2
|
-
= f.text_field :url
|
3
|
-
= f.text_field :title
|
4
|
-
= f.text_area :description, :rows => 10, :class => "rich_text_editor"
|
5
|
-
= f.file_field :image, :required => true
|
6
|
-
= f.primary :save.l
|
@@ -1,6 +0,0 @@
|
|
1
|
-
%p
|
2
|
-
= link_to :back.l, homepage_features_path, :class => 'btn btn-default'
|
3
|
-
= link_to :show.l, homepage_feature_path(@homepage_feature), :class => 'btn btn-primary'
|
4
|
-
= link_to :delete.l, homepage_feature_path(@homepage_feature), data: { confirm: :are_you_sure.l }, :method => :delete, :class => 'btn btn-danger'
|
5
|
-
|
6
|
-
= render 'form'
|
@@ -1,24 +0,0 @@
|
|
1
|
-
-@page_title = :homepage_features.l
|
2
|
-
= render :partial => 'shared/admin_nav'
|
3
|
-
|
4
|
-
%table.table.table-bordered.table-striped
|
5
|
-
%tr
|
6
|
-
%th= :date_title.l
|
7
|
-
%th= :title.l
|
8
|
-
%th= :description.l
|
9
|
-
%th= :image.l
|
10
|
-
%th= :actions.l
|
11
|
-
|
12
|
-
- for homepage_feature in @homepage_features
|
13
|
-
%tr
|
14
|
-
%td=h I18n.l(homepage_feature.created_at, :format => :short_published_date)
|
15
|
-
%td
|
16
|
-
%a{:href=>"#{h homepage_feature.url}"}=h homepage_feature.title
|
17
|
-
%td=h truncate(homepage_feature.description, :length => 250).html_safe
|
18
|
-
%td= image_tag homepage_feature.image.url(:thumb)
|
19
|
-
%td
|
20
|
-
= link_to :show.l, homepage_feature_path(homepage_feature), :class => 'btn btn-default'
|
21
|
-
= link_to :edit.l, edit_homepage_feature_path(homepage_feature), :class => 'btn btn-warning'
|
22
|
-
= link_to :delete.l, homepage_feature_path(homepage_feature), data: { confirm: :are_you_sure.l }, :method => :delete, :class => 'btn btn-danger'
|
23
|
-
|
24
|
-
= link_to :new_homepage_feature.l, new_homepage_feature_path, :class => 'btn btn-success'
|
@@ -1,27 +0,0 @@
|
|
1
|
-
-@page_title = @homepage_feature.title
|
2
|
-
|
3
|
-
%p
|
4
|
-
= link_to :back.l, homepage_features_path, :class => 'btn btn-default'
|
5
|
-
= link_to :edit.l, edit_homepage_feature_path(@homepage_feature), :class => 'btn btn-warning'
|
6
|
-
= link_to :delete.l, homepage_feature_path(@homepage_feature), data: { confirm: :are_you_sure.l }, :method => :delete, :class => 'btn btn-danger'
|
7
|
-
|
8
|
-
%dl.dl-horizontal.clearfix
|
9
|
-
-unless @homepage_feature.url.blank?
|
10
|
-
%dt= :url.l
|
11
|
-
%dd= h @homepage_feature.url
|
12
|
-
|
13
|
-
-unless @homepage_feature.title.blank?
|
14
|
-
%dt= :title.l
|
15
|
-
%dd= h @homepage_feature.title
|
16
|
-
|
17
|
-
-unless @homepage_feature.description.blank?
|
18
|
-
%dt= :description.l
|
19
|
-
%dd= @homepage_feature.description.html_safe
|
20
|
-
|
21
|
-
%dt= :created_at.l
|
22
|
-
%dd= h @homepage_feature.created_at
|
23
|
-
|
24
|
-
%dt= :updated_at.l
|
25
|
-
%dd= h @homepage_feature.updated_at
|
26
|
-
|
27
|
-
= image_tag @homepage_feature.image.url(:large), :class => 'thumbnail'
|
@@ -1,6 +0,0 @@
|
|
1
|
-
= bootstrap_form_for @metro_area, :layout => :horizontal do |f|
|
2
|
-
= f.collection_select :country_id, Country.order('name ASC'), :id, :name
|
3
|
-
= f.collection_select :state_id, State.all, :id, :name, :include_blank => true
|
4
|
-
= f.text_field :name
|
5
|
-
= f.form_group :submit_group do
|
6
|
-
= f.primary :save.l
|
@@ -1,8 +0,0 @@
|
|
1
|
-
-@page_title= :editing_metro_area.l
|
2
|
-
|
3
|
-
%p
|
4
|
-
= link_to :back.l, metro_areas_path, :class => 'btn btn-default'
|
5
|
-
= link_to :show.l, metro_area_path(@metro_area), :class => 'btn btn-primary'
|
6
|
-
= link_to :delete.l, metro_area_path(@metro_area), data: { confirm: :are_you_sure.l }, :method => :delete, :class => 'btn btn-danger'
|
7
|
-
|
8
|
-
= render 'form'
|
@@ -1,21 +0,0 @@
|
|
1
|
-
-@page_title = :metro_areas.l
|
2
|
-
= render :partial => 'shared/admin_nav'
|
3
|
-
|
4
|
-
%table.table.table-bordered.table-striped
|
5
|
-
%tr
|
6
|
-
%th= :name.l
|
7
|
-
%th= :state.l
|
8
|
-
%th= :country.l
|
9
|
-
%th= :actions.l
|
10
|
-
|
11
|
-
- for metro_area in @metro_areas
|
12
|
-
%tr
|
13
|
-
%td= link_to metro_area.name, metro_area
|
14
|
-
%td= metro_area.state.name if metro_area.state
|
15
|
-
%td= metro_area.country.name
|
16
|
-
%td
|
17
|
-
= link_to :show.l, metro_area_path(metro_area), :class => 'btn btn-default'
|
18
|
-
= link_to :edit.l, edit_metro_area_path(metro_area), :class => 'btn btn-warning'
|
19
|
-
= link_to :delete.l, metro_area_path(metro_area), data: { confirm: :are_you_sure.l }, :method => :delete, :class => 'btn btn-danger'
|
20
|
-
= paginate @metro_areas, :theme => 'bootstrap'
|
21
|
-
= link_to :new_metro_area.l, new_metro_area_path, :class => 'btn btn-success'
|
@@ -1,14 +0,0 @@
|
|
1
|
-
-@page_title=:showing_metro_area_details.l
|
2
|
-
%p
|
3
|
-
= link_to :back.l, metro_areas_path, :class => 'btn btn-default'
|
4
|
-
= link_to :edit.l, edit_metro_area_path(@metro_area), :class => 'btn btn-warning'
|
5
|
-
= link_to :delete.l, metro_area_path(@metro_area), data: { confirm: :are_you_sure.l }, :method => :delete, :class => 'btn btn-danger'
|
6
|
-
|
7
|
-
%dl.dl-horizontal
|
8
|
-
%dt=:country.l
|
9
|
-
%dd= h @metro_area.country.name
|
10
|
-
- if @metro_area.state
|
11
|
-
%dt=:state.l
|
12
|
-
%dd= @metro_area.state.name
|
13
|
-
%dt=:name.l
|
14
|
-
%dd= @metro_area.name
|