Permalink
Browse files

Version 0.2.1 (exported from SVN)

  • Loading branch information...
1 parent 5556795 commit 1b6819a488a8debed51124eeda533f526bc06f73 @chrisparrish chrisparrish committed Oct 18, 2008
View
3 README
@@ -32,6 +32,9 @@ There are a number of interesting benefits gained by this approach:
etc.) and focus on behaviors that make absolutely no sense for, say, a
stylesheet page (I mean, do javascripts really need a layout?).
+ * Makes it easy to include search functionality across your pages without
+ terms like "background" turning up all your stylesheets.
+
* Declutter the pages tree view so that it truly only shows what your clients
see -- the things they'd aim their browser at.
View
@@ -1,6 +1,13 @@
class TextAsset < ActiveRecord::Base
set_inheritance_column :class_name
+ # Default Order
+ order_by 'filename'
+
+ # Associations
+ belongs_to :created_by, :class_name => 'User'
+ belongs_to :updated_by, :class_name => 'User'
+
validates_presence_of :filename, :message => 'required'
validates_length_of :filename, :maximum => 100, :message => '%d-character limit'
validates_uniqueness_of :filename, :scope => :class_name, :message => 'filename already in use'
@@ -17,6 +17,9 @@
].each do |current_asset|
describe current_asset[:controller] do
+
+ integrate_views
+
# ok, this is weird... I would have just loaded all three scenarios but,
# for some *strange* reason, which ever loads 2nd -- javascripts or
# stylesheets -- trumps the previous. Everything works fine *except* for
@@ -1,6 +1,9 @@
require File.dirname(__FILE__) + '/../spec_helper'
describe TextAssetSiteController, "routes text_asset requests" do
+
+ integrate_views
+
# Pages scenario is used for two reasons. First, we test for conditions where
# pages have been created that conflict with css_ or javascript_directory
# values. Secondly, at least one page must exist when SiteController goes
@@ -34,7 +34,7 @@
end
- it 'should permit the same filename across different subclasses' do
+ it 'should permit the same filename as a stylesheet and javascript' do
@record.filename = 'abc.123'
@record.save!
@@ -84,6 +84,20 @@
end
end
+ it 'should automatically sort by filename' do
+ @record.filename = 'a_is_for_apple'
+ @record.save!
+
+ @record = current_asset.new
+ @record.filename = 'j_is_for_jacks'
+ @record.save!
+
+ @record = current_asset.new
+ @record.filename = 'c_is_for_chocolate_frosted_sugar_bombs'
+ @record.save!
+
+ current_asset.find(:all).should == current_asset.find(:all).sort_by { |item| item[:filename] }
+ end
end
end
@@ -6,7 +6,7 @@
class StylesNScriptsExtension < Radiant::Extension
- version "0.2"
+ version "0.2.1"
extension_name "Styles 'n Scripts"
description "Adds CSS and JS file management to Radiant"
@@ -39,12 +39,13 @@ class StylesNScriptsExtension < Radiant::Extension
:asset_class => 'javascript'
end
+
def activate
-# SiteController.send :include, SiteControllerMods
admin.tabs.add "CSS", "/admin/css", :after => "Layouts", :visibility => [:admin, :developer]
admin.tabs.add "JS", "/admin/js", :after => "CSS", :visibility => [:admin, :developer]
end
+
def deactivate
admin.tabs.remove "CSS"
admin.tabs.remove "JS"

0 comments on commit 1b6819a

Please sign in to comment.