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

Compatibility with Spree 3-1-stable branch #18

Open
wants to merge 7 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('ok', Spree.t(:view_in_store), url, options.merge(class: 'btn btn-default btn-sm'))
end
end
6 changes: 3 additions & 3 deletions app/overrides/add_blog_admin_menu_tab.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Deface::Override.new(:virtual_path => "spree/admin/shared/_menu",
Deface::Override.new(:virtual_path => "spree/layouts/admin",
: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 %>",
:insert_bottom => "#main-sidebar",
:partial => 'spree/admin/shared/blog_sidebar_menu',
:disabled => false)
50 changes: 27 additions & 23 deletions app/views/spree/admin/blog_entries/_form.html.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@

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

<%= form.field_container :title 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' %>
<%= form.error_message_on :title %>
<% end %>

<%= form.field_container :permalink 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 %>

Expand All @@ -30,9 +29,10 @@
$("#blog_entry_category_list").select2({tags: <%= Spree::BlogEntry.tag_counts_on(:categories).map{|t| t.name }.to_json.html_safe %> });
</script>
<% end %>
</div>


<div class="columns five alpha">
<div class="col-md-4">
<%= form.field_container :published_at do %>
<%= form.label :published_at, Spree.t(:published_at) %><br />
<%= form.error_message_on :published_at %>
Expand All @@ -41,21 +41,20 @@
<% 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.label :visible, Spree.t(:visible) %><br />
<%= form.check_box :visible %>
<%= form.error_message_on :visible %>
<% end %>
</div>

</div>

<div class="omega six columns">
</div>
<div class="row">

<div class="col-md-12">

<%= form.field_container :author_id do %>
<%= form.label :author_id, Spree.t(:author_id) %><br />
Expand All @@ -78,22 +77,27 @@

<%= form.field_container :blog_entry_image_alt 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.label :body %> <span class="required">*</span><br />
<%= form.text_area :body, {:cols => 60, :rows => 4, :class => 'fullwidth', :id => 'blog_entry_body'} %>
<%= form.error_message_on :body %>
<% end %>

<%= form.field_container :summary do %>
<%= form.label :summary %><br />
<%= form.text_area :summary, {:cols => 60, :rows => 4, :class => 'fullwidth', :id => 'blog_entry_summary'} %>
<%= form.error_message_on :summary %>
<% end %>
<div class="row">

<div class="col-md-12">
<%= form.field_container :body do %>
<%= form.label :body %> <span class="required">*</span><br />
<%= 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.label :summary %><br />
<%= form.text_area :summary, {:cols => 60, :rows => 4, :class => 'form-control', :id => 'blog_entry_summary'} %>
<%= form.error_message_on :summary %>
<% end %>
</div>
</div>
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
5 changes: 2 additions & 3 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, :icon => 'plus' %>
<% end %>

<% if @blog_entries.any? %>
Expand Down Expand Up @@ -32,7 +32,7 @@
<td class="align-center"><%= blog_entry.title %></td>
<td class="align-center"><%= blog_entry.summary.truncate(300) if blog_entry.summary %></td>
<td class="align-center">
<%= content_tag(:i, '', :class => 'fa fa-ok green') if blog_entry.visible %>
<%= content_tag(:i, '', :class => 'icon icon-ok text-success') if blog_entry.visible %>
</td>
<td class="actions">
<%= link_to_blog_in_store blog_entry, :no_text => true, target: '_blank' %>
Expand All @@ -51,4 +51,3 @@
<%= link_to Spree.t(:add_one), spree.new_admin_blog_entry_path %>!
</div>
<% end %>

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
Binary file not shown.
5 changes: 5 additions & 0 deletions app/views/spree/admin/shared/_blog_sidebar_menu.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<% if can? :manage, Spree::BlogEntry %>
<ul class="nav nav-sidebar">
<%= tab Spree::BlogEntry, :label => Spree::BlogEntry.model_name.human(count: 1.1), :url => spree.admin_blog_entries_path, :icon => 'file' %>
</ul>
<% end %>
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="col-md-12">
<div class="row">
<div class="col-md-6">
<%= f.field_container :nickname 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 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 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 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>
3 changes: 3 additions & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ en:
google_plus_url: Google Plus URL
bio_info: Biographical info
spree:
editing: Editing
title: Title
body: Body
summary: Summary
Expand Down Expand Up @@ -51,6 +52,8 @@ en:
blog_tag: Tag
blog_category: Category
blog_author: Author
view_in_store: View in Store
back_to_blog_list: Back to blog list
admin:
tab:
blog_entries: Blog entries
Expand Down
10 changes: 7 additions & 3 deletions config/locales/ru.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ ru:
activerecord:
models:
spree/blog_entry:
one: Blog Entry
other: Blog Entries
one: Публикация
other: Публикации
many: Публикаций
attributes:
spree/blog_entry:
title: Заголовок
Expand All @@ -24,9 +25,10 @@ ru:
google_plus_url: Ссылка на профиль в Google Plus
bio_info: Биография
spree:
editing: Редактирование
title: Заголовок
body: Содержимое
summary: Summary
summary: Анонс
permalink: Постоянная ссылка
published_at: Дата публикации
visible: Показывать
Expand All @@ -51,6 +53,8 @@ ru:
blog_tag: Ключевое слово
blog_category: Категория
blog_author: Автор
view_in_store: Посмотреть в Магазине
back_to_blog_list: Назад к списку
admin:
tab:
blog_entries: Блог
Expand Down
1 change: 1 addition & 0 deletions db/migrate/20130128124852_acts_as_taggable_on_migration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ class ActsAsTaggableOnMigration < ActiveRecord::Migration
def self.up
create_table :tags do |t|
t.string :name
t.integer :taggings_count, default: 0
end

create_table :taggings do |t|
Expand Down
4 changes: 2 additions & 2 deletions spree_blogging_spree.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ Gem::Specification.new do |s|
s.require_path = 'lib'
s.requirements << 'none'

s.add_dependency 'spree_core', '~> 2.3.0'
s.add_dependency 'acts-as-taggable-on', '~> 3.0.2'
s.add_dependency 'spree_core', '~> 3.1.0'
s.add_dependency 'acts-as-taggable-on', '~> 3.5.0'

s.add_development_dependency 'capybara', '~> 2.2.1'
s.add_development_dependency 'coffee-rails', '~> 4.0.0'
Expand Down