diff --git a/app/helpers/block_helper.rb b/app/helpers/block_helper.rb
index 8fbe47f..1f65c02 100644
--- a/app/helpers/block_helper.rb
+++ b/app/helpers/block_helper.rb
@@ -6,4 +6,21 @@ module BlockHelper
content_tag 'h3', content_tag('span', title), :class => tag_class
end
+ def highlights_block_config_image_fields(block, image={})
+ "
+
+
+ #{select_tag 'block[images][][image_id]', content_tag(:option) + option_groups_from_collection_for_select(block.folder_choices, :images, :name, :id, :name, image[:image_id].to_i)}
+ |
+ #{text_field_tag 'block[images][][address]', image[:address], :class => 'highlight-address', :size => 20} |
+ #{text_field_tag 'block[images][][position]', image[:position], :class => 'highlight-position', :size => 1} |
+
+ |
+
+ "
+ end
+
end
diff --git a/app/views/box_organizer/_highlights_block.rhtml b/app/views/box_organizer/_highlights_block.rhtml
index 734f1bf..548686a 100644
--- a/app/views/box_organizer/_highlights_block.rhtml
+++ b/app/views/box_organizer/_highlights_block.rhtml
@@ -1,27 +1,14 @@
<%= _('Highlights') %>
-
- <%= _('Image') %> | <%= _('Address') %> | <%= _('Position') %> | <%= _('Title') %> |
+
+ <%= _('Image') %> | <%= _('Address') %> | <%= _('Position') %> |
<% for image in @block.images do %>
-
-
- <%= select_tag 'block[images][][image_id]', content_tag(:option) + option_groups_from_collection_for_select(@block.folder_choices, :images, :name, :id, :name, image[:image_id].to_i), :style => "width: 100px" %>
- |
- <%= text_field_tag 'block[images][][address]', image[:address], :class => 'highlight-address', :size => 10 %> |
- <%= text_field_tag 'block[images][][position]', image[:position], :class => 'highlight-position', :size => 3 %> |
- <%= text_field_tag 'block[images][][title]', image[:title], :class => 'highlight-title', :size => 10 %> |
-
+ <%= highlights_block_config_image_fields @block, image %>
<% end %>
-
+
<%= link_to_function(_('New highlight'), nil, :class => 'button icon-add with-text') do |page|
- page.insert_html :bottom, 'highlights', content_tag('tr',
- content_tag('td', select_tag('block[images][][image_id]', content_tag(:option) + option_groups_from_collection_for_select(@block.folder_choices, :images, :name, :id, :name), :style => "width: 100px")) +
- content_tag('td', text_field_tag('block[images][][address]', nil, :class => 'highlight-address', :size => 10)) +
- content_tag('td', text_field_tag('block[images][][position]', nil, :class => 'highlight-position', :size => 3)) +
- content_tag('td', text_field_tag('block[images][][title]', nil, :class => 'highlight-position', :size => 10))
- ) +
- javascript_tag("$('edit-link-list-block').scrollTop = $('edit-link-list-block').scrollHeight")
+ page.insert_html :bottom, 'highlights-data-table', highlights_block_config_image_fields(@block)
end %>
<%= labelled_form_field _('Image transition:'), select('block', 'interval', [[_('No automatic transition'), 0]] + [1, 2, 3, 4, 5, 10, 20, 30, 60].map {|item| [n_('Every 1 second', 'Every %d seconds', item) % item, item]}) %>
diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css
index ba382d3..545d48f 100644
--- a/public/stylesheets/application.css
+++ b/public/stylesheets/application.css
@@ -4314,6 +4314,35 @@ h1#agenda-title {
text-align: center;
overflow: hidden;
}
+
+.block-config-options.HighlightsBlock-options .image-data-line select {
+ width: 150px;
+}
+
+.block-config-options.HighlightsBlock-options td {
+ text-align: center;
+}
+
+.block-config-options.HighlightsBlock-options .image-data-line td {
+ padding-top: 7px;
+}
+
+.block-config-options.HighlightsBlock-options .image-title {
+ white-space: nowrap;
+ border-bottom: 1px solid #CCC;
+}
+.block-config-options.HighlightsBlock-options .image-title:last-child {
+ border: none;
+}
+
+.block-config-options.HighlightsBlock-options .image-title td {
+ padding-bottom: 7px;
+}
+
+.block-config-options.HighlightsBlock-options .image-title span {
+ padding-right: 5px;
+}
+
/* Featured Products stuff */
.featured-product-items {
--
libgit2 0.21.2