diff options
Diffstat (limited to 'app/views/refinery')
39 files changed, 935 insertions, 0 deletions
diff --git a/app/views/refinery/admin/blog/_submenu.html.erb b/app/views/refinery/admin/blog/_submenu.html.erb new file mode 100644 index 0000000..442ab47 --- /dev/null +++ b/app/views/refinery/admin/blog/_submenu.html.erb @@ -0,0 +1,96 @@ +<nav id='actions' class='multilist'> + <ul class='search_list'> + <li class='not_a_link'> + <%= render :partial => "/refinery/admin/search", + :locals => { + :url => main_app.refinery_admin_blog_posts_path + } %> + </li> + </ul> + + <ul class='collapsible_menu'> + <li class='not_a_link'> + <%= link_to t('.posts.title'), '#', + :class => 'page_copy_icon' %> + </li> + <li> + <%= link_to t('.posts.manage'), main_app.refinery_admin_blog_posts_path, + :class => 'page_icon' %> + </li> + <li> + <%= link_to t('.posts.uncategorized'), main_app.uncategorized_refinery_admin_blog_posts_path, + :class => 'page_icon' %> + </li> + <li> + <%= link_to t('.posts.new'), main_app.new_refinery_admin_blog_post_path, + :class => 'page_add_icon' %> + </li> + </ul> + <% if Refinery::BlogPost.comments_allowed? %> + <ul class='collapsible_menu'> + <li class='not_a_link'> + <% if Refinery::BlogComment.unmoderated.any? %> + <% title = t('.comments.title_with_count', :new_count => Refinery::BlogComment.unmoderated.size) %> + <% else %> + <% title = t('.comments.title') %> + <% end %> + <%= link_to title, '#', + :class => 'comments_icon' %> + </li> + <li> + <%= link_to t('.comments.new'), main_app.refinery_admin_blog_comments_path, + :class => 'comment_icon' %> + </li> + <li> + <%= link_to t('.comments.approved'), main_app.approved_refinery_admin_blog_comments_path, + :class => 'comment_tick_icon' %> + </li> + <li> + <%= link_to t('.comments.rejected'), main_app.rejected_refinery_admin_blog_comments_path, + :class => 'comment_cross_icon' %> + </li> + </ul> + <% end %> + + <ul class='collapsible_menu'> + <li class='not_a_link'> + <%= link_to t('.categories.title'), '#', + :class => 'folder_icon' %> + </li> + <li> + <%= link_to t('.categories.manage'), main_app.refinery_admin_blog_categories_path, + :class => 'folder_edit_icon' %> + </li> + <li> + <%= link_to t('.categories.new'), main_app.new_refinery_admin_blog_category_path(:dialog => true, :height => 325), + :class => 'folder_add_icon' %> + </li> + </ul> + + <ul class='collapsible_menu'> + <li class='not_a_link'> + <%= link_to t('.settings.title'), main_app.refinery_admin_blog_settings_path, + :class => 'settings_icon' %> + </li> + <li> + <%= link_to t('.settings.comments'), main_app.comments_refinery_admin_blog_settings_path, + :class => "#{Refinery::BlogPost.comments_allowed? ? 'success' : 'failure'}_icon" %> + </li> + <li> + <%= link_to t('.settings.moderation'), main_app.moderation_refinery_admin_blog_settings_path, + :class => "#{Refinery::BlogComment::Moderation.enabled? ? 'success' : 'failure'}_icon" %> + </li> + <li> + <%= link_to t('.settings.update_notified'), + main_app.notification_recipients_refinery_admin_blog_settings_path(:dialog => true, :height => 400), + :class => 'user_comment_icon' %> + </li> + <li> + <%= link_to t('.settings.teasers'), + main_app.teasers_refinery_admin_blog_settings_path, :class => "#{Refinery::BlogPost.teasers_enabled? ? 'success' : 'failure'}_icon" %> + </li> + </ul> + +</nav> + +<% content_for :stylesheets, stylesheet_link_tag('refinery/refinerycms-blog')%> diff --git a/app/views/refinery/admin/blog/categories/_category.html.erb b/app/views/refinery/admin/blog/categories/_category.html.erb new file mode 100644 index 0000000..191f649 --- /dev/null +++ b/app/views/refinery/admin/blog/categories/_category.html.erb @@ -0,0 +1,16 @@ +<li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(category) -%>"> + <span class='title'> + <%= category.title %> + <span class="preview"> </span> + </span> + <span class='actions'> + <%= link_to refinery_icon_tag("application_edit.png"), + edit_admin_blog_category_path(category, :dialog => true, :height => 325), + :title => t('.edit') %> + <%= link_to refinery_icon_tag("delete.png"), admin_blog_category_path(category), + :class => "cancel confirm-delete", + :title => t('.delete'), + :method => :delete, + :confirm => t('message', :scope => 'shared.admin.delete', :title => category.title) %> + </span> +</li> diff --git a/app/views/refinery/admin/blog/categories/_form.html.erb b/app/views/refinery/admin/blog/categories/_form.html.erb new file mode 100644 index 0000000..bfcbc7b --- /dev/null +++ b/app/views/refinery/admin/blog/categories/_form.html.erb @@ -0,0 +1,19 @@ +<%= form_for [:admin, @blog_category] do |f| -%> + <%= render :partial => "/shared/admin/error_messages", + :locals => { + :object => f.object, + :include_object_name => true + } %> + + <div class='field'> + <%= f.label :title -%> + <%= f.text_field :title, :class => 'larger widest' -%> + </div> + + <%= render :partial => "/shared/admin/form_actions", + :locals => { + :f => f, + :continue_editing => false, + :delete_title => t('delete', :scope => 'admin.blog.categories.category') + } %> +<% end %> diff --git a/app/views/refinery/admin/blog/categories/_sortable_list.html.erb b/app/views/refinery/admin/blog/categories/_sortable_list.html.erb new file mode 100644 index 0000000..df6a39b --- /dev/null +++ b/app/views/refinery/admin/blog/categories/_sortable_list.html.erb @@ -0,0 +1,7 @@ +<ul id='sortable_list'> + <%= render :partial => 'category', :collection => @blog_categories %> +</ul> +<%= render :partial => "/shared/admin/sortable_list", + :locals => { + :continue_reordering => (defined?(continue_reordering) ? continue_reordering : true) + } %> diff --git a/app/views/refinery/admin/blog/categories/edit.html.erb b/app/views/refinery/admin/blog/categories/edit.html.erb new file mode 100644 index 0000000..2872e82 --- /dev/null +++ b/app/views/refinery/admin/blog/categories/edit.html.erb @@ -0,0 +1 @@ +<%= render :partial => "form" %> diff --git a/app/views/refinery/admin/blog/categories/index.html.erb b/app/views/refinery/admin/blog/categories/index.html.erb new file mode 100644 index 0000000..5d17d42 --- /dev/null +++ b/app/views/refinery/admin/blog/categories/index.html.erb @@ -0,0 +1,26 @@ +<%= render :partial => '/admin/blog/submenu' %> +<div id='records'> + <% if searching? %> + <h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2> + <% if @blog_categories.any? %> + <%= render :partial => "blog_categories", + :collection => @blog_categories %> + <% else %> + <p><%= t('search_no_results', :scope => 'admin') %></p> + <% end %> + <% else %> + <% if @blog_categories.any? %> + <%= will_paginate @blog_categories %> + + <%= render :partial => "sortable_list" %> + + <%= will_paginate @blog_categories %> + <% else %> + <p> + <strong> + <%= t('.no_items_yet', :create => t('new', :scope => 'admin.blog.submenu.categories')) %> + </strong> + </p> + <% end %> + <% end %> +</div> diff --git a/app/views/refinery/admin/blog/categories/new.html.erb b/app/views/refinery/admin/blog/categories/new.html.erb new file mode 100644 index 0000000..2872e82 --- /dev/null +++ b/app/views/refinery/admin/blog/categories/new.html.erb @@ -0,0 +1 @@ +<%= render :partial => "form" %> diff --git a/app/views/refinery/admin/blog/comments/_comment.html.erb b/app/views/refinery/admin/blog/comments/_comment.html.erb new file mode 100644 index 0000000..547b9e4 --- /dev/null +++ b/app/views/refinery/admin/blog/comments/_comment.html.erb @@ -0,0 +1,20 @@ +<li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= "comment-#{comment.to_param}" -%>"> + <span class='title'> + <%= comment.name %> + <span class="preview"> - <%= truncate(comment.message, :length => 75) %></span> + </span> + <span class='actions'> + <%= link_to refinery_icon_tag("application_go.png"), + blog_post_url(comment.post, :anchor => "comment-#{comment.to_param}"), + :title => t('.view_live_html'), + :target => "_blank" unless comment.unmoderated? %> + <%= link_to refinery_icon_tag('zoom.png'), admin_blog_comment_path(comment), + :title => t('.read') %> + <%= link_to refinery_icon_tag("cross.png"), + rejected_admin_blog_comment_path(comment, :return_to => request.path.split('/').last.gsub(/^comments$/, 'index')), + :title => t('.reject') unless comment.rejected? %> + <%= link_to refinery_icon_tag("tick.png"), + approved_admin_blog_comment_path(comment, :return_to => request.path.split('/').last.gsub(/^comments$/, 'index')), + :title => t('.approve') unless comment.approved? %> + </span> +</li> diff --git a/app/views/refinery/admin/blog/comments/_sortable_list.html.erb b/app/views/refinery/admin/blog/comments/_sortable_list.html.erb new file mode 100644 index 0000000..e141dee --- /dev/null +++ b/app/views/refinery/admin/blog/comments/_sortable_list.html.erb @@ -0,0 +1,7 @@ +<ul id='sortable_list'> + <%= render :partial => 'comment', :collection => @blog_comments %> +</ul> +<%= render :partial => "/shared/admin/sortable_list", + :locals => { + :continue_reordering => (defined?(continue_reordering) ? continue_reordering : true) + } %> diff --git a/app/views/refinery/admin/blog/comments/index.html.erb b/app/views/refinery/admin/blog/comments/index.html.erb new file mode 100644 index 0000000..aaec4ae --- /dev/null +++ b/app/views/refinery/admin/blog/comments/index.html.erb @@ -0,0 +1,35 @@ +<%= render :partial => '/admin/blog/submenu' %> +<div id='records'> + <% if searching? %> + <h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2> + <% if @blog_comments.any? %> + <%=# will_paginate @blog_comments + %> + + <ul> + <%= render :partial => "blog_comments", + :collection => @blog_comments %> + </ul> + + <%=# will_paginate @blog_comments + %> + <% else %> + <p><%= t('search_no_results', :scope => 'admin') %></p> + <% end %> + <% else %> + <% if @blog_comments.any? %> + <%=# will_paginate @blog_comments + %> + + <%= render :partial => "sortable_list" %> + + <%=# will_paginate @blog_comments + %> + <% else %> + <h3> + <%= t('.no_items_yet', + :type => t(action_name.gsub('index', 'new'), :scope => 'admin.blog.submenu.comments').downcase) %> + </h3> + <% end %> + <% end %> +</div> diff --git a/app/views/refinery/admin/blog/comments/show.html.erb b/app/views/refinery/admin/blog/comments/show.html.erb new file mode 100644 index 0000000..d4c2186 --- /dev/null +++ b/app/views/refinery/admin/blog/comments/show.html.erb @@ -0,0 +1,63 @@ +<div id='actions'> + <h2><%= t('.details')%></h2> + <p> + <strong><%= t('.age') %>:</strong> <%= time_ago_in_words(@blog_comment.created_at) %> + </p> + <h2><%= t('.actions') %></h2> + <ul> + <li> + <%= link_to t('.back'), {:action => 'index'}, :class => "back_icon" %> + </li> + <li> + <%= link_to t('.reject'), rejected_admin_blog_comment_path(@blog_comment, :return_to => 'rejected'), + :class => 'comment_cross_icon' unless @blog_comment.rejected? %> + </li> + <li> + <%= link_to t('.approve'), approved_admin_blog_comment_path(@blog_comment, :return_to => 'approved'), + :class => 'comment_tick_icon' unless @blog_comment.approved? %> + </li> + </ul> +</div> +<div id='records'> + <h2><%= t('.comment') %></h2> + <table id='inquiry'> + <tr> + <td> + <strong><%= t('.blog_post') %></strong> + </td> + <td> + <%= link_to @blog_comment.post.title, + blog_post_url(@blog_comment.post, :anchor => "comment-#{@blog_comment.to_param}"), + :target => '_blank' %> + </td> + </tr> + <tr> + <td> + <strong><%= t('.from') %></strong> + </td> + <td> + <%= @blog_comment.name %> [<%= mail_to @blog_comment.email, @blog_comment.email, {:title => t('.click_to_email')} %>] + </td> + </tr> + <tr> + <td> + <strong><%= t('.date') %></strong> + </td> + <td> + <%= l(Date.parse(@blog_comment.created_at.to_s), :format => :long) %> + </td> + </tr> + <tr> + <td valign='top'> + <strong><%= t('.message') %></strong> + </td> + <td> + <p style='margin-top: 0px'> + <%= @blog_comment.message.gsub("\r\n\r\n", "\r\n").gsub("\r\n", "</p><p>") %> + </p> + </td> + </tr> + </table> +</div> + +<% content_for :stylesheets, stylesheet_link_tag('refinery/refinerycms-blog') %> diff --git a/app/views/refinery/admin/blog/posts/_form.css.erb b/app/views/refinery/admin/blog/posts/_form.css.erb new file mode 100644 index 0000000..869ab9b --- /dev/null +++ b/app/views/refinery/admin/blog/posts/_form.css.erb @@ -0,0 +1,20 @@ +<style type='text/css'> + ul.blog_categories{ + height:200px; + overflow:auto; + border:1px solid #ccc; + padding:5px; + } + ul.blog_categories, ul.blog_categories li { + list-style: none; + margin:5px 0; + } + a#copy_body_link { + background: url("/images/refinery/icons/add.png") no-repeat scroll 0 6px transparent; + border-bottom: 0 none; + display: inline; + line-height: 29px; + margin-top: 0; + padding-left: 20px; + } +</style> diff --git a/app/views/refinery/admin/blog/posts/_form.html.erb b/app/views/refinery/admin/blog/posts/_form.html.erb new file mode 100644 index 0000000..1fc0050 --- /dev/null +++ b/app/views/refinery/admin/blog/posts/_form.html.erb @@ -0,0 +1,108 @@ +<%= form_for [main_app, :refinery_admin, @blog_post] do |f| -%> + <%= render :partial => "/refinery/admin/error_messages", + :locals => { + :object => f.object, + :include_object_name => true + } %> + + <div class='field'> + <%= f.label :title -%> + <%= f.text_field :title, :class => 'larger widest' -%> + </div> + + <div class='field'> + <div id='page-tabs' class='clearfix ui-tabs ui-widget ui-widget-content ui-corner-all'> + <ul id='page_parts'> + <li class='ui-state-default ui-state-active'> + <%= link_to t('body', :scope => 'activerecord.attributes.blog_post'), "#page_part_body" %> + </li> + <li class='ui-state-default'> + <%= link_to t('teaser', :scope => 'activerecord.attributes.blog_post'), "#page_part_teaser" %> + </li> + <% Refinery::Blog.tabs.each_with_index do |tab, tab_index| %> + <li class='ui-state-default' id="custom_<%= tab.name %>_tab"> + <%= link_to tab.name.titleize, "#custom_tab_#{tab_index}" %> + </li> + <% end %> + </ul> + + <div id='page_part_editors'> + + <% part_index = -1 %> + <%= render :partial => 'form_part', + :locals => { + :f => f, + :part_index => (part_index += 1), + } -%> + <%= render :partial => 'teaser_part', + :locals => { + :f => f, + :part_index => (part_index += 1), + } if f.object.respond_to?(:custom_teaser) -%> + <% Refinery::Blog.tabs.each_with_index do |tab, tab_index| %> + <div class='page_part' id='<%= "custom_tab_#{tab_index}" %>'> + <%= render :partial => tab.partial, :locals => {:f => f} %> + </div> + <% end %> + </div> + </div> + </div> + + <div class='field'> + <%= f.label :tag_list, t('blog.shared.tags.title') -%> + <%= f.text_field :tag_list, :class => 'larger' -%> + </div> + + <div id='more_options_field'> + <p> + <%= link_to t('.advanced_options'), "#", + :id => 'toggle_advanced_options', + :title => t('.toggle_advanced_options') %> + </p> + <span id='draft_field'> + <%= f.check_box :draft %> + <%= f.label :draft, t('.save_as_draft'), :class => "stripped" %> + </span> + </div> + <div id='more_options' style="display:none;"> + <div class="hemisquare"> + <h3><%= t('title', :scope => 'admin.blog.submenu.categories') %></h3> + <ul class='blog_categories'> + <% @blog_categories.each do |category| %> + <li> + <%= check_box_tag 'blog_post[category_ids][]', category.id, + @blog_post.categories.include?(category), + :id => (id="blog_post_category_ids_#{category.id}") %> + <%= label_tag 'blog_post[category_ids][]', category.title, + :class => 'stripped', + :for => id %> + </li> + <% end %> + </ul> + <h3><%= t('.published_at') %></h3> + <%= f.datetime_select :published_at %> + + <div class='field'> + <span class='label_with_help'> + <%= f.label :custom_url, t('.custom_url') %> + <%= refinery_help_tag t('.custom_url_help') %> + </span> + <%= f.text_field :custom_url, :class => "widest" %> + </div> + + </div> + <div class='hemisquare right_side'> + <%= render :partial => '/seo_meta/form', :locals => {:form => f} %> + </div> + </div> + <%= render :partial => "/refinery/admin/form_actions", + :locals => { + :f => f, + :continue_editing => true, + :delete_title => t('delete', :scope => 'admin.blog.posts.post') + } %> +<% end -%> + +<% content_for :stylesheets, render(:partial => 'form.css') -%> +<% content_for :javascripts, render(:partial => 'form.js') -%> +<%= render 'refinery/shared/admin/autocomplete', :dom_id => '#blog_post_tag_list', :url => main_app.tags_refinery_admin_blog_posts_url %> diff --git a/app/views/refinery/admin/blog/posts/_form.js.erb b/app/views/refinery/admin/blog/posts/_form.js.erb new file mode 100644 index 0000000..87ad23f --- /dev/null +++ b/app/views/refinery/admin/blog/posts/_form.js.erb @@ -0,0 +1,23 @@ +<script> + (function($) { + $(function() { + $('#page-tabs').tabs(); + $('#copy_body_link').click(function(event) { + // Find the WYMEditor that maps to the custom_teaser field + var teaserTextArea = $('#blog_post_custom_teaser')[0]; + var teaserEditor = null; + $.each(WYMeditor.INSTANCES, function(index, editor) { + if (editor._element[0] == teaserTextArea) { + teaserEditor = editor; + } + }); + + if (teaserEditor) { + teaserEditor.html($('#blog_post_body').attr('value')); + } + + event.preventDefault(); + }); + }); + })(jQuery); +</script> diff --git a/app/views/refinery/admin/blog/posts/_form_part.html.erb b/app/views/refinery/admin/blog/posts/_form_part.html.erb new file mode 100644 index 0000000..114e493 --- /dev/null +++ b/app/views/refinery/admin/blog/posts/_form_part.html.erb @@ -0,0 +1,3 @@ +<div class='page_part' id='page_part_body'> + <%= f.text_area :body, :rows => 20, :class => 'wymeditor widest' -%> +</div> diff --git a/app/views/refinery/admin/blog/posts/_post.html.erb b/app/views/refinery/admin/blog/posts/_post.html.erb new file mode 100644 index 0000000..a7f09e0 --- /dev/null +++ b/app/views/refinery/admin/blog/posts/_post.html.erb @@ -0,0 +1,21 @@ +<li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(post) -%>"> + <span class='title'> + <%= post.title %> + <span class="preview"> + <%= post.published_at.try(:strftime, '%b %d, %Y') || 'draft' %> + <%= " by #{post.author.username}" if post.author.present? %> + </span> + </span> + <span class='actions'> + <%= link_to refinery_icon_tag("application_go.png"), blog_post_url(post), + :title => t('.view_live_html'), + :target => "_blank" %> + <%= link_to refinery_icon_tag("application_edit.png"), edit_admin_blog_post_path(post), + :title => t('.edit') %> + <%= link_to refinery_icon_tag("delete.png"), admin_blog_post_path(post), + :class => "cancel confirm-delete", + :title => t('.delete'), + :method => :delete, + :confirm => t('message', :scope => 'shared.admin.delete', :title => post.title) %> + </span> +</li> diff --git a/app/views/refinery/admin/blog/posts/_sortable_list.html.erb b/app/views/refinery/admin/blog/posts/_sortable_list.html.erb new file mode 100644 index 0000000..7ae0ad3 --- /dev/null +++ b/app/views/refinery/admin/blog/posts/_sortable_list.html.erb @@ -0,0 +1,7 @@ +<ul id='sortable_list'> + <%= render :partial => 'post', :collection => @blog_posts %> +</ul> +<%= render :partial => "/shared/admin/sortable_list", + :locals => { + :continue_reordering => (defined?(continue_reordering) ? continue_reordering : true) + } %> diff --git a/app/views/refinery/admin/blog/posts/_teaser_part.html.erb b/app/views/refinery/admin/blog/posts/_teaser_part.html.erb new file mode 100644 index 0000000..71d7d01 --- /dev/null +++ b/app/views/refinery/admin/blog/posts/_teaser_part.html.erb @@ -0,0 +1,11 @@ +<div class='page_part' id='page_part_teaser'> + <%= f.text_area :custom_teaser, :rows => 20, :class => 'wymeditor widest' -%> + <p> + <span class='clearfix label_inline_with_link'> + <%= link_to t('copy_body', :scope => 'admin.blog.posts.form'), "#", + :id => 'copy_body_link', + :title => t('copy_body_help', :scope => 'admin.blog.posts.form') %> + </span> + </p> +</div> + diff --git a/app/views/refinery/admin/blog/posts/edit.html.erb b/app/views/refinery/admin/blog/posts/edit.html.erb new file mode 100644 index 0000000..2872e82 --- /dev/null +++ b/app/views/refinery/admin/blog/posts/edit.html.erb @@ -0,0 +1 @@ +<%= render :partial => "form" %> diff --git a/app/views/refinery/admin/blog/posts/index.html.erb b/app/views/refinery/admin/blog/posts/index.html.erb new file mode 100644 index 0000000..72037ca --- /dev/null +++ b/app/views/refinery/admin/blog/posts/index.html.erb @@ -0,0 +1,28 @@ +<%= render :partial => '/refinery/admin/blog/submenu' %> +<div id='records'> + <% if searching? %> + <h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2> + <% if @blog_posts.any? %> + <ul> + <%= render :partial => "post", + :collection => @blog_posts %> + </ul> + <% else %> + <p><%= t('no_results', :scope => 'shared.admin.search') %></p> + <% end %> + <% else %> + <% if @blog_posts.any? %> + <%= will_paginate @blog_posts %> + + <%= render :partial => "sortable_list" %> + + <%= will_paginate @blog_posts %> + <% else %> + <p> + <strong> + <%= t('.no_items_yet', :create => t('new', :scope => 'admin.blog.submenu.posts')) %> + </strong> + </p> + <% end %> + <% end %> +</div> diff --git a/app/views/refinery/admin/blog/posts/new.html.erb b/app/views/refinery/admin/blog/posts/new.html.erb new file mode 100644 index 0000000..2872e82 --- /dev/null +++ b/app/views/refinery/admin/blog/posts/new.html.erb @@ -0,0 +1 @@ +<%= render :partial => "form" %> diff --git a/app/views/refinery/admin/blog/posts/uncategorized.html.erb b/app/views/refinery/admin/blog/posts/uncategorized.html.erb new file mode 100644 index 0000000..19d9e20 --- /dev/null +++ b/app/views/refinery/admin/blog/posts/uncategorized.html.erb @@ -0,0 +1,26 @@ +<%= render :partial => '/admin/blog/submenu' %> +<div id='records'> + <% if searching? %> + <h2><%= t('results_for', :scope => 'shared.admin.search', :query => params[:search]) %></h2> + <% if @blog_posts.any? %> + <%= render :partial => "blog_posts", + :collection => @blog_posts %> + <% else %> + <p><%= t('search_no_results', :scope => 'admin') %></p> + <% end %> + <% else %> + <% if @blog_posts.any? %> + <%= will_paginate @blog_posts %> + + <%= render :partial => "sortable_list" %> + + <%= will_paginate @blog_posts %> + <% else %> + <p> + <strong> + <%= t('.no_items_yet', :create => t('new', :scope => 'admin.blog.submenu.posts')) %> + </strong> + </p> + <% end %> + <% end %> +</div> diff --git a/app/views/refinery/admin/blog/settings/notification_recipients.html.erb b/app/views/refinery/admin/blog/settings/notification_recipients.html.erb new file mode 100644 index 0000000..41e7f2d --- /dev/null +++ b/app/views/refinery/admin/blog/settings/notification_recipients.html.erb @@ -0,0 +1,24 @@ +<%= form_tag do %> + + <div class='field'> + <span class='label_with_help'> + <%= label_tag :recipients, t('.value') %> + </span> + <%= text_field_tag :recipients, @recipients, :class => "larger widest" %> + </div> + + <p> + <%= t('.hint') %> + </p> + <p> + <%= t('.example') %> + </p> + + <%= render :partial => "/shared/admin/form_actions", + :locals => { + :f => nil, + :continue_editing => false, + :cancel_url => admin_blog_posts_url, + :hide_delete => true + } %> +<% end %> diff --git a/app/views/refinery/blog/categories/show.html.erb b/app/views/refinery/blog/categories/show.html.erb new file mode 100644 index 0000000..40444ec --- /dev/null +++ b/app/views/refinery/blog/categories/show.html.erb @@ -0,0 +1,21 @@ +<% content_for :body_content_title, @category.title %> + +<% content_for :body_content_left do %> + <% if @blog_posts.any? %> + <section id="blog_posts"> + <%= render :partial => "/blog/shared/post", :collection => @blog_posts %> + <%= will_paginate @blog_posts %> + </section> + <% else %> + <p> + <%= t('.no_posts') %> + </p> + <% end %> +<% end %> + +<% content_for :body_content_right do %> + <%= render :partial => "/blog/shared/categories" %> +<% end %> + +<%= render :partial => "/shared/content_page" %> +<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %> diff --git a/app/views/refinery/blog/comment_mailer/notification.html.erb b/app/views/refinery/blog/comment_mailer/notification.html.erb new file mode 100644 index 0000000..800f12c --- /dev/null +++ b/app/views/refinery/blog/comment_mailer/notification.html.erb @@ -0,0 +1,17 @@ +<%=raw t('.greeting') %>, + +<%=raw t('.you_recieved_new_comment') %> + +<%=raw t('.comment_starts') %> + +<%=raw t('.from') %>: <%= @comment.name %> +<%=raw t('.email') %>: <%= @comment.email %> +<%=raw t('.message') %>: +<%=simple_format strip_tags(@comment.body) %> + +<%=raw t('.comment_ends') %> + +<%=raw t('.closing_line') %>, +<%=raw RefinerySetting[:site_name] %> + +<%=raw t('.ps') %> diff --git a/app/views/refinery/blog/posts/_comment.html.erb b/app/views/refinery/blog/posts/_comment.html.erb new file mode 100644 index 0000000..5503826 --- /dev/null +++ b/app/views/refinery/blog/posts/_comment.html.erb @@ -0,0 +1,10 @@ +<article class='blog_comment_message' id='<%= "comment-#{comment.to_param}" %>'> + <%= image_tag comment.avatar_url, :alt => comment.name, :class => 'avatar' %> + <%= simple_format auto_link(comment.message.to_s) %> + <footer class='blog_comment_author'> + <p> + <%= t('by', :scope => 'blog.posts.comments', :who => comment.name) %>, + <%= t('time_ago', :scope => 'blog.posts.comments', :time => time_ago_in_words(comment.created_at)) %> + </p> + </footer> +</article> diff --git a/app/views/refinery/blog/posts/_nav.html.erb b/app/views/refinery/blog/posts/_nav.html.erb new file mode 100644 index 0000000..df4b435 --- /dev/null +++ b/app/views/refinery/blog/posts/_nav.html.erb @@ -0,0 +1,11 @@ +<nav id="next_prev_article"> + <% if @blog_post.next.present? -%> + <%= link_to (truncate(@blog_post.next.title) + " »").html_safe, @blog_post.next, :class => 'next' %> + <% end -%> + + <%= link_to t('blog_home', :scope => 'blog.posts.show'), blog_root_path, :class => 'home' %> + + <% if @blog_post.prev.present? -%> + <%= link_to ("« " + truncate(@blog_post.prev.title)).html_safe, @blog_post.prev, :class => 'prev' %> + <% end -%> +</nav><!-- /next_prev_article --> diff --git a/app/views/refinery/blog/posts/_post.html.erb b/app/views/refinery/blog/posts/_post.html.erb new file mode 100644 index 0000000..12978d3 --- /dev/null +++ b/app/views/refinery/blog/posts/_post.html.erb @@ -0,0 +1,31 @@ +<% flash.each do |key, value| %> + <div id='flash' class="flash flash_<%= key %>"> + <%= value %> + </div> +<% end %> +<article id="blog_post"> + <header> + <h1><%= @blog_post.title %></h1> + <section class='details'> + <time datetime="<%=l @blog_post.published_at.to_date, :format => :default %>" class='posted_at'> + <%= t('created_at', :scope => 'blog.shared.posts', :when => l(@blog_post.published_at.to_date, :format => :short)) %> + </time> + <%= "#{t('by', :scope => 'blog.posts.show')} #{@blog_post.author.username}" if @blog_post.author.present? %>. + <% if (categories = @blog_post.categories).any? %> + <aside class='filed_in'> + <%= t('filed_in', :scope => 'blog.posts.show') %> + <% categories.each_with_index do |category, index| %> + <%= link_to category.title, blog_category_url(category) -%><%= ',' if index < ((categories.length) - 1) %> + <% end %> + </aside> + <% end %> + </section> + </header> + <%= @blog_post.body.html_safe %> + + <% if BlogPost::ShareThis.enabled? %> + <span class="st_sharethis" displayText="ShareThis"></span> + <% end %> +</article> +<%= render :partial => '/shared/draft_page_message' unless @blog_post.nil? or @blog_post.live? -%> +<%= render 'nav' if next_or_previous?(@blog_post) %> diff --git a/app/views/refinery/blog/posts/archive.html.erb b/app/views/refinery/blog/posts/archive.html.erb new file mode 100644 index 0000000..a2044e8 --- /dev/null +++ b/app/views/refinery/blog/posts/archive.html.erb @@ -0,0 +1,20 @@ +<% content_for :body_content_left do %> + <h1><%= t('.blog_archive_for', :date => @archive_date.strftime('%B %Y')) %></h1> + <% if @blog_posts.any? %> + <section id="blog_posts"> + <%= render :partial => "/blog/shared/post", :collection => @blog_posts %> + </section> + <% else %> + <p><%= t('.no_blog_articles_posted', :date => @archive_date.strftime('%B %Y')) %></p> + <% end %> +<% end %> + +<% content_for :body_content_right do %> + <%= render :partial => "/blog/shared/categories" %> + <%= render :partial => "/blog/shared/tags" %> + <%= render :partial => "/blog/shared/rss_feed" %> + <%= blog_archive_list %> +<% end %> + +<%= render :partial => "/shared/content_page" %> +<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %> diff --git a/app/views/refinery/blog/posts/index.html.erb b/app/views/refinery/blog/posts/index.html.erb new file mode 100644 index 0000000..8c3801a --- /dev/null +++ b/app/views/refinery/blog/posts/index.html.erb @@ -0,0 +1,24 @@ +<% content_for :body_content_left do %> + <%=raw @page[Page.default_parts.first.to_sym] if Page.default_parts.any? %> + + <% if @blog_posts.any? %> + <section id="blog_posts"> + <%= render :partial => "/blog/shared/post", :collection => @blog_posts %> + <%= will_paginate @blog_posts %> + </section> + <% else %> + <p><%= t('.no_blog_articles_yet') %></p> + <% end %> +<% end %> + +<% content_for :body_content_right do %> + <%=raw @page[Page.default_parts.second.to_sym] if Page.default_parts.many? %> + + <%= render :partial => "/blog/shared/categories" %> + <%= render :partial => "/blog/shared/tags" %> + <%= render :partial => "/blog/shared/rss_feed" %> + <%= blog_archive_list %> +<% end %> + +<%= render :partial => "/shared/content_page" %> +<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %> diff --git a/app/views/refinery/blog/posts/index.rss.builder b/app/views/refinery/blog/posts/index.rss.builder new file mode 100644 index 0000000..51fa4da --- /dev/null +++ b/app/views/refinery/blog/posts/index.rss.builder @@ -0,0 +1,17 @@ +xml.instruct! :xml, :version => "1.0" +xml.rss :version => "2.0" do + xml.channel do + xml.title RefinerySetting.find_or_set(:site_name, "Company Name") + xml.description RefinerySetting.find_or_set(:site_name, "Company Name") + " Blog Posts" + xml.link blog_root_url + + @blog_posts.each do |post| + xml.item do + xml.title post.title + xml.description post.body + xml.pubDate post.published_at.to_s(:rfc822) + xml.link blog_post_url(post) + end + end + end +end
\ No newline at end of file diff --git a/app/views/refinery/blog/posts/show.html.erb b/app/views/refinery/blog/posts/show.html.erb new file mode 100644 index 0000000..cc763a8 --- /dev/null +++ b/app/views/refinery/blog/posts/show.html.erb @@ -0,0 +1,67 @@ +<% 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> + <% if (comments = @blog_post.comments.approved).any? %> + <%= render :partial => "comment", :collection => comments %> + <% else %> + <p> + <%= t('none', :scope => 'blog.shared.comments') %>. + </p> + <% end %> + + <% flash.each do |key, value| %> + <div id='flash' class="flash flash_<%= key %>"> + <%= value %> + </div> + <% end %> + + <h2><%= t('.comments.add') %></h2> + <%= form_for [:blog_post, @blog_comment] do |f| %> + <%= render :partial => "/shared/admin/error_messages", + :locals => { + :object => f.object, + :include_object_name => true + } %> + <div class='field'> + <%= f.label :name %> + <%= f.text_field :name %> + </div> + <div class='field'> + <%= f.label :email %> + <%= f.email_field :email %> + </div> + <div class='field message_field'> + <%= f.label :message %> + <%= f.text_area :message, :rows => 6 %> + </div> + <div class='field form-actions'> + <%= f.submit t('.submit') %> + </div> + <% end %> + </aside> + <% end %> +<% end %> + +<% content_for :body_content_right do %> + <%= render :partial => "/blog/shared/categories" %> + <%= render :partial => "/blog/shared/tags" %> + <%= render :partial => "/blog/shared/posts" %> + <%= render :partial => "/blog/shared/rss_feed" %> + <%= blog_archive_list %> +<% end %> + +<%= render :partial => "/shared/content_page", :locals => { :remove_automatic_sections => true } %> + +<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %> +<% content_for :before_javascript_libraries, jquery_include_tags(:jquery_ui => false) %> +<% content_for :javascripts do %> + <%# enable AJAX'd post nav at your own risk until html5 history API implemented. %> + <%#= 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? %> diff --git a/app/views/refinery/blog/posts/tagged.html.erb b/app/views/refinery/blog/posts/tagged.html.erb new file mode 100644 index 0000000..904150f --- /dev/null +++ b/app/views/refinery/blog/posts/tagged.html.erb @@ -0,0 +1,22 @@ +<% content_for :body_content_title, "#{t('.posts_tagged')} “#{@tag_name.titleize}”".html_safe -%> + +<% content_for :body_content_left do %> + <% if @blog_posts.any? %> + <section id="blog_posts"> + <%= render :partial => "/blog/shared/post", :collection => @blog_posts %> + <%= will_paginate @blog_posts %> + </section> + <% else %> + <p><%= t('.no_blog_articles_yet') %></p> + <% end %> +<% end %> + +<% content_for :body_content_right do %> + <%= render :partial => "/blog/shared/categories" %> + <%= render :partial => "/blog/shared/tags" %> + <%= render :partial => "/blog/shared/rss_feed" %> + <%= blog_archive_list %> +<% end %> + +<%= render :partial => "/shared/content_page" %> +<% content_for :stylesheets, stylesheet_link_tag('refinerycms-blog') %> diff --git a/app/views/refinery/blog/shared/_categories.html.erb b/app/views/refinery/blog/shared/_categories.html.erb new file mode 100644 index 0000000..05cc53f --- /dev/null +++ b/app/views/refinery/blog/shared/_categories.html.erb @@ -0,0 +1,10 @@ +<% if @blog_categories.any? %> + <h2><%= t('.title') %></h2> + <ul id='categories'> + <% @blog_categories.each do |category| %> + <li<%= " class='selected'" if @category.present? and @category.id == category.id %>> + <%= link_to "#{category.title} (#{category.post_count})", blog_category_url(category) %> + </li> + <% end %> + </ul> +<% end %>
\ No newline at end of file diff --git a/app/views/refinery/blog/shared/_post.html.erb b/app/views/refinery/blog/shared/_post.html.erb new file mode 100644 index 0000000..6cda22d --- /dev/null +++ b/app/views/refinery/blog/shared/_post.html.erb @@ -0,0 +1,46 @@ +<% if post.live? %> + <article class="blog_post" id="<%= dom_id(post) %>"> + <header> + <h1><%= link_to post.title, blog_post_url(post) %></h1> + <section class='details'> + <time datetime="<%=l post.published_at.to_date, :format => :default %>" class='posted_at'> + <%= t('created_at', :scope => 'blog.shared.posts', :when => l(post.published_at.to_date, :format => :short)) %> + </time> + <%= "#{t('by', :scope => 'blog.posts.show')} #{post.author.username}" if post.author.present? %>. + <% if (categories = post.categories).any? %> + <aside class='filed_in'> + <%= t('filed_in', :scope => 'blog.posts.show') %> + <%=raw categories.collect { |category| link_to category.title, blog_category_url(category) }.to_sentence %> + </aside> + <% end %> + <% if (tags = post.tags).any? %> + <aside class='tagged'> + <%= t('tagged', :scope => 'blog.posts.show') %> + <%=raw tags.collect { |tag| link_to tag, tagged_posts_path(tag.id, tag.name.parameterize) }.to_sentence %> + </aside> + <% end %> + </section> + </header> + <section class='clearfix'> + <% if blog_post_teaser_enabled? %> + <%= blog_post_teaser(post) %> + <% else %> + <%= post.body.html_safe %> + <% end %> + </section> + <footer> + <p> + <%= link_to t('read_more', :scope => 'blog.shared.posts'), blog_post_url(post) if blog_post_teaser_enabled? %> + </p> + <aside class='comment_count'> + <% if BlogPost.comments_allowed? %> + <% if post.comments.any? %> + (<%= pluralize(post.comments.approved.count, t('singular', :scope => 'blog.shared.comments')) %>) + <% else %> + (<%= t('none', :scope => 'blog.shared.comments') %>) + <% end %> + <% end %> + </aside> + </footer> + </article> +<% end %> diff --git a/app/views/refinery/blog/shared/_posts.html.erb b/app/views/refinery/blog/shared/_posts.html.erb new file mode 100644 index 0000000..24a8199 --- /dev/null +++ b/app/views/refinery/blog/shared/_posts.html.erb @@ -0,0 +1,10 @@ +<% if @blog_posts.many? %> + <h2><%= t('.other') %></h2> + <ul id="blog_posts"> + <% @blog_posts.each do |blog_post| %> + <li class='clearfix'> + <%= link_to blog_post.title, blog_post_url(blog_post) %> + </li> + <% end %> + </ul> +<% end %>
\ No newline at end of file diff --git a/app/views/refinery/blog/shared/_rss_feed.html.erb b/app/views/refinery/blog/shared/_rss_feed.html.erb new file mode 100644 index 0000000..1c2cef7 --- /dev/null +++ b/app/views/refinery/blog/shared/_rss_feed.html.erb @@ -0,0 +1,2 @@ +<h2><%= t('.title') %></h2> +<%= link_to t('.subscribe'), blog_rss_feed_url, :id => "rss_feed_subscribe"%> diff --git a/app/views/refinery/blog/shared/_tags.html.erb b/app/views/refinery/blog/shared/_tags.html.erb new file mode 100644 index 0000000..b0b11ee --- /dev/null +++ b/app/views/refinery/blog/shared/_tags.html.erb @@ -0,0 +1,8 @@ +<% if @tags.any? %> + <h2><%= t('.title') %></h2> + <nav id='tags'> + <% tag_cloud(@tags, %w(tag1 tag2 tag3 tag4)) do |tag, css_class| %> + <%= link_to tag.name, tagged_posts_path(tag.id, tag.name.parameterize), :class => css_class %> + <% end %> + </nav> +<% end %>
\ No newline at end of file diff --git a/app/views/refinery/shared/admin/_autocomplete.html.erb b/app/views/refinery/shared/admin/_autocomplete.html.erb new file mode 100644 index 0000000..b4898cc --- /dev/null +++ b/app/views/refinery/shared/admin/_autocomplete.html.erb @@ -0,0 +1,55 @@ +<% content_for :stylesheets, stylesheet_link_tag("ui-lightness/jquery-ui-1.8.13.custom.css") -%> + +<% content_for :javascripts do %> + <%= javascript_include_tag "https://ajax.googleapis.com/ajax/libs/jqueryui/1.8.13/jquery-ui.min.js" %> + <script> + function split( val ) { + return val.split( /,\s*/ ); + } + function extractLast( term ) { + return split( term ).pop(); + } + + + $(document).ready(function(){ + page_options.init(false, '', '') + + $('<%= dom_id %>') + .bind( "keydown", function( event ) { + if ( event.keyCode === $.ui.keyCode.TAB && + $( this ).data( "autocomplete" ).menu.active ) { + event.preventDefault() + } + }) + .autocomplete({ + source: function( request, response ) { + $.getJSON( "<%= url %>", { + term: extractLast( request.term ) + }, response ); + }, + search: function() { + // custom minLength + var term = extractLast( this.value ); + if ( term.length < 2 ) { + return false; + } + }, + focus: function() { + // prevent value inserted on focus + return false; + }, + select: function( event, ui ) { + var terms = split( this.value ); + // remove the current input + terms.pop(); + // add the selected item + terms.push( ui.item.value ); + // add placeholder to get the comma-and-space at the end + terms.push( "" ); + this.value = terms.join( ", " ); + return false; + } + }) + }); + </script> +<% end %>
\ No newline at end of file |