trusty-clipped-extension 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE +22 -0
- data/README.md +191 -0
- data/Rakefile +109 -0
- data/app/assets/flash/ZeroClipboard.swf +0 -0
- data/app/assets/images/admin/add.png +0 -0
- data/app/assets/images/admin/archive_icon.png +0 -0
- data/app/assets/images/admin/audio_icon.png +0 -0
- data/app/assets/images/admin/audio_thumbnail.png +0 -0
- data/app/assets/images/admin/c_icon.png +0 -0
- data/app/assets/images/admin/copy.png +0 -0
- data/app/assets/images/admin/css_icon.png +0 -0
- data/app/assets/images/admin/database_icon.png +0 -0
- data/app/assets/images/admin/delete.png +0 -0
- data/app/assets/images/admin/document_icon.png +0 -0
- data/app/assets/images/admin/document_thumbnail.png +0 -0
- data/app/assets/images/admin/flash_icon.png +0 -0
- data/app/assets/images/admin/flash_thumbnail.png +0 -0
- data/app/assets/images/admin/font_icon.png +0 -0
- data/app/assets/images/admin/gzip_icon.png +0 -0
- data/app/assets/images/admin/html_icon.png +0 -0
- data/app/assets/images/admin/image_icon.png +0 -0
- data/app/assets/images/admin/image_thumbnail.png +0 -0
- data/app/assets/images/admin/java_icon.png +0 -0
- data/app/assets/images/admin/page_edit.png +0 -0
- data/app/assets/images/admin/perl_icon.png +0 -0
- data/app/assets/images/admin/php_icon.png +0 -0
- data/app/assets/images/admin/presentation_icon.png +0 -0
- data/app/assets/images/admin/python_icon.png +0 -0
- data/app/assets/images/admin/reorder_assets.png +0 -0
- data/app/assets/images/admin/ruby_icon.png +0 -0
- data/app/assets/images/admin/script_icon.png +0 -0
- data/app/assets/images/admin/spreadsheet_icon.png +0 -0
- data/app/assets/images/admin/tar_icon.png +0 -0
- data/app/assets/images/admin/unknown_icon.png +0 -0
- data/app/assets/images/admin/unknown_thumbnail.png +0 -0
- data/app/assets/images/admin/video_icon.png +0 -0
- data/app/assets/images/admin/video_thumbnail.png +0 -0
- data/app/assets/images/admin/xml_icon.png +0 -0
- data/app/assets/images/admin/zip_icon.png +0 -0
- data/app/assets/javascripts/admin/assets.js +261 -0
- data/app/assets/javascripts/admin/jquery.fileupload.js +1457 -0
- data/app/assets/javascripts/admin/jquery.iframe-transport.js +214 -0
- data/app/assets/javascripts/admin/jquery.ui.widget.js +558 -0
- data/app/assets/javascripts/admin/prototype_assets.js +166 -0
- data/app/assets/stylesheets/admin/assets.sass +224 -0
- data/app/assets/stylesheets/application.scss +0 -0
- data/app/controllers/admin/assets_controller.rb +67 -0
- data/app/controllers/admin/page_attachments_controller.rb +18 -0
- data/app/helpers/admin/assets_helper.rb +16 -0
- data/app/helpers/admin/page_attachments_helper.rb +2 -0
- data/app/models/asset.rb +241 -0
- data/app/models/asset_type.rb +241 -0
- data/app/models/old_page_attachment.rb +26 -0
- data/app/models/page_attachment.rb +20 -0
- data/app/views/admin/assets/_asset.html.haml +12 -0
- data/app/views/admin/assets/_asset_table.html.haml +30 -0
- data/app/views/admin/assets/_errors.html.haml +3 -0
- data/app/views/admin/assets/_form.html.haml +21 -0
- data/app/views/admin/assets/_page_assets.html.haml +12 -0
- data/app/views/admin/assets/_search.html.haml +17 -0
- data/app/views/admin/assets/_search_results.html.haml +17 -0
- data/app/views/admin/assets/edit.html.haml +40 -0
- data/app/views/admin/assets/index.html.haml +16 -0
- data/app/views/admin/assets/new.html.haml +24 -0
- data/app/views/admin/assets/refresh.html.haml +14 -0
- data/app/views/admin/assets/remove.html.haml +16 -0
- data/app/views/admin/configuration/_clipped_edit.html.haml +8 -0
- data/app/views/admin/configuration/_clipped_show.html.haml +12 -0
- data/app/views/admin/page_attachments/_attachment.html.haml +25 -0
- data/app/views/admin/page_parts/_page_part.html.haml +21 -0
- data/app/views/admin/pages/_asset_popups.html.haml +56 -0
- data/app/views/admin/pages/_assets.html.haml +14 -0
- data/app/views/admin/removed/_assets_bucket.html.haml +8 -0
- data/app/views/admin/removed/_assets_container.html.haml +58 -0
- data/app/views/admin/removed/_bucket.html.haml +11 -0
- data/app/views/admin/removed/_bucket_asset.html.haml +9 -0
- data/app/views/admin/removed/_show_bucket_link.html.haml +4 -0
- data/app/views/admin/removed/_upload_to_page.html.haml +12 -0
- data/app/views/admin/removed/bucket/_iframe.html.haml +1 -0
- data/artwork/icons.png +0 -0
- data/clipped_extension.rb +53 -0
- data/config/initializers/interpolation.rb +6 -0
- data/config/initializers/processors.rb +43 -0
- data/config/initializers/radiant_config.rb +66 -0
- data/config/locales/de.yml +109 -0
- data/config/locales/en.yml +110 -0
- data/config/locales/nl.yml +107 -0
- data/config/locales/ru.yml +110 -0
- data/config/routes.rb +17 -0
- data/cucumber.yml +1 -0
- data/db/migrate/001_create_assets.rb +12 -0
- data/db/migrate/002_create_paperclip_attributes.rb +13 -0
- data/db/migrate/003_create_user_observer.rb +13 -0
- data/db/migrate/004_create_page_attachments.rb +19 -0
- data/db/migrate/005_rename_users.rb +13 -0
- data/db/migrate/20110513205050_asset_uuid.rb +11 -0
- data/db/migrate/20110606111250_update_configuration.rb +34 -0
- data/db/migrate/20110609101438_dimensions.rb +13 -0
- data/features/support/env.rb +11 -0
- data/features/support/paths.rb +22 -0
- data/lib/asset_tags.rb +346 -0
- data/lib/clipped/engine.rb +5 -0
- data/lib/clipped_admin_ui.rb +32 -0
- data/lib/cloud.rb +41 -0
- data/lib/generators/templates/clipped_config.rb +53 -0
- data/lib/page_asset_associations.rb +13 -0
- data/lib/paperclip/frame_grab.rb +73 -0
- data/lib/paperclip/geometry_transformation.rb +80 -0
- data/lib/tasks/clipped_extension_tasks.rake +124 -0
- data/lib/tasks/paperclip_tasks.rake +79 -0
- data/lib/trusty-clipped-extension.rb +8 -0
- data/spec/ci/before_script +23 -0
- data/spec/ci/script +2 -0
- data/spec/controllers/admin/assets_controller_spec.rb +50 -0
- data/spec/controllers/admin/page_attachments_controller_spec.rb +50 -0
- data/spec/datasets/assets_dataset.rb +36 -0
- data/spec/fixtures/5k.png +0 -0
- data/spec/fixtures/test.flv +0 -0
- data/spec/lib/asset_tags_spec.rb +107 -0
- data/spec/lib/frame_grab_spec.rb +17 -0
- data/spec/lib/geometry_transformation_spec.rb +63 -0
- data/spec/models/asset_spec.rb +72 -0
- data/spec/models/asset_type_spec.rb +70 -0
- data/spec/models/post_processing_spec.rb +62 -0
- data/spec/spec.opts +7 -0
- data/spec/spec_helper.rb +36 -0
- data/trusty-clipped-extension.gemspec +29 -0
- data/wireframes/edit-page-assets-2.bmml +453 -0
- data/wireframes/edit-page-assets-2.png +0 -0
- data/wireframes/edit-page-assets-3.bmml +454 -0
- data/wireframes/edit-page-assets-3.png +0 -0
- data/wireframes/edit-page-assets.bmml +433 -0
- data/wireframes/edit-page-assets.png +0 -0
- data/wireframes/edit-page.bmml +174 -0
- data/wireframes/edit-page.png +0 -0
- metadata +265 -0
@@ -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,20 @@
|
|
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
|
+
self[position_column] ||= bottom_position_in_list.to_i + 1
|
18
|
+
end
|
19
|
+
|
20
|
+
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?(:total_pages) && assets.total_pages > 1
|
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?(:total_pages) && assets.total_pages > 1
|
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,21 @@
|
|
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.more{:href=>'#attributes', :rel=>"toggle[attributes]"}
|
21
|
+
= t('more')
|
@@ -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", :id => 'filesearchforminput', :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
|
+
= stylesheet_link_tag '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 = TrustyCms::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,16 @@
|
|
1
|
+
= stylesheet_link_tag 'admin/assets'
|
2
|
+
= javascript_include_tag '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'}
|
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)
|
@@ -0,0 +1,24 @@
|
|
1
|
+
= stylesheet_link_tag '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%", :multiple => true
|
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
|
+
|
@@ -0,0 +1,14 @@
|
|
1
|
+
= stylesheet_link_tag '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
|
@@ -0,0 +1,16 @@
|
|
1
|
+
= stylesheet_link_tag 'admin/assets'
|
2
|
+
|
3
|
+
%h1= t("clipped_extension.remove_asset")
|
4
|
+
%p= t("clipped_extension.confirm_remove_asset")
|
5
|
+
|
6
|
+
%table.index#assets{:cellpadding => "0", :cellspacing => "0", :border => "0"}
|
7
|
+
%tbody
|
8
|
+
%tr[@asset]
|
9
|
+
%td.icon= image_tag @asset.thumbnail(:icon), :title => @asset.asset_file_name
|
10
|
+
%td.name= @asset.title
|
11
|
+
|
12
|
+
= form_for [:admin, @asset], :html => { :method => 'delete' } do
|
13
|
+
.buttons
|
14
|
+
%input.button{:type => "submit", :value => t("clipped_extension.delete_asset")}
|
15
|
+
= t("or")
|
16
|
+
= link_to t("cancel"), admin_assets_path
|
@@ -0,0 +1,8 @@
|
|
1
|
+
%fieldset
|
2
|
+
%h3
|
3
|
+
= t('clipped_extension.assets')
|
4
|
+
%p= edit_config 'assets.max_asset_size'
|
5
|
+
%p= edit_config 'assets.display_size'
|
6
|
+
%p= edit_config 'assets.insertion_size'
|
7
|
+
- %w{image video pdf}.each do |type|
|
8
|
+
%p= edit_config "assets.create_#{type}_thumbnails?"
|
@@ -0,0 +1,12 @@
|
|
1
|
+
%h4
|
2
|
+
= t('clipped_extension.assets')
|
3
|
+
%p.ruled
|
4
|
+
= show_config 'assets.max_asset_size'
|
5
|
+
%p.ruled
|
6
|
+
= show_config 'assets.display_size'
|
7
|
+
%p.ruled
|
8
|
+
= show_config 'assets.insertion_size'
|
9
|
+
- %w{image video pdf}.each do |type|
|
10
|
+
%p.ruled
|
11
|
+
= show_config "assets.create_#{type}_thumbnails?"
|
12
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
- attachment ||= @page_attachment
|
2
|
+
|
3
|
+
- page = attachment.page
|
4
|
+
- asset = attachment.asset
|
5
|
+
- asset_type = asset.image? ? "image" : "link"
|
6
|
+
- css_class = "#{asset_type} asset"
|
7
|
+
- css_class += ' unsaved' if attachment.new_record?
|
8
|
+
|
9
|
+
%li{:class => css_class, :id => "attachment_#{asset.uuid}"}
|
10
|
+
= fields_for :page, @page do |f|
|
11
|
+
= f.fields_for :page_attachments, attachment, :child_index => asset.uuid do |paf|
|
12
|
+
- if attachment.new_record?
|
13
|
+
= paf.hidden_field :asset_id, :class => 'attacher'
|
14
|
+
- else
|
15
|
+
= paf.hidden_field :_destroy, :class => 'destroyer'
|
16
|
+
= paf.hidden_field :position, :class => 'pos'
|
17
|
+
.front
|
18
|
+
.thumbnail= image_tag asset.thumbnail(:thumbnail)
|
19
|
+
.back
|
20
|
+
.title= asset.title
|
21
|
+
%ul.actions
|
22
|
+
%li
|
23
|
+
= asset_insertion_link(asset)
|
24
|
+
%li
|
25
|
+
= link_to t('clipped_extension.detach'), '#', :class => 'detach_asset'
|
@@ -0,0 +1,21 @@
|
|
1
|
+
.page{:id => "page_#{page_part.name.to_slug}", 'data-caption'=>h(page_part.name)}
|
2
|
+
.part{:id => "part-#{page_part.name.to_slug}"}
|
3
|
+
= hidden_field_tag "page[parts_attributes][#{page_part_counter}][name]", page_part.name, :id => "part_#{page_part.name.to_slug}_name"
|
4
|
+
= hidden_field_tag "page[parts_attributes][#{page_part_counter}][id]", page_part.id, :id => "part_#{page_part_counter}_id", :class => "id_input" unless page_part.new_record?
|
5
|
+
= hidden_field_tag "page[parts_attributes][#{page_part_counter}][_destroy]", page_part._destroy, :class => "delete_input"
|
6
|
+
%p
|
7
|
+
%label{:for => "part_#{page_part.name.to_slug}_filter_id"}
|
8
|
+
= t('filter')
|
9
|
+
= select_tag "page[parts_attributes][#{page_part_counter}][filter_id]", filter_options_for_select(page_part.filter_id), :id => "part_#{page_part.name.to_slug}_filter_id"
|
10
|
+
/ bring this back when the new toolbar ui arrives
|
11
|
+
/ %span.toolbar
|
12
|
+
/ = link_to t('clipped_extension.assets'), '#attach_asset', :class => 'popup', :style => 'color: #666'
|
13
|
+
%span.reference_links
|
14
|
+
= t('reference')
|
15
|
+
%span{:id => "filter_reference_link_#{page_part.name.to_slug}"}
|
16
|
+
= link_to_function t('filter'), "loadFilterReference('#{page_part.name.to_slug}');"
|
17
|
+
%span{:id => "tag_reference_link_#{page_part.name.to_slug}"}
|
18
|
+
= link_to_function t('available_tags'), "loadTagReference('#{page_part.name.to_slug}');"
|
19
|
+
= render_region :part_controls, :locals => {:page_part => page_part}
|
20
|
+
%div
|
21
|
+
~ text_area_tag "page[parts_attributes][#{page_part_counter}][content]", page_part.content, :class => "textarea large", :style => "width: 100%", :id => "part_#{page_part.name.to_slug}_content"
|
@@ -0,0 +1,56 @@
|
|
1
|
+
- render_region :asset_popups do |popups|
|
2
|
+
- popups.upload_asset do
|
3
|
+
#upload_asset.popup.textured{:style => "display: none; width: 28em"}
|
4
|
+
#upload_asset_busy.busy{:style => "display: none"}= image('spinner.gif', :alt => "")
|
5
|
+
|
6
|
+
.popup_title= t('clipped_extension.upload_asset')
|
7
|
+
|
8
|
+
= form_for([:admin, Asset.new], :html => {:method => 'post', :multipart => true, :class => 'upload_asset'}) do |f|
|
9
|
+
= hidden_field_tag "for_attachment", 1
|
10
|
+
= hidden_field_tag "page_id", @page.id
|
11
|
+
#upload-controls
|
12
|
+
%p
|
13
|
+
= f.label :asset, t("clipped_extension.choose_file")
|
14
|
+
= f.file_field :asset, :class => 'file', :multiple => true
|
15
|
+
#upload-status{:style => 'display: none;'}
|
16
|
+
%img{:src => "/images/admin/spinner.gif"}
|
17
|
+
%p
|
18
|
+
%a#attach-popup{:href=>"#attach_asset", :style => 'color: #666; font-size: .8em'}= t('clipped_extension.attach_existing')
|
19
|
+
|
20
|
+
|
21
|
+
= form_tag('/admin/assets/', :id=> 'update_asset', :class => 'upload_asset') do |f|
|
22
|
+
= hidden_field_tag "for_attachment", 1
|
23
|
+
= hidden_field_tag "page_id", @page.id
|
24
|
+
= hidden_field_tag "asset_id", ""
|
25
|
+
|
26
|
+
#update-controls
|
27
|
+
%p
|
28
|
+
%strong
|
29
|
+
= label_tag :title, t("clipped_extension.alt_text_or_title")
|
30
|
+
%p
|
31
|
+
= text_field_tag :title, nil, {:name => "asset[title]", :class => "textbox big"}
|
32
|
+
|
33
|
+
.buttons
|
34
|
+
= button_tag "Set Title", {:id => 'update-asset', :class => "button"}
|
35
|
+
#update-status{:style => 'display: none;'}
|
36
|
+
%img{:src => "/images/admin/spinner.gif"}
|
37
|
+
= t('or')
|
38
|
+
%a.close_popup{:href=>"#"}= 'Continue'
|
39
|
+
#upload_holders
|
40
|
+
|
41
|
+
- popups.attach_asset do
|
42
|
+
#attach_asset.popup.textured{:style=>"display: none;"}
|
43
|
+
|
44
|
+
.popup_title= t('clipped_extension.find_assets')
|
45
|
+
|
46
|
+
.toolbar
|
47
|
+
= render :partial => 'admin/assets/search'
|
48
|
+
|
49
|
+
#assets_table.assets.viewport{:style=>"height: 320px; width: 610px"}
|
50
|
+
- assets = Asset.all.paginate(:per_page => 20)
|
51
|
+
= render :partial => 'admin/assets/asset_table', :locals => {:assets => assets, :with_pagination => true}
|
52
|
+
|
53
|
+
.busy{:style => "display: none"}= image('spinner.gif', :alt => "")
|
54
|
+
.buttons
|
55
|
+
%a.cancel.close_popup{:href=>"#"}= t('close')
|
56
|
+
%a.upload-popup{:href=>"#upload_asset", :id=> "upload_asset_link", :style => 'color: #666; float: left'}= t('clipped_extension.upload_asset')
|
@@ -0,0 +1,14 @@
|
|
1
|
+
= stylesheet_link_tag 'admin/assets'
|
2
|
+
= javascript_include_tag 'admin/jquery.ui.widget'
|
3
|
+
= javascript_include_tag 'admin/jquery.iframe-transport'
|
4
|
+
= javascript_include_tag 'admin/jquery.fileupload'
|
5
|
+
= javascript_include_tag 'admin/assets'
|
6
|
+
|
7
|
+
#attachment_list.assets
|
8
|
+
%ul#attachment_fields{:class => @page.page_attachments.empty? ? 'empty' : ''}
|
9
|
+
= render :partial => 'admin/page_attachments/attachment', :collection => @page.page_attachments
|
10
|
+
%p.note
|
11
|
+
= link_to t('clipped_extension.assets'), '#attach_asset', :class => '', :id => "attach_assets"
|
12
|
+
%span.message
|
13
|
+
- if @page.page_attachments.empty?
|
14
|
+
= t('clipped_extension.no_attached_assets')
|