Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3 0 stable #14

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/helpers/spree/admin/navigation_helper_decorator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@
def link_to_blog_in_store(resource, options={})
url = options[:url] || blog_entry_permalink(resource)
#options[:data] = {:action => 'show'}
link_to_with_icon('icon-view', Spree.t(:view_in_store), url, options)
link_to_with_icon('share', Spree.t(:view_in_store), url, options)
end
end
16 changes: 11 additions & 5 deletions app/overrides/add_blog_admin_menu_tab.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Deface::Override.new(:virtual_path => "spree/admin/shared/_menu",
:name => "blog_admin_tabs",
:insert_bottom => "[data-hook='admin_tabs'], #admin_tabs[data-hook]",
:text => "<%= tab(:blog_entries, :label => 'Blog', :url => spree.admin_blog_entries_path, :icon => 'file') if can? :manage, Spree::BlogEntry %>",
:disabled => false)
Deface::Override.new({
:virtual_path => "spree/layouts/admin",
:name => "blog_admin_tabs",
:insert_bottom => "[data-hook='admin_tabs'], #admin_tabs[data-hook]",
:text => "
<ul class='nav nav-sidebar'>
<%= tab(:blog_entries, :label => 'Blog', :url => spree.admin_blog_entries_path, :icon => 'file') if can? :manage, Spree::BlogEntry %>
</ul>
",
:disabled => false
})
12 changes: 7 additions & 5 deletions app/overrides/add_user_admin_author_info_fields.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Deface::Override.new(:virtual_path => "spree/admin/users/_form",
:name => "admin_author_info_fields",
:insert_bottom => "[data-hook='admin_user_form_fields']",
:partial => "spree/admin/users/author_info_fields",
:disabled => false)
Deface::Override.new({
:virtual_path => "spree/admin/users/_form",
:name => "admin_author_info_fields",
:insert_bottom => "[data-hook='admin_user_form_fields']",
:partial => "spree/admin/users/author_info_fields",
:disabled => false
})
43 changes: 21 additions & 22 deletions app/views/spree/admin/blog_entries/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@

<div class="row">
<div class="alpha ten columns">
<div class="col-md-6">

<%= form.field_container :title do %>
<%= form.field_container :title, class: ['form-group'] do %>
<%= form.label :title, Spree.t(:title) %> <span class="required">*</span><br />
<%= form.text_field :title, :class => 'fullwidth title' %>
<%= form.text_field :title, :class => 'form-control title' %>
<%= form.error_message_on :title %>
<% end %>

<%= form.field_container :permalink do %>
<%= form.field_container :permalink, class: ['form-group'] do %>
<%= form.label :permalink, Spree.t(:permalink) %> <span class="required">*</span><br />
<%= form.text_field :permalink, :class => 'fullwidth' %>
<%= form.text_field :permalink, :class => 'form-control' %>
<%= form.error_message_on :permalink %>
<% end %>

<%= form.field_container :category_list do %>
<%= form.field_container :category_list, class: ['form-group'] do %>
<%= form.label :category_list, Spree.t(:category_list) %><br />
<%= form.text_field :category_list, :class => 'fullwidth' %>
<%= form.text_field :category_list, :class => 'form-control' %>
<% end %>

<%= form.field_container :tag_list do %>
<%= form.field_container :tag_list, class: ['form-group'] do %>
<%= form.label :tag_list, Spree.t(:tag_list) %><br />
<%= form.text_field :tag_list, :class => 'fullwidth' %>
<%= form.text_field :tag_list, :class => 'form-control' %>
<% end %>

<% unless Rails.env.test? %>
Expand All @@ -33,20 +32,20 @@


<div class="columns five alpha">
<%= form.field_container :published_at do %>
<%= form.field_container :published_at, class: ['form-group'] do %>
<%= form.label :published_at, Spree.t(:published_at) %><br />
<%= form.error_message_on :published_at %>
<% if @blog_entry.published_at? %>
<% published_at = l(@blog_entry.published_at, :format => Spree.t('date_picker.format')) %>
<% else %>
<% published_at = nil %>
<% end %>
<%= form.text_field :published_at, :value => published_at, :class => 'datepicker' %>
<%= form.text_field :published_at, :value => published_at, :class => 'datepicker form-control' %>
<% end %>
</div>

<div class="columns five omega">
<%= form.field_container :visible do %>
<%= form.field_container :visible, class: ['form-group'] do %>
<%= form.label :visible, Spree.t(:visible) %><br />
<%= form.check_box :visible %>
<%= form.error_message_on :visible %>
Expand All @@ -55,9 +54,9 @@

</div>

<div class="omega six columns">
<div class="col-md-6">

<%= form.field_container :author_id do %>
<%= form.field_container :author_id, class: ['form-group'] do %>
<%= form.label :author_id, Spree.t(:author_id) %><br />
<%= form.select :author_id, Spree.user_class.joins(:spree_roles).where("#{Spree::Role.table_name}.name" => "blogger").collect {|u| [u.email, u.id]}, {:include_blank => true}, :class => 'select2' %>
<% end %>
Expand All @@ -66,7 +65,7 @@
<% @blog_entry.build_blog_entry_image unless @blog_entry.blog_entry_image %>

<%= form.fields_for :blog_entry_image do |blog_entry_image_field| %>
<%= form.field_container :blog_entry_image_attachment do %>
<%= form.field_container :blog_entry_image_attachment, class: ['form-group'] do %>
<% unless @blog_entry.blog_entry_image.new_record? %>
<div class="blog_entry_image_thumbnail">
<%= link_to image_tag(@blog_entry.blog_entry_image.attachment.url(:mini)), @blog_entry.blog_entry_image.attachment.url(:large) %>
Expand All @@ -76,24 +75,24 @@
<%= blog_entry_image_field.file_field :attachment %>
<% end %>

<%= form.field_container :blog_entry_image_alt do %>
<%= form.field_container :blog_entry_image_alt, class: ['form-group'] do %>
<%= blog_entry_image_field.label :alt, Spree.t(:alt_text) %><br/>
<%= blog_entry_image_field.text_field :alt %>
<%= blog_entry_image_field.text_field :alt, :class => 'form-control' %>
<% end %>
<% end %>
<% end %>

</div>
</div>

<%= form.field_container :body do %>
<%= form.field_container :body, class: ['form-group'] do %>
<%= form.label :body %> <span class="required">*</span><br />
<%= form.text_area :body, {:cols => 60, :rows => 4, :class => 'fullwidth', :id => 'blog_entry_body'} %>
<%= form.text_area :body, {:cols => 60, :rows => 4, :class => 'form-control', :id => 'blog_entry_body'} %>
<%= form.error_message_on :body %>
<% end %>

<%= form.field_container :summary do %>
<%= form.field_container :summary, class: ['form-group'] do %>
<%= form.label :summary %><br />
<%= form.text_area :summary, {:cols => 60, :rows => 4, :class => 'fullwidth', :id => 'blog_entry_summary'} %>
<%= form.text_area :summary, {:cols => 60, :rows => 4, :class => 'form-control', :id => 'blog_entry_summary'} %>
<%= form.error_message_on :summary %>
<% end %>
2 changes: 1 addition & 1 deletion app/views/spree/admin/blog_entries/edit.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<% end %>

<% content_for :page_actions do %>
<li><%= button_link_to Spree.t(:back_to_blog_list), spree.admin_blog_entries_url, :icon => 'arrow-left' %></li>
<%= button_link_to Spree.t(:back_to_blog_list), spree.admin_blog_entries_url, :icon => 'arrow-left' %>
<% end %>

<%= render "spree/shared/error_messages", :target => @blog_entry %>
Expand Down
4 changes: 2 additions & 2 deletions app/views/spree/admin/blog_entries/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<% end %>

<% content_for :page_actions do %>
<li><%= button_link_to Spree.t(:new_blog_entry), new_object_url, :icon => 'plus' %></li>
<%= button_link_to Spree.t(:new_blog_entry), new_object_url, :class => 'btn-success', :icon => 'plus' %>
<% end %>

<% if @blog_entries.any? %>
Expand Down Expand Up @@ -35,7 +35,7 @@
<%= content_tag(:i, '', :class => 'fa fa-ok green') if blog_entry.visible %>
</td>
<td class="actions">
<%= link_to_blog_in_store blog_entry, :no_text => true, target: '_blank' %>
<%= link_to_blog_in_store blog_entry, :no_text => true, target: '_blank', :class => 'btn btn-success btn-sm' %>
<%= link_to_edit blog_entry, :no_text => true %>
<%= link_to_delete blog_entry, :no_text => true %>
</td>
Expand Down
2 changes: 1 addition & 1 deletion app/views/spree/admin/blog_entries/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<% end %>

<% content_for :page_actions do %>
<li><%= button_link_to Spree.t(:back_to_blog_list), spree.admin_blog_entries_url, :icon => 'arrow-left' %></li>
<%= button_link_to Spree.t(:back_to_blog_list), spree.admin_blog_entries_url, :icon => 'arrow-left' %>
<% end %>

<%= render "spree/shared/error_messages", :target => @blog_entry %>
Expand Down
52 changes: 27 additions & 25 deletions app/views/spree/admin/users/_author_info_fields.html.erb
Original file line number Diff line number Diff line change
@@ -1,26 +1,28 @@
<div class="ten columns alpha omega">
<div class="alpha five columns">
<%= f.field_container :nickname do %>
<%= f.label :nickname, Spree.t(:nickname) %>
<%= f.text_field :nickname, :class => 'fullwidth' %>
<%= error_message_on :user, :nickname %>
<% end %>
<%= f.field_container :website_url do %>
<%= f.label :website_url, Spree.t(:website_url) %>
<%= f.text_field :website_url, :class => 'fullwidth' %>
<%= error_message_on :user, :website_url %>
<% end %>
<%= f.field_container :google_plus_url do %>
<%= f.label :google_plus_url, Spree.t(:google_plus_url) %>
<%= f.text_field :google_plus_url, :class => 'fullwidth' %>
<%= f.error_message_on :google_plus_url %>
<% end %>
<div class='row'>
<div class="col-md-12">
<div class="col-md-6">
<%= f.field_container :nickname, class: ['form-group'] do %>
<%= f.label :nickname, Spree.t(:nickname) %>
<%= f.text_field :nickname, :class => 'form-control' %>
<%= error_message_on :user, :nickname %>
<% end %>
<%= f.field_container :website_url, class: ['form-group'] do %>
<%= f.label :website_url, Spree.t(:website_url) %>
<%= f.text_field :website_url, :class => 'form-control' %>
<%= error_message_on :user, :website_url %>
<% end %>
<%= f.field_container :google_plus_url, class: ['form-group'] do %>
<%= f.label :google_plus_url, Spree.t(:google_plus_url) %>
<%= f.text_field :google_plus_url, :class => 'form-control' %>
<%= f.error_message_on :google_plus_url %>
<% end %>
</div>
<div class="col-md-6">
<%= f.field_container :bio_info, class: ['form-group'] do %>
<%= f.label :bio_info, Spree.t(:bio_info) %>
<%= f.text_area :bio_info, {:rows => 4, :class => 'form-control'} %>
<%= f.error_message_on :bio_info %>
<% end %>
</div>
</div>
<div class="omega five columns">
<%= f.field_container :bio_info do %>
<%= f.label :bio_info, Spree.t(:bio_info) %>
<%= f.text_area :bio_info, {:rows => 4, :class => 'fullwidth'} %>
<%= f.error_message_on :bio_info %>
<% end %>
</div>
</div>
</div>
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ en:
blog_tag: Tag
blog_category: Category
blog_author: Author
view_in_store: "View in Store"
admin:
tab:
blog_entries: Blog entries
Expand Down
6 changes: 4 additions & 2 deletions spree_blogging_spree.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
s.name = 'spree_blogging_spree'
s.version = '2.3.0'
s.version = '3.0.0'
s.summary = 'BloggingSpree: A Spree blogging solution'
s.description = 'A basic blogging solution for use with the Spree E-Commerce platform.'
s.required_ruby_version = '>= 1.9.3'
Expand All @@ -16,7 +16,9 @@ Gem::Specification.new do |s|
s.require_path = 'lib'
s.requirements << 'none'

s.add_dependency 'spree_core', '~> 2.3.0'
spree_version = '~> 3.0.0'

s.add_dependency 'spree_core', spree_version
s.add_dependency 'acts-as-taggable-on', '~> 3.0.2'

s.add_development_dependency 'capybara', '~> 2.2.1'
Expand Down