From 4883c70ae2f5fcd86bbcc470ffead04353e0a52d Mon Sep 17 00:00:00 2001 From: danielgrippi Date: Sun, 11 Dec 2011 11:46:34 -0800 Subject: [PATCH] move templates into app/views/templates/_templates.haml --- app/views/layouts/application.html.haml | 9 +-------- app/views/templates/_templates.haml | 12 ++++++++++++ .../{_comment.html.underscore => comment.ujs} | 0 ...ent_stream.html.underscore => comment_stream.ujs} | 0 ...am_element.html.underscore => stream_element.ujs} | 0 5 files changed, 13 insertions(+), 8 deletions(-) create mode 100644 app/views/templates/_templates.haml rename app/views/templates/{_comment.html.underscore => comment.ujs} (100%) rename app/views/templates/{_comment_stream.html.underscore => comment_stream.ujs} (100%) rename app/views/templates/{_stream_element.html.underscore => stream_element.ujs} (100%) diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 9b437ff8d..52bf259fe 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -75,14 +75,7 @@ = render 'layouts/header' - if @backbone - %script{:id => "stream-element-template", :type => 'text/template'} - != File.read("#{Rails.root}/app/views/templates/_stream_element.html.underscore") - - %script{:id => "comment-template", :type => 'text/template'} - != File.read("#{Rails.root}/app/views/templates/_comment.html.underscore") - - %script{:id => "comment-stream-template", :type => 'text/template'} - != File.read("#{Rails.root}/app/views/templates/_comment_stream.html.underscore") + = render 'templates/templates' .container{:style=> "#{yield(:break_the_mold)}"} - if @aspsect == :getting_started || @page == :logged_out diff --git a/app/views/templates/_templates.haml b/app/views/templates/_templates.haml new file mode 100644 index 000000000..568f74159 --- /dev/null +++ b/app/views/templates/_templates.haml @@ -0,0 +1,12 @@ +-# Copyright (c) 2010-2011, Diaspora Inc. This file is +-# licensed under the Affero General Public License version 3 or later. See +-# the COPYRIGHT file. + +%script{:id => "stream-element-template", :type => 'text/template'} + != File.read("#{Rails.root}/app/views/templates/stream_element.ujs") + +%script{:id => "comment-template", :type => 'text/template'} + != File.read("#{Rails.root}/app/views/templates/comment.ujs") + +%script{:id => "comment-stream-template", :type => 'text/template'} + != File.read("#{Rails.root}/app/views/templates/comment_stream.ujs") diff --git a/app/views/templates/_comment.html.underscore b/app/views/templates/comment.ujs similarity index 100% rename from app/views/templates/_comment.html.underscore rename to app/views/templates/comment.ujs diff --git a/app/views/templates/_comment_stream.html.underscore b/app/views/templates/comment_stream.ujs similarity index 100% rename from app/views/templates/_comment_stream.html.underscore rename to app/views/templates/comment_stream.ujs diff --git a/app/views/templates/_stream_element.html.underscore b/app/views/templates/stream_element.ujs similarity index 100% rename from app/views/templates/_stream_element.html.underscore rename to app/views/templates/stream_element.ujs