-
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 13 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 |
---|---|---|
|
@@ -9,6 +9,7 @@ class ImageSlideshowsController < ::Refinery::AdminController | |
|
||
def image_slideshow_params | ||
params.require(:image_slideshow).permit( | ||
:active, | ||
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. by convention we use |
||
:title, | ||
:position, | ||
:js_config, | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,35 @@ | ||
<% | ||
# 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> | ||
|
||
<%= content_tag :span, class: "#{image_slide.active? ? :success_icon : :failure_icon} less-important" 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. We have label to handle |
||
<strong><%== t(image_slide.active? ? 'active' : 'inactive', scope: 'refinery.image_slideshows.admin.states' ).titleize %></strong> | ||
<% end %> | ||
|
||
<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,27 @@ | ||
<% | ||
# 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> | ||
|
||
<%= content_tag :span, class: "#{image_slideshow.active? ? :success_icon : :failure_icon} less-important" do %> | ||
<strong><%== t(image_slideshow.active? ? 'active' : 'inactive', scope: 'refinery.image_slideshows.admin.states' ).titleize %></strong> | ||
<% end %> | ||
|
||
<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,5 +1,11 @@ | ||
#!/usr/bin/env ruby | ||
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application. | ||
# This command will automatically be run when you run "rails" with Rails gems | ||
# installed from the root of your application. | ||
|
||
ENGINE_PATH = File.expand_path('../..', __FILE__) | ||
load File.expand_path('../../spec/dummy/bin/rails', __FILE__) | ||
begin | ||
load File.join(File.expand_path('../../', __FILE__), 'spec/dummy/bin/rails') | ||
rescue LoadError => load_error | ||
warn "No dummy Rails application found! \n" \ | ||
"To create one in spec/dummy, please run: \n\n" \ | ||
" rake refinery:testing:dummy_app" | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
Refinery::Core::Engine.routes.append do | ||
# frozen_string_literal: true | ||
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 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
class AddJsConfigToImageSlideshows < ActiveRecord::Migration | ||
# frozen_string_literal: true | ||
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,5 @@ | ||
class AddLinkUrlToImageSlides < ActiveRecord::Migration | ||
# frozen_string_literal: true | ||
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 | ||
|
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.
Layout/EmptyLinesAroundBlockBody: Extra empty line detected at block body beginning.