Nuevo plugin Redmine Glossary 0.9.2
This commit is contained in:
parent
5d298a7529
commit
693eb3ee50
72 changed files with 2962 additions and 0 deletions
35
plugins/redmine_glossary/lib/term_link_helper.rb
Executable file
35
plugins/redmine_glossary/lib/term_link_helper.rb
Executable file
|
@ -0,0 +1,35 @@
|
|||
require 'redmine'
|
||||
require 'cgi'
|
||||
|
||||
module ActionView
|
||||
module Helpers
|
||||
module TermLinkHelper
|
||||
|
||||
def term_link_new(name, proj)
|
||||
link_to(name + '?',
|
||||
{:controller => 'glossary', :action => 'new', :project_id => proj,
|
||||
:new_term_name => CGI::escapeHTML(name)},
|
||||
{:class=>'new'})
|
||||
end
|
||||
|
||||
def term_link(term)
|
||||
str = link_to(term.name, :controller => 'glossary', :action => 'show', :project_id => term.project,
|
||||
:id => term.id)
|
||||
unless (term.abbr_whole.empty?)
|
||||
str = content_tag(:abbr, str, :title=>term.abbr_whole)
|
||||
end
|
||||
unless (term.rubi.empty?)
|
||||
str = content_tag(:ruby) {
|
||||
tstr = content_tag(:rb, str)
|
||||
tstr += content_tag(:rp, '(')
|
||||
tstr += content_tag(:rt, term.rubi)
|
||||
tstr += content_tag(:rp, ')')
|
||||
}
|
||||
end
|
||||
str
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue