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