Commit c46bac17 authored by jak4's avatar jak4
Browse files

Added to more fields to photo model: css_class and preview_type

Added config options for url, css_class and preview_type
Added preview_link method to photo model. Will either use the provided ext_type or the preview_type in the database. If there is an exception this will be catched and the version :error_wrong_preview_version will be delivered.
parent 6db6c234
......@@ -15,21 +15,21 @@
<%= p.text_area :description, :rows => "5", :cols=> "57" %>
</div>
<% if Refinery::PhotoGallery.admin_options_show_url %>
<% if Refinery::PhotoGallery.admin_photo_options_show_url %>
<div class='field'>
<%= p.label :url %>
<%= p.text_field :url, :class => "larger" %>
</div>
<% end %>
<% if Refinery::PhotoGallery.admin_options_show_css_class %>
<% if Refinery::PhotoGallery.admin_photo_options_show_css_class %>
<div class='field'>
<%= p.label :css_class %>
<%= p.text_field :css_class, :class => "larger" %>
</div>
<% end %>
<% if Refinery::PhotoGallery.admin_options_show_preview_type %>
<% if Refinery::PhotoGallery.admin_photo_options_show_preview_type %>
<div class='field'>
<%= p.label :preview_type %>
<%= p.text_field :preview_type, :class => "larger" %>
......
......@@ -31,7 +31,7 @@ Refinery::PhotoGallery.configure do |config|
# config.albums_per_page = <%= Refinery::PhotoGallery.albums_per_page.inspect %>
# config.photos_per_page = <%= Refinery::PhotoGallery.photos_per_page.inspect %>
# config.admin_options_show_url = <%= Refinery::PhotoGallery.admin_options_show_url.inspect %>
# config.admin_options_show_css_class = <%= Refinery::PhotoGallery.admin_options_show_css_class.inspect %>
# config.admin_options_show_preview_type = <%= Refinery::PhotoGallery.admin_options_show_preview_type.inspect %>
# config.admin_photo_options_show_url = <%= Refinery::PhotoGallery.admin_photo_options_show_url.inspect %>
# config.admin_photo_options_show_css_class = <%= Refinery::PhotoGallery.admin_photo_options_show_css_class.inspect %>
# config.admin_photo_options_show_preview_type = <%= Refinery::PhotoGallery.admin_photo_options_show_preview_type.inspect %>
end
......@@ -5,8 +5,8 @@ module Refinery
config_accessor :runtimes, :max_file_size,:client_side_resize, :client_side_resize_params, :plupload_locale, :extension_white_list,:photo_gallery_dir,
:delete_uploaded_file,:collection_dimensions, :album_dimensions, :preview_dimensions, :single_dimensions, :photo_gallery_dir_relative_to_root,
:photos_per_page, :albums_per_page, :collections_per_page,
:admin_options_show_url, :admin_options_show_css_class,
:admin_options_show_preview_type
:admin_photo_options_show_url, :admin_photo_options_show_css_class,
:admin_photo_options_show_preview_type
......@@ -30,8 +30,8 @@ module Refinery
self.collections_per_page = 10
self.photos_per_page = 10
self.admin_options_show_url = true
self.admin_options_show_css_class = true
self.admin_options_show_preview_type = true
self.admin_photo_options_show_url = true
self.admin_photo_options_show_css_class = true
self.admin_photo_options_show_preview_type = true
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment