プロジェクト

全般

プロフィール

« | » 

リビジョン b8dc04a8

Massimo Rossello さんがほぼ13年前に追加

Support for redmine 2.3.x

差分を表示:

README.rdoc
This is the Redmine(Project manage system) plug-in which adds the feature of the glossary.
Ported to and tested on 2.3.x Redmine branch.
Care has been taken to keep compatibility with 1.4.x, but not tested!
== The Use
* Management of technical terms in a system analysis phase
......
* Management of naming examples in a coding
== Gegging a plugin package
== Getting a plugin package
{SourceForge.JP}[http://sourceforge.jp/projects/rp-glossary/releases/]
== Installation and Setup
== Installation and Setup (redmine 2.x)
cf. http://www.redmine.org/wiki/1/Plugins
1. Extends the dawnloaded package in vender/plugins directory.
1. Put the downloaded package in the /plugins directory.
2. run the following command to upgrade your database.
rake db:migrate_plugins RAILS_ENV=production
rake redmine:plugins:migrate RAILS_ENV=production
3. Restart Redmine WEB server.
4. Set permissions of glossary plugin in "Administration" -> "Roles and permissions"
5. Open the setting page of projects you need, check the "Glossray" module
5. Open the setting page of projects you need, check the "Glossary" module
6. If you need, select items to make hidden in plugin setting page.
== Usage
......
* http://www.r-labs.org/projects/rp-glossary/wiki/UsageEn
== Quesion or Proposal
== Question or Proposal
If you find a bug(Defect) or hava a Proposal, create a new issue.
If you find a bug(Defect) or have a Proposal, create a new issue.
http://www.r-labs.org/projects/rp-glossary/issues
If you quest about this plugin, write the forum.
app/controllers/glossary_controller.rb
def edit
@term_categories = TermCategory.find(:all, :conditions => "project_id = #{@project.id}", :order => "position")
if request.post?
if request.post? || request.put?
@term.attributes = params[:term]
@term.updater_id = User.current.id
if @term.save
attach_files(@term, params[:attachments])
flash[:notice] = l(:notice_successful_update)
redirect_to(:controller => 'glossary', :action => 'show',
:project_id => @project, :id => @term.id)
redirect_to(:controller => 'glossary', :action => 'show',
:project_id => @project, :id => @term.id)
return
end
end
app/controllers/term_categories_controller.rb
before_filter :find_project, :authorize
before_filter :retrieve_glossary_style, :only => [:index]
verify :method => :post, :only => :destroy
verify :mothod => :post, :only => :change_order
helper :glossary
include GlossaryHelper
helper :glossary_styles
app/helpers/glossary_helper.rb
def updated_by(updated, author)
l(:label_updated_time_by,
:author => link_to_user(author), :age => time_tag(updated)).html_safe
l(:label_updated_time_by, :author => link_to_user(author), :age => time_tag(updated)).html_safe
end
end
app/helpers/glossary_port_helper.rb
module GlossaryPortHelper
def glossary_csvout(csv, ic, ary)
#def glossary_csvout(csv, ic, ary)
def glossary_csvout(csv, ary)
csv << ary.collect {|c|
begin
ic.iconv(c.to_s)
#ic.iconv(c.to_s)
Redmine::CodesetUtil.from_utf8(c.to_s, l(:general_csv_encoding))
rescue
c.to_s
end
......
end
def glossary_to_csv(terms)
ic = Iconv.new(l(:general_csv_encoding), 'UTF-8')
#ic = Iconv.new(l(:general_csv_encoding), 'UTF-8')
export = FCSV.generate(:col_sep => l(:general_csv_separator)) do |csv|
# csv header fields
headers = Term.export_params.collect {|prm|
label_param(prm)
}
glossary_csvout(csv, ic, headers)
#glossary_csvout(csv, ic, headers)
glossary_csvout(csv, headers)
# csv lines
terms.each do |term|
fields = Term.export_params.collect {|prm|
term.param_to_s(prm)
}
glossary_csvout(csv, ic, fields)
#glossary_csvout(csv, ic, fields)
glossary_csvout(csv, fields)
end
end
export
......
def glossary_from_csv(portinfo, projid)
line_count = 0
begin
ic = Iconv.new('UTF-8', portinfo.in_encoding)
#ic = Iconv.new('UTF-8', portinfo.in_encoding)
raise l(:error_file_none) if (!portinfo.import_file)
FCSV::parse(portinfo.import_file) { |row|
......
name = row[portinfo.param_col('name')]
raise sprintf(l(:error_no_name), t("label.name")) unless name
name = ic.iconv(name)
#name = ic.iconv(name)
name = Redmine::CodesetUtil.to_utf8(name, portinfo.in_encoding)
term = Term.find(:first,
:conditions => ["project_id = #{projid} AND name = :name",
{:name=>name}])
......
for col in 0 ... row.size
prm = portinfo.col_param(col)
next unless prm
val = ic.iconv(row[col].to_s)
#val = ic.iconv(row[col].to_s)
name = Redmine::CodesetUtil.to_utf8(row[col].to_s, portinfo.in_encoding)
case prm
when 'name'
when 'category'
app/helpers/glossary_styles_helper.rb
str += '</td>'
end
str += '</tr></table>'
str.html_safe
end
def search_params
app/models/term.rb
end
def self.default_show_params
['name_cn', 'name_fr', 'name_en', 'tech_en', 'rubi', 'abbr_whole', 'datatype', 'codename', 'project', 'category']
['name_en', 'rubi', 'abbr_whole', 'datatype', 'codename', 'project', 'category']
end
def self.default_searched_params
['name', 'name_en', 'name_cn', 'name_fr', 'tech_en', 'abbr_whole', 'datatype', 'codename', 'description']
['name', 'name_en', 'abbr_whole', 'datatype', 'codename', 'description']
end
def self.default_sort_params
['id', 'name', 'name_en', 'name_cn', 'name_fr', 'tech_en', 'abbr_whole', 'datatype', 'codename', 'project', 'category',
['id', 'name', 'name_en', 'abbr_whole', 'datatype', 'codename', 'project', 'category',
'datetime']
end
def self.hidable_params
['name_en', 'name_cn', 'name_fr', 'tech_en', 'rubi', 'abbr_whole', 'datatype', 'codename']
['name_en', 'rubi', 'abbr_whole', 'datatype', 'codename']
end
def self.setting_params
['name_en', 'name_cn', 'name_fr', 'tech_en', 'rubi', 'abbr_whole', 'datatype', 'codename']
['name_en', 'rubi', 'abbr_whole', 'datatype', 'codename']
end
def self.export_params
['id','project',
'name', 'name_en', 'name_cn', 'name_fr', 'tech_en', 'rubi', 'abbr_whole', 'category', 'datatype', 'codename',
'name', 'name_en', 'rubi', 'abbr_whole', 'category', 'datatype', 'codename',
'author', 'updater', 'created_on', 'updated_on',
'description']
end
def self.import_params
['name', 'name_en', 'name_cn', 'name_fr', 'tech_en', 'rubi', 'abbr_whole', 'category', 'datatype', 'codename',
['name', 'name_en', 'rubi', 'abbr_whole', 'category', 'datatype', 'codename',
'description']
end
end
end
app/views/glossary/_add_term_category_modal.html.erb
<h3 class="title"><%=l(:label_term_category_new)%></h3>
<% form = labelled_form_for @category, :as => :category, :url => { :action => 'add_term_category', :project_id => @project }, :html => {:class => 'tabular'} do |f| %>
<%= render :partial => 'term_categories/form', :locals => { :f => f } %>
<p class="buttons">
<%= submit_tag l(:button_create), :name => nil %>
<%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %>
</p>
<% end %>
<%= form if Rails::VERSION::MAJOR >= 3 %>
app/views/glossary/_form.html.erb
<div class="splitcontentleft">
<p><%= f.select :category_id, (@term_categories.collect {|c| [c.name, c.id]}), :include_blank => true %>
<%= prompt_to_remote(l(:label_term_category_new),
l(:label_term_category_new), 'category[name]',
{:controller => 'glossary', :action => 'add_term_category', :project_id => @project},
<% if Rails::VERSION::MAJOR >= 3 %>
<%= link_to(l(:label_term_category_new),
{:controller => 'glossary', :action => 'add_term_category', :project_id => @project.id },
:category => 'category[name]',
:class => 'icon icon-add',
:tabindex => 199,
:method => 'get',
:remote => true) if authorize_for('glossary', 'add_term_category') %></p>
<% else %>
<%= prompt_to_remote(l(:label_term_category_new),
l(:label_term_category_new), 'category[name]',
{:controller => 'glossary', :action => 'add_term_category', :project_id => @project },
:class => 'icon icon-add', :tabindex => 199) if authorize_for('glossary', 'add_term_category') %></p>
<% end %>
</div>
<p><%= f.text_area :description, :label=>t('label.description'),
:cols => 60,
app/views/glossary/_index_in_category.html.erb
<% for prm in @show_params %>
<td><%=h term.value(prm) %></td>
<% end %>
<td><%=h truncate(term.description, :length=>50) %></td>
<td align="right">
<% if term.project_id == @project.id %>
<!--td><%=h truncate(term.description, :length=>50) %></td-->
<td><%=textilizable term.description %></td>
<td align="right" width="40px">
<% if term.project_id == @project.id %>
<%= link_to_if_authorized(image_tag('edit.png'), {:action => 'edit', :project_id => @project, :id => term}, :title => l(:button_edit)) %>
<%= link_to_if_authorized(image_tag('delete.png'), {:action => 'destroy', :project_id => @project, :id => term}, :confirm => l(:text_are_you_sure), :method => :post, :title => l(:button_delete)) %>
<% end %>
......
<% end %>
</tbody>
</table>
<br />
<br />
app/views/glossary/_sidebar.html.erb
<%= link_to_if_authorized(l(:button_clear), {:controller => 'glossary', :action => 'index_clear', :project_id => @project}, :class => 'icon icon-reload') %>
</div>
<% end %>
<%= search_index_table(l(:index_ary_en), l(:index_ary_en_sep_cnt), @project, 'en') %>
<br />
<%= search_index_table(l(:index_ary), l(:index_ary_sep_cnt), @project) %>
app/views/glossary/add_term_category.html.erb
<h2><%=l(:label_term_category_new)%></h2>
<% form = labelled_form_for @category, :as => :category, :url => { :action => 'add_term_category', :project_id => @project }, :html => {:class => 'tabular'} do |f| %>
<%= render :partial => 'term_categories/form', :locals => { :f => f } %>
<%= submit_tag l(:button_create) %>
<% end %>
<%= form if Rails::VERSION::MAJOR >= 3 %>
<% html_title(l(:glossary_title)) -%>
app/views/glossary/add_term_category.js.erb
$('#ajax-modal').html('<%= escape_javascript(render :partial => 'glossary/add_term_category_modal') %>');
showModal('ajax-modal', '600px');
app/views/glossary/edit.html.erb
<h2><%= l(:label_term) %> #<%= @term.id %></h2>
<% labelled_tabular_form_for :term, @term,
<% form = labelled_form_for @term, :as => :term,
:url => {:action => 'edit', :project_id => @project, :id => @term},
:html => {:multipart => true, :id => 'term-form'} do |f| %>
:html => {:class => 'tabular', :multipart => true, :id => 'term-form'} do |f| %>
<%= error_messages_for 'term' %>
<div class="box">
<%= render :partial => 'glossary/form', :locals => {:f => f} %>
</div>
<%= submit_tag l(:button_edit) %>
<%= link_to_remote l(:label_preview),
{ :url => { :controller => 'glossary', :action => 'preview', :project_id => @project },
:method => 'post',
:update => 'preview',
:with => "Form.serialize('term-form')",
:complete => "Element.scrollTo('preview')"
}, :accesskey => accesskey(:preview) %>
<% if Rails::VERSION::MAJOR >= 3 %>
<%= preview_link({:controller => 'glossary', :action => 'preview', :project_id => @project.id },
"term-form",
"preview") %>
<% else %>
<%= link_to_remote l(:label_preview),
{ :url => { :controller => 'glossary', :action => 'preview', :project_id => @project },
:method => 'post',
:update => 'preview',
:with => "Form.serialize('term-form')",
:complete => "Element.scrollTo('preview')"
}, :accesskey => accesskey(:preview) %>
<% end %>
<% end %>
<%= form if Rails::VERSION::MAJOR >= 3 %>
<div id="preview" class="wiki"></div>
app/views/glossary/import_csv.html.erb
<h2><%=h l(:label_glossary_import_csv) %> </h2>
<% form_tag({:controller => 'glossary', :action => 'import_csv_exec', :project_id=>@project},
<% form = form_tag({:controller => 'glossary', :action => 'import_csv_exec', :project_id=>@project},
{:multipart => true}) do %>
<%= l(:label_csv_file) %>
......
<%= submit_tag(l(:label_import)) %>
<% end %>
<%= form if Rails::VERSION::MAJOR >= 3 %>
<% html_title(l(:glossary_title)) -%>
app/views/glossary/move_all.html.erb
<%= simple_format(l(:error_no_movement_project)) %>
</div>
<% else %>
<% form_tag({:project_id => @project}, :id => 'move_all_form') do %>
<% form = form_tag({:project_id => @project}, :id => 'move_all_form') do %>
<div class="box tabular">
<p><label for="new_project_id"><%=l(:label_movement_project)%>:</label>
......
</div>
<%= submit_tag l(:button_move) %>
<% end %>
<%= form if Rails::VERSION::MAJOR >= 3 %>
<% end %>
app/views/glossary/new.html.erb
<h2><%=l(:label_term_new)%></h2>
<% labelled_tabular_form_for :term, @term,
:url => {:action => 'new', :project_id => @project},
:html => {:multipart => true, :id => 'term-form'} do |f| %>
<% form = labelled_form_for @term, :as => :term,
:url => {:action => 'new', :project_id => @project, :id => @term},
:html => {:class => 'tabular', :multipart => true, :id => 'term-form'} do |f| %>
<%= error_messages_for 'term' %>
<div class="box">
<%= render :partial => 'glossary/form', :locals => {:f => f} %>
</div>
<%= submit_tag l(:button_create) %>
<%= submit_tag l(:button_create_and_continue), :name => 'continue' %>
<%= link_to_remote l(:label_preview),
{ :url => { :controller => 'glossary', :action => 'preview', :project_id => @project },
:method => 'post',
:update => 'preview',
:with => "Form.serialize('term-form')",
:complete => "Element.scrollTo('preview')"
}, :accesskey => accesskey(:preview) %>
<% if Rails::VERSION::MAJOR >= 3 %>
<%= preview_link({:controller => 'glossary', :action => 'preview', :project_id => @project.id },
"term-form",
"preview") %>
<% else %>
<%= link_to_remote l(:label_preview),
{ :url => { :controller => 'glossary', :action => 'preview', :project_id => @project },
:method => 'post',
:update => 'preview',
:with => "Form.serialize('term-form')",
:complete => "Element.scrollTo('preview')"
}, :accesskey => accesskey(:preview) %>
<% end %>
<% end %>
<%= form if Rails::VERSION::MAJOR >= 3 %>
<div id="preview" class="wiki"></div>
app/views/glossary_styles/_form.html.erb
:project_id => @project,
:glossary_style_id => @glossary_style.id}
add_search_params(urlopts)
form_for :glossary_style, @glossary_style, :url => urlopts do |f| %>
form = form_for @glossary_style, :url => urlopts do |f| %>
<label> <%= f.check_box "show_desc" %> <%= l(:label_glossary_style_show_desc) %> </label>
......
<%= submit_tag l(:button_clear), :name => 'clear' %>
<% end %>
<%= form if Rails::VERSION::MAJOR >= 3 %>
app/views/glossary_styles/_search.html.erb
<% form_tag({:controller => 'glossary_styles', :action => 'search', :project_id => @project},
<% form = form_tag({:controller => 'glossary_styles', :action => 'search', :project_id => @project},
{:method => 'get', :id=>'search_form'}
) do %>
<%= hidden_field_tag 'project_id', @project.id.to_s %>
......
</div>
<% end %>
<%= form if Rails::VERSION::MAJOR >= 3 %>
app/views/settings/_glossary_settings.html.erb
<h2> <%= t('label_hide_item') %> </h2>
<table>
<% for item in Term.hidable_params %>
<% name = "hide_item_#{item}" %>
<tr><td>
<%= check_box_tag("settings[#{name}]", 1, @settings[name]) %>
</td><td>
<%= t("label.#{item}") %>
</td><tr>
<% end %>
</table>
app/views/term_categories/destroy.html.erb
<h2><%=l(:label_term_category)%>: <%=h @category.name %></h2>
<% form_tag({}) do %>
<% form = form_tag({}) do %>
<div class="box">
<p><strong><%= l(:text_term_category_destroy_question, :value => @term_count) %></strong></p>
<p><label><%= radio_button_tag 'todo', 'nullify', true %> <%= l(:text_term_category_destroy_assignments) %></label><br />
......
<%= submit_tag l(:button_apply) %>
<%= link_to l(:button_cancel), :controller => 'term_categories', :action => 'index', :project_id => @project %>
<% end %>
<%= form if Rails::VERSION::MAJOR >= 3 %>
<% html_title(l(:glossary_title)) -%>
app/views/term_categories/edit.html.erb
<h2><%=l(:label_term_category)%></h2>
<% labelled_tabular_form_for :category, @category, :url => { :action => 'edit', :project_id => @project, :id => @category } do |f| %>
<% form = labelled_form_for @category, :as => :category, :url => { :action => 'edit', :project_id => @project, :id => @category }, :html => {:class => 'tabular'} do |f| %>
<%= render :partial => 'term_categories/form', :locals => { :f => f } %>
<%= submit_tag l(:button_save) %>
<% end %>
<%= form if Rails::VERSION::MAJOR >= 3 %>
<% html_title(l(:glossary_title)) -%>
app/views/term_categories/index.html.erb
<th style="text-align:left">#</th>
<th style="text-align:left"><%= l(:field_name) %></th>
<th style="text-align:left"><%= l(:field_term_counts_under_category) %></th>
<th style="text-align:left;width:15%"></th>
<th style="text-align:left;width:30%"></th>
<th style="text-align:left;width:100px"></th>
<th style="text-align:left;width:40px"></th>
</thead>
<tbody>
<% for category in @categories %>
......
<% end %>
</td>
<td align="right">
<%= link_to_if_authorized(image_tag('edit.png'), { :action => 'edit', :project_id => @project, :id => category }, :title => l(:button_edit)) %>
<%= link_to_if_authorized(image_tag('delete.png'), {:action => 'destroy', :project_id => @project, :id => category}, :method => :post, :title => l(:button_delete)) %></td>
<%= link_to_if_authorized(image_tag('edit.png'), { :action => 'edit', :controller => 'term_categories', :project_id => @project, :id => category }, :title => l(:button_edit)) %>
<%= link_to_if_authorized(image_tag('delete.png'), {:action => 'destroy', :controller => 'term_categories', :project_id => @project, :id => category}, :method => :post, :title => l(:button_delete)) %></td>
</tr>
<% end %>
<% end %>
config/locales/de.yml
field_term_counts_under_category: Anzahl der Begriffe
text_term_category_destroy_question: Dieser Kategorie sind ({{value}}) Begriffe zugeordnet. Was wollen sie tun?
text_term_category_destroy_question: Dieser Kategorie sind (@{value}) Begriffe zugeordnet. Was wollen sie tun?
text_term_category_destroy_assignments: Kategoriezuordnung entfernen
text_term_category_reassign_to: Kategoriezuordnung ändern zu
......
error_term_not_found_name: "\"%s\": Keinen Begriff mit diesem Namen gefunden."
error_term_not_found_name_project: "\"%s\": Keinen Begriff mit diesem Namen im Projekt \"%s\" gefunden."
error_project_not_found: "\"%s\": Kein Projekt unter diesem Namen gefunden."
error_to_number: Ungltige Zahl. --- %s
error_to_number: Ung?ltige Zahl. --- %s
error_csv_import_row: " Zeile : %d"
error_import_no_name: "\"%s\" ist unbekannt."
config/locales/en.yml
id: No.
name: Term
name_en: English
name_cn: Chinese
name_fr: French
tech_en: "Technical English"
category: Category
datatype: "Data type for coding"
codename: "Abbreviation for coding"
......
field_term_counts_under_category: Term count
text_term_category_destroy_question: Some term ({{value}}) is assigned to this category. What do you want to do ?
text_term_category_destroy_question: Some term (%{value}) is assigned to this category. What do you want to do ?
text_term_category_destroy_assignments: Remove category assignments
text_term_category_reassign_to: Reassign term to this category
......
index_ary: []
index_subary: []
in_encoding_candidates: []
in_encoding_candidates: []
config/locales/it.yml
# Italian strings go here for Rails i18n
it:
project_module_glossary: Glossario
permission_view_terms: Mostra Glossario
permission_manage_terms: Gestisci Glossario
permission_manage_term_categories: Gestisci Termini Categoria
glossary_title: Glossario
label:
id: Nr.
name: Termine
name_en: Inglese
category: Categoria
datatype: "Tipo di dato in programmazione"
codename: "Abbreviazione per programmazione"
description: Descrizione
rubi: Ruby
abbr_whole: "Parola intera per l'abbreviazione"
label_updater: Aggiornamento
label_term_plural: Glossari
label_manage: Gestione
label_manage_term_category: Gestisci categoria
label_not_categorized: Senza categoria
label_view: Mostra
label_style: Stile
label_term: Termine
label_term_new: Nuovo termine
label_index: Elenco
label_grouping: Raggruppamento
label_glossary_style_show_desc: Mostra descrizioni
label_glossary_style_all_project: Tutti i progetti
label_glossary_style_project_current: Currente
label_glossary_style_project_mine: Miei
label_glossary_style_project_all: Tutti
label_latest: Ultimo
label_indays: Giorni
label_glossary_style_index: Indice
label_import: Importa
label_glossary_import_csv: Importa da CSV
label_csv_file: file CSV
label_csv_import_is_first_comment: La prima riga è una linea di commento?
label_import_items: Importa elementi
label_item: Elemento
label_column: Colonna
message_import_item: "Per il progetto, l'autore e il resto, viene usato il valore attuale."
label_csv_import_finished: Importazione da CSV terminata
error_import_failed: Errore in importazione file.
label_create_category_num: Il numero di categorie create
label_create_term_num: Il numero di termini creati
label_update_term_num: Il numero di termini aggiornati
label_file_encoding: Codifica del file
label_movement_project: Progetto di spostamento
label_move_all_terms: Sposta tutti i termini
label_term_category: Categoria del termine
label_term_category_new: Nuova categoria
field_term_counts_under_category: Numero di termini
text_term_category_destroy_question: Qualche termine (%{value}) è assegnato a questa categoria. Cosa vuoi fare?
text_term_category_destroy_assignments: Rimuovi assegnamenti di categoria
text_term_category_reassign_to: Riassegna il termine a questa categoria
label_hide_item: Impostazione di termini nascosti
label_tag_termlink: Collegamento a un termine
notice_glossary_style_create_f: Errore nella creazione dei dati di Stile del Glossario
error_term_macro_arg: "\"term\" macro necessita di argomenti, 1 oppure 2."
error_termno_macro_arg: "\"termno\" macro usa un solo argomento."
error_term_not_found_id: "\"%s\": Nessun termine corrisponde a questo numero."
error_term_not_found_name: "\"%s\": Nessun termine ha questo nome."
error_term_not_found_name_project: "\"%s\": Nessun termine ha questo nome nel progetto \"%s\"."
error_project_not_found: "\"%s\": Nessun progetto a questo identificativo."
error_to_number: Errore di conversione numerica. --- %s
error_csv_import_row: " linea : %d"
error_import_no_name: "\"%s\" non è descritto."
error_create_term_category: Errore nella creazione di una Categoria di Termini.
error_create_term: Errore nella creazione di un Termine.
error_file_none: Nessun File specificato.
error_no_movement_project: Non esiste un progetto in cui un termine viene spostato.
index_ary_en_sep_cnt: 6
index_ary_en: [A, B, C, D, E, F,
G, H, I, J, K, L,
M, N, O, P, Q, R,
S, T, U, V, W, X,
Y, Z]
index_ary_sep_cnt: 0
index_ary: []
index_subary: []
in_encoding_candidates: []
config/locales/ja.yml
field_term_counts_under_category: 割り当て用語数
text_term_category_destroy_question: いくつかの用語 ({{value}}) は、このカテゴリに分類されています。どうしましょうか?
text_term_category_destroy_question: いくつかの用語 (%{value}) は、このカテゴリに分類されています。どうしましょうか?
text_term_category_destroy_assignments: カテゴリから用語を解除する
text_term_category_reassign_to: 用語をこのカテゴリに関連付けする
config/locales/zh.yml
field_term_counts_under_category: 术语数量
text_term_category_destroy_question: 术语({{value}})已配置到当前类别。请选择下一步操作?
text_term_category_destroy_question: 术语(%{value})已配置到当前类别。请选择下一步操作?
text_term_category_destroy_assignments: 将当前术语从该类别中移出
text_term_category_reassign_to: 重新指定术语所属类别
config/routes.rb
ActionController::Routing::Routes.draw do |map|
map.connect 'glossary_styles/:action', :controller => 'glossary_styles'
map.with_options :controller => 'glossary' do |submap|
submap.connect 'projects/:project_id/glossary', :action => 'index'
submap.connect 'projects/:project_id/glossary/new', :action => 'new'
submap.connect 'projects/:project_id/glossary/:id', :action => 'show', :id => /\d+/
submap.connect 'projects/:project_id/glossary/:action'
submap.connect 'projects/:project_id/glossary/:id/:action', :id => /\d+/
end
map.with_options :controller => 'term_categories' do |submap|
submap.connect 'projects/:project_id/term_categories', :action => 'index'
submap.connect 'projects/:project_id/term_categories/:action'
submap.connect 'projects/:project_id/term_categories/:id/:action', :id => /\d+/
end
end
if Rails::VERSION::MAJOR < 3
ActionController::Routing::Routes.draw do |map|
map.connect 'glossary_styles/:action', :controller => 'glossary_styles'
map.with_options :controller => 'glossary' do |submap|
submap.connect 'projects/:project_id/glossary', :action => 'index'
submap.connect 'projects/:project_id/glossary/new', :action => 'new'
submap.connect 'projects/:project_id/glossary/:id', :action => 'show', :id => /\d+/
submap.connect 'projects/:project_id/glossary/:action'
submap.connect 'projects/:project_id/glossary/:id/:action', :id => /\d+/
end
map.with_options :controller => 'term_categories' do |submap|
submap.connect 'projects/:project_id/term_categories', :action => 'index'
submap.connect 'projects/:project_id/term_categories/:action'
submap.connect 'projects/:project_id/term_categories/:id/:action', :id => /\d+/
end
end
else
RedmineApp::Application.routes.draw do
match 'glossary_styles/:action', :to => 'glossary_styles', :via => [ :get, :post, :put ]
match 'projects/:project_id/glossary', :to => 'glossary#index', :via => [ :get ]
match 'projects/:project_id/glossary/new', :to => 'glossary#new', :via => [ :get ]
match 'projects/:project_id/glossary/edit', :to => 'glossary#edit', :via => [ :get, :post ]
match 'projects/:project_id/glossary/:id/edit', :to => 'glossary#edit', :id => /\d+/, :via => [ :get, :post ]
match 'projects/:project_id/glossary/:id/:action', :to => 'glossary', :id => /\d+/
match 'projects/:project_id/glossary/:id', :to => 'glossary#show', :id => /\d+/, :via => [ :get ]
match 'projects/:project_id/glossary/destroy', :to => 'glossary#destroy', :via => [ :delete ]
match 'projects/:project_id/glossary/:action', :to => 'glossary'
match 'projects/:project_id/term_categories', :to => 'term_categories#index'
match 'projects/:project_id/term_categories/destroy', :to => 'term_categories#destroy', :via => [ :delete ]
match 'projects/:project_id/term_categories/change_order', :to => 'term_categories#change_order', :via => [ :post ]
match 'projects/:project_id/term_categories/:action', :to => 'term_categories'
match 'projects/:project_id/term_categories/:id/:action', :to => 'term_categories', :id => /\d+/
end
end
init.rb
term = nil
case sargs.size
when 1
proj = Project.find_by_identifier(params[:project_id])
proj = Project.find_by_identifier(params[:project_id]) unless proj
term = Term.find_for_macro(sargs[0], proj, true)
when 2
proj = Project.find_by_identifier(sargs[1])
lib/term_link_helper.rb
end
def term_link(term)
str = link_to(term.name, :controller => 'glossary', :action => 'show',
:project_id => term.project, :id => term.id)
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

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