annotate plugins/redmine_embedded/app/helpers/redmine_embedded_helper.rb @ 1465:ab8bd24eeb65
bug_635
Close obsolete branch bug_635
author |
Chris Cannam |
date |
Fri, 19 Jul 2013 12:13:20 +0100 |
parents |
22d81bd0b62c |
children |
|
rev |
line source |
luis@1119
|
1 # Redmine - project management software
|
luis@1119
|
2 # Copyright (C) 2008 Jean-Philippe Lang
|
luis@1119
|
3 #
|
luis@1119
|
4 # This program is free software; you can redistribute it and/or
|
luis@1119
|
5 # modify it under the terms of the GNU General Public License
|
luis@1119
|
6 # as published by the Free Software Foundation; either version 2
|
luis@1119
|
7 # of the License, or (at your option) any later version.
|
luis@1119
|
8 #
|
luis@1119
|
9 # This program is distributed in the hope that it will be useful,
|
luis@1119
|
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
|
luis@1119
|
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
luis@1119
|
12 # GNU General Public License for more details.
|
luis@1119
|
13 #
|
luis@1119
|
14 # You should have received a copy of the GNU General Public License
|
luis@1119
|
15 # along with this program; if not, write to the Free Software
|
luis@1119
|
16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
luis@1119
|
17
|
luis@1119
|
18 module RedmineEmbeddedHelper
|
luis@1119
|
19
|
luis@1119
|
20 # Adds include tags for assets of the given template
|
luis@1119
|
21 def asset_include_tags(template)
|
luis@1119
|
22
|
luis@1119
|
23 Redmine::Plugins::RedmineEmbedded.assets(template).each { |asset| content_for(:header_tags) { asset_include_tag(asset) } }
|
luis@1119
|
24 end
|
luis@1119
|
25
|
luis@1119
|
26 private
|
luis@1119
|
27
|
luis@1119
|
28 def asset_include_tag(asset)
|
luis@1119
|
29 if asset =~ %r{\.js$}
|
luis@1119
|
30 javascript_include_tag(asset, :plugin => 'redmine_embedded')
|
luis@1119
|
31 else
|
luis@1119
|
32 stylesheet_link_tag(asset, :plugin => 'redmine_embedded')
|
luis@1119
|
33 end
|
luis@1119
|
34 end
|
luis@1119
|
35 end
|