sunrise-cms 0.6.5 → 0.6.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. data/CHANGELOG.rdoc +4 -0
  2. data/README.md +14 -2
  3. data/app/assets/stylesheets/sunrise/main.css +4 -4
  4. data/app/controllers/sunrise/manager_controller.rb +1 -0
  5. data/app/views/sunrise/manager/_field.html.erb +1 -1
  6. data/app/views/sunrise/manager/_nested_field.html.erb +1 -1
  7. data/lib/sunrise/config/field.rb +1 -3
  8. data/lib/sunrise/version.rb +1 -1
  9. data/spec/dummy/log/test.log +4210 -0
  10. data/spec/requests/manager/default/new_spec.rb +11 -0
  11. metadata +2 -70
  12. data/spec/tmp/app/models/defaults/ability.rb +0 -18
  13. data/spec/tmp/app/models/defaults/asset.rb +0 -7
  14. data/spec/tmp/app/models/defaults/attachment_file.rb +0 -5
  15. data/spec/tmp/app/models/defaults/avatar.rb +0 -7
  16. data/spec/tmp/app/models/defaults/picture.rb +0 -7
  17. data/spec/tmp/app/models/defaults/position_type.rb +0 -7
  18. data/spec/tmp/app/models/defaults/role_type.rb +0 -8
  19. data/spec/tmp/app/models/defaults/settings.rb +0 -6
  20. data/spec/tmp/app/models/defaults/structure.rb +0 -10
  21. data/spec/tmp/app/models/defaults/structure_type.rb +0 -9
  22. data/spec/tmp/app/models/defaults/user.rb +0 -14
  23. data/spec/tmp/app/models/sunrise/sunrise_navigation.rb +0 -14
  24. data/spec/tmp/app/models/sunrise/sunrise_page.rb +0 -10
  25. data/spec/tmp/app/models/sunrise/sunrise_structure.rb +0 -35
  26. data/spec/tmp/app/models/sunrise/sunrise_user.rb +0 -50
  27. data/spec/tmp/app/uploaders/attachment_file_uploader.rb +0 -5
  28. data/spec/tmp/app/uploaders/avatar_uploader.rb +0 -15
  29. data/spec/tmp/app/uploaders/picture_uploader.rb +0 -15
  30. data/spec/tmp/app/views/layouts/application.html.erb +0 -22
  31. data/spec/tmp/app/views/pages/show.html.erb +0 -2
  32. data/spec/tmp/app/views/shared/_notice.html.erb +0 -17
  33. data/spec/tmp/config/application.rb +0 -63
  34. data/spec/tmp/config/database.yml.sample +0 -34
  35. data/spec/tmp/config/initializers/sunrise.rb +0 -51
  36. data/spec/tmp/config/logrotate-config.sample +0 -9
  37. data/spec/tmp/config/nginx-config.sample +0 -67
  38. data/spec/tmp/config/routes.rb +0 -10
  39. data/spec/tmp/db/seeds.rb +0 -30
  40. data/spec/tmp/spec/controllers/pages_controller_spec.rb +0 -22
  41. data/spec/tmp/spec/controllers/welcome_controller_spec.rb +0 -18
  42. data/spec/tmp/spec/factories/structure_factory.rb +0 -22
  43. data/spec/tmp/spec/factories/user_factory.rb +0 -61
  44. data/spec/tmp/spec/spec_helper.rb +0 -37
  45. data/spec/tmp/spec/support/helpers/controller_macros.rb +0 -52
data/CHANGELOG.rdoc CHANGED
@@ -1,3 +1,7 @@
1
+ == 0.6.6
2
+ * Allow pre-fill attributes on new form
3
+ * Add :html option on field config to setup holder
4
+
1
5
  == 0.6.5
2
6
  * Fix bugs
3
7
 
data/README.md CHANGED
@@ -50,6 +50,18 @@ class SunriseProduct < Sunrise::AbstractModel
50
50
  field :price
51
51
  field :total_stock
52
52
  end
53
+
54
+ list :export do
55
+ scope { Product.includes(:picture).recently.with_state(:finished) }
56
+
57
+ field :id
58
+ field :product_title
59
+ field :size
60
+ field :started_at
61
+ field :finished_at
62
+ field :unique_accounts_count
63
+ field :total_points
64
+ end
53
65
 
54
66
  show do
55
67
  field :title
@@ -72,9 +84,9 @@ class SunriseProduct < Sunrise::AbstractModel
72
84
  end
73
85
 
74
86
  group :bottom, :holder => :bottom do
75
- nested_attributes :variants do
87
+ nested_attributes :variants, :multiply => true do
76
88
  field :size
77
- field :total_stock, :div_style => 'width:100%;clear:both;'
89
+ field :total_stock, :html => { :style => 'width:100%;clear:both;' }
78
90
  field :item_model_id, :collection => lambda { ItemModel.all }, :include_blank => false
79
91
  end
80
92
 
@@ -731,9 +731,9 @@ input[disabled].button.gray {
731
731
  }
732
732
 
733
733
  a.close-but {
734
- width: 8px;
735
- height: 8px;
736
- background: url(/assets/sunrise/chosen-sprite.png) no-repeat -50px -2px;
734
+ width: 9px;
735
+ height: 9px;
736
+ background: url(/assets/sunrise/chosen-sprite.png) no-repeat -43px 0px;
737
737
  display: block;
738
738
  position: absolute;
739
739
  top: 12px;
@@ -741,7 +741,7 @@ a.close-but {
741
741
  }
742
742
 
743
743
  a.close-but:hover {
744
- background-position: -50px -13px;
744
+ background-position: -43px -11px;
745
745
  }
746
746
 
747
747
  .dnd-area {
@@ -27,6 +27,7 @@ module Sunrise
27
27
  end
28
28
 
29
29
  def new
30
+ @record.attributes = abstract_model.model_params
30
31
  respond_with(@record) do |format|
31
32
  format.html { render_with_scope }
32
33
  end
@@ -1,5 +1,5 @@
1
1
  <% options ||= {} %>
2
- <%= content_tag :div, field.html_options do %>
2
+ <%= content_tag :div, field.html_options do -%>
3
3
  <% if field.visible?(form.object) -%>
4
4
  <% if field.nested? -%>
5
5
  <div class="nested">
@@ -1,4 +1,4 @@
1
1
  <div class="nested_item">
2
- <%= manage_remove_child_link '', form, :class => "close-but" %>
2
+ <%= manage_remove_child_link('', form, :class => "close-but") if field.multiply? %>
3
3
  <%= render :partial => 'field', :collection => field.fields, :locals => {:form => form} %>
4
4
  </div>
@@ -36,9 +36,7 @@ module Sunrise
36
36
  css << "grey-but" if input_options[:boolean]
37
37
  css << "tags-edit" if association?
38
38
 
39
- opts = { :class => css.join(' ') }
40
- opts.merge!({ :style => input_options[:div_style] }) if input_options[:div_style]
41
- opts
39
+ {:class => css}.merge(input_options[:html] || {})
42
40
  end
43
41
 
44
42
  def association?
@@ -1,3 +1,3 @@
1
1
  module Sunrise
2
- VERSION = "0.6.5".freeze
2
+ VERSION = "0.6.6".freeze
3
3
  end