diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/models/blog_comment.rb | 23 | ||||
-rw-r--r-- | app/views/admin/blog/_submenu.html.erb | 15 | ||||
-rw-r--r-- | app/views/admin/blog/comments/show.html.erb | 7 | ||||
-rw-r--r-- | app/views/admin/blog/posts/_form.css.erb | 7 | ||||
-rw-r--r-- | app/views/admin/blog/posts/_form.html.erb | 32 | ||||
-rw-r--r-- | app/views/admin/blog/posts/_form.js.erb | 13 | ||||
-rw-r--r-- | app/views/blog/posts/show.html.erb | 32 |
7 files changed, 82 insertions, 47 deletions
diff --git a/app/models/blog_comment.rb b/app/models/blog_comment.rb index b888e35..9b84ece 100644 --- a/app/models/blog_comment.rb +++ b/app/models/blog_comment.rb @@ -60,11 +60,16 @@ class BlogComment < ActiveRecord::Base end def toggle! - RefinerySetting[:comment_moderation] = { - :value => !self.enabled?, + new_value = { + :value => !BlogComment::Moderation.enabled?, :scoping => :blog, :restricted => false } + if RefinerySetting.respond_to?(:set) + RefinerySetting.set(:comment_moderation, new_value) + else + RefinerySetting[:comment_moderation] = new_value + end end end end @@ -80,11 +85,16 @@ class BlogComment < ActiveRecord::Base end def recipients=(emails) - RefinerySetting[:comment_notification_recipients] = { + new_value = { :value => emails, :scoping => :blog, :restricted => false } + if RefinerySetting.respond_to?(:set) + RefinerySetting.set(:comment_notification_recipients, new_value) + else + RefinerySetting[:comment_notification_recipients] = new_value + end end def subject @@ -95,11 +105,16 @@ class BlogComment < ActiveRecord::Base end def subject=(subject_line) - RefinerySetting[:comment_notification_subject] = { + new_value = { :value => subject_line, :scoping => :blog, :restricted => false } + if RefinerySetting.respond_to?(:set) + RefinerySetting.set(:comment_notification_subject, new_value) + else + RefinerySetting[:comment_notification_subject] = new_value + end end end end diff --git a/app/views/admin/blog/_submenu.html.erb b/app/views/admin/blog/_submenu.html.erb index 5db96cf..a966f5b 100644 --- a/app/views/admin/blog/_submenu.html.erb +++ b/app/views/admin/blog/_submenu.html.erb @@ -78,9 +78,12 @@ </ul> </nav> -<% content_for :stylesheets do -%> - <%= stylesheet_link_tag 'refinery/refinerycms-blog' %> -<% end -%> -<% content_for :javascripts do -%> - <%= javascript_include_tag 'refinery/refinerycms-blog' %> -<% end -%>
\ No newline at end of file +<% if Refinery.version < '0.9.9' %> + <% content_for :head do %> + <%= stylesheet_link_tag('refinery/refinerycms-blog') %> + <%# this javascript is not even required in >= 0.9.9 because we made this sort of menu core. %> + <%= javascript_link_tag('refinery/refinerycms-blog') %> + <% end %> +<% else %> + <% content_for :stylesheets, stylesheet_link_tag('refinery/refinerycms-blog')%> +<% end %>
\ No newline at end of file diff --git a/app/views/admin/blog/comments/show.html.erb b/app/views/admin/blog/comments/show.html.erb index d4c2186..82a5f6f 100644 --- a/app/views/admin/blog/comments/show.html.erb +++ b/app/views/admin/blog/comments/show.html.erb @@ -59,5 +59,8 @@ </tr> </table> </div> - -<% content_for :stylesheets, stylesheet_link_tag('refinery/refinerycms-blog') %> +<% if Refinery.version < '0.9.9' %> + <% content_for :head, stylesheet_link_tag('refinery/refinerycms-blog') %> +<% else %> + <% content_for :stylesheets, stylesheet_link_tag('refinery/refinerycms-blog') %> +<% end %>
\ No newline at end of file diff --git a/app/views/admin/blog/posts/_form.css.erb b/app/views/admin/blog/posts/_form.css.erb new file mode 100644 index 0000000..d6f2c20 --- /dev/null +++ b/app/views/admin/blog/posts/_form.css.erb @@ -0,0 +1,7 @@ +<style type='text/css'> + ul.blog_categories, ul.blog_categories li { + list-style: none; + margin: 0px; + padding: 0px; + } +</style>
\ No newline at end of file diff --git a/app/views/admin/blog/posts/_form.html.erb b/app/views/admin/blog/posts/_form.html.erb index de46afc..5779e4c 100644 --- a/app/views/admin/blog/posts/_form.html.erb +++ b/app/views/admin/blog/posts/_form.html.erb @@ -57,27 +57,13 @@ :delete_title => t('admin.blog.posts.post.delete') } %> <% end -%> -<% content_for :stylesheets do -%> - <style type='text/css'> - ul.blog_categories, ul.blog_categories li { - list-style: none; - margin: 0px; - padding: 0px; - } - </style> -<% end -%> -<% content_for :after_javascript_libraries do %> - <script type='text/javascript'> - $(document).ready(function(){ - $('#toggle_advanced_options').click(function(e){ - e.preventDefault(); - - $('#more_options').animate({opacity: 'toggle', height: 'toggle'}, 250); - $('html,body').animate({ - scrollTop: $('#toggle_advanced_options').parent().offset().top - }, 250); - }); - }); - </script> -<% end %>
\ No newline at end of file +<% if Refinery.version < '0.9.9' %> + <% content_for :head do %> + <%= render :partial => 'form.css' %> + <%= render :partial => 'form.js' %> + <% end %> +<% else %> + <% content_for :stylesheets, render(:partial => 'form.css') -%> + <% content_for :javascripts, render(:partial => 'form.js') -%> +<% end %> diff --git a/app/views/admin/blog/posts/_form.js.erb b/app/views/admin/blog/posts/_form.js.erb new file mode 100644 index 0000000..394975f --- /dev/null +++ b/app/views/admin/blog/posts/_form.js.erb @@ -0,0 +1,13 @@ +<script> + $(document).ready(function(){ + $('#toggle_advanced_options').click(function(e){ + e.preventDefault(); + + $('#more_options').animate({opacity: 'toggle', height: 'toggle'}, 250); + + $('html,body').animate({ + scrollTop: $('#toggle_advanced_options').parent().offset().top + }, 250); + }); + }); +</script>
\ No newline at end of file diff --git a/app/views/blog/posts/show.html.erb b/app/views/blog/posts/show.html.erb index 1c725d5..603a44f 100644 --- a/app/views/blog/posts/show.html.erb +++ b/app/views/blog/posts/show.html.erb @@ -1,17 +1,8 @@ -<% content_for :after_javascript_libraries do %> - <% if BlogPost::ShareThis.enabled? %> - <script src="http://w.sharethis.com/button/buttons.js"></script> - <script> - stLight.options({publisher:'<%= BlogPost::ShareThis.key %>'}); - </script> - <% end %> -<% end %> - <% content_for :body_content_left do %> <div id="show_blog_post"> <%= render 'post' %> </div> - + <% if BlogPost.comments_allowed? %> <aside id="comments"> <h2><%= t('.comments.title') %></h2> @@ -73,5 +64,22 @@ <% end %> <%= render :partial => "/shared/content_page", :locals => { :remove_automatic_sections => true } %> -<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %> -<% content_for :javascripts, javascript_include_tag('jquery','refinerycms-blog') %>
\ No newline at end of file + +<% if Refinery.version < '0.9.9' %> + <% content_for :head_libraries, jquery_include_tags(:jquery_ui => false) %> + <% content_for :head do %> + <%= stylesheet_link_tag 'refinerycms-blog' %> + <%= javascript_include_tag('refinerycms-blog') %> + <% if BlogPost::ShareThis.enabled? %> + <script src="http://w.sharethis.com/button/buttons.js"></script> + <script>stLight.options({publisher:'<%= BlogPost::ShareThis.key %>'});</script> + <% end %> +<% else %> + <% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %> + <% content_for :before_javascript_libraries, jquery_include_tags(:jquery_ui => false) %> + <% content_for :javascripts do %> + <%= javascript_include_tag 'refinerycms-blog' %> + <script src="http://w.sharethis.com/button/buttons.js"></script> + <script>stLight.options({publisher:'<%= BlogPost::ShareThis.key %>'});</script> + <% end if BlogPost::ShareThis.enabled? %> +<% end %>
\ No newline at end of file |