-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of git://github.com/resolve/Refinery
- Loading branch information
Showing
16 changed files
with
159 additions
and
156 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class ChangeDefaultImageThumbnails < ActiveRecord::Migration | ||
def self.up | ||
RefinerySetting[:image_thumbnails] = RefinerySetting[:image_thumbnails].merge({:grid => 'c135x135'}) | ||
end | ||
|
||
def self.down | ||
RefinerySetting[:image_thumbnails] = RefinerySetting[:image_thumbnails].delete_if {|key, value| key == :grid } | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,17 @@ | ||
module Admin::ImagesHelper | ||
|
||
def image_views | ||
["grid", "list"] | ||
end | ||
|
||
def current_image_view | ||
session[:image_view] || :list | ||
end | ||
|
||
def alternate_image_view | ||
image_views.reject {|i| i == current_image_view.to_s }[0] | ||
end | ||
|
||
def change_list_mode_if_specified | ||
if params[:action] == "index" and not params[:view].blank? | ||
session[:image_view] = params[:view] if ["grid", "list"].include?(params[:view]) | ||
end | ||
end | ||
|
||
|
||
def image_views | ||
RefinerySetting.find_or_set(:image_views, [:grid, :list]) | ||
end | ||
|
||
def current_image_view | ||
RefinerySetting.find_or_set(:preferred_image_view, :list) | ||
end | ||
|
||
def change_list_mode_if_specified | ||
unless params[:action] != "index" or params[:view].blank? or !image_views.include? params[:view].to_sym | ||
RefinerySetting[:preferred_image_view] = params[:view] | ||
end | ||
end | ||
|
||
end |
29 changes: 13 additions & 16 deletions
29
vendor/plugins/images/app/views/admin/images/_grid_view.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,15 @@ | ||
<div id="image_grid" class="clearfix"> | ||
<ul id="image_grid" class="clearfix"> | ||
<% @images.each do |image| -%> | ||
<div id="image_<%= image.id %>" class="image_grid_item"> | ||
<p><%= image_tag( image.public_filename(:preview), :title => h(image.title) ) %></p> | ||
<p title="<%=h image.title %>"> | ||
<%=h truncate(image.title, :length => 15) %> | ||
</p> | ||
<p> | ||
<%= link_to image_tag('refinery/icons/application_edit.png'), edit_admin_image_path(image), | ||
:title => 'Edit this image' %> | ||
<%= link_to image_tag('refinery/icons/delete.png'), admin_image_path(image), | ||
:confirm => "Are you sure you want to delete #{image.title}?", | ||
:class => "cancel", :method => :delete, | ||
:title => "Remove this image forever" %> | ||
</p> | ||
</div> | ||
<li id="image_<%= image.id %>" <%= "class='row-end'" if (@images.index(image)+1) % 4 == 0 %>> | ||
<%= image_fu image, :grid, :title => image.title %> | ||
<span class='actions'> | ||
<%= link_to image_tag('refinery/icons/application_edit.png'), edit_admin_image_path(image), | ||
:title => 'Edit this image' %> | ||
<%= link_to image_tag('refinery/icons/delete.png'), admin_image_path(image), | ||
:confirm => "Are you sure you want to delete #{image.title}?", | ||
:class => "cancel", :method => :delete, | ||
:title => "Remove this image forever" %> | ||
</span> | ||
</li> | ||
<% end -%> | ||
</div> | ||
</ul> |
30 changes: 15 additions & 15 deletions
30
vendor/plugins/images/app/views/admin/images/_list_view.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
<ul> | ||
<% @images.each do |image| -%> | ||
<li id="sortable_<%= image.id %>" class='clearfix record <%= cycle("on", "on-hover") %>'> | ||
<span class='title'> | ||
<span class='actions'> | ||
<%= link_to image_tag('refinery/icons/eye.png'), image.public_filename, | ||
:target => "_blank", :title => "#{image_tag image.public_filename(:preview)}" %> | ||
<%= link_to image_tag('refinery/icons/application_edit.png'), edit_admin_image_path(image), | ||
:title => 'Edit this image' %> | ||
<%= link_to image_tag('refinery/icons/delete.png'), admin_image_path(image), | ||
:confirm => "Are you sure you want to delete #{image.title}?", | ||
:class => "cancel", :method => :delete, | ||
:title => "Remove this image forever" %> | ||
</span> | ||
<%=h image.title %> <span class="preview"> </span> | ||
</span> | ||
</li> | ||
<li id="sortable_<%= image.id %>" class='clearfix record <%= cycle("on", "on-hover") %>'> | ||
<span class='title'> | ||
<span class='actions'> | ||
<%= link_to image_tag('refinery/icons/eye.png'), image.public_filename, | ||
:target => "_blank", :title => "#{image_fu image, :preview}" %> | ||
<%= link_to image_tag('refinery/icons/application_edit.png'), edit_admin_image_path(image), | ||
:title => 'Edit this image' %> | ||
<%= link_to image_tag('refinery/icons/delete.png'), admin_image_path(image), | ||
:confirm => "Are you sure you want to delete #{image.title}?", | ||
:class => "cancel", :method => :delete, | ||
:title => "Remove this image forever" %> | ||
</span> | ||
<%= image.title %> <span class="preview"> </span> | ||
</span> | ||
</li> | ||
<% end -%> | ||
</ul> |
20 changes: 10 additions & 10 deletions
20
vendor/plugins/images/app/views/admin/images/index.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
vendor/plugins/inquiries/app/views/admin/inquiries/index.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.