diff options
-rw-r--r-- | app/views/admin/blog/_submenu.html.erb | 7 | ||||
-rw-r--r-- | app/views/blog/shared/_post.html.erb | 2 | ||||
-rw-r--r-- | config/locales/en.yml | 1 | ||||
-rw-r--r-- | public/images/refinerycms-blog/icons/down.gif | bin | 0 -> 110 bytes | |||
-rw-r--r-- | public/images/refinerycms-blog/icons/up.gif | bin | 0 -> 111 bytes | |||
-rw-r--r-- | public/javascripts/refinery/refinerycms-blog.js | 3 | ||||
-rw-r--r-- | public/stylesheets/refinery/refinerycms-blog.css | 6 | ||||
-rw-r--r-- | readme.md | 16 |
8 files changed, 32 insertions, 3 deletions
diff --git a/app/views/admin/blog/_submenu.html.erb b/app/views/admin/blog/_submenu.html.erb index 246488a..5c93891 100644 --- a/app/views/admin/blog/_submenu.html.erb +++ b/app/views/admin/blog/_submenu.html.erb @@ -24,7 +24,12 @@ <ul class='collapsible_menu'> <li> - <%= link_to t('.comments.title'), '#', + <% if BlogComment.unmoderated.any? %> + <% title = t('.comments.title_with_count', :new_count => BlogComment.unmoderated.size) %> + <% else %> + <% title = t('.comments.title') %> + <% end %> + <%= link_to title, '#', :class => 'comments_icon' %> </li> <li> diff --git a/app/views/blog/shared/_post.html.erb b/app/views/blog/shared/_post.html.erb index d8194d3..56ac89c 100644 --- a/app/views/blog/shared/_post.html.erb +++ b/app/views/blog/shared/_post.html.erb @@ -1,4 +1,4 @@ -<li> +<li class='clearfix'> <h2><%= link_to post.title, blog_post_url(post) %></h2> <p class='posted_at'> <%= t('blog.shared.posts.created_at', :when => post.created_at.strftime('%d %B %Y')) %> diff --git a/config/locales/en.yml b/config/locales/en.yml index c3fd8a4..9f82fbc 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -57,6 +57,7 @@ en: new: Create new category comments: title: Comments + title_with_count: 'Comments ({{new_count}} new)' new: New unmoderated: New approved: Approved diff --git a/public/images/refinerycms-blog/icons/down.gif b/public/images/refinerycms-blog/icons/down.gif Binary files differnew file mode 100644 index 0000000..990bd87 --- /dev/null +++ b/public/images/refinerycms-blog/icons/down.gif diff --git a/public/images/refinerycms-blog/icons/up.gif b/public/images/refinerycms-blog/icons/up.gif Binary files differnew file mode 100644 index 0000000..1edf617 --- /dev/null +++ b/public/images/refinerycms-blog/icons/up.gif diff --git a/public/javascripts/refinery/refinerycms-blog.js b/public/javascripts/refinery/refinerycms-blog.js index c92ba3e..fdbf392 100644 --- a/public/javascripts/refinery/refinerycms-blog.js +++ b/public/javascripts/refinery/refinerycms-blog.js @@ -15,12 +15,15 @@ $(document).ready(function(){ $('ul.collapsible_menu').each(function(i, ul) { (first_li = $(this).children('li:first')).after(div=$("<div></div>")); + if (($(this).children('li.selected')).length == 0) { div.hide(); + first_li.addClass("closed"); } $(this).children('li:not(:first)').appendTo(div); first_li.find('> a').click(function(e){ + first_li.toggleClass("closed"); $(this).parent().next('div').animate({ opacity: 'toggle' , height: 'toggle' diff --git a/public/stylesheets/refinery/refinerycms-blog.css b/public/stylesheets/refinery/refinerycms-blog.css index cc6f582..bede6ce 100644 --- a/public/stylesheets/refinery/refinerycms-blog.css +++ b/public/stylesheets/refinery/refinerycms-blog.css @@ -30,4 +30,10 @@ } .page_add_icon { background-image: url('/images/refinerycms-blog/icons/page_add.png'); +} +.collapsible_menu li:first { + background-image: url('/images/refinerycms-blog/icons/up.png'); +} +.collapsible_menu li.closed { + background-image: url('/images/refinerycms-blog/icons/down.png'); }
\ No newline at end of file @@ -1 +1,15 @@ -Blog plugin redux
\ No newline at end of file +Install + +Open up your GemFile and add at the bottom this line + +gem 'refinerycms-blog', '= 1.0.rc6' + +Now run ``bundle install`` + +Next to install it run: + +ruby script/generate refinery_blog + +Finally migration your database and you're done. + +rake db:migrate
\ No newline at end of file |