sunrise-core 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (31) hide show
  1. data/README.rdoc +2 -2
  2. data/app/controllers/manage/assets_controller.rb +2 -2
  3. data/app/views/layouts/manage.html.erb +4 -5
  4. data/app/views/manage/{assets/_picture.html.erb → fileupload/_asset.html.erb} +4 -3
  5. data/app/views/manage/fileupload/_container.html.erb +25 -0
  6. data/app/views/manage/fileupload/_tmpl.html.erb +14 -0
  7. data/app/views/manage/users/_form.html.erb +5 -1
  8. data/app/views/manage/users/_model_filter.html.erb +5 -3
  9. data/config/locales/manage/en.yml +5 -0
  10. data/config/locales/manage/ru.yml +5 -0
  11. data/config/locales/manage/uk.yml +5 -0
  12. data/lib/generators/sunrise/install_generator.rb +26 -6
  13. data/lib/generators/sunrise/templates/helpers/manage/assets_helper.rb +0 -14
  14. data/lib/generators/sunrise/templates/javascripts/manage-fileuploader.js +182 -0
  15. data/lib/generators/sunrise/templates/javascripts/manage.js +17 -13
  16. data/lib/generators/sunrise/templates/models/defaults/user.rb +1 -5
  17. data/lib/generators/sunrise/templates/stylesheets/manage/buttons.css +42 -0
  18. data/lib/generators/sunrise/templates/stylesheets/manage/main.css +11 -0
  19. data/lib/generators/sunrise/templates/stylesheets/smoothness/{jquery-ui-1.8.6.custom.css → jquery-ui-1.8.13.custom.css} +37 -31
  20. data/lib/sunrise/engine.rb +5 -0
  21. data/lib/sunrise/models/asset.rb +1 -1
  22. data/lib/sunrise/version.rb +1 -1
  23. data/lib/sunrise/views/form_builder.rb +53 -6
  24. metadata +56 -43
  25. data/app/views/manage/assets/_collection.html.erb +0 -32
  26. data/app/views/manage/assets/_swfscript.html.erb +0 -51
  27. data/lib/generators/sunrise/templates/javascripts/swfupload/fileprogress.js +0 -114
  28. data/lib/generators/sunrise/templates/javascripts/swfupload/handlers.js +0 -164
  29. data/lib/generators/sunrise/templates/javascripts/swfupload/swfupload.js +0 -1134
  30. data/lib/generators/sunrise/templates/javascripts/swfupload/swfupload.queue.js +0 -98
  31. data/lib/generators/sunrise/templates/javascripts/swfupload/swfupload.swf +0 -0
@@ -1,7 +1,7 @@
1
1
  /*
2
- * jQuery UI CSS Framework 1.8.6
2
+ * jQuery UI CSS Framework 1.8.13
3
3
  *
4
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
4
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
5
5
  * Dual licensed under the MIT or GPL Version 2 licenses.
6
6
  * http://jquery.org/license
7
7
  *
@@ -11,7 +11,7 @@
11
11
  /* Layout helpers
12
12
  ----------------------------------*/
13
13
  .ui-helper-hidden { display: none; }
14
- .ui-helper-hidden-accessible { position: absolute; left: -99999999px; }
14
+ .ui-helper-hidden-accessible { position: absolute !important; clip: rect(1px 1px 1px 1px); clip: rect(1px,1px,1px,1px); }
15
15
  .ui-helper-reset { margin: 0; padding: 0; border: 0; outline: 0; line-height: 1.3; text-decoration: none; font-size: 100%; list-style: none; }
16
16
  .ui-helper-clearfix:after { content: "."; display: block; height: 0; clear: both; visibility: hidden; }
17
17
  .ui-helper-clearfix { display: inline-block; }
@@ -42,9 +42,9 @@
42
42
 
43
43
 
44
44
  /*
45
- * jQuery UI CSS Framework 1.8.6
45
+ * jQuery UI CSS Framework 1.8.13
46
46
  *
47
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
47
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
48
48
  * Dual licensed under the MIT or GPL Version 2 licenses.
49
49
  * http://jquery.org/license
50
50
  *
@@ -293,16 +293,21 @@
293
293
  /* Overlays */
294
294
  .ui-widget-overlay { background: #aaaaaa url(/stylesheets/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
295
295
  .ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(/stylesheets/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*
296
- * jQuery UI Resizable 1.8.6
296
+ * jQuery UI Resizable 1.8.13
297
297
  *
298
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
298
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
299
299
  * Dual licensed under the MIT or GPL Version 2 licenses.
300
300
  * http://jquery.org/license
301
301
  *
302
302
  * http://docs.jquery.com/UI/Resizable#theming
303
303
  */
304
304
  .ui-resizable { position: relative;}
305
- .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;}
305
+ .ui-resizable-handle { position: absolute;font-size: 0.1px;z-index: 99999; display: block;
306
+ /* http://bugs.jqueryui.com/ticket/7233
307
+ - Resizable: resizable handles fail to work in IE if transparent and content overlaps
308
+ */
309
+ background-image:url(data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=);
310
+ }
306
311
  .ui-resizable-disabled .ui-resizable-handle, .ui-resizable-autohide .ui-resizable-handle { display: none; }
307
312
  .ui-resizable-n { cursor: n-resize; height: 7px; width: 100%; top: -5px; left: 0; }
308
313
  .ui-resizable-s { cursor: s-resize; height: 7px; width: 100%; bottom: -5px; left: 0; }
@@ -312,9 +317,9 @@
312
317
  .ui-resizable-sw { cursor: sw-resize; width: 9px; height: 9px; left: -5px; bottom: -5px; }
313
318
  .ui-resizable-nw { cursor: nw-resize; width: 9px; height: 9px; left: -5px; top: -5px; }
314
319
  .ui-resizable-ne { cursor: ne-resize; width: 9px; height: 9px; right: -5px; top: -5px;}/*
315
- * jQuery UI Selectable 1.8.6
320
+ * jQuery UI Selectable 1.8.13
316
321
  *
317
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
322
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
318
323
  * Dual licensed under the MIT or GPL Version 2 licenses.
319
324
  * http://jquery.org/license
320
325
  *
@@ -322,9 +327,9 @@
322
327
  */
323
328
  .ui-selectable-helper { position: absolute; z-index: 100; border:1px dotted black; }
324
329
  /*
325
- * jQuery UI Accordion 1.8.6
330
+ * jQuery UI Accordion 1.8.13
326
331
  *
327
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
332
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
328
333
  * Dual licensed under the MIT or GPL Version 2 licenses.
329
334
  * http://jquery.org/license
330
335
  *
@@ -339,10 +344,11 @@
339
344
  .ui-accordion-icons .ui-accordion-header a { padding-left: 2.2em; }
340
345
  .ui-accordion .ui-accordion-header .ui-icon { position: absolute; left: .5em; top: 50%; margin-top: -8px; }
341
346
  .ui-accordion .ui-accordion-content { padding: 1em 2.2em; border-top: 0; margin-top: -2px; position: relative; top: 1px; margin-bottom: 2px; overflow: auto; display: none; zoom: 1; }
342
- .ui-accordion .ui-accordion-content-active { display: block; }/*
343
- * jQuery UI Autocomplete 1.8.6
347
+ .ui-accordion .ui-accordion-content-active { display: block; }
348
+ /*
349
+ * jQuery UI Autocomplete 1.8.13
344
350
  *
345
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
351
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
346
352
  * Dual licensed under the MIT or GPL Version 2 licenses.
347
353
  * http://jquery.org/license
348
354
  *
@@ -354,7 +360,7 @@
354
360
  * html .ui-autocomplete { width:1px; } /* without this, the menu expands to 100% in IE6 */
355
361
 
356
362
  /*
357
- * jQuery UI Menu 1.8.6
363
+ * jQuery UI Menu 1.8.13
358
364
  *
359
365
  * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
360
366
  * Dual licensed under the MIT or GPL Version 2 licenses.
@@ -393,9 +399,9 @@
393
399
  margin: -1px;
394
400
  }
395
401
  /*
396
- * jQuery UI Button 1.8.6
402
+ * jQuery UI Button 1.8.13
397
403
  *
398
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
404
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
399
405
  * Dual licensed under the MIT or GPL Version 2 licenses.
400
406
  * http://jquery.org/license
401
407
  *
@@ -431,17 +437,17 @@ input.ui-button { padding: .4em 1em; }
431
437
  /* workarounds */
432
438
  button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra padding in Firefox */
433
439
  /*
434
- * jQuery UI Dialog 1.8.6
440
+ * jQuery UI Dialog 1.8.13
435
441
  *
436
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
442
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
437
443
  * Dual licensed under the MIT or GPL Version 2 licenses.
438
444
  * http://jquery.org/license
439
445
  *
440
446
  * http://docs.jquery.com/UI/Dialog#theming
441
447
  */
442
448
  .ui-dialog { position: absolute; padding: .2em; width: 300px; overflow: hidden; }
443
- .ui-dialog .ui-dialog-titlebar { padding: .5em 1em .3em; position: relative; }
444
- .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .2em 0; }
449
+ .ui-dialog .ui-dialog-titlebar { padding: .4em 1em; position: relative; }
450
+ .ui-dialog .ui-dialog-title { float: left; margin: .1em 16px .1em 0; }
445
451
  .ui-dialog .ui-dialog-titlebar-close { position: absolute; right: .3em; top: 50%; width: 19px; margin: -10px 0 0 0; padding: 1px; height: 18px; }
446
452
  .ui-dialog .ui-dialog-titlebar-close span { display: block; margin: 1px; }
447
453
  .ui-dialog .ui-dialog-titlebar-close:hover, .ui-dialog .ui-dialog-titlebar-close:focus { padding: 0; }
@@ -452,9 +458,9 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
452
458
  .ui-dialog .ui-resizable-se { width: 14px; height: 14px; right: 3px; bottom: 3px; }
453
459
  .ui-draggable .ui-dialog-titlebar { cursor: move; }
454
460
  /*
455
- * jQuery UI Slider 1.8.6
461
+ * jQuery UI Slider 1.8.13
456
462
  *
457
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
463
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
458
464
  * Dual licensed under the MIT or GPL Version 2 licenses.
459
465
  * http://jquery.org/license
460
466
  *
@@ -475,9 +481,9 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
475
481
  .ui-slider-vertical .ui-slider-range { left: 0; width: 100%; }
476
482
  .ui-slider-vertical .ui-slider-range-min { bottom: 0; }
477
483
  .ui-slider-vertical .ui-slider-range-max { top: 0; }/*
478
- * jQuery UI Tabs 1.8.6
484
+ * jQuery UI Tabs 1.8.13
479
485
  *
480
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
486
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
481
487
  * Dual licensed under the MIT or GPL Version 2 licenses.
482
488
  * http://jquery.org/license
483
489
  *
@@ -493,15 +499,15 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
493
499
  .ui-tabs .ui-tabs-panel { display: block; border-width: 0; padding: 1em 1.4em; background: none; }
494
500
  .ui-tabs .ui-tabs-hide { display: none !important; }
495
501
  /*
496
- * jQuery UI Datepicker 1.8.6
502
+ * jQuery UI Datepicker 1.8.13
497
503
  *
498
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
504
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
499
505
  * Dual licensed under the MIT or GPL Version 2 licenses.
500
506
  * http://jquery.org/license
501
507
  *
502
508
  * http://docs.jquery.com/UI/Datepicker#theming
503
509
  */
504
- .ui-datepicker { width: 17em; padding: .2em .2em 0; }
510
+ .ui-datepicker { width: 17em; padding: .2em .2em 0; display: none; }
505
511
  .ui-datepicker .ui-datepicker-header { position:relative; padding:.2em 0; }
506
512
  .ui-datepicker .ui-datepicker-prev, .ui-datepicker .ui-datepicker-next { position:absolute; top: 2px; width: 1.8em; height: 1.8em; }
507
513
  .ui-datepicker .ui-datepicker-prev-hover, .ui-datepicker .ui-datepicker-next-hover { top: 1px; }
@@ -560,9 +566,9 @@ button.ui-button::-moz-focus-inner { border: 0; padding: 0; } /* reset extra pad
560
566
  width: 200px; /*must have*/
561
567
  height: 200px; /*must have*/
562
568
  }/*
563
- * jQuery UI Progressbar 1.8.6
569
+ * jQuery UI Progressbar 1.8.13
564
570
  *
565
- * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about)
571
+ * Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
566
572
  * Dual licensed under the MIT or GPL Version 2 licenses.
567
573
  * http://jquery.org/license
568
574
  *
@@ -1,5 +1,6 @@
1
1
  require 'rails'
2
2
  require 'sunrise-core'
3
+ require 'sunrise-file-upload'
3
4
 
4
5
  module Sunrise
5
6
  class Engine < ::Rails::Engine
@@ -35,6 +36,10 @@ module Sunrise
35
36
  filename = attachment.original_filename.gsub(/#{File.extname(attachment.original_filename)}$/, "")
36
37
  Sunrise::Utils.parameterize_filename( filename )
37
38
  end
39
+
40
+ Sunrise::FileUpload::Manager.before_create do |env, asset|
41
+ asset.user = env['warden'].user if env['warden']
42
+ end
38
43
  end
39
44
 
40
45
  # For railties migrations rake
@@ -91,7 +91,7 @@ module Sunrise
91
91
  end
92
92
 
93
93
  def make_content_type
94
- if data_content_type.blank? || data_content_type == "application/octet-stream"
94
+ if filename && (data_content_type.blank? || data_content_type == "application/octet-stream")
95
95
  content_types = MIME::Types.type_for(filename)
96
96
  self.data_content_type = content_types.first.to_s unless content_types.empty?
97
97
  end
@@ -1,3 +1,3 @@
1
1
  module Sunrise
2
- VERSION = "0.1.1".freeze
2
+ VERSION = "0.1.2".freeze
3
3
  end
@@ -4,7 +4,7 @@ require 'sunrise/views/inputs/date_time_input'
4
4
  module Sunrise
5
5
  module Views
6
6
  class FormBuilder < ::SimpleForm::FormBuilder
7
- delegate :concat, :content_tag, :link_to, :link_to_function, :to => :template
7
+ delegate :concat, :content_tag, :link_to, :link_to_function, :dom_id, :to => :template
8
8
 
9
9
  def input(attribute_name, options = {}, &block)
10
10
  options[:input_html] ||= {}
@@ -24,14 +24,61 @@ module Sunrise
24
24
 
25
25
  def button(type, *args, &block)
26
26
  options = args.extract_options!
27
+
28
+ html = options[:input_html] || {}
27
29
  url = options[:url] || [:manage, object_plural]
28
- title = object.new_record? ? I18n.t('manage.create') : I18n.t('manage.update')
30
+ value = object.new_record? ? 'create' : 'update'
31
+ title = html[:title] || I18n.t(value, :scope => :manage)
32
+
33
+ html = {
34
+ :value => value, :type => type,
35
+ :class => "gr cupid-green", :name => "commit"
36
+ }.merge(html)
37
+
38
+ content_tag(:div, :class => "buts controls") do
39
+ concat content_tag(:button, title, html)
40
+ concat link_to(I18n.t('manage.cancel'), url, :class => "erase")
41
+ end
42
+ end
43
+
44
+ def attach_file_field(attribute_name, options = {}, &block)
45
+ value = options.delete(:value) if options.key?(:value)
46
+ value ||= object.fileupload_asset(attribute_name)
47
+
48
+ element_guid = object.fileupload_guid
49
+ element_id = dom_id(object, [attribute_name, element_guid].join('_'))
50
+ script_options = (options.delete(:script) || {}).stringify_keys
51
+
52
+ params = {
53
+ :method => attribute_name,
54
+ :assetable_id => object.new_record? ? nil : object.id,
55
+ :assetable_type => object.class.name,
56
+ :guid => element_guid
57
+ }.merge(script_options.delete(:params) || {})
58
+
59
+ script_options['action'] ||= '/sunrise/fileupload?' + Rack::Utils.build_query(params)
60
+ script_options['allowedExtensions'] ||= ['jpg', 'jpeg', 'png', 'gif']
61
+ script_options['multiple'] ||= object.fileupload_multiple?(attribute_name)
62
+ script_options['element'] ||= element_id
29
63
 
30
- content_tag(:div, :style => "padding: 20px 0px 10px 20px;", :class => "buts") do
31
- concat link_to_function content_tag(:span, title), "$(this).parents('form').submit()", :class=>"gr"
32
- concat link_to I18n.t('manage.cancel'), url, :class=>"erase"
33
- concat super(type, {:style => "display:none"}, &block)
64
+ label ||= if object && object.class.respond_to?(:human_attribute_name)
65
+ object.class.human_attribute_name(attribute_name)
34
66
  end
67
+
68
+ locals = {
69
+ :element_id => element_id,
70
+ :file_title => (options[:file_title] || "JPEG, GIF, PNG or TIFF"),
71
+ :file_max_size => (options[:file_max_size] || 10),
72
+ :label => (label || attribute_name.to_s.humanize),
73
+ :object => object,
74
+ :attribute_name => attribute_name,
75
+ :assets => [value].flatten.delete_if { |v| v.nil? || v.new_record? },
76
+ :script_options => script_options.inspect.gsub('=>', ':'),
77
+ :multiple => script_options['multiple'],
78
+ :asset_klass => params[:klass]
79
+ }
80
+
81
+ template.render(:partial => "manage/fileupload/container", :locals => locals)
35
82
  end
36
83
 
37
84
  protected
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sunrise-core
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 1
9
- - 1
10
- version: 0.1.1
9
+ - 2
10
+ version: 0.1.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - Igor Galeta
@@ -16,9 +16,11 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-05-18 00:00:00 Z
19
+ date: 2011-05-23 00:00:00 +03:00
20
+ default_executable:
20
21
  dependencies:
21
22
  - !ruby/object:Gem::Dependency
23
+ type: :runtime
22
24
  requirement: &id001 !ruby/object:Gem::Requirement
23
25
  none: false
24
26
  requirements:
@@ -30,11 +32,11 @@ dependencies:
30
32
  - 0
31
33
  - 7
32
34
  version: 3.0.7
33
- version_requirements: *id001
34
- type: :runtime
35
35
  name: rails
36
+ version_requirements: *id001
36
37
  prerelease: false
37
38
  - !ruby/object:Gem::Dependency
39
+ type: :runtime
38
40
  requirement: &id002 !ruby/object:Gem::Requirement
39
41
  none: false
40
42
  requirements:
@@ -46,11 +48,11 @@ dependencies:
46
48
  - 4
47
49
  - 4
48
50
  version: 1.4.4
49
- version_requirements: *id002
50
- type: :runtime
51
51
  name: nokogiri
52
+ version_requirements: *id002
52
53
  prerelease: false
53
54
  - !ruby/object:Gem::Dependency
55
+ type: :runtime
54
56
  requirement: &id003 !ruby/object:Gem::Requirement
55
57
  none: false
56
58
  requirements:
@@ -62,11 +64,11 @@ dependencies:
62
64
  - 2
63
65
  - 2
64
66
  version: 1.2.2
65
- version_requirements: *id003
66
- type: :runtime
67
67
  name: inherited_resources
68
+ version_requirements: *id003
68
69
  prerelease: false
69
70
  - !ruby/object:Gem::Dependency
71
+ type: :runtime
70
72
  requirement: &id004 !ruby/object:Gem::Requirement
71
73
  none: false
72
74
  requirements:
@@ -78,11 +80,11 @@ dependencies:
78
80
  - 3
79
81
  - 11
80
82
  version: 2.3.11
81
- version_requirements: *id004
82
- type: :runtime
83
83
  name: paperclip
84
+ version_requirements: *id004
84
85
  prerelease: false
85
86
  - !ruby/object:Gem::Dependency
87
+ type: :runtime
86
88
  requirement: &id005 !ruby/object:Gem::Requirement
87
89
  none: false
88
90
  requirements:
@@ -93,11 +95,11 @@ dependencies:
93
95
  - 1
94
96
  - 16
95
97
  version: "1.16"
96
- version_requirements: *id005
97
- type: :runtime
98
98
  name: mime-types
99
+ version_requirements: *id005
99
100
  prerelease: false
100
101
  - !ruby/object:Gem::Dependency
102
+ type: :runtime
101
103
  requirement: &id006 !ruby/object:Gem::Requirement
102
104
  none: false
103
105
  requirements:
@@ -109,27 +111,27 @@ dependencies:
109
111
  - 12
110
112
  - 4
111
113
  version: 0.12.4
112
- version_requirements: *id006
113
- type: :runtime
114
114
  name: kaminari
115
+ version_requirements: *id006
115
116
  prerelease: false
116
117
  - !ruby/object:Gem::Dependency
118
+ type: :runtime
117
119
  requirement: &id007 !ruby/object:Gem::Requirement
118
120
  none: false
119
121
  requirements:
120
122
  - - ~>
121
123
  - !ruby/object:Gem::Version
122
- hash: 7
124
+ hash: 5
123
125
  segments:
124
126
  - 1
125
127
  - 6
126
- - 4
127
- version: 1.6.4
128
- version_requirements: *id007
129
- type: :runtime
128
+ - 5
129
+ version: 1.6.5
130
130
  name: cancan
131
+ version_requirements: *id007
131
132
  prerelease: false
132
133
  - !ruby/object:Gem::Dependency
134
+ type: :runtime
133
135
  requirement: &id008 !ruby/object:Gem::Requirement
134
136
  none: false
135
137
  requirements:
@@ -141,41 +143,54 @@ dependencies:
141
143
  - 1
142
144
  - 2
143
145
  version: 0.1.2
144
- version_requirements: *id008
145
- type: :runtime
146
146
  name: cancan_namespace
147
+ version_requirements: *id008
147
148
  prerelease: false
148
149
  - !ruby/object:Gem::Dependency
150
+ type: :runtime
149
151
  requirement: &id009 !ruby/object:Gem::Requirement
150
152
  none: false
151
153
  requirements:
152
154
  - - ~>
153
155
  - !ruby/object:Gem::Version
154
- hash: 27
156
+ hash: 19
155
157
  segments:
156
158
  - 1
157
159
  - 3
158
- - 0
159
- version: 1.3.0
160
- version_requirements: *id009
161
- type: :runtime
160
+ - 4
161
+ version: 1.3.4
162
162
  name: devise
163
+ version_requirements: *id009
163
164
  prerelease: false
164
165
  - !ruby/object:Gem::Dependency
166
+ type: :runtime
165
167
  requirement: &id010 !ruby/object:Gem::Requirement
166
168
  none: false
167
169
  requirements:
168
170
  - - ~>
169
171
  - !ruby/object:Gem::Version
170
- hash: 25
172
+ hash: 7
171
173
  segments:
172
174
  - 1
173
- - 3
174
- - 1
175
- version: 1.3.1
175
+ - 4
176
+ - 0
177
+ version: 1.4.0
178
+ name: simple_form
176
179
  version_requirements: *id010
180
+ prerelease: false
181
+ - !ruby/object:Gem::Dependency
177
182
  type: :runtime
178
- name: simple_form
183
+ requirement: &id011 !ruby/object:Gem::Requirement
184
+ none: false
185
+ requirements:
186
+ - - ">="
187
+ - !ruby/object:Gem::Version
188
+ hash: 3
189
+ segments:
190
+ - 0
191
+ version: "0"
192
+ name: sunrise-file-upload
193
+ version_requirements: *id011
179
194
  prerelease: false
180
195
  description: Sunrise is a Aimbulance CMS
181
196
  email: galeta.igor@gmail.com
@@ -196,9 +211,9 @@ files:
196
211
  - app/controllers/manage/users_controller.rb
197
212
  - app/controllers/pages_controller.rb
198
213
  - app/views/layouts/manage.html.erb
199
- - app/views/manage/assets/_collection.html.erb
200
- - app/views/manage/assets/_picture.html.erb
201
- - app/views/manage/assets/_swfscript.html.erb
214
+ - app/views/manage/fileupload/_asset.html.erb
215
+ - app/views/manage/fileupload/_container.html.erb
216
+ - app/views/manage/fileupload/_tmpl.html.erb
202
217
  - app/views/manage/headers/_form.html.erb
203
218
  - app/views/manage/pages/_form.html.erb
204
219
  - app/views/manage/pages/edit.html.erb
@@ -350,13 +365,9 @@ files:
350
365
  - lib/generators/sunrise/templates/javascripts/jquery.cookie.js
351
366
  - lib/generators/sunrise/templates/javascripts/jquery.fancybox-1.3.4.pack.js
352
367
  - lib/generators/sunrise/templates/javascripts/jquery.tmpl.min.js
368
+ - lib/generators/sunrise/templates/javascripts/manage-fileuploader.js
353
369
  - lib/generators/sunrise/templates/javascripts/manage.js
354
370
  - lib/generators/sunrise/templates/javascripts/preloader.js
355
- - lib/generators/sunrise/templates/javascripts/swfupload/fileprogress.js
356
- - lib/generators/sunrise/templates/javascripts/swfupload/handlers.js
357
- - lib/generators/sunrise/templates/javascripts/swfupload/swfupload.js
358
- - lib/generators/sunrise/templates/javascripts/swfupload/swfupload.queue.js
359
- - lib/generators/sunrise/templates/javascripts/swfupload/swfupload.swf
360
371
  - lib/generators/sunrise/templates/migrate/create_assets.rb
361
372
  - lib/generators/sunrise/templates/migrate/create_headers.rb
362
373
  - lib/generators/sunrise/templates/migrate/create_pages.rb
@@ -398,6 +409,7 @@ files:
398
409
  - lib/generators/sunrise/templates/stylesheets/fancybox/images/fancybox-y.png
399
410
  - lib/generators/sunrise/templates/stylesheets/fancybox/images/fancybox.png
400
411
  - lib/generators/sunrise/templates/stylesheets/fancybox/jquery.fancybox-1.3.4.css
412
+ - lib/generators/sunrise/templates/stylesheets/manage/buttons.css
401
413
  - lib/generators/sunrise/templates/stylesheets/manage/ie.css
402
414
  - lib/generators/sunrise/templates/stylesheets/manage/main.css
403
415
  - lib/generators/sunrise/templates/stylesheets/manage/panel.css
@@ -414,7 +426,7 @@ files:
414
426
  - lib/generators/sunrise/templates/stylesheets/smoothness/images/ui-icons_454545_256x240.png
415
427
  - lib/generators/sunrise/templates/stylesheets/smoothness/images/ui-icons_888888_256x240.png
416
428
  - lib/generators/sunrise/templates/stylesheets/smoothness/images/ui-icons_cd0a0a_256x240.png
417
- - lib/generators/sunrise/templates/stylesheets/smoothness/jquery-ui-1.8.6.custom.css
429
+ - lib/generators/sunrise/templates/stylesheets/smoothness/jquery-ui-1.8.13.custom.css
418
430
  - lib/generators/sunrise/templates/sweepers/page_sweeper.rb
419
431
  - lib/generators/sunrise/templates/sweepers/structure_sweeper.rb
420
432
  - lib/generators/sunrise/templates/sweepers/user_sweeper.rb
@@ -453,6 +465,7 @@ files:
453
465
  - lib/sunrise/views/form_builder.rb
454
466
  - lib/sunrise/views/helpers.rb
455
467
  - lib/sunrise/views/inputs/date_time_input.rb
468
+ has_rdoc: true
456
469
  homepage: https://github.com/galetahub/sunrise-core
457
470
  licenses: []
458
471
 
@@ -482,7 +495,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
482
495
  requirements: []
483
496
 
484
497
  rubyforge_project:
485
- rubygems_version: 1.8.2
498
+ rubygems_version: 1.6.2
486
499
  signing_key:
487
500
  specification_version: 3
488
501
  summary: Rails CMS
@@ -1,32 +0,0 @@
1
- <% unless model.new_record? %>
2
- <div class="gray-blocks">
3
- <div style="padding: 20px;" class="bg-bl">
4
- <div style="padding: 0px 0px 15px;" class="gr-title"><%= t('manage.pictures') %></div>
5
-
6
- <%= content_tag(:div, :id=>"swf_collection_#{model.id}", :class=>"galery") do %>
7
- <%= render :partial=>"/manage/assets/picture", :collection => model.pictures %>
8
- <% end %>
9
-
10
- <div style="padding-top:20px;">
11
- <%= content_tag(:span, nil, :id=>"swf_button_#{model.id}", :class=>"white-but") %>
12
- <%= content_tag(:div, nil, :id=>"swf_container_#{model.id}") %>
13
- </div>
14
- </div>
15
- </div>
16
-
17
- <%= render :partial=>"/manage/assets/swfscript", :locals=>{:model=>model, :klass=>model.pictures.name } %>
18
-
19
- <script type='text/javascript'>
20
- $(document).ready(function(){
21
- Manage.init_assets('div.galery', '<%= sort_manage_assets_path(:klass => model.pictures.name) %>');
22
- });
23
- </script>
24
- <script id="asset_tmpl" type="text/x-jquery-tmpl">
25
- <div id="<%= dom_class(model.class.reflections[:pictures].klass) %>_${id}" class="asset ill">
26
- <%= link_to image_tag("manage/empty.gif", :alt=>t('manage.delete'), :title=>t('manage.delete')),
27
- "/manage/assets/${id}", :remote => true, :method => :delete, :confirm => t('manage.confirm_delete'), :class => "del" %>
28
-
29
- <a class="fancybox" href="${link_path}"><img title="${image_title}" src="${image_path}"></a>
30
- </div>
31
- </script>
32
- <% end %>
@@ -1,51 +0,0 @@
1
- <% javascript "swfupload/swfupload", "swfupload/swfupload.queue", "swfupload/fileprogress", "swfupload/handlers" %>
2
-
3
- <script type="text/javascript">
4
- $(document).ready(function(){
5
- new SWFUpload({
6
- // Backend settings
7
- upload_url: "<%= manage_assets_path_with_session_information(klass, {:collection=>1}) %>",
8
- post_params: {"assetable_type" : "<%= model.class.to_s %>", "assetable_id" : "<%= model.id %>"},
9
- file_post_name: "data_file",
10
-
11
- // Flash file settings
12
- file_size_limit : "10 MB",
13
- file_types : "*.jpg;*.jpeg;*.png;*.gif", // or you could use something like: "*.doc;*.wpd;*.pdf",
14
- file_types_description : "All Images",
15
- file_upload_limit : 20,
16
- file_queue_limit : 0,
17
-
18
- // The event handler functions are defined in handlers.js
19
- //swfupload_loaded_handler : swfUploadLoaded,
20
- file_queued_handler : fileQueued,
21
- file_queue_error_handler : fileQueueError,
22
- file_dialog_complete_handler : fileDialogComplete,
23
- upload_start_handler : uploadStart,
24
- upload_progress_handler : uploadProgress,
25
- upload_error_handler : uploadError,
26
- upload_success_handler : uploadSuccess,
27
- upload_complete_handler : uploadComplete,
28
- queue_complete_handler : queueComplete, // Queue plugin event
29
-
30
- // Button Settings
31
- button_image_url : "/images/manage/button_add_foto_<%= I18n.locale %>.gif",
32
- button_placeholder_id : <%=raw "swf_button_#{model.id}".inspect %>,
33
- button_width: 170,
34
- button_height: 32,
35
- button_window_mode: SWFUpload.WINDOW_MODE.TRANSPARENT,
36
- button_cursor: SWFUpload.CURSOR.HAND,
37
-
38
- // Flash Settings
39
- flash_url : "/javascripts/swfupload/swfupload.swf",
40
-
41
- custom_settings : {
42
- progressTarget : <%=raw "swf_container_#{model.id}".inspect %>,
43
- collectionTarget: <%=raw "swf_collection_#{model.id}".inspect %>,
44
- cancelButtonId : "btn_cancel"
45
- },
46
-
47
- // Debug settings
48
- debug: <%= Rails.env.development? ? 'true' : 'false' %>
49
- });
50
- });
51
- </script>