-
Notifications
You must be signed in to change notification settings - Fork 15
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
WIP: Feature/mobility #6
base: master
Are you sure you want to change the base?
Changes from 7 commits
ded7082
d2b8b0d
8fcf4e5
3636a47
4e6e0a2
97dd843
e7c8a40
05f7475
01bd144
2f819f8
bae7bce
8dd9b65
4caf0e9
b1b4599
c48e2b1
107cddf
42edd2c
4eb2a83
7feb3fa
1829e4d
9e7879a
9d188d3
20bc9a0
242ec70
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,14 +2,20 @@ source "https://rubygems.org" | |
|
||
gemspec | ||
|
||
git "https://github.com/refinery/refinerycms", branch: "master" do | ||
# TODO: use master branch before merging this PR | ||
# git "https://github.com/refinery/refinerycms", branch: "master" do | ||
git "https://github.com/refinery/refinerycms", branch: "feature/mobility" do | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning. |
||
gem "refinerycms" | ||
|
||
group :test do | ||
gem "refinerycms-testing" | ||
end | ||
end | ||
|
||
# TODO: remove refinerycms-i18n and mobility from this Gemfile before merging this PR | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Metrics/LineLength: Line is too long. [85/80] |
||
gem 'refinerycms-i18n', git: "https://github.com/refinery/refinerycms-i18n", branch: 'feature/mobility' | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols. |
||
|
||
# Database Configuration | ||
unless ENV["TRAVIS"] | ||
gem "activerecord-jdbcsqlite3-adapter", :platform => :jruby | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,9 @@ class ImageSlidesController < ::Refinery::AdminController | |
:sortable => true, | ||
:include => [:translations] | ||
|
||
before_filter :find_image_slideshow | ||
before_filter :find_image_slides, only: :index | ||
before_filter :find_image_slide, :except => [:index, :new] | ||
before_action :find_image_slideshow | ||
before_action :find_image_slides, only: :index | ||
before_action :find_image_slide, :except => [:index, :new] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/HashSyntax: Use the new Ruby 1.9 hash syntax. |
||
|
||
def create | ||
if Refinery::ImageSlideshows::ImageSlide.any? | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,30 @@ | ||
<% | ||
# setup params for various action links | ||
edit_url = refinery.edit_image_slideshows_admin_image_slideshow_image_slide_path(@image_slideshow, image_slide) | ||
delete_url = refinery.image_slideshows_admin_image_slideshow_image_slide_path(@image_slideshow, image_slide) | ||
delete_options = { | ||
class: "cancel confirm-delete", | ||
data: {confirm: t('message', scope: 'refinery.admin.delete', title: image_slide.title)} | ||
} | ||
%> | ||
<li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(image_slide) -%>" style="background-color: #EAEAEA; margin-bottom: 10px;"> | ||
<%= image_fu image_slide.image, '128x128', :style => 'padding: 1em 1em 0 1em;' %> | ||
<span class="preview"> | ||
<% image_slide.translations.each do |translation| %> | ||
<% if translation.title.present? %> | ||
<%= link_to refinery_icon_tag("flags/#{translation.locale}.png", :size => '16x11'), | ||
refinery.edit_image_slideshows_admin_image_slideshow_image_slide_path(@image_slideshow, image_slide, :switch_locale => translation.locale), | ||
:class => 'locale' %> | ||
<%= link_to refinery.edit_image_slideshows_admin_image_slideshow_image_slide_path(@image_slideshow, image_slide, :switch_locale => translation.locale), | ||
class: 'locale', title: translation.locale.upcase do %> | ||
|
||
<div class="<%=translation.locale %> locale_marker"> | ||
<%= locale_text_icon(translation.locale.upcase) %> | ||
</div> | ||
<% end %> | ||
<% end %> | ||
<% end %> | ||
</span> | ||
|
||
<span class='actions'> | ||
<%= link_to refinery_icon_tag("application_edit.png"), refinery.edit_image_slideshows_admin_image_slideshow_image_slide_path(@image_slideshow, image_slide), | ||
:title => t('.edit') %> | ||
<%= link_to refinery_icon_tag("delete.png"), refinery.image_slideshows_admin_image_slideshow_image_slide_path(@image_slideshow, image_slide), | ||
:class => "cancel confirm-delete", | ||
:title => t('.delete'), | ||
:confirm => t('message', :scope => 'refinery.admin.delete', :title => image_slide.title), | ||
:method => :delete %> | ||
<%= action_icon(:edit, edit_url , t('edit', scope: 'refinery.image_slideshows.admin.image_slides.image_slide' ) ) %> | ||
<%= action_icon(:delete, delete_url, t('delete', scope: 'refinery.image_slideshows.admin.image_slides.image_slide' ), delete_options ) %> | ||
</span> | ||
</li> | ||
</li> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,22 @@ | ||
<% | ||
# setup params for various action links | ||
manage_url = refinery.image_slideshows_admin_image_slideshow_image_slides_path(image_slideshow) | ||
edit_url = refinery.edit_image_slideshows_admin_image_slideshow_path(image_slideshow) | ||
delete_url = refinery.image_slideshows_admin_image_slideshow_path(image_slideshow) | ||
delete_options = { | ||
class: "cancel confirm-delete", | ||
data: {confirm: t('message', scope: 'refinery.admin.delete', title: image_slideshow.title)} | ||
} | ||
%> | ||
<li class='clearfix record <%= cycle("on", "on-hover") %>' id="<%= dom_id(image_slideshow) -%>"> | ||
<span class='title'> | ||
<%= link_to refinery.image_slideshows_admin_image_slideshow_image_slides_path(image_slideshow) do %> | ||
<%= image_slideshow.title %> | ||
<% end %> | ||
</span> | ||
<span class='actions'> | ||
<%= link_to refinery_icon_tag("img.png"), refinery.image_slideshows_admin_image_slideshow_image_slides_path(image_slideshow), | ||
:title => t('.manage_image_slides') %> | ||
<%= link_to refinery_icon_tag("application_edit.png"), refinery.edit_image_slideshows_admin_image_slideshow_path(image_slideshow), | ||
:title => t('.edit') %> | ||
<%= link_to refinery_icon_tag("delete.png"), refinery.image_slideshows_admin_image_slideshow_path(image_slideshow), | ||
:class => "cancel confirm-delete", | ||
:title => t('.delete'), | ||
:confirm => t('message', :scope => 'refinery.admin.delete', :title => image_slideshow.title), | ||
:method => :delete %> | ||
<%= action_icon(:switch_view_list, manage_url, t('.manage_image_slides') ) %> | ||
<%= action_icon(:edit, edit_url , t('.edit') ) %> | ||
<%= action_icon(:delete, delete_url, t('.delete'), delete_options ) %> | ||
</span> | ||
</li> | ||
</li> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
Refinery::Core::Engine.routes.append do | ||
Refinery::Core::Engine.routes.draw do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/FrozenStringLiteralComment: Missing magic comment # frozen_string_literal: true. |
||
|
||
# Admin routes | ||
namespace :image_slideshows, :path => '' do | ||
|
@@ -16,4 +16,4 @@ | |
end | ||
end | ||
|
||
end | ||
end | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Layout/TrailingBlankLines: Final newline missing. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
class AddJsConfigToImageSlideshows < ActiveRecord::Migration | ||
class AddJsConfigToImageSlideshows < ActiveRecord::Migration[5.1] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/Documentation: Missing top-level class documentation comment. |
||
def change | ||
add_column :refinery_image_slideshows, :js_config, :text | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
class AddLinkUrlToImageSlides < ActiveRecord::Migration | ||
class AddLinkUrlToImageSlides < ActiveRecord::Migration[5.1] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/Documentation: Missing top-level class documentation comment. |
||
def change | ||
add_column :refinery_image_slides, :link_url, :string | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
class AddHeightAndWidthToImageSlideshows < ActiveRecord::Migration | ||
class AddHeightAndWidthToImageSlideshows < ActiveRecord::Migration[5.1] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/Documentation: Missing top-level class documentation comment. |
||
def change | ||
add_column :refinery_image_slideshows, :height, :string | ||
add_column :refinery_image_slideshows, :width, :string | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,20 @@ | ||
class CreateImageSlidesTranslations < ActiveRecord::Migration | ||
def up | ||
Refinery::ImageSlideshows::ImageSlide.create_translation_table!({ | ||
:title => :string, | ||
:caption => :string, | ||
:link_url => :string | ||
}, { | ||
:migrate_data => true | ||
}) | ||
end | ||
class CreateImageSlidesTranslations < ActiveRecord::Migration[5.1] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/Documentation: Missing top-level class documentation comment. |
||
def change | ||
create_table :refinery_image_slide_translations do |t| | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning. |
||
# Translated attribute(s) | ||
t.string :title | ||
t.string :caption | ||
t.string :link_url | ||
|
||
t.string :locale, null: false | ||
t.integer :refinery_image_slide_id, null: false | ||
|
||
t.timestamps null: false | ||
end | ||
|
||
add_index :refinery_image_slide_translations, :locale, name: :index_8a4a2e1ce2c2f55f4778012dc82b5ec014fac0f5 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Metrics/LineLength: Line is too long. [112/80] |
||
add_index :refinery_image_slide_translations, [:refinery_image_slide_id, :locale], name: :index_299ee7f96d4de207d5ce93e99727d66ae68c25f2, unique: true | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/SymbolArray: Use %i or %I for an array of symbols. |
||
|
||
def down | ||
Refinery::ImageSlideshows::ImageSlide.drop_translation_table! :migrate_data => true | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
class AddBodyToImageSlides < ActiveRecord::Migration | ||
def up | ||
Refinery::ImageSlideshows::ImageSlide.add_translation_fields! body: :text | ||
end | ||
def down | ||
remove_column :refinery_image_slide_translations, :body | ||
class AddBodyToImageSlides < ActiveRecord::Migration[5.1] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/Documentation: Missing top-level class documentation comment. |
||
def change | ||
add_column :refinery_image_slide_translations, :body, :text | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
if defined?(Refinery::User) | ||
Refinery::User.all.each do |user| | ||
if user.plugins.where(:name => 'refinerycms-image_slideshows').blank? | ||
user.plugins.create(:name => "refinerycms-image_slideshows", | ||
user.plugins.create(:name => 'refinerycms-image_slideshows', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Style/HashSyntax: Use the new Ruby 1.9 hash syntax. |
||
:position => (user.plugins.maximum(:position) || -1) +1) | ||
end | ||
end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/StringLiterals: Prefer single-quoted strings when you don't need string interpolation or special symbols.