Skip to content

Commit

Permalink
changed last views to haml and added shards
Browse files Browse the repository at this point in the history
  • Loading branch information
Keith Bingman authored and Keith Bingman committed Mar 19, 2008
1 parent f1f4ddb commit 4a7546f
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 31 deletions.
1 change: 1 addition & 0 deletions app/views/admin/asset/_bucket.html.haml
@@ -1,3 +1,4 @@
- @stylesheets << 'admin/assets'
#bucket-container
- if @page
= render :partial => "admin/asset/page_assets" unless @page.assets.empty?
Expand Down
25 changes: 25 additions & 0 deletions app/views/admin/asset/_form.html.haml
@@ -0,0 +1,25 @@
%p.title
%label{ :for => "asset_title" } Title
= text_field "asset", "title", :class => 'textbox', :maxlength => 100
#extended-metadata{ :class => "row", :style => "display: none" }
%table.fieldset{ :cellpadding => "0", :cellspacing => "0", :border => "0" }
%tr
%td.label
%label{ :for => "asset_caption" } Caption
%td.field
= text_field "asset", "caption", :class => 'textbox', :maxlength => 255
%p
%small
%a{ :id => "more-extended-metadata", :href => "#", :onclick => "#{toggle_javascript_for('extended-metadata')}" } More
%a{ :id => "less-extended-metadata", :href => "#", :onclick => "#{toggle_javascript_for('extended-metadata')}", :style => "display: none" } Less

%p.content
%label{ :for => "layout_content", :class => "asset" }
Filename:
= @asset.filename unless @asset.new_record?

- unless @asset.new_record?
.asset
= image_tag @asset.public_filename(:original)

= file_field "asset", "uploaded_data", :class => "", :style => "width: 100%"
27 changes: 0 additions & 27 deletions app/views/admin/asset/_form.rhtml

This file was deleted.

2 changes: 2 additions & 0 deletions app/views/admin/page/_assets_extra_td.html.haml
@@ -0,0 +1,2 @@
%td.assets
= page.assets.empty? ? '' : page.assets.size
2 changes: 2 additions & 0 deletions app/views/admin/page/_assets_extra_th.html.haml
@@ -0,0 +1,2 @@
%th
Assets
12 changes: 8 additions & 4 deletions assets_extension.rb
@@ -1,5 +1,3 @@
require_dependency 'application'

class AssetsExtension < Radiant::Extension
version "0.4"
description "Describe your extension here"
Expand All @@ -23,7 +21,13 @@ class AssetsExtension < Radiant::Extension
end

def activate

raise "The Shards extension is required and must be loaded first!" unless defined?(Shards)
admin.page.index.add :sitemap_head, 'assets_extra_th', :before => "status_column_header"
admin.page.index.add :node, 'assets_extra_td', :before => "status_column"
admin.page.edit.add :form_bottom, '/admin/asset/bucket', :before => "edit_buttons"

require_dependency 'application'

AssetDisplayPage
AssetListingPage

Expand All @@ -32,7 +36,7 @@ def activate
include AssetTags
}
UserActionObserver.send :include, ObserveAssets
Admin::PageController.send :include, AssetsInterface
# Admin::PageController.send :include, AssetsInterface

# Default sizes for the images used in the admin views. Other sizes can be added in the Config table using
# "assets.foo" = "[width]x[height]". You can also use RMagick flags for cropping.
Expand Down

0 comments on commit 4a7546f

Please sign in to comment.