Chris@154: # Redmine - project management software Chris@154: # Copyright (C) 2008 Jean-Philippe Lang Chris@154: # Chris@154: # This program is free software; you can redistribute it and/or Chris@154: # modify it under the terms of the GNU General Public License Chris@154: # as published by the Free Software Foundation; either version 2 Chris@154: # of the License, or (at your option) any later version. Chris@154: # Chris@154: # This program is distributed in the hope that it will be useful, Chris@154: # but WITHOUT ANY WARRANTY; without even the implied warranty of Chris@154: # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the Chris@154: # GNU General Public License for more details. Chris@154: # Chris@154: # You should have received a copy of the GNU General Public License Chris@154: # along with this program; if not, write to the Free Software Chris@154: # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Chris@154: Chris@154: module EmbeddedHelper Chris@154: Chris@154: # Adds include tags for assets of the given template Chris@154: def asset_include_tags(template) Chris@154: Chris@154: Redmine::Plugins::Embedded.assets(template).each { |asset| content_for(:header_tags) { asset_include_tag(asset) } } Chris@154: end Chris@154: Chris@154: private Chris@154: Chris@154: def asset_include_tag(asset) Chris@154: if asset =~ %r{\.js$} Chris@154: javascript_include_tag(asset, :plugin => 'embedded') Chris@154: else Chris@154: stylesheet_link_tag(asset, :plugin => 'embedded') Chris@154: end Chris@154: end Chris@154: end