From f22379bcc4add1d8b6207b99bf6afc9ea3089997 Mon Sep 17 00:00:00 2001 From: Gaelian Ditchburn Date: Thu, 2 Sep 2010 19:39:45 +1000 Subject: [PATCH 01/10] Updated Rails version to 2.3.8. Updated Coderay gem to version 0.9.4. Added patch for ActionView::Helpers::TagHelper - now outputs HTML tags. Updated views and helpers to HTML5. --- app/helpers/application_helper.rb | 4 ++-- app/views/comments/_comment.html.erb | 2 +- app/views/layouts/admin.html.erb | 10 +++------- app/views/layouts/application.html.erb | 14 +++++--------- app/views/layouts/login.html.erb | 10 +++------- app/views/posts/show.html.erb | 2 +- config/environment.rb | 4 ++-- config/initializers/enki_ext.rb | 1 + lib/enki/html5_tags.rb | 8 ++++++++ public/404.html | 8 +++----- public/422.html | 8 +++----- public/500.html | 8 +++----- 12 files changed, 35 insertions(+), 44 deletions(-) create mode 100644 lib/enki/html5_tags.rb diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 28e40e66e..99f087a2e 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -6,8 +6,8 @@ def author def open_id_delegation_link_tags(server, delegate) links = <<-EOS - - + + EOS end diff --git a/app/views/comments/_comment.html.erb b/app/views/comments/_comment.html.erb index 9e89b1cbd..ecbbf5f87 100644 --- a/app/views/comments/_comment.html.erb +++ b/app/views/comments/_comment.html.erb @@ -1,4 +1,4 @@ <%= author_link(comment) %> says: -
+
<%= format_comment_date(comment.created_at) %>

<%= comment.body_html.untaint %>

diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index a6d71f83c..c85b2dc47 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -1,11 +1,7 @@ - - - - + + - + <%=h config[:title] %> - Admin diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index 6f866a1dd..4aeac08be 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,11 +1,7 @@ - - - - + + - + <%= yield(:page_title) || h(config[:title]) %> <%= stylesheet_link_tag 'application' %> <%= javascript_include_tag 'jquery' %> @@ -39,8 +35,8 @@

- - + +
diff --git a/app/views/layouts/login.html.erb b/app/views/layouts/login.html.erb index b1dd16f6d..fa17263c4 100644 --- a/app/views/layouts/login.html.erb +++ b/app/views/layouts/login.html.erb @@ -1,11 +1,7 @@ - - - - + + - + <%=h config[:title] %> - Admin Login diff --git a/app/views/posts/show.html.erb b/app/views/posts/show.html.erb index d11fce2ee..c6b0c54e7 100644 --- a/app/views/posts/show.html.erb +++ b/app/views/posts/show.html.erb @@ -28,7 +28,7 @@ <% form_for([@post, @comment]) do |form| -%>

<%= form.text_field 'author' %>

-

<%= form.text_area 'body' %>
(lesstile enabled - surround code blocks with ---)

+

<%= form.text_area 'body' %>
(lesstile enabled - surround code blocks with ---)

<%= submit_tag "Add Comment" %>

<% end -%> diff --git a/config/environment.rb b/config/environment.rb index c67b57d28..a7767178a 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -1,7 +1,7 @@ # Be sure to restart your server when you modify this file # Specifies gem version of Rails to use when vendor/rails is not present -RAILS_GEM_VERSION = '2.3.4' unless defined? RAILS_GEM_VERSION +RAILS_GEM_VERSION = '2.3.8' unless defined? RAILS_GEM_VERSION # Bootstrap the Rails environment, frameworks, and default configuration require File.join(File.dirname(__FILE__), 'boot') @@ -18,7 +18,7 @@ config.gem "RedCloth", :lib => "redcloth", :version => "~> 4.0" config.gem "ruby-openid", :lib => "openid", :version => "~> 2.1.0" config.gem "chronic", :version => "~> 0.2.0" - config.gem "coderay", :version => "~> 0.8.0" + config.gem "coderay", :version => "~> 0.9.4" config.gem "lesstile", :version => "~> 0.3" config.gem "will_paginate", :version => "~> 2.3", :source => 'http://gemcutter.org' diff --git a/config/initializers/enki_ext.rb b/config/initializers/enki_ext.rb index c69c8c96a..95bbecc03 100644 --- a/config/initializers/enki_ext.rb +++ b/config/initializers/enki_ext.rb @@ -1,2 +1,3 @@ require 'core_extensions/string' require 'core_extensions/object' +require 'enki/html5_tags' diff --git a/lib/enki/html5_tags.rb b/lib/enki/html5_tags.rb new file mode 100644 index 000000000..d8aaf23e8 --- /dev/null +++ b/lib/enki/html5_tags.rb @@ -0,0 +1,8 @@ +# TagHelper will output HTML tags as opposed to self-closed XHTML tags. +# Shouldn't be needed for Rails >= version 3. +module ActionView::Helpers::TagHelper + def tag_with_html_patch(name, options = nil, open = true, escape = true) + tag_without_html_patch(name, options, true, escape) + end + alias_method_chain :tag, :html_patch +end \ No newline at end of file diff --git a/public/404.html b/public/404.html index eff660b90..4cb92fbca 100644 --- a/public/404.html +++ b/public/404.html @@ -1,10 +1,8 @@ - - - + + - + The page you were looking for doesn't exist (404)