プロジェクト

全般

プロフィール

« | » 

リビジョン 32a3149c

高徹 高橋 徹 さんが約6年前に追加

[phase-16]add term macro, and macro define moved from init.rb to new file

差分を表示:

init.rb
#Rails.configuration.to_prepare do
# Redmine::Activity.register :glossary_terms
#end
Rails.configuration.to_prepare do
require_dependency "glossary_macros"
end
Redmine::Plugin.register :redmine_glossary do
name 'Redmine Glossary plugin'
......
Redmine::Activity.register :glossary_terms
Redmine::WikiFormatting::Macros.register do
desc "create macro which links to glossary term."
macro :termno do |obj, args|
puts "@@@@@@@@@@@@ Macros.register macro block: obj=#{obj.inspect} @@@@@@@@@@@@"
term_id = args.first
term = GlossaryTerm.find(term_id)
link_to term.name, project_glossary_term_path(@project, term)
end
macro :term do |obj, args|
term = GlossaryTerm.find_by(name: args.first)
link_to
end
end

他の形式にエクスポート: Unified diff