Commit 2173925cb48f2d6630eebd132ee5de957cac4e1a

Merged in various changes from SVN trunk.

Commit diff

app/models/standard_tags.rb

 
391391 desc %{
392392 Renders a trail of breadcrumbs to the current page. The separator attribute
393393 specifies the HTML fragment that is inserted between each of the breadcrumbs. By
394 default it is set to @>@.
394 default it is set to @>@. The boolean nolinks attribute can be specified to render
395 breadcrumbs in plain text, without any links (useful when generating title tag).
395396
396397 *Usage:*
397 <pre><code><r:breadcrumbs [separator="separator_string"] /></code></pre>
398 <pre><code><r:breadcrumbs [separator="separator_string"] [nolinks="true"] /></code></pre>
398399 }
399400 tag 'breadcrumbs' do |tag|
400401 page = tag.locals.page
401402 breadcrumbs = [page.breadcrumb]
403 nolinks = (tag.attr['nolinks'] == 'true')
402404 page.ancestors.each do |ancestor|
403 breadcrumbs.unshift %{<a href="#{ancestor.url}">#{ancestor.breadcrumb}</a>}
405 if nolinks
406 breadcrumbs.unshift ancestor.breadcrumb
407 else
408 breadcrumbs.unshift %{<a href="#{ancestor.url}">#{ancestor.breadcrumb}</a>}
409 end
404410 end
405411 separator = tag.attr['separator'] || ' &gt; '
406412 breadcrumbs.join(separator)
551551 end
552552 end
553553 between = hash.has_key?(:between) ? hash[:between].call : ' '
554 result.join(between)
554 result.reject { |i| i.blank? }.join(between)
555555 end
556556 [:normal, :here, :selected, :between].each do |symbol|
557557 tag "navigation:#{symbol}" do |tag|
602602 end
603603 end
604604
605 desc %{
606 Prints the page's status as a string. Optional attribute 'downcase'
607 will cause the status to be all lowercase.
608
609 *Usage:*
610 <pre><code><r:status [downcase='true'] /></code></pre>
611 }
612 tag 'status' do |tag|
613 status = tag.globals.page.status.name
614 return status.downcase if tag.attr['downcase']
615 status
616 end
617
605618 private
606619
607620 def children_find_options(tag)
toggle raw diff

app/views/admin/page/edit.html.erb

 
9191 <p><label for="page_class_name">Page Type</label>
9292 <%= select "page", "class_name", [['<normal>', 'Page']] + Page.descendants.map { |p| [p.display_name, p.name] }.sort_by { |p| p.first } %></p>
9393 <p><label for="page_status_id">Status</label>
94 <%= select "page", "status_id", Status.find_all.map { |s| [s.name, s.id] } %></p>
94 <%= select "page", "status_id", Status.find_all.map { |s| [s.name, s.id] }, {} %></p>
95 <p id="publication-date" style="display: none;"><label for="page_published_at">Published At</label>
96 <%= datetime_select "page", "published_at", :disabled => true %></p>
9597 </div>
9698 <span class="clear">&nbsp;</span>
9799 <%= updated_stamp @page %>
toggle raw diff

lib/tasks/extensions.rake

 
4343 end
4444end
4545
46namespace :spec do
47 desc "Runs specs on all available Radiant extensions, pass EXT=extension_name to test a single extension"
48 task :extensions => "db:test:prepare" do
49 extension_roots = Radiant::Extension.descendants.map(&:root)
50 if ENV["EXT"]
51 extension_roots = extension_roots.select {|x| /\/(\d+_)?#{ENV["EXT"]}$/ === x }
52 if extension_roots.empty?
53 puts "Sorry, that extension is not installed."
54 end
55 end
56 extension_roots.each do |directory|
57 chdir directory do
58 if RUBY_PLATFORM =~ /win32/
59 system "rake.cmd spec"
60 else
61 system "rake spec"
62 end
63 end
64 end
65 end
66end
67
4668# Load any custom rakefiles from extensions
4769[RAILS_ROOT, RADIANT_ROOT].uniq.each do |root|
4870 Dir[root + '/vendor/extensions/**/tasks/**/*.rake'].sort.each { |ext| load ext }
49end
71end
toggle raw diff

lib/tasks/framework.rake

 
103103 desc "Update config/boot.rb from your current radiant install"
104104 task :configs do
105105 FileUtils.cp("#{File.dirname(__FILE__)}/../generators/instance/templates/instance_boot.rb", RAILS_ROOT + '/config/boot.rb')
106 instance_env = "#{RAILS_ROOT}/config/environment.rb"
107 gen_env = "#{File.dirname(__FILE__)}/../generators/instance/templates/instance_environment.rb"
108 backup_env = "#{RAILS_ROOT}/config/environment.bak"
109 unless FileUtils.compare_file(instance_env, gen_env)
110 FileUtils.cp(instance_env, backup_env)
111 FileUtils.cp(gen_env, instance_env)
112 puts "** WARNING **
113config/environment.rb has changed in Radiant 0.6.5. Your original has been
114backed up to config/environment.bak and replaced with the packaged version.
115Please copy your customizations to the new file."
116 end
106117 end
107118
108119 desc "Update admin images from your current radiant install"
131131 end
132132 end
133133 end
134end
134end
toggle raw diff

lib/tasks/instance.rake

 
44
55 ENV['RADIANT_ENV_FILE'] = File.join(RAILS_ROOT, 'config', 'environment')
66
7 Dir["#{RADIANT_ROOT}/vendor/rails/railties/lib/tasks/*.rake"].each do |rake|
7 Dir["#{RADIANT_ROOT}/vendor/rails/railties/lib/tasks/*.rake", "#{RADIANT_ROOT}/vendor/plugins/rspec_on_rails/tasks/*.rake"].each do |rake|
88 lines = IO.readlines(rake)
99 lines.map! do |line|
10 line.gsub!('RAILS_ROOT', 'RADIANT_ROOT') unless rake =~ /misc\.rake$/
10 line.gsub!('RAILS_ROOT', 'RADIANT_ROOT') unless rake =~ /(misc|rspec)\.rake$/
1111 case rake
1212 when /testing\.rake$/
1313 line.gsub!(/t.libs << (["'])/, 't.libs << \1' + RADIANT_ROOT + '/')
1515 when /databases\.rake$/
1616 line.gsub!(/migrate\((["'])/, 'migrate(\1' + RADIANT_ROOT + '/')
1717 line.sub!("db/schema.rb", "#{RAILS_ROOT}/db/schema.rb")
18 when /rspec\.rake$/
19 line.gsub!('RAILS_ROOT', 'RADIANT_ROOT') unless line =~ /:noop/
20 line.gsub!(/FileList\[(["'])/, "FileList[\\1#{RADIANT_ROOT}/")
1821 end
1922 line
2023 end
2124 eval(lines.join("\n"), binding, rake)
2225 end
23end
26end
toggle raw diff

public/javascripts/admin.js

 
4848 e.stop();
4949 });
5050 });
51
52 when('page_status_id', function(select){
53 if($F('page_status_id') == '100')
54 $('publication-date').show().select('select').invoke('enable');
55
56 select.observe('change', function(){
57 if($F(this) == '100')
58 $('publication-date').show().select('select').invoke('enable');
59 else
60 $('publication-date').hide().select('select').invoke('disable');
61 })
62 });
5163});
5264
5365Element.addMethods({
toggle raw diff