refinerycms-whatson 1.8.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.
Files changed (137) hide show
  1. data/.gitignore +48 -0
  2. data/.tork.rb +2 -0
  3. data/.travis.yml +2 -0
  4. data/Gemfile +7 -0
  5. data/Rakefile +3 -0
  6. data/app/controllers/admin/whatson/categories_controller.rb +11 -0
  7. data/app/controllers/admin/whatson/comments_controller.rb +40 -0
  8. data/app/controllers/admin/whatson/posts_controller.rb +97 -0
  9. data/app/controllers/admin/whatson/settings_controller.rb +53 -0
  10. data/app/controllers/whatson/categories_controller.rb +13 -0
  11. data/app/controllers/whatson/posts_controller.rb +109 -0
  12. data/app/controllers/whatson_controller.rb +16 -0
  13. data/app/helpers/whatson_posts_helper.rb +56 -0
  14. data/app/mailers/whatson/comment_mailer.rb +13 -0
  15. data/app/models/categorization.rb +7 -0
  16. data/app/models/whatson/comment_mailer.rb +1 -0
  17. data/app/models/whatson_category.rb +19 -0
  18. data/app/models/whatson_comment.rb +137 -0
  19. data/app/models/whatson_post.rb +114 -0
  20. data/app/views/admin/whatson/_submenu.html.erb +96 -0
  21. data/app/views/admin/whatson/categories/_category.html.erb +16 -0
  22. data/app/views/admin/whatson/categories/_form.html.erb +19 -0
  23. data/app/views/admin/whatson/categories/_sortable_list.html.erb +7 -0
  24. data/app/views/admin/whatson/categories/edit.html.erb +1 -0
  25. data/app/views/admin/whatson/categories/index.html.erb +26 -0
  26. data/app/views/admin/whatson/categories/new.html.erb +1 -0
  27. data/app/views/admin/whatson/comments/_comment.html.erb +20 -0
  28. data/app/views/admin/whatson/comments/_sortable_list.html.erb +7 -0
  29. data/app/views/admin/whatson/comments/index.html.erb +35 -0
  30. data/app/views/admin/whatson/comments/show.html.erb +63 -0
  31. data/app/views/admin/whatson/posts/_form.css.erb +20 -0
  32. data/app/views/admin/whatson/posts/_form.html.erb +110 -0
  33. data/app/views/admin/whatson/posts/_form.js.erb +23 -0
  34. data/app/views/admin/whatson/posts/_form_part.html.erb +3 -0
  35. data/app/views/admin/whatson/posts/_post.html.erb +24 -0
  36. data/app/views/admin/whatson/posts/_sortable_list.html.erb +7 -0
  37. data/app/views/admin/whatson/posts/_teaser_part.html.erb +11 -0
  38. data/app/views/admin/whatson/posts/edit.html.erb +1 -0
  39. data/app/views/admin/whatson/posts/index.html.erb +28 -0
  40. data/app/views/admin/whatson/posts/new.html.erb +1 -0
  41. data/app/views/admin/whatson/posts/uncategorized.html.erb +26 -0
  42. data/app/views/admin/whatson/settings/notification_recipients.html.erb +24 -0
  43. data/app/views/shared/admin/_autocomplete.html.erb +55 -0
  44. data/app/views/whatson/categories/show.html.erb +21 -0
  45. data/app/views/whatson/comment_mailer/notification.html.erb +17 -0
  46. data/app/views/whatson/posts/_comment.html.erb +10 -0
  47. data/app/views/whatson/posts/_nav.html.erb +11 -0
  48. data/app/views/whatson/posts/archive.html.erb +20 -0
  49. data/app/views/whatson/posts/index.html.erb +24 -0
  50. data/app/views/whatson/posts/index.rss.builder +17 -0
  51. data/app/views/whatson/posts/show.html.erb +98 -0
  52. data/app/views/whatson/posts/tagged.html.erb +22 -0
  53. data/app/views/whatson/shared/_archive_list.html.erb +9 -0
  54. data/app/views/whatson/shared/_categories.html.erb +10 -0
  55. data/app/views/whatson/shared/_post.html.erb +46 -0
  56. data/app/views/whatson/shared/_related_posts.html.erb +10 -0
  57. data/app/views/whatson/shared/_rss_feed.html.erb +2 -0
  58. data/app/views/whatson/shared/_tags.html.erb +8 -0
  59. data/config/locales/bg.yml +158 -0
  60. data/config/locales/cs.yml +128 -0
  61. data/config/locales/de.yml +130 -0
  62. data/config/locales/en.yml +159 -0
  63. data/config/locales/es.yml +159 -0
  64. data/config/locales/fr.yml +154 -0
  65. data/config/locales/it.yml +156 -0
  66. data/config/locales/ja.yml +159 -0
  67. data/config/locales/nb.yml +30 -0
  68. data/config/locales/nl.yml +134 -0
  69. data/config/locales/pl.yml +134 -0
  70. data/config/locales/pt-BR.yml +143 -0
  71. data/config/locales/ru.yml +135 -0
  72. data/config/locales/sk.yml +128 -0
  73. data/config/locales/zh-CN.yml +128 -0
  74. data/config/routes.rb +47 -0
  75. data/db/migrate/1_create_whatson_structure.rb +54 -0
  76. data/db/migrate/2_add_user_id_to_whatson_posts.rb +11 -0
  77. data/db/migrate/3_acts_as_taggable_on_migration.rb +28 -0
  78. data/db/migrate/4_create_seo_meta_for_whatson.rb +25 -0
  79. data/db/migrate/5_add_cached_slugs.rb +11 -0
  80. data/db/migrate/6_add_custom_url_field_to_whatson_posts.rb +9 -0
  81. data/db/migrate/7_add_custom_teaser_field_to_whatson_posts.rb +10 -0
  82. data/db/migrate/8_add_primary_key_to_categorizations.rb +12 -0
  83. data/db/seeds/refinerycms_whatson.rb +20 -0
  84. data/features/authors.feature +15 -0
  85. data/features/category.feature +23 -0
  86. data/features/support/factories/whatson_categories.rb +5 -0
  87. data/features/support/factories/whatson_comments.rb +8 -0
  88. data/features/support/factories/whatson_posts.rb +9 -0
  89. data/features/support/paths.rb +24 -0
  90. data/features/support/step_definitions/authors_steps.rb +7 -0
  91. data/features/support/step_definitions/category_steps.rb +11 -0
  92. data/features/support/step_definitions/tags_steps.rb +13 -0
  93. data/features/tags.feature +26 -0
  94. data/lib/gemspec.rb +37 -0
  95. data/lib/generators/refinerycms_whatson_generator.rb +8 -0
  96. data/lib/refinery/whatson/tabs.rb +28 -0
  97. data/lib/refinery/whatson/version.rb +17 -0
  98. data/lib/refinerycms-whatson.rb +41 -0
  99. data/public/images/refinerycms-whatson/icons/cog.png +0 -0
  100. data/public/images/refinerycms-whatson/icons/comment.png +0 -0
  101. data/public/images/refinerycms-whatson/icons/comment_cross.png +0 -0
  102. data/public/images/refinerycms-whatson/icons/comment_tick.png +0 -0
  103. data/public/images/refinerycms-whatson/icons/comments.png +0 -0
  104. data/public/images/refinerycms-whatson/icons/down.gif +0 -0
  105. data/public/images/refinerycms-whatson/icons/folder.png +0 -0
  106. data/public/images/refinerycms-whatson/icons/folder_add.png +0 -0
  107. data/public/images/refinerycms-whatson/icons/folder_edit.png +0 -0
  108. data/public/images/refinerycms-whatson/icons/page.png +0 -0
  109. data/public/images/refinerycms-whatson/icons/page_add.png +0 -0
  110. data/public/images/refinerycms-whatson/icons/page_copy.png +0 -0
  111. data/public/images/refinerycms-whatson/icons/up.gif +0 -0
  112. data/public/images/refinerycms-whatson/rss-feed.png +0 -0
  113. data/public/javascripts/refinery/refinerycms-whatson.js +50 -0
  114. data/public/javascripts/refinerycms-whatson.js +25 -0
  115. data/public/stylesheets/refinery/refinerycms-whatson.css +57 -0
  116. data/public/stylesheets/refinerycms-whatson.css +93 -0
  117. data/public/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_18_b81900_40x40.png +0 -0
  118. data/public/stylesheets/ui-lightness/images/ui-bg_diagonals-thick_20_666666_40x40.png +0 -0
  119. data/public/stylesheets/ui-lightness/images/ui-bg_flat_10_000000_40x100.png +0 -0
  120. data/public/stylesheets/ui-lightness/images/ui-bg_glass_100_f6f6f6_1x400.png +0 -0
  121. data/public/stylesheets/ui-lightness/images/ui-bg_glass_100_fdf5ce_1x400.png +0 -0
  122. data/public/stylesheets/ui-lightness/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
  123. data/public/stylesheets/ui-lightness/images/ui-bg_gloss-wave_35_f6a828_500x100.png +0 -0
  124. data/public/stylesheets/ui-lightness/images/ui-bg_highlight-soft_100_eeeeee_1x100.png +0 -0
  125. data/public/stylesheets/ui-lightness/images/ui-bg_highlight-soft_75_ffe45c_1x100.png +0 -0
  126. data/public/stylesheets/ui-lightness/images/ui-icons_222222_256x240.png +0 -0
  127. data/public/stylesheets/ui-lightness/images/ui-icons_228ef1_256x240.png +0 -0
  128. data/public/stylesheets/ui-lightness/images/ui-icons_ef8c08_256x240.png +0 -0
  129. data/public/stylesheets/ui-lightness/images/ui-icons_ffd27a_256x240.png +0 -0
  130. data/public/stylesheets/ui-lightness/images/ui-icons_ffffff_256x240.png +0 -0
  131. data/public/stylesheets/ui-lightness/jquery-ui-1.8.13.custom.css +330 -0
  132. data/readme.md +41 -0
  133. data/refinerycms-whatson.gemspec +18 -0
  134. data/spec/models/whatson_category_spec.rb +41 -0
  135. data/spec/models/whatson_comment_spec.rb +21 -0
  136. data/spec/models/whatson_post_spec.rb +217 -0
  137. metadata +235 -0
@@ -0,0 +1,13 @@
1
+ module Whatson
2
+ class CommentMailer < ActionMailer::Base
3
+
4
+ def notification(comment, request)
5
+ subject WhatsonComment::Notification.subject
6
+ recipients WhatsonComment::Notification.recipients
7
+ from "\"#{RefinerySetting[:site_name]}\" <no-reply@#{request.domain(RefinerySetting.find_or_set(:tld_length, 1))}>"
8
+ sent_on Time.now
9
+ @comment = comment
10
+ end
11
+
12
+ end
13
+ end
@@ -0,0 +1,7 @@
1
+ class Categorization < ActiveRecord::Base
2
+
3
+ set_table_name 'whatson_categories_whatson_posts'
4
+ belongs_to :whatson_post
5
+ belongs_to :whatson_category
6
+
7
+ end
@@ -0,0 +1 @@
1
+ require File.expand_path('../../../mailers/whatson/comment_mailer', __FILE__)
@@ -0,0 +1,19 @@
1
+ class WhatsonCategory < ActiveRecord::Base
2
+
3
+ has_many :categorizations, :dependent => :destroy
4
+ has_many :posts, :through => :categorizations, :source => :whatson_post
5
+
6
+ acts_as_indexed :fields => [:title]
7
+
8
+ validates :title, :presence => true, :uniqueness => true
9
+
10
+ has_friendly_id :title, :use_slug => true,
11
+ :default_locale => (::Refinery::I18n.default_frontend_locale rescue :en),
12
+ :approximate_ascii => RefinerySetting.find_or_set(:approximate_ascii, false, :scoping => 'whatson'),
13
+ :strip_non_ascii => RefinerySetting.find_or_set(:strip_non_ascii, false, :scoping => 'whatson')
14
+
15
+ def post_count
16
+ posts.select(&:live?).count
17
+ end
18
+
19
+ end
@@ -0,0 +1,137 @@
1
+ class WhatsonComment < ActiveRecord::Base
2
+
3
+ attr_accessible :name, :email, :message
4
+
5
+ filters_spam :author_field => :name,
6
+ :email_field => :email,
7
+ :message_field => :body
8
+
9
+ belongs_to :post, :class_name => 'WhatsonPost', :foreign_key => 'whatson_post_id'
10
+
11
+ acts_as_indexed :fields => [:name, :email, :message]
12
+
13
+ alias_attribute :message, :body
14
+
15
+ validates :name, :message, :presence => true
16
+ validates :email, :format => { :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i }
17
+
18
+ scope :unmoderated, :conditions => {:state => nil}
19
+ scope :approved, :conditions => {:state => 'approved'}
20
+ scope :rejected, :conditions => {:state => 'rejected'}
21
+
22
+ def avatar_url(options = {})
23
+ require 'digest/md5'
24
+ params = {
25
+ :s => options[:size] || 60,
26
+ :d => options[:default_image]
27
+ }
28
+ query_string = params.map do |k,v|
29
+ [k,v].map { |s| CGI::escape(s.to_s) }.join('=')
30
+ end.join('&')
31
+ email_md5 = Digest::MD5.hexdigest(self.email.to_s.strip.downcase)
32
+ "http://gravatar.com/avatar/#{email_md5}?#{query_string}"
33
+ end
34
+
35
+ def approve!
36
+ self.update_attribute(:state, 'approved')
37
+ end
38
+
39
+ def reject!
40
+ self.update_attribute(:state, 'rejected')
41
+ end
42
+
43
+ def rejected?
44
+ self.state == 'rejected'
45
+ end
46
+
47
+ def approved?
48
+ self.state == 'approved'
49
+ end
50
+
51
+ def unmoderated?
52
+ self.state.nil?
53
+ end
54
+
55
+ def self.toggle!
56
+ currently = RefinerySetting.find_or_set(:comments_allowed, true, {
57
+ :scoping => 'whatson'
58
+ })
59
+ RefinerySetting.set(:comments_allowed, {:value => !currently, :scoping => 'whatson'})
60
+ end
61
+
62
+ before_create do |comment|
63
+ unless WhatsonComment::Moderation.enabled?
64
+ comment.state = comment.ham? ? 'approved' : 'rejected'
65
+ end
66
+ end
67
+
68
+ module Moderation
69
+ class << self
70
+ def enabled?
71
+ RefinerySetting.find_or_set(:comment_moderation, true, {
72
+ :scoping => 'whatson',
73
+ :restricted => false
74
+ })
75
+ end
76
+
77
+ def toggle!
78
+ new_value = {
79
+ :value => !WhatsonComment::Moderation.enabled?,
80
+ :scoping => 'whatson',
81
+ :restricted => false
82
+ }
83
+ if RefinerySetting.respond_to?(:set)
84
+ RefinerySetting.set(:comment_moderation, new_value)
85
+ else
86
+ RefinerySetting[:comment_moderation] = new_value
87
+ end
88
+ end
89
+ end
90
+ end
91
+
92
+ module Notification
93
+ class << self
94
+ def recipients
95
+ RefinerySetting.find_or_set(:comment_notification_recipients, (Role[:refinery].users.first.email rescue ''),
96
+ {
97
+ :scoping => 'whatson',
98
+ :restricted => false
99
+ })
100
+ end
101
+
102
+ def recipients=(emails)
103
+ new_value = {
104
+ :value => emails,
105
+ :scoping => 'whatson',
106
+ :restricted => false
107
+ }
108
+ if RefinerySetting.respond_to?(:set)
109
+ RefinerySetting.set(:comment_notification_recipients, new_value)
110
+ else
111
+ RefinerySetting[:comment_notification_recipients] = new_value
112
+ end
113
+ end
114
+
115
+ def subject
116
+ RefinerySetting.find_or_set(:comment_notification_subject, "New inquiry from your website", {
117
+ :scoping => 'whatson',
118
+ :restricted => false
119
+ })
120
+ end
121
+
122
+ def subject=(subject_line)
123
+ new_value = {
124
+ :value => subject_line,
125
+ :scoping => 'whatson',
126
+ :restricted => false
127
+ }
128
+ if RefinerySetting.respond_to?(:set)
129
+ RefinerySetting.set(:comment_notification_subject, new_value)
130
+ else
131
+ RefinerySetting[:comment_notification_subject] = new_value
132
+ end
133
+ end
134
+ end
135
+ end
136
+
137
+ end
@@ -0,0 +1,114 @@
1
+ require 'acts-as-taggable-on'
2
+ require 'seo_meta'
3
+
4
+ class WhatsonPost < ActiveRecord::Base
5
+
6
+ is_seo_meta if self.table_exists?
7
+
8
+ default_scope :order => 'published_at DESC'
9
+ #.first & .last will be reversed -- consider a with_exclusive_scope on these?
10
+
11
+ belongs_to :author, :class_name => 'User', :foreign_key => :user_id, :readonly => true
12
+
13
+ has_many :comments, :class_name => 'WhatsonComment', :dependent => :destroy
14
+ acts_as_taggable
15
+
16
+ has_many :categorizations, :dependent => :destroy
17
+ has_many :categories, :through => :categorizations, :source => :whatson_category
18
+
19
+ acts_as_indexed :fields => [:title, :body]
20
+
21
+ validates :title, :presence => true, :uniqueness => true
22
+ validates :body, :presence => true
23
+
24
+ has_friendly_id :friendly_id_source, :use_slug => true,
25
+ :default_locale => (::Refinery::I18n.default_frontend_locale rescue :en),
26
+ :approximate_ascii => RefinerySetting.find_or_set(:approximate_ascii, false, :scoping => 'whatson'),
27
+ :strip_non_ascii => RefinerySetting.find_or_set(:strip_non_ascii, false, :scoping => 'whatson')
28
+
29
+ scope :by_archive, lambda { |archive_date|
30
+ where(['published_at between ? and ?', archive_date.beginning_of_month, archive_date.end_of_month])
31
+ }
32
+
33
+ scope :by_year, lambda { |archive_year|
34
+ where(['published_at between ? and ?', archive_year.beginning_of_year, archive_year.end_of_year])
35
+ }
36
+
37
+ scope :all_previous, lambda { where(['published_at <= ?', Time.now.beginning_of_month]) }
38
+
39
+ scope :live, lambda { where( "published_at <= ? and draft = ?", Time.now, false) }
40
+
41
+ scope :previous, lambda { |i| where(["published_at < ? and draft = ?", i.published_at, false]).limit(1) }
42
+ # next is now in << self
43
+
44
+ def next
45
+ WhatsonPost.next(self).first
46
+ end
47
+
48
+ def prev
49
+ WhatsonPost.previous(self).first
50
+ end
51
+
52
+ def live?
53
+ !draft and published_at <= Time.now
54
+ end
55
+
56
+ def category_ids=(ids)
57
+ self.categories = ids.reject{|id| id.blank?}.collect {|c_id|
58
+ WhatsonCategory.find(c_id.to_i) rescue nil
59
+ }.compact
60
+ end
61
+
62
+ def friendly_id_source
63
+ custom_url.present? ? custom_url : title
64
+ end
65
+
66
+ class << self
67
+ def next current_record
68
+ self.send(:with_exclusive_scope) do
69
+ where(["published_at > ? and draft = ?", current_record.published_at, false]).order("published_at ASC")
70
+ end
71
+ end
72
+
73
+ def comments_allowed?
74
+ RefinerySetting.find_or_set(:comments_allowed, true, {
75
+ :scoping => 'whatson'
76
+ })
77
+ end
78
+
79
+ def teasers_enabled?
80
+ RefinerySetting.find_or_set(:teasers_enabled, true, {
81
+ :scoping => 'whatson'
82
+ })
83
+ end
84
+
85
+ def teaser_enabled_toggle!
86
+ currently = RefinerySetting.find_or_set(:teasers_enabled, true, {
87
+ :scoping => 'whatson'
88
+ })
89
+ RefinerySetting.set(:teasers_enabled, {:value => !currently, :scoping => 'whatson'})
90
+ end
91
+
92
+ def uncategorized
93
+ WhatsonPost.live.reject { |p| p.categories.any? }
94
+ end
95
+ end
96
+
97
+ module ShareThis
98
+ DEFAULT_KEY = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
99
+
100
+ class << self
101
+ def key
102
+ RefinerySetting.find_or_set(:share_this_key, WhatsonPost::ShareThis::DEFAULT_KEY, {
103
+ :scoping => 'whatson'
104
+ })
105
+ end
106
+
107
+ def enabled?
108
+ key = WhatsonPost::ShareThis.key
109
+ key.present? and key != WhatsonPost::ShareThis::DEFAULT_KEY
110
+ end
111
+ end
112
+ end
113
+
114
+ end
@@ -0,0 +1,96 @@
1
+ <nav id='actions' class='multilist'>
2
+ <ul class='search_list'>
3
+ <li class='not_a_link'>
4
+ <%= render :partial => "/shared/admin/search",
5
+ :locals => {
6
+ :url => admin_whatson_posts_url
7
+ } %>
8
+ </li>
9
+ </ul>
10
+
11
+ <ul class='collapsible_menu'>
12
+ <li class='not_a_link'>
13
+ <%= link_to t('.posts.title'), '#',
14
+ :class => 'page_copy_icon' %>
15
+ </li>
16
+ <li>
17
+ <%= link_to t('.posts.manage'), admin_whatson_posts_path,
18
+ :class => 'page_icon' %>
19
+ </li>
20
+ <li>
21
+ <%= link_to t('.posts.uncategorized'), uncategorized_admin_whatson_posts_url,
22
+ :class => 'page_icon' %>
23
+ </li>
24
+ <li>
25
+ <%= link_to t('.posts.new'), new_admin_whatson_post_url,
26
+ :class => 'page_add_icon' %>
27
+ </li>
28
+ </ul>
29
+ <% if WhatsonPost.comments_allowed? %>
30
+ <ul class='collapsible_menu'>
31
+ <li class='not_a_link'>
32
+ <% if WhatsonComment.unmoderated.any? %>
33
+ <% title = t('.comments.title_with_count', :new_count => WhatsonComment.unmoderated.size) %>
34
+ <% else %>
35
+ <% title = t('.comments.title') %>
36
+ <% end %>
37
+ <%= link_to title, '#',
38
+ :class => 'comments_icon' %>
39
+ </li>
40
+ <li>
41
+ <%= link_to t('.comments.new'), admin_whatson_comments_path,
42
+ :class => 'comment_icon' %>
43
+ </li>
44
+ <li>
45
+ <%= link_to t('.comments.approved'), approved_admin_whatson_comments_path,
46
+ :class => 'comment_tick_icon' %>
47
+ </li>
48
+ <li>
49
+ <%= link_to t('.comments.rejected'), rejected_admin_whatson_comments_path,
50
+ :class => 'comment_cross_icon' %>
51
+ </li>
52
+ </ul>
53
+ <% end %>
54
+
55
+ <ul class='collapsible_menu'>
56
+ <li class='not_a_link'>
57
+ <%= link_to t('.categories.title'), '#',
58
+ :class => 'folder_icon' %>
59
+ </li>
60
+ <li>
61
+ <%= link_to t('.categories.manage'), admin_whatson_categories_url,
62
+ :class => 'folder_edit_icon' %>
63
+ </li>
64
+ <li>
65
+ <%= link_to t('.categories.new'), new_admin_whatson_category_url(:dialog => true, :height => 325),
66
+ :class => 'folder_add_icon' %>
67
+ </li>
68
+ </ul>
69
+
70
+ <ul class='collapsible_menu'>
71
+ <li class='not_a_link'>
72
+ <%= link_to t('.settings.title'), admin_whatson_settings_path,
73
+ :class => 'settings_icon' %>
74
+ </li>
75
+ <li>
76
+ <%= link_to t('.settings.comments'), comments_admin_whatson_settings_url,
77
+ :class => "#{WhatsonPost.comments_allowed? ? 'success' : 'failure'}_icon" %>
78
+ </li>
79
+ <li>
80
+ <%= link_to t('.settings.moderation'), moderation_admin_whatson_settings_url,
81
+ :class => "#{WhatsonComment::Moderation.enabled? ? 'success' : 'failure'}_icon" %>
82
+ </li>
83
+ <li>
84
+ <%= link_to t('.settings.update_notified'),
85
+ notification_recipients_admin_whatson_settings_url(:dialog => true, :height => 400),
86
+ :class => 'user_comment_icon' %>
87
+ </li>
88
+ <li>
89
+ <%= link_to t('.settings.teasers'),
90
+ teasers_admin_whatson_settings_url, :class => "#{WhatsonPost.teasers_enabled? ? 'success' : 'failure'}_icon" %>
91
+ </li>
92
+ </ul>
93
+
94
+ </nav>
95
+
96
+ <% content_for :stylesheets, stylesheet_link_tag('refinery/refinerycms-whatson')%>
@@ -0,0 +1,16 @@
1
+ <li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(category) -%>">
2
+ <span class='title'>
3
+ <%= category.title %>
4
+ <span class="preview">&nbsp;</span>
5
+ </span>
6
+ <span class='actions'>
7
+ <%= link_to refinery_icon_tag("application_edit.png"),
8
+ edit_admin_whatson_category_path(category, :dialog => true, :height => 325),
9
+ :title => t('.edit') %>
10
+ <%= link_to refinery_icon_tag("delete.png"), admin_whatson_category_path(category),
11
+ :class => "cancel confirm-delete",
12
+ :title => t('.delete'),
13
+ :method => :delete,
14
+ :confirm => t('message', :scope => 'shared.admin.delete', :title => category.title) %>
15
+ </span>
16
+ </li>
@@ -0,0 +1,19 @@
1
+ <%= form_for [:admin, @whatson_category] do |f| -%>
2
+ <%= render :partial => "/shared/admin/error_messages",
3
+ :locals => {
4
+ :object => f.object,
5
+ :include_object_name => true
6
+ } %>
7
+
8
+ <div class='field'>
9
+ <%= f.label :title -%>
10
+ <%= f.text_field :title, :class => 'larger widest' -%>
11
+ </div>
12
+
13
+ <%= render :partial => "/shared/admin/form_actions",
14
+ :locals => {
15
+ :f => f,
16
+ :continue_editing => false,
17
+ :delete_title => t('delete', :scope => 'admin.whatson.categories.category')
18
+ } %>
19
+ <% end %>
@@ -0,0 +1,7 @@
1
+ <ul id='sortable_list'>
2
+ <%= render :partial => 'category', :collection => @whatson_categories %>
3
+ </ul>
4
+ <%= render :partial => "/shared/admin/sortable_list",
5
+ :locals => {
6
+ :continue_reordering => (defined?(continue_reordering) ? continue_reordering : true)
7
+ } %>
@@ -0,0 +1 @@
1
+ <%= render :partial => "form" %>