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