Commit 9b8afba9 authored by Dennis Collinson's avatar Dennis Collinson

metaprogram template addition

parent dec3006b
- templates_dir = Rails.root.join("app", "views", "templates")
= Dir[templates_dir.to_s + "/*.jst"].each do |template|
- template_name = File.basename(template, ".jst").gsub("_","-")
%script{:id => "#{template_name}-template", :type => 'text/template'}
!= File.read(templates_dir.join(template))
......@@ -113,7 +113,7 @@
%header
= render 'layouts/header'
= render 'templates/templates'
= render 'layouts/templates'
.container{:style=> "#{yield(:break_the_mold)}"}
- if @aspsect == :getting_started || @page == :logged_out
......
-# Copyright (c) 2010-2011, Diaspora Inc. This file is
-# licensed under the Affero General Public License version 3 or later. See
-# the COPYRIGHT file.
- ["header",
"feedback",
"static_text",
"stream_element",
"comment_stream",
"comment",
"status_message",
"activity_streams_photo",
"reshare",
"likes_info",
"stream_faces"].each do |template_name|
%script{:id => "#{template_name.gsub("_","-")}-template", :type => 'text/template'}
!= File.read("#{Rails.root}/app/views/templates/#{template_name}.jst")
app.views.ReshareFeedback = Backbone.View.extend({
app.views.ReshareFeedback = app.views.Base.extend({
template_name: "#reshare-feedback-template",
});
......@@ -3,7 +3,7 @@ require "spec_helper"
describe "template generation" do
it "generates templates", :fixture => true do
extend JasmineFixtureGeneration
templates = Haml::Engine.new(Rails.root.join("app", "views", "templates", "_templates.haml").read).render
templates = Haml::Engine.new(Rails.root.join("app", "views", "layouts", "_templates.haml").read).render
save_fixture(templates, "underscore_templates")
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment