From c343dd2889402a5e0eca4d490fbd0fbf3c892b70 Mon Sep 17 00:00:00 2001 From: Philip Arndt Date: Thu, 26 Aug 2010 20:53:46 +1200 Subject: display more frontend, create separate css for frontend and backend, namespace the js in the same fashion, now has full English support.. --- app/views/admin/blog/_submenu.html.erb | 9 ++--- app/views/admin/blog/categories/index.html.erb | 4 +-- app/views/admin/blog/comments/index.html.erb | 2 +- app/views/admin/blog/posts/_form.html.erb | 2 +- app/views/admin/blog/posts/index.html.erb | 4 +-- app/views/blog_posts/_side_bar.html.erb | 8 +++++ app/views/blog_posts/_sidebar.html.erb | 8 ----- app/views/blog_posts/index.html.erb | 5 ++- app/views/blog_posts/show.html.erb | 23 ++++++++----- config/locales/en.yml | 17 ++++++--- public/javascripts/refinery/refinerycms-blog.js | 40 +++++++++++++++++++++ public/javascripts/refinerycms-blog.js | 40 --------------------- public/stylesheets/refinery/refinerycms-blog.css | 33 ++++++++++++++++++ public/stylesheets/refinerycms-blog.css | 44 +++++++----------------- 14 files changed, 132 insertions(+), 107 deletions(-) create mode 100644 app/views/blog_posts/_side_bar.html.erb delete mode 100644 app/views/blog_posts/_sidebar.html.erb create mode 100644 public/javascripts/refinery/refinerycms-blog.js delete mode 100644 public/javascripts/refinerycms-blog.js create mode 100644 public/stylesheets/refinery/refinerycms-blog.css diff --git a/app/views/admin/blog/_submenu.html.erb b/app/views/admin/blog/_submenu.html.erb index db3064f..246488a 100644 --- a/app/views/admin/blog/_submenu.html.erb +++ b/app/views/admin/blog/_submenu.html.erb @@ -74,11 +74,6 @@ <% content_for :head do %> - - - + <%= stylesheet_link_tag 'refinery/refinerycms-blog' %> + <%= javascript_include_tag 'refinery/refinerycms-blog' %> <% end %> \ No newline at end of file diff --git a/app/views/admin/blog/categories/index.html.erb b/app/views/admin/blog/categories/index.html.erb index 824b1c3..9bd50a8 100644 --- a/app/views/admin/blog/categories/index.html.erb +++ b/app/views/admin/blog/categories/index.html.erb @@ -1,7 +1,7 @@ <%= render :partial => '/admin/blog/submenu' %>
<% if searching? %> -

<%= t('admin.search_results_for', :query => params[:search]) %>

+

<%= t('shared.admin.search.results_for', :query => params[:search]) %>

<% if @blog_categories.any? %> <%= render :partial => "blog_categories", :collection => @blog_categories %> @@ -22,7 +22,7 @@ <% else %>

- <%= t('.no_items_yet') %> + <%= t('.no_items_yet', :create => t('admin.blog.submenu.categories.new')) %>

<% end %> diff --git a/app/views/admin/blog/comments/index.html.erb b/app/views/admin/blog/comments/index.html.erb index 20fceb8..c5e911b 100644 --- a/app/views/admin/blog/comments/index.html.erb +++ b/app/views/admin/blog/comments/index.html.erb @@ -1,7 +1,7 @@ <%= render :partial => '/admin/blog/submenu' %>
<% if searching? %> -

<%= t('admin.search_results_for', :query => params[:search]) %>

+

<%= t('shared.admin.search.results_for', :query => params[:search]) %>

<% if @blog_comments.any? %> <%= will_paginate @blog_comments %> diff --git a/app/views/admin/blog/posts/_form.html.erb b/app/views/admin/blog/posts/_form.html.erb index f4322df..f6f332f 100644 --- a/app/views/admin/blog/posts/_form.html.erb +++ b/app/views/admin/blog/posts/_form.html.erb @@ -44,7 +44,7 @@ :locals => { :f => f, :continue_editing => true, - :delete_title => t('admin.blogs.blogs.delete') + :delete_title => t('admin.blog.posts.post.delete') } %> <% end -%> <% content_for :head do %> diff --git a/app/views/admin/blog/posts/index.html.erb b/app/views/admin/blog/posts/index.html.erb index 5b65962..ae825eb 100644 --- a/app/views/admin/blog/posts/index.html.erb +++ b/app/views/admin/blog/posts/index.html.erb @@ -1,7 +1,7 @@ <%= render :partial => '/admin/blog/submenu' %>
<% if searching? %> -

<%= t('admin.search_results_for', :query => params[:search]) %>

+

<%= t('shared.admin.search.results_for', :query => params[:search]) %>

<% if @blog_posts.any? %> <%= render :partial => "blog_posts", :collection => @blog_posts %> @@ -22,7 +22,7 @@ <% else %>

- <%= t('.no_items_yet') %> + <%= t('.no_items_yet', :create => t('admin.blog.submenu.posts.new')) %>

<% end %> diff --git a/app/views/blog_posts/_side_bar.html.erb b/app/views/blog_posts/_side_bar.html.erb new file mode 100644 index 0000000..56bd825 --- /dev/null +++ b/app/views/blog_posts/_side_bar.html.erb @@ -0,0 +1,8 @@ +

<%= t('.categories') %>

+
    + <% @blog_categories.each do |category| %> +
  • + <%= category.title %> +
  • + <% end %> +
\ No newline at end of file diff --git a/app/views/blog_posts/_sidebar.html.erb b/app/views/blog_posts/_sidebar.html.erb deleted file mode 100644 index 56bd825..0000000 --- a/app/views/blog_posts/_sidebar.html.erb +++ /dev/null @@ -1,8 +0,0 @@ -

<%= t('.categories') %>

-
    - <% @blog_categories.each do |category| %> -
  • - <%= category.title %> -
  • - <% end %> -
\ No newline at end of file diff --git a/app/views/blog_posts/index.html.erb b/app/views/blog_posts/index.html.erb index 7832a66..4e0cdbb 100644 --- a/app/views/blog_posts/index.html.erb +++ b/app/views/blog_posts/index.html.erb @@ -18,7 +18,10 @@ <% content_for :body_content_right do %> <%= @page[Page.default_parts.second.to_sym] %> - <%= render :partial => "sidebar" %> + <%= render :partial => "side_bar" %> <% end %> <%= render :partial => "/shared/content_page" %> +<% content_for :head do %> + <%= stylesheet_link_tag 'refinerycms-blog' %> +<% end %> \ 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 7a4c9c3..2a6fa12 100644 --- a/app/views/blog_posts/show.html.erb +++ b/app/views/blog_posts/show.html.erb @@ -4,21 +4,23 @@ <%= @blog_post.body %> <% if (categories = @blog_post.categories).any? %> - <%= t('.filed_in') %> -
    - <% categories.each do |category| %> -
  • - <%= link_to category.title, blog_category_url(category) %> -
  • - <% end %> -
+
+ <%= t('.filed_in') %> +
    + <% categories.each_with_index do |category, index| %> +
  • + <%= link_to category.title, blog_category_url(category) -%><%= ',' if index < ((categories.length) - 1) %> +
  • + <% end %> +
+
<% end %> <% end %> <% content_for :body_content_right do %>

<%= t('.created_at_title') %>

<%= t('.created_at', :when => @blog_post.created_at.strftime('%d %B %Y')) %> - <%= render :partial => "sidebar" %> + <%= render :partial => "side_bar" %>

<%= t('.other') %>

    @@ -31,3 +33,6 @@ <% end %> <%= render :partial => "/shared/content_page" %> +<% content_for :head do %> + <%= stylesheet_link_tag 'refinerycms-blog' %> +<% end %> \ No newline at end of file diff --git a/config/locales/en.yml b/config/locales/en.yml index 7263e70..c37ba53 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -8,6 +8,8 @@ en: category: edit: Edit this category delete: Delete this category forever + index: + no_items_yet: There are no categories yet. Click "{{create}}" to add your first category. comments: index: no_items_yet: There are no {{type}} comments yet. @@ -17,7 +19,7 @@ en: toggle_advanced_options: Click to access meta tag settings and menu options save_as_draft: Save as Draft index: - no_items_yet: There are no Blog Posts yet. Click "Create a new Blog Posts" to add your first blog posts. + no_items_yet: There are no Blog Posts yet. Click "{{create}}" to add your first blog post. post: view_live: View this blog post live
    (opens in a new window) edit: Edit this blog post @@ -25,8 +27,8 @@ en: settings: notification_recipients: value: Send notifications to - explanation: "Every time someone comments on a blog post, Refinery sends out an email to say there is a new comment." - hint: "When a new comment is added, Refinery will send an email notification to you." + explanation: Every time someone comments on a blog post, Refinery sends out an email to say there is a new comment. + hint: When a new comment is added, Refinery will send an email notification to you. example: "Enter your email address(es) like: jack@work.com, jill@office.com" submenu: categories: @@ -48,5 +50,12 @@ en: moderation: Moderation update_notified: Update who gets notified blog_posts: + side_bar: + categories: Categories + index: + read_more: Read more show: - other: Other Blog Posts \ No newline at end of file + other: Other Blog Posts + filed_in: Filed in + created_at_title: Publishing Date + created_at: Posted on {{when}} diff --git a/public/javascripts/refinery/refinerycms-blog.js b/public/javascripts/refinery/refinerycms-blog.js new file mode 100644 index 0000000..0159655 --- /dev/null +++ b/public/javascripts/refinery/refinerycms-blog.js @@ -0,0 +1,40 @@ +$(document).ready(function(){ + $('nav#actions.multilist > ul:not(.search_list) li a[href$=' + window.location.pathname + ']') + .parent().addClass('selected'); + + $('nav#actions.multilist > ul:not(.search_list) li > a').each(function(i,a){ + if ($(this).data('dialog-title') == null) { + $(this).bind('click', function(){ + $(this).css('background-image', "url('/images/refinery/icons/ajax-loader.gif') !important"); + }); + } + }); + + $('ul.collapsible_menu').each(function(i, ul) { + (first_li = $(this).children('li:first')).after(div=$("
    ")); + if (($(this).children('li.selected')).length == 0) { + div.hide(); + } + $(this).children('li:not(:first)').appendTo(div); + + first_li.find('> a').click(function(e){ + $(this).parent().next('div').animate({ + opacity: 'toggle' + , height: 'toggle' + }, 250, $.proxy(function(){ + $(this).css('background-image', null); + }, $(this)) + ); + e.preventDefault(); + }); + }); + + $('.success_icon, .failure_icon').bind('click', function(e) { + $.get($(this).attr('href'), $.proxy(function(data){ + $(this).css('background-image', null) + .toggleClass('success_icon') + .toggleClass('failure_icon'); + }, $(this))); + e.preventDefault(); + }); +}); \ No newline at end of file diff --git a/public/javascripts/refinerycms-blog.js b/public/javascripts/refinerycms-blog.js deleted file mode 100644 index 0159655..0000000 --- a/public/javascripts/refinerycms-blog.js +++ /dev/null @@ -1,40 +0,0 @@ -$(document).ready(function(){ - $('nav#actions.multilist > ul:not(.search_list) li a[href$=' + window.location.pathname + ']') - .parent().addClass('selected'); - - $('nav#actions.multilist > ul:not(.search_list) li > a').each(function(i,a){ - if ($(this).data('dialog-title') == null) { - $(this).bind('click', function(){ - $(this).css('background-image', "url('/images/refinery/icons/ajax-loader.gif') !important"); - }); - } - }); - - $('ul.collapsible_menu').each(function(i, ul) { - (first_li = $(this).children('li:first')).after(div=$("
    ")); - if (($(this).children('li.selected')).length == 0) { - div.hide(); - } - $(this).children('li:not(:first)').appendTo(div); - - first_li.find('> a').click(function(e){ - $(this).parent().next('div').animate({ - opacity: 'toggle' - , height: 'toggle' - }, 250, $.proxy(function(){ - $(this).css('background-image', null); - }, $(this)) - ); - e.preventDefault(); - }); - }); - - $('.success_icon, .failure_icon').bind('click', function(e) { - $.get($(this).attr('href'), $.proxy(function(data){ - $(this).css('background-image', null) - .toggleClass('success_icon') - .toggleClass('failure_icon'); - }, $(this))); - e.preventDefault(); - }); -}); \ No newline at end of file diff --git a/public/stylesheets/refinery/refinerycms-blog.css b/public/stylesheets/refinery/refinerycms-blog.css new file mode 100644 index 0000000..cc6f582 --- /dev/null +++ b/public/stylesheets/refinery/refinerycms-blog.css @@ -0,0 +1,33 @@ +.comments_icon { + background-image: url('/images/refinerycms-blog/icons/comments.png'); +} +.comment_icon { + background-image: url('/images/refinerycms-blog/icons/comment.png'); +} +.comment_cross_icon { + background-image: url('/images/refinerycms-blog/icons/comment_cross.png'); +} +.comment_tick_icon { + background-image: url('/images/refinerycms-blog/icons/comment_tick.png'); +} +.folder_icon { + background-image: url('/images/refinerycms-blog/icons/folder.png'); +} +.folder_add_icon { + background-image: url('/images/refinerycms-blog/icons/folder_add.png'); +} +.folder_edit_icon { + background-image: url('/images/refinerycms-blog/icons/folder_edit.png'); +} +.settings_icon { + background-image: url('/images/refinerycms-blog/icons/cog.png'); +} +.page_icon { + background-image: url('/images/refinerycms-blog/icons/page.png'); +} +.page_copy_icon { + background-image: url('/images/refinerycms-blog/icons/page_copy.png'); +} +.page_add_icon { + background-image: url('/images/refinerycms-blog/icons/page_add.png'); +} \ No newline at end of file diff --git a/public/stylesheets/refinerycms-blog.css b/public/stylesheets/refinerycms-blog.css index cc6f582..d961487 100644 --- a/public/stylesheets/refinerycms-blog.css +++ b/public/stylesheets/refinerycms-blog.css @@ -1,33 +1,13 @@ -.comments_icon { - background-image: url('/images/refinerycms-blog/icons/comments.png'); -} -.comment_icon { - background-image: url('/images/refinerycms-blog/icons/comment.png'); -} -.comment_cross_icon { - background-image: url('/images/refinerycms-blog/icons/comment_cross.png'); -} -.comment_tick_icon { - background-image: url('/images/refinerycms-blog/icons/comment_tick.png'); -} -.folder_icon { - background-image: url('/images/refinerycms-blog/icons/folder.png'); -} -.folder_add_icon { - background-image: url('/images/refinerycms-blog/icons/folder_add.png'); -} -.folder_edit_icon { - background-image: url('/images/refinerycms-blog/icons/folder_edit.png'); -} -.settings_icon { - background-image: url('/images/refinerycms-blog/icons/cog.png'); -} -.page_icon { - background-image: url('/images/refinerycms-blog/icons/page.png'); -} -.page_copy_icon { - background-image: url('/images/refinerycms-blog/icons/page_copy.png'); -} -.page_add_icon { - background-image: url('/images/refinerycms-blog/icons/page_add.png'); +.post_categories .filed_in { + display: inline; +} +.post_categories ul { + margin: 0px 0px 0px 6px; + padding: 0px; + display: inline; +} +.post_categories ul li { + margin: 0px; + padding: 0px; + display: inline; } \ No newline at end of file -- cgit v1.2.3