From f087c23c8600fe197d3a59f4a0cd839754459b37 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Fri, 25 Jan 2013 21:53:05 +0100 Subject: Initial commit. --- app/assets/images/rails.png | Bin 0 -> 6646 bytes app/assets/javascripts/application.js | 15 +++++++++++++++ app/assets/stylesheets/application.css | 13 +++++++++++++ app/controllers/application_controller.rb | 3 +++ app/decorators/controllers/refinery/.gitkeep | 0 app/decorators/models/refinery/.gitkeep | 0 app/helpers/application_helper.rb | 2 ++ app/mailers/.gitkeep | 0 app/models/.gitkeep | 0 app/views/sitemap/index.xml.builder | 25 +++++++++++++++++++++++++ 10 files changed, 58 insertions(+) create mode 100644 app/assets/images/rails.png create mode 100644 app/assets/javascripts/application.js create mode 100644 app/assets/stylesheets/application.css create mode 100644 app/controllers/application_controller.rb create mode 100644 app/decorators/controllers/refinery/.gitkeep create mode 100644 app/decorators/models/refinery/.gitkeep create mode 100644 app/helpers/application_helper.rb create mode 100644 app/mailers/.gitkeep create mode 100644 app/models/.gitkeep create mode 100644 app/views/sitemap/index.xml.builder (limited to 'app') diff --git a/app/assets/images/rails.png b/app/assets/images/rails.png new file mode 100644 index 0000000..d5edc04 Binary files /dev/null and b/app/assets/images/rails.png differ diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js new file mode 100644 index 0000000..9097d83 --- /dev/null +++ b/app/assets/javascripts/application.js @@ -0,0 +1,15 @@ +// This is a manifest file that'll be compiled into application.js, which will include all the files +// listed below. +// +// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, +// or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. +// +// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the +// the compiled file. +// +// WARNING: THE FIRST BLANK LINE MARKS THE END OF WHAT'S TO BE PROCESSED, ANY BLANK LINE SHOULD +// GO AFTER THE REQUIRES BELOW. +// +//= require jquery +//= require jquery_ujs +//= require_tree . diff --git a/app/assets/stylesheets/application.css b/app/assets/stylesheets/application.css new file mode 100644 index 0000000..3192ec8 --- /dev/null +++ b/app/assets/stylesheets/application.css @@ -0,0 +1,13 @@ +/* + * This is a manifest file that'll be compiled into application.css, which will include all the files + * listed below. + * + * Any CSS and SCSS file within this directory, lib/assets/stylesheets, vendor/assets/stylesheets, + * or vendor/assets/stylesheets of plugins, if any, can be referenced here using a relative path. + * + * You're free to add application-wide styles to this file and they'll appear at the top of the + * compiled file, but it's generally better to create a new file per style scope. + * + *= require_self + *= require_tree . + */ diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb new file mode 100644 index 0000000..e8065d9 --- /dev/null +++ b/app/controllers/application_controller.rb @@ -0,0 +1,3 @@ +class ApplicationController < ActionController::Base + protect_from_forgery +end diff --git a/app/decorators/controllers/refinery/.gitkeep b/app/decorators/controllers/refinery/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/decorators/models/refinery/.gitkeep b/app/decorators/models/refinery/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb new file mode 100644 index 0000000..de6be79 --- /dev/null +++ b/app/helpers/application_helper.rb @@ -0,0 +1,2 @@ +module ApplicationHelper +end diff --git a/app/mailers/.gitkeep b/app/mailers/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/models/.gitkeep b/app/models/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/app/views/sitemap/index.xml.builder b/app/views/sitemap/index.xml.builder new file mode 100644 index 0000000..8e89852 --- /dev/null +++ b/app/views/sitemap/index.xml.builder @@ -0,0 +1,25 @@ +xml.instruct! + +xml.urlset "xmlns" => "http://www.sitemaps.org/schemas/sitemap/0.9" do + + @locales.each do |locale| + ::I18n.locale = locale + ::Refinery::Page.live.in_menu.includes(:parts).each do |page| + # exclude sites that are external to our own domain. + page_url = if page.url.is_a?(Hash) + # This is how most pages work without being overriden by link_url + page.url.merge({:only_path => false}) + elsif page.url.to_s !~ /^http/ + # handle relative link_url addresses. + [request.protocol, request.host_with_port, page.url].join + end + + # Add XML entry only if there is a valid page_url found above. + xml.url do + xml.loc url_for(page_url) + xml.lastmod page.updated_at.to_date + end if page_url.present? and page.show_in_menu? + end + end + +end -- cgit v1.2.3