spree-homepager 0.40.4 → 0.40.5

Sign up to get free protection for your applications and to get access to all the features.
data/app/models/banner.rb CHANGED
@@ -2,4 +2,6 @@ class Banner < ActiveRecord::Base
2
2
  acts_as_list
3
3
  has_attached_file :image, :styles => {:thumb => "100x100>" }
4
4
  default_scope :order => "position"
5
+
6
+ scope :visible, where(:visible => true)
5
7
  end
@@ -10,7 +10,12 @@
10
10
  <%= f.error_message_on :target_url %>
11
11
  <% end %>
12
12
 
13
- <%f.field_container :image do%>
13
+ <% f.field_container :image do %>
14
14
  <%= f.label :image, t("image")%> <br />
15
15
  <%= f.file_field :image%>
16
- <%end%>
16
+ <% end %>
17
+
18
+ <% f.field_container :visible do %>
19
+ <%= f.label :visible, t("visible") %><br />
20
+ <%= f.check_box :visible %>
21
+ <% end %>
@@ -18,7 +18,7 @@
18
18
  <%= t("reorder")%>
19
19
  </th>
20
20
  <th>
21
- <%= t("image")%>
21
+ <%= t("image")%>
22
22
  </th>
23
23
  <th>
24
24
  <%= t("tagline")%>
@@ -26,6 +26,9 @@
26
26
  <th>
27
27
  <%= t("target_url")%>
28
28
  </th>
29
+ <th>
30
+ <%= t("visible")%>
31
+ </th>
29
32
  <th>&nbsp;</th>
30
33
  </tr>
31
34
  </thead>
@@ -34,8 +37,9 @@
34
37
  <tr id="<%= dom_id banner %>">
35
38
  <td><span class="handle">[drag]</span></td>
36
39
  <td><%= link_to(image_tag(banner.image.url(:thumb)), banner.image.url(:banner)) %></td>
37
- <td><%=banner.tagline%></td>
40
+ <td><%=banner.tagline%></td>
38
41
  <td><%=banner.target_url%></td>
42
+ <td><%=image_tag "img_#{banner.visible}.gif"%></td>
39
43
  <td>
40
44
  <%=link_to_edit banner%> &nbsp;
41
45
  <%=link_to_delete banner%>
@@ -46,25 +50,25 @@
46
50
  </table>
47
51
 
48
52
  <script type="text/javascript" charset="utf-8">
49
-
53
+
50
54
  var fixWidthHelper = function(e, ui) {
51
55
  ui.children().each(function() {
52
56
  $(this).width($(this).width());
53
57
  });
54
58
  return ui;
55
59
  };
56
-
60
+
57
61
  $(function() {
58
62
  $("#banners tbody").sortable({
59
63
  axis: 'y',
60
64
  handle: '.handle',
61
65
  cursor: "move",
62
66
  helper: fixWidthHelper,
63
-
67
+
64
68
  update: function(){
65
69
  $.ajax({
66
- type: 'post',
67
- data: $('#banners tbody').sortable('serialize'),
70
+ type: 'post',
71
+ data: $('#banners tbody').sortable('serialize'),
68
72
  dataType: 'script',
69
73
  complete: function(request){
70
74
  $('#banners tbody').effect('highlight');
@@ -74,5 +78,5 @@
74
78
  }
75
79
  }).disableSelection();
76
80
  });
77
-
78
- </script>
81
+
82
+ </script>
@@ -1,5 +1,5 @@
1
1
  <div id="banner-slideshow">
2
- <% Banner.all.each do |banner| -%>
2
+ <% Banner.visible.each do |banner| -%>
3
3
  <div class="banner">
4
4
  <div class="tagline"><%=banner.tagline%></div>
5
5
  <%if banner.target_url.empty?%>
@@ -18,5 +18,5 @@ $(document).ready(function() {
18
18
  speed: 1000,
19
19
  timeout: 1000
20
20
  });
21
- });
22
- </script>
21
+ });
22
+ </script>
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spree-homepager
3
3
  version: !ruby/object:Gem::Version
4
- hash: 183
4
+ hash: 181
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 40
9
- - 4
10
- version: 0.40.4
9
+ - 5
10
+ version: 0.40.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Peter Berkenbosch
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-02-22 00:00:00 +01:00
18
+ date: 2011-02-24 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency