radiant-clipped-extension 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (123) hide show
  1. data/LICENSE +22 -0
  2. data/README.md +230 -0
  3. data/Rakefile +109 -0
  4. data/app/controllers/admin/assets_controller.rb +60 -0
  5. data/app/controllers/admin/page_attachments_controller.rb +18 -0
  6. data/app/helpers/admin/assets_helper.rb +16 -0
  7. data/app/models/asset.rb +224 -0
  8. data/app/models/asset_tags.rb +384 -0
  9. data/app/models/asset_type.rb +170 -0
  10. data/app/models/old_page_attachment.rb +26 -0
  11. data/app/models/page_attachment.rb +21 -0
  12. data/app/views/admin/assets/_asset.html.haml +12 -0
  13. data/app/views/admin/assets/_asset_table.html.haml +30 -0
  14. data/app/views/admin/assets/_errors.html.haml +3 -0
  15. data/app/views/admin/assets/_form.html.haml +20 -0
  16. data/app/views/admin/assets/_page_assets.html.haml +12 -0
  17. data/app/views/admin/assets/_search.html.haml +17 -0
  18. data/app/views/admin/assets/_search_results.html.haml +17 -0
  19. data/app/views/admin/assets/edit.html.haml +40 -0
  20. data/app/views/admin/assets/index.html.haml +19 -0
  21. data/app/views/admin/assets/new.html.haml +24 -0
  22. data/app/views/admin/assets/refresh.html.haml +14 -0
  23. data/app/views/admin/assets/remove.html.haml +16 -0
  24. data/app/views/admin/configuration/_edit.html.haml +8 -0
  25. data/app/views/admin/configuration/_show.html.haml +12 -0
  26. data/app/views/admin/page_attachments/_attachment.html.haml +25 -0
  27. data/app/views/admin/page_parts/_page_part.html.haml +21 -0
  28. data/app/views/admin/pages/_asset_popups.html.haml +42 -0
  29. data/app/views/admin/pages/_assets.html.haml +11 -0
  30. data/app/views/admin/removed/_assets_bucket.html.haml +8 -0
  31. data/app/views/admin/removed/_assets_container.html.haml +58 -0
  32. data/app/views/admin/removed/_bucket.html.haml +11 -0
  33. data/app/views/admin/removed/_bucket_asset.html.haml +9 -0
  34. data/app/views/admin/removed/_show_bucket_link.html.haml +4 -0
  35. data/app/views/admin/removed/_upload_to_page.html.haml +12 -0
  36. data/app/views/admin/removed/bucket/_iframe.html.haml +1 -0
  37. data/artwork/icons.png +0 -0
  38. data/clipped_extension.rb +89 -0
  39. data/config/initializers/interpolation.rb +6 -0
  40. data/config/initializers/processors.rb +43 -0
  41. data/config/initializers/radiant_config.rb +34 -0
  42. data/config/locales/en.yml +108 -0
  43. data/config/locales/nl.yml +105 -0
  44. data/config/routes.rb +8 -0
  45. data/cucumber.yml +1 -0
  46. data/db/migrate/001_create_assets.rb +12 -0
  47. data/db/migrate/002_create_paperclip_attributes.rb +13 -0
  48. data/db/migrate/003_create_user_observer.rb +13 -0
  49. data/db/migrate/004_create_page_attachments.rb +19 -0
  50. data/db/migrate/005_rename_users.rb +13 -0
  51. data/db/migrate/20090316132151_disable_file_types.rb +20 -0
  52. data/db/migrate/20110513205050_asset_uuid.rb +11 -0
  53. data/db/migrate/20110606111250_update_configuration.rb +28 -0
  54. data/db/migrate/20110609101438_dimensions.rb +13 -0
  55. data/features/support/env.rb +11 -0
  56. data/features/support/paths.rb +22 -0
  57. data/lib/clipped_admin_ui.rb +32 -0
  58. data/lib/page_asset_associations.rb +13 -0
  59. data/lib/paperclip/frame_grab.rb +73 -0
  60. data/lib/paperclip/geometry_transformation.rb +79 -0
  61. data/lib/radiant-clipped-extension.rb +2 -0
  62. data/lib/radiant-clipped-extension/version.rb +3 -0
  63. data/lib/tasks/clipped_extension_tasks.rake +126 -0
  64. data/lib/tasks/paperclip_tasks.rake +79 -0
  65. data/public/flash/ZeroClipboard.swf +0 -0
  66. data/public/images/admin/assets/add.png +0 -0
  67. data/public/images/admin/assets/archive_icon.png +0 -0
  68. data/public/images/admin/assets/audio_icon.png +0 -0
  69. data/public/images/admin/assets/audio_thumbnail.png +0 -0
  70. data/public/images/admin/assets/c_icon.png +0 -0
  71. data/public/images/admin/assets/copy.png +0 -0
  72. data/public/images/admin/assets/css_icon.png +0 -0
  73. data/public/images/admin/assets/database_icon.png +0 -0
  74. data/public/images/admin/assets/delete.png +0 -0
  75. data/public/images/admin/assets/document_icon.png +0 -0
  76. data/public/images/admin/assets/document_thumbnail.png +0 -0
  77. data/public/images/admin/assets/flash_icon.png +0 -0
  78. data/public/images/admin/assets/flash_thumbnail.png +0 -0
  79. data/public/images/admin/assets/font_icon.png +0 -0
  80. data/public/images/admin/assets/gzip_icon.png +0 -0
  81. data/public/images/admin/assets/html_icon.png +0 -0
  82. data/public/images/admin/assets/image_icon.png +0 -0
  83. data/public/images/admin/assets/image_thumbnail.png +0 -0
  84. data/public/images/admin/assets/java_icon.png +0 -0
  85. data/public/images/admin/assets/page_edit.png +0 -0
  86. data/public/images/admin/assets/perl_icon.png +0 -0
  87. data/public/images/admin/assets/php_icon.png +0 -0
  88. data/public/images/admin/assets/presentation_icon.png +0 -0
  89. data/public/images/admin/assets/python_icon.png +0 -0
  90. data/public/images/admin/assets/reorder_assets.png +0 -0
  91. data/public/images/admin/assets/ruby_icon.png +0 -0
  92. data/public/images/admin/assets/script_icon.png +0 -0
  93. data/public/images/admin/assets/spreadsheet_icon.png +0 -0
  94. data/public/images/admin/assets/tar_icon.png +0 -0
  95. data/public/images/admin/assets/unknown_icon.png +0 -0
  96. data/public/images/admin/assets/unknown_thumbnail.png +0 -0
  97. data/public/images/admin/assets/video_icon.png +0 -0
  98. data/public/images/admin/assets/video_thumbnail.png +0 -0
  99. data/public/images/admin/assets/xml_icon.png +0 -0
  100. data/public/images/admin/assets/zip_icon.png +0 -0
  101. data/public/javascripts/admin/assets.js +296 -0
  102. data/public/stylesheets/sass/admin/assets.sass +209 -0
  103. data/radiant-clipped-extension.gemspec +33 -0
  104. data/spec/controllers/admin/assets_controller_spec.rb +50 -0
  105. data/spec/controllers/admin/page_attachments_controller_spec.rb +50 -0
  106. data/spec/datasets/assets_dataset.rb +35 -0
  107. data/spec/fixtures/test.flv +0 -0
  108. data/spec/lib/asset_tags_spec.rb +101 -0
  109. data/spec/lib/frame_grab_spec.rb +17 -0
  110. data/spec/lib/geometry_transformation_spec.rb +63 -0
  111. data/spec/models/asset_spec.rb +72 -0
  112. data/spec/models/asset_type_spec.rb +63 -0
  113. data/spec/spec.opts +6 -0
  114. data/spec/spec_helper.rb +36 -0
  115. data/wireframes/edit-page-assets-2.bmml +453 -0
  116. data/wireframes/edit-page-assets-2.png +0 -0
  117. data/wireframes/edit-page-assets-3.bmml +454 -0
  118. data/wireframes/edit-page-assets-3.png +0 -0
  119. data/wireframes/edit-page-assets.bmml +433 -0
  120. data/wireframes/edit-page-assets.png +0 -0
  121. data/wireframes/edit-page.bmml +174 -0
  122. data/wireframes/edit-page.png +0 -0
  123. metadata +249 -0
@@ -0,0 +1,170 @@
1
+ class AssetType
2
+
3
+ # The Asset Type encapsulates a type of attachment.
4
+ # Conventionally this would a sensible category like 'image' or 'video'
5
+ # that should be processed and presented in a particular way.
6
+ # An AssetType currently provides:
7
+ # * processor definitions for paperclip
8
+ # * styles definitions for paperclip
9
+ # * mime type list for file recognition
10
+ # * selectors and scopes for retrieving this (or not this) category of asset
11
+ # * radius tags for those subsets of assets (temporarily removed pending discussion of interface)
12
+
13
+ @@types = []
14
+ @@type_lookup = {}
15
+ @@mime_lookup = {}
16
+ @@default_type = nil
17
+ attr_reader :name, :processors, :styles, :icon_name, :catchall, :default_radius_tag
18
+
19
+ def initialize(name, options = {})
20
+ options = options.symbolize_keys
21
+ @name = name
22
+ @icon_name = options[:icon] || name
23
+ @processors = options[:processors] || []
24
+ @styles = options[:styles] || {}
25
+ @mimes = options[:mime_types] || []
26
+ @default_radius_tag = options[:default_radius_tag] || 'link'
27
+ if @mimes.any?
28
+ @mimes.each { |mimetype| @@mime_lookup[mimetype] ||= self }
29
+ end
30
+ this = self
31
+ Asset.send :define_method, "#{name}?".intern do this.mime_types.include?(asset_content_type) end
32
+ Asset.send :define_class_method, "#{name}_condition".intern do this.condition; end
33
+ Asset.send :define_class_method, "not_#{name}_condition".intern do this.non_condition; end
34
+ Asset.send :named_scope, plural.to_sym, :conditions => condition
35
+ Asset.send :named_scope, "not_#{plural}".to_sym, :conditions => non_condition
36
+
37
+ # Page.define_radius_tags_for_asset_type self #TODO discuss interface
38
+ @@types.push self
39
+ @@type_lookup[@name] = self
40
+ end
41
+
42
+ def plural
43
+ name.to_s.pluralize
44
+ end
45
+
46
+ def icon(style_name='icon')
47
+ if File.exist?("#{RAILS_ROOT}/public/images/admin/assets/#{icon_name}_#{style_name.to_s}.png")
48
+ return "/images/admin/assets/#{icon_name}_#{style_name.to_s}.png"
49
+ else
50
+ return "/images/admin/assets/#{icon_name}_icon.png"
51
+ end
52
+ end
53
+
54
+ def icon_path(style_name='icon')
55
+ "#{RAILS_ROOT}/public#{icon(style_name)}"
56
+ end
57
+
58
+ def condition
59
+ if @mimes.any?
60
+ ["asset_content_type IN (#{@mimes.map{'?'}.join(',')})", *@mimes]
61
+ else
62
+ self.class.other_condition
63
+ end
64
+ end
65
+
66
+ def sanitized_condition
67
+ ActiveRecord::Base.send :sanitize_sql_array, condition
68
+ end
69
+
70
+ def non_condition
71
+ if @mimes.any?
72
+ ["NOT asset_content_type IN (#{@mimes.map{'?'}.join(',')})", *@mimes]
73
+ else
74
+ self.class.non_other_condition
75
+ end
76
+ end
77
+
78
+ def sanitized_non_condition
79
+ ActiveRecord::Base.send :sanitize_sql_array, non_condition
80
+ end
81
+
82
+ def mime_types
83
+ @mimes
84
+ end
85
+
86
+ def paperclip_processors
87
+ Radiant.config["assets.create_#{name}_thumbnails?"] ? processors : []
88
+ end
89
+
90
+ def paperclip_styles
91
+ if paperclip_processors.any?
92
+ #TODO: define permitted options for each asset type and pass through that subset of the style-definition hash
93
+ @paperclip_styles ||= styles.reverse_merge(configured_styles.inject({}) {|h, (k, v)| h[k] = v[:format].blank? ? v[:size] : [v[:size], v[:format].to_sym]; h})
94
+ else
95
+ {}
96
+ end
97
+ end
98
+
99
+ def configured_styles
100
+ styles = {}
101
+ if style_definitions = Radiant.config["assets.thumbnails.#{name}"]
102
+ style_definitions.to_s.gsub(' ','').split('|').each do |definition|
103
+ name, rule = definition.split(':')
104
+ styles[name.to_sym] = rule.split(',').collect{|option| option.split('=')}.inject({}) {|h, (k, v)| h[k.to_sym] = v; h}
105
+ end
106
+ end
107
+ styles
108
+ end
109
+
110
+ def legacy_styles
111
+ Radiant::config["assets.additional_thumbnails"].to_s.gsub(' ','').split(',').collect{|s| s.split('=')}.inject({}) {|ha, (k, v)| ha[k.to_sym] = v; ha}
112
+ end
113
+
114
+ def style_dimensions(style_name)
115
+ if style = paperclip_styles[style_name.to_sym]
116
+ style.is_a?(Array) ? style.first : style
117
+ end
118
+ end
119
+
120
+ # class methods
121
+
122
+ def self.from(mimetype)
123
+ @@mime_lookup[mimetype] || catchall
124
+ end
125
+
126
+ def self.catchall
127
+ @@default_type ||= self.find(:other)
128
+ end
129
+
130
+ def self.known?(name)
131
+ !self.find(name).nil?
132
+ end
133
+
134
+ def self.slice(*types)
135
+ @@type_lookup.slice(*types.map(&:to_sym)).values if types # Hash#slice is provided by will_paginate
136
+ end
137
+
138
+ def self.find(type)
139
+ @@type_lookup[type] if type
140
+ end
141
+
142
+ def self.all
143
+ @@types
144
+ end
145
+
146
+ def self.known_types
147
+ @@types.map(&:name) # to preserve order
148
+ end
149
+
150
+ def self.known_mimetypes
151
+ @@mime_lookup.keys
152
+ end
153
+
154
+ def self.mime_types_for(*names)
155
+ names.collect{ |name| find(name).mime_types }.flatten
156
+ end
157
+
158
+ def self.conditions_for(*names)
159
+ names.collect{ |name| self.find(name).sanitized_condition }.join(' OR ')
160
+ end
161
+
162
+ def self.non_other_condition
163
+ ["asset_content_type IN (#{known_mimetypes.map{'?'}.join(',')})", *known_mimetypes]
164
+ end
165
+
166
+ def self.other_condition
167
+ ["NOT asset_content_type IN (#{known_mimetypes.map{'?'}.join(',')})", *known_mimetypes]
168
+ end
169
+
170
+ end
@@ -0,0 +1,26 @@
1
+ class OldPageAttachment < ActiveRecord::Base
2
+ def create_paperclipped_record
3
+ options = {
4
+ :asset_file_size => size,
5
+ :asset_file_name => filename,
6
+ :asset_content_type => content_type,
7
+ :created_by_id => created_by
8
+ }
9
+
10
+ # In newer versions of page_attachments we have title and description fields.
11
+ options[:title] = title if respond_to?(:title)
12
+ options[:caption] = description if respond_to?(:description)
13
+
14
+ a = Asset.new(options)
15
+ a.save
16
+
17
+ # Re-attach the asset to it's page
18
+ page = Page.find(page_id)
19
+ p = PageAttachment.create(:asset_id => a.id, :page_id => page.id)
20
+
21
+ # Circumvent acts_as_list before_create filter to set the original page_attachment position.
22
+ PageAttachment.update_all("position=#{position}", "id=#{p.id}") if respond_to?(:position)
23
+
24
+ a
25
+ end
26
+ end
@@ -0,0 +1,21 @@
1
+ class PageAttachment < ActiveRecord::Base
2
+ belongs_to :asset
3
+ belongs_to :page
4
+ attr_accessor :selected
5
+
6
+ accepts_nested_attributes_for :asset
7
+
8
+ acts_as_list :scope => :page_id
9
+
10
+ def selected?
11
+ !!selected
12
+ end
13
+
14
+ # a small change to the method in acts_as_list so that we don't override
15
+ # the position value if it has already been set (as it usually is for new attachments)
16
+ def add_to_list_bottom
17
+ p "add_to_list_bottom: current value is #{self[position_column]}"
18
+ self[position_column] ||= bottom_position_in_list.to_i + 1
19
+ end
20
+
21
+ end
@@ -0,0 +1,12 @@
1
+ - asset ||= @asset
2
+ - asset_type = asset.image? ? "image" : "link"
3
+
4
+ %li{:class => "#{asset_type} asset", :id => "asset_#{asset.id}"}
5
+ .front
6
+ .thumbnail= image_tag asset.thumbnail(:thumbnail)
7
+ .back
8
+ .title= asset.title
9
+ %ul.actions
10
+ %li
11
+ = link_to t('clipped_extension.edit'), edit_admin_asset_url(asset), :class => 'edit_asset'
12
+ = link_to t('clipped_extension.remove'), remove_admin_asset_url(asset), :class => 'remove_asset'
@@ -0,0 +1,30 @@
1
+ - assets ||= @assets
2
+ - page ||= @page
3
+ - with_pagination ||= false
4
+
5
+ - if assets.empty?
6
+ %p
7
+ = t("clipped_extension.no_assets")
8
+ - else
9
+ - if with_pagination && assets.respond_to?(:previous_page) && assets.previous_page
10
+ = pagination_for(assets, pagination_parameters.merge(:depaginate => false, :params => {:controller => 'admin/assets', :action => 'index', :id => nil, :format => 'js'}))
11
+
12
+ %ul
13
+ - assets.each_with_index do |asset, index|
14
+ - asset_type = asset.image? ? "image" : "link"
15
+ %li{:class => "#{asset_type} asset", :id => "asset_#{asset.id}"}
16
+ .front
17
+ .thumbnail= image_tag asset.thumbnail(:thumbnail)
18
+ .back
19
+ .title
20
+ = asset.title
21
+ %ul.actions
22
+ - if @page
23
+ %li= asset_insertion_link(asset)
24
+ %li= asset_attachment_link(asset)
25
+ - else
26
+ %li= link_to t('clipped_extension.edit'), admin_asset_path(asset), :class => 'edit'
27
+ %li= link_to t("clipped_extension.remove"), remove_admin_asset_path(asset), :class => "delete"
28
+
29
+ - if with_pagination && assets.respond_to?(:next_page) && assets.next_page
30
+ = pagination_for(assets, pagination_parameters.merge(:depaginate => false, :param_name => 'p', :params => {:controller => 'admin/assets', :action => 'index', :id => nil, :format => 'js', :page_id => (page && page.id), :pp => assets.per_page }))
@@ -0,0 +1,3 @@
1
+ - if @asset.errors && !@asset.errors.empty?
2
+ %p#asset_errors
3
+ %strong= t("clipped_extension.asset_errors", :errors => @asset.errors.full_messages.to_sentence)
@@ -0,0 +1,20 @@
1
+ = render_region :form_top
2
+ - render_region :form do |form|
3
+ - form.edit_title do
4
+ %p.title
5
+ %label{ :for => "asset_title" }
6
+ = t("clipped_extension.title")
7
+ = f.text_field :title, :class => 'textbox', :maxlength => 100
8
+ - form.edit_metadata do
9
+ .drawer
10
+ .drawer_contents#attributes
11
+ %table.fieldset
12
+ %tr
13
+ %th.label
14
+ %label{ :for => "asset_caption" }
15
+ = t("clipped_extension.caption")
16
+ %td.field
17
+ = f.text_field :caption, :class => 'textbox', :maxlength => 255
18
+ = render_region :extended_metadata, :locals => {:f => f}
19
+ .drawer_handle
20
+ %a.toggle{:href=>'#attributes', :rel=>"toggle[attributes]", :class=>"#{(meta_errors? ? 'less' : 'more')}"}= meta_label
@@ -0,0 +1,12 @@
1
+ - unless @page.assets.empty?
2
+ - @page.page_attachments.each do |attachment|
3
+ = render :partial => 'admin/assets/asset', :locals => { :attachment => attachment }
4
+ - else
5
+ %li
6
+ %p.note
7
+ = t("clipped_extension.no_attached_assets")
8
+
9
+ %script{ :type => "text/javascript" }
10
+ Asset.MakeDraggables();
11
+
12
+ = sortable_element 'attachments', :url => reorder_assets_url(@page), :constraint => 'horizontal', :handle => 'reorder', :ghosting => false, :complete => visual_effect(:highlight, 'assets')
@@ -0,0 +1,17 @@
1
+ - form_tag(admin_assets_path, :id=>'filesearchform', :method => 'get', :class=>"search") do
2
+ - if @page
3
+ = hidden_field_tag "page_id", @page.id
4
+ = hidden_field_tag "p", params['p'] || 1
5
+ = hidden_field_tag "pp", params['pp'] || 20
6
+
7
+ .asset_filters
8
+ = link_to t("asset_types.all"), admin_assets_url, :id => "select_all", :class => params[:filter].blank? ? "deselective pressed" : "deselective"
9
+ - AssetType.all.each do |type|
10
+ - unless type.name == :other
11
+ = link_to t("asset_types.#{type.plural}"), admin_assets_url(:filter => type.name), :rel => type.name.to_s, :class => params[:filter] == type.name.to_s ? "selective pressed" : "selective"
12
+ .right
13
+ %input{:type=>"search", :class=>"search", :name=>"search", :value=>h(params[:search]), :placeholder=>"Search", :results=>0, :size=>30}
14
+
15
+ #type_boxes{:style => "display: none"}
16
+ - AssetType.all.each do |type|
17
+ = check_box_tag 'filter[]', type.name.to_s, false, :id => "#{type.name}-check", :class => 'selective'
@@ -0,0 +1,17 @@
1
+ %ul#search_list
2
+ - unless @assets.empty?
3
+ - @assets.each do |asset|
4
+ =# render :partial => 'asset', :locals => { :asset => asset, :page => @page }
5
+ = render :partial => 'admin/assets/asset', :locals => { :asset_url => asset.asset.url, :asset_id => asset.id, :asset_type => 'image', :asset_title => asset.title, :asset_thumbnail => asset.thumbnail(:thumbnail), :page => @page }
6
+
7
+ - else
8
+ %li
9
+ %p.note
10
+ = t("clipped_extension.no_assets_found")
11
+
12
+ %script
13
+ Asset.MakeDroppables();
14
+ Asset.MakeDraggables();
15
+ Event.addBehavior({ '.asset a' : Asset.DisableLinks, 'a.add_asset' : Asset.AddToPage });
16
+
17
+
@@ -0,0 +1,40 @@
1
+ - include_stylesheet 'admin/assets'
2
+ = render_region :top
3
+
4
+ - render_region :main do |main|
5
+ - main.edit_header do
6
+ %h1= t("clipped_extension.asset_edit_title")
7
+
8
+ - main.edit_form do
9
+ - form_for :asset, :url => admin_asset_path(@asset), :html => { :method => "put", :multipart => true } do |f|
10
+ .form_area
11
+ = render :partial => "form", :locals => { :f => f }
12
+
13
+ %div.content
14
+ %p
15
+ %label.filename
16
+ = "#{t("clipped_extension.filename")}: #{@asset.asset_file_name unless @asset.new_record?}"
17
+ %p.asset
18
+ - display_size = Radiant::config['assets.display_size'] || 'normal'
19
+ = image_tag @asset.thumbnail(display_size.to_sym), :class => 'preview'
20
+
21
+ = updated_stamp @asset
22
+
23
+ %p.upload
24
+ %label.upload
25
+ = t("clipped_extension.replace_file")
26
+ = f.file_field :asset, :class => "", :style => "width: 100%"
27
+
28
+ .buttons
29
+ = save_model_button(@asset)
30
+ = save_model_and_continue_editing_button(@asset)
31
+ = t("or")
32
+ = link_to t("cancel"), admin_assets_path
33
+
34
+ - main.edit_regenerate do
35
+ - if current_user.admin? or current_user.designer?
36
+ %p= t("clipped_extension.regenerate_thumbnails")
37
+
38
+ - form_tag refresh_admin_asset_path(@asset), :method => :put do
39
+ %p.asset_buttons
40
+ %input.button{ :type => "submit", :value => t("clipped_extension.regenerate") }
@@ -0,0 +1,19 @@
1
+ - include_stylesheet 'admin/assets'
2
+ - include_javascript 'admin/assets'
3
+
4
+ - content_for :toolbar do
5
+ = render 'search'
6
+
7
+ .outset
8
+ #assets_table.assets
9
+ = render :partial => 'asset_table', :locals => { :assets => @assets }
10
+ %p{:style => 'clear: both; height: 2em'} &nbsp;
11
+
12
+ - render_region :bottom do |bottom|
13
+ #actions
14
+ = pagination_for @assets, :depaginate => false
15
+ %ul
16
+ %li= link_to((image('upload') + ' ' + t('clipped_extension.upload_asset')), new_admin_asset_path)
17
+ - if current_user.admin?
18
+ %li
19
+ = link_to t('clipped_extension.regenerate_thumbnails'), refresh_admin_assets_path
@@ -0,0 +1,24 @@
1
+ - include_stylesheet 'admin/assets'
2
+ = render_region :top
3
+
4
+ - render_region :main do |main|
5
+ - main.edit_header do
6
+ %h1= t("clipped_extension.new_asset")
7
+
8
+ - main.edit_form do
9
+ - form_for :asset, :url => admin_assets_path, :html => { :method => "post", :multipart => true } do |f|
10
+
11
+ = render :partial => "form", :locals => { :f => f }
12
+
13
+ %p
14
+ %label= t("clipped_extension.choose_file")
15
+ = f.file_field :asset, :style => "width: 100%"
16
+
17
+ .buttons
18
+ = save_model_button(@asset)
19
+ = save_model_and_continue_editing_button(@asset)
20
+ = t("or")
21
+ = link_to t("cancel"), admin_assets_path
22
+
23
+ - main.edit_regenerate do
24
+ &nbsp;
@@ -0,0 +1,14 @@
1
+ - include_stylesheet 'admin/assets'
2
+
3
+ %h1
4
+ = t("clipped_extension.refresh_assets")
5
+ %p.confirmation
6
+ = t("clipped_extension.confirm_refresh_assets")
7
+ %p.confirmation
8
+ =t('clipped_extension.refresh_assets_rake_task')
9
+
10
+ %form{:action => regenerate_admin_assets_path, :method => :post}
11
+ .buttons
12
+ %input.button{:type => "submit", :value => t("clipped_extension.refresh_assets")}
13
+ = t("or")
14
+ = link_to t("cancel"), admin_assets_path