Permalink
Browse files

changed last views to haml and added shards

  • Loading branch information...
Keith Bingman Keith Bingman
Keith Bingman authored and Keith Bingman committed Mar 19, 2008
1 parent f1f4ddb commit 4a7546f097403a06733f5ddff10deb5a7b66ea12
@@ -1,3 +1,4 @@
+- @stylesheets << 'admin/assets'
#bucket-container
- if @page
= render :partial => "admin/asset/page_assets" unless @page.assets.empty?
@@ -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%"
@@ -1,27 +0,0 @@
- <p class="title">
- <label for="asset_title"><%= "Title"[:title] %></label>
- <%= text_field "asset", "title", :class => 'textbox', :maxlength => 100 %>
- </p>
- <div id="extended-metadata" class="row"<%= meta_visible(:meta) %>>
- <table class="fieldset" cellpadding="0" cellspacing="0" border="0">
- <tr>
- <td class="label"><label for="asset_caption">Caption</label></td>
- <td class="field"><%= text_field "asset", "caption", :class => 'textbox', :maxlength => 255 %></td>
- </tr>
- </table>
- </div>
- <p>
- <small>
- <a id="more-extended-metadata" href="#" onclick="<%= toggle_javascript_for('extended-metadata') %>"<%= meta_visible(:meta_more) %>>More</a>
- <a id="less-extended-metadata" href="#" onclick="<%= toggle_javascript_for('extended-metadata') %>"<%= meta_visible(:meta_less) %>>Less</a>
- </small>
- </p>
- <p class="content">
- <label for="layout_content" class="asset"><%= "Filename: "[:asset] %><%= @asset.filename unless @asset.new_record? %></label>
- <% unless @asset.new_record? -%>
- <div class="asset">
- <%= image_tag @asset.public_filename(:original) %>
- </div>
- <% end -%>
- <%= file_field "asset", "uploaded_data", :class => "", :style => "width: 100%" %>
- </p>
@@ -0,0 +1,2 @@
+%td.assets
+ = page.assets.empty? ? '' : page.assets.size
@@ -0,0 +1,2 @@
+%th
+ Assets
View
@@ -1,5 +1,3 @@
-require_dependency 'application'
-
class AssetsExtension < Radiant::Extension
version "0.4"
description "Describe your extension here"
@@ -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
@@ -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.

0 comments on commit 4a7546f

Please sign in to comment.