diff --git a/plugins/redmine_glossary/README.ja.rdoc b/plugins/redmine_glossary/README.ja.rdoc deleted file mode 100755 index f73bcc3..0000000 --- a/plugins/redmine_glossary/README.ja.rdoc +++ /dev/null @@ -1,47 +0,0 @@ -= Redmine 用語集プラグイン - -Redmine(プロジェクト管理システム)に用語集の機能を追加するプラグインです。 -以下のような用途に使えます。 - * 業務分析工程での専門用語の管理 - * 対訳表 - * 用語とデータ型(クラス名)との変換辞書 - * コーディング時の略名の付け方の方針管理 - - -== プラグインパッケージの取得 - -プラグインパッケージは以下から取得してください。 -* {SourceForge.JP}[http://sourceforge.jp/projects/rp-glossary/releases/] - - -== インストールと設定 - -1. 取得した圧縮ファイルを (インストールディレクトリ)/vender/plugins に展開します。 -2. データベースの設定を行います。 http://www.redmine.org/wiki/1/Plugins - rake db:migrate_plugins RAILS_ENV=production -3. Redmine の WEB サーバ(Apache など)を再起動します。 -4. "管理" メニューの "ロールと権限" から用語集の各権限を設定します。 -5. 用語集を使用したいプロジェクトの "設定" メニューで "用語集" のモジュールにチェックを入れます。 -6. 非表示にしたい項目があれば、プラグインの "設定" ページで設定してください。 - -cf. http://www.r-labs.org/projects/r-labs/wiki/%E3%83%97%E3%83%A9%E3%82%B0%E3%82%A4%E3%83%B3%E3%81%AE%E3%82%A4%E3%83%B3%E3%82%B9%E3%83%88%E3%83%BC%E3%83%AB%E6%96%B9%E6%B3%95 - - -== 使用法 - -プロジェクトメニューの "用語集" からご利用ください。 - -使用法の詳細は以下をご覧ください。 -* http://www.r-labs.org/projects/rp-glossary/wiki/Usage - - -== 質問、バグ報告など - -不具合報告や要望などありましたら、以下で Defect や Proposal のチケットを発行して下さい。 -http://www.r-labs.org/projects/rp-glossary/issues - -質問などは以下のフォーラムに記述して下さい。要望などはこちらに書いてもらってもかまいません。 -http://www.r-labs.org/projects/rp-glossary/boards - - - diff --git a/plugins/redmine_glossary/README.md b/plugins/redmine_glossary/README.md new file mode 100644 index 0000000..1c54c40 --- /dev/null +++ b/plugins/redmine_glossary/README.md @@ -0,0 +1,39 @@ +# Redmine Glossary Plugin + +This is a plugin for Redmine to create a glossary that is a list of terms in a project. + +This is a remake version of [the original glossary plugin](https://ja.osdn.net/projects/rp-glossary/releases/). The main goal of remaking is to fit for the recent redmine version to be maintainable. + +## The use + +- Management of technical terms in a system analysis phase +- Interlinear translation table +- Translate table from term to data type (class name) +- Management of naming examples in a coding + +## To get + +### Repository + +- + +The branches are as follows: + +- __master__ for the recent Redmine version +- __development__ under developping for the next release +- __support/2.x__ original glossary plugin ported for Redmine 2.x +- __support/3.x__ original glossary plugin ported for Redmine 3.x +- __support/4.0or1/based_original__ original glossary plugin ported for Redmine 4.0 or 4.1 + +### Installation and Setup + +1. Copy the plugin directory into the Redmine's plugin directory. Note that the name of plugin's directory should be "redmine_glossary". +2. Migrate plugin task. +3. Restart the redmine. +4. Set permission of glossary plugin in "Administration > Roles and permissions" + +### Uninstall + +- rails redmine:plugins:migrate NAME=redmine_glossary VERSION=0 + + diff --git a/plugins/redmine_glossary/README.rdoc b/plugins/redmine_glossary/README.rdoc deleted file mode 100755 index 81438f8..0000000 --- a/plugins/redmine_glossary/README.rdoc +++ /dev/null @@ -1,45 +0,0 @@ -= Redmine Glossary Plugin - -This is the Redmine(Project manage system) plug-in which adds the feature of the glossary. - -Ported to 3.0.x and 3.1.x on master branch. -It doesn't keep compatibility with 2.x! - -Ported to comming 4.0.x on support-redmine4 branch. -It doesn't keep compativility with 3.x and below. - -== Use Cases - - * Management of technical terms in a system analysis phase - * Interlinear translation table - * Translate table from term to data type (class name) - * Management of naming examples in a coding - -== Installation and Setup (redmine 3.x) - -cf. http://www.redmine.org/wiki/1/Plugins - -1. Put the downloaded package in the /plugins directory. -2. run the following command to upgrade your database. - 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 "Glossary" module -6. If you need, select items to make hidden in plugin setting page. - -== Installation and Setup (redmine 4.x) - -T.B.D. - -1. Put the downloaded package in the /plugins directory. - Or clone from this repository. - - - -== Usage - -Start from "Glossary" item of a project menu. - - -For the details of the usage, see the following page. -* http://www.r-labs.org/projects/rp-glossary/wiki/UsageEn diff --git a/plugins/redmine_glossary/app/controllers/glossary_categories_controller.rb b/plugins/redmine_glossary/app/controllers/glossary_categories_controller.rb new file mode 100644 index 0000000..003b0c0 --- /dev/null +++ b/plugins/redmine_glossary/app/controllers/glossary_categories_controller.rb @@ -0,0 +1,64 @@ +class GlossaryCategoriesController < ApplicationController + + before_action :find_category_from_id, only: [:show, :edit, :update, :destroy] + before_action :find_project_by_project_id, :authorize + + def index + @categories = GlossaryCategory.where(project_id: @project.id).sorted + end + + def show + end + + def new + @category = GlossaryCategory.new + end + + def edit + end + + def create + category = GlossaryCategory.new(glossary_category_params) + category.project = @project + if category.save + redirect_to [@project, category], notice: l(:notice_successful_create) + end + end + + def update + @category.attributes = glossary_category_params + if @category.save + respond_to do |format| + format.html { + redirect_to [@project, @category], + notice: l(:notice_successful_update) + } + format.js { + head 200 + } + end + end + rescue ActiveRecord::StaleObjectError + flash.now[:error] = l(:notice_locking_conflict) + end + + def destroy + @category.destroy + redirect_to project_glossary_categories_path(@project) + end + + # Find the category whose id is the :id parameter + def find_category_from_id + @category = GlossaryCategory.find(params[:id]) + rescue ActiveRecord::RecordNotFound + render_404 + end + + private + + def glossary_category_params + params.require(:glossary_category).permit( + :name, :position + ) + end +end diff --git a/plugins/redmine_glossary/app/controllers/glossary_controller.rb b/plugins/redmine_glossary/app/controllers/glossary_controller.rb deleted file mode 100755 index 96abca3..0000000 --- a/plugins/redmine_glossary/app/controllers/glossary_controller.rb +++ /dev/null @@ -1,386 +0,0 @@ - -class GlossaryController < ApplicationController - menu_item :glossary - unloadable - - layout 'base' - before_filter :find_project, :authorize - before_filter :find_term, :only => [:show, :edit, :destroy] - before_filter :retrieve_glossary_style, :only => [:index, :show, :show_all, :import_csv_exec] - - helper :attachments - include AttachmentsHelper - helper :sort - include SortHelper - helper :glossary - include GlossaryHelper - helper :glossary_port - include GlossaryPortHelper - helper :glossary_styles - include GlossaryStylesHelper - - - def index - - @is_index = true - set_show_params - @terms = find_terms(@glossary_style.project_scope) - unless @terms.empty? - sortparams = @glossary_style.sort_params - sort_terms(@terms, sortparams) unless sortparams.empty? - off_params = @show_params.clone - off_params.delete("category") - off_params.delete("project") - if (!@glossary_style.grouping?) - check_nouse_params(@terms, off_params) - else - @terms = grouping(@glossary_style.groupby, @terms, off_params) - end - @show_params.delete_if {|prm| off_params.member?(prm) } - end - - - respond_to do |format| - format.html { render :template => 'glossary/index.html.erb', :layout => !request.xhr? } - format.csv { - ary = @terms - ary = GroupingTerms.flatten(@terms) if (@glossary_style.grouping?) - send_data(glossary_to_csv(ary), :type => 'text', - :filename => "glossary-export.csv") - } - end - end - - - def index_clear - params[:search_index_ch] = nil - redirect_to :controller => 'glossary', :action => 'index', :project_id => @project - end - - - def show - set_show_params - @term_categories = TermCategory.where(:project_id => @project.id).order(:position) - respond_to do |format| - format.html { render :template => 'glossary/show.html.erb', :layout => !request.xhr? } - end - end - - def new - @term_categories = TermCategory.where(:project_id => @project.id).order(:position) - @term = Term.new(params[:term]) - @term.name = CGI::unescapeHTML(params[:new_term_name]) if params[:new_term_name] - @term.project_id = @project.id - - unless (request.get? || request.xhr?) - @term.author_id = User.current.id - @term.updater_id = User.current.id - if @term.save - attach_files(@term, params[:attachments]) - flash[:notice] = l(:notice_successful_create) - if (params[:continue]) - redirect_to :controller => 'glossary', :action => 'new', :project_id => @project - else - redirect_to :controller => 'glossary', :action => 'show', :project_id => @project, - :id => @term - end - end - end - end - - def preview - @text = params[:term][:description] - render :partial => 'common/preview' - end - - def edit - @term_categories = TermCategory.where(:project_id => @project.id).order(:position) - - if request.post? || request.put? || request.patch? - @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) - return - end - end - rescue ActiveRecord::StaleObjectError - # Optimistic locking exception - flash.now[:error] = l(:notice_locking_conflict) - end - - def destroy - @term.destroy - redirect_to :action => 'index', :project_id => @project - end - - def add_term_category - @category = TermCategory.new(params[:category]) - @category.project_id = @project.id - if request.post? and @category.save - respond_to do |format| - format.html do - flash[:notice] = l(:notice_successful_create) - redirect_to :controller => 'term_categories', :action => 'index', :project_id => @project - end - format.js do - term_categories = TermCategory.where(:project_id => @project.id) - render(:update) {|page| page.replace "term_category_id", - content_tag('select', '' + options_from_collection_for_select(term_categories, 'id', 'name', @category.id), :id => 'term_category_id', :name => 'term[category_id]') - } - end - end - end - end - - - def move_all - projs = Project.visible.all - @allowed_projs = projs.find_all {|proj| - User.current.allowed_to?({:controller =>'glossary', :action => 'index'}, proj) and - User.current.allowed_to?({:controller =>'glossary', :action => 'move_all'}, proj) and - proj != @project - } - if request.post? - newproj = Project.find(params[:new_project_id]) - cats = TermCategory.where(:project_id => newproj.id).order(:position) - posbase = (cats.blank?) ? 0 : cats.last.position - 1; - cats = TermCategory.where(:project_id => @project.id) - cats.each {|cat| - cat.project_id = newproj.id - cat.position += cat.position + posbase - cat.save - } - Term.where(project_id: @project.id).update_all(project_id: newproj.id) - flash[:notice] = l(:notice_successful_update) - redirect_to({:action => 'index', :project_id => newproj}) - end - end - - - def import_csv - end - - def import_csv_exec - @import_info = CsvGlossaryImportInfo.new(params) - glossary_from_csv(@import_info, @project.id) - if (@import_info.success?) - flash[:notice] = l(:notice_successful_create) - else - flash.now[:error] = l(:error_import_failed) + " " + @import_info.err_string - end - end - - - private - - def show_param?(prmname) - case prmname - when 'project' - return false unless @glossary_style.project_scope != GlossaryStyle::ProjectCurrent - return true unless @is_index - @glossary_style.groupby != GlossaryStyle::GroupByProject - when 'category' - return true unless @is_index - @glossary_style.groupby != GlossaryStyle::GroupByCategory - when 'rubi' - (param_visible?(prmname) and !@is_index) - when 'abbr_whole' - (param_visible?(prmname) and !@is_index) - else - param_visible?(prmname) - end - end - - def set_show_params - @show_params = default_show_params.find_all {|prmname| - show_param?(prmname) - } - end - - def check_nouse_params(terms, off_params) - terms.each {|term| - return if off_params.empty? - off_params.delete_if {|prm| !term[prm].empty? } - } - end - - def grouping(type, terms, off_params) - grouptbl = {} - terms.each {|term| - off_params.delete_if {|prm| !term[prm].empty? } - tgt = (type == GlossaryStyle::GroupByProject) ? term.project : term.category - gterms = grouptbl[tgt]; - unless (gterms) - gterms = GroupingTerms.new(type, tgt) - grouptbl[tgt] = gterms - end - gterms.ary << term - } - grouptbl.values.sort - end - - - #### sort - - def sort_terms(terms, prms) - terms.to_a.sort! {|a, b| - re = nil - prms.each {|prm| - re = Term.compare_by_param(prm, a, b) - break if (re != 0) - } - (re == 0) ? a.id <=> b.id : re - } - end - - - #### find - - def join_queries(ary, ex = 'OR') - joinstr = " #{ex} " - ((ary.size == 1) ? ary[0] : "( #{ary.join(joinstr)} )") - end - - def query_project_scope(projscope, queries) - ary = authorized_projects(projscope, @project, - {:controller => :glossary, :action => :index}) - return false if ary.empty? - queries << join_queries(ary.collect{|proj| "project_id = #{proj.id}" }) - true - end - - def query_category(catname, queries) - return if (!catname or catname.empty? ) - if (catname == "(#{l(:label_not_categorized)})") - queries << "( category_id IS NULL )" - else - cats = TermCategory.where(["name LIKE :catname", - {:catname => catname + "%"}]) - ary = [] - ptn = /^#{Regexp.escape(catname)}\// - cats.each {|encat| - if (encat.name == catname or encat.name =~ ptn) - ary << "category_id = #{encat.id}" - end - } - queries << join_queries(ary) unless (ary.empty?) - end - end - - - def query_search_str(str, queries, symbols) - return unless (str and !str.empty?) - strs = tokenize_by_space(str) - cnt = 0 - strs.each {|ss| - symbols["search_str_#{cnt}".to_sym] = "%#{ss}%" - cnt += 1 - } - ary = [] - default_searched_params.each {|prm| - subary = [] - cnt = 0 - strs.each {|ss| - subary << "( #{prm} LIKE :search_str_#{cnt} )" - cnt += 1 - } - ary << join_queries(subary, 'AND') - } - queries << join_queries(ary) if (0 < ary.size) - end - - - def get_search_index_charset(ch, type) - charset = [ch] - return charset if type - idx = l(:index_ary).index(ch) - subary = l(:index_subary) - if (subary.is_a?(Array) and subary[idx] and !subary[idx].empty?) - if (subary[idx].is_a?(Array)) - subary[idx].each {|subch| - charset << subch - } - else - charset << subary[idx] - end - end - charset - end - - - def query_search_index(ch, type, queries, symbols) - return unless (ch and !ch.empty?) - charset = get_search_index_charset(ch, type) - searchprms = [:name, :abbr_whole, :rubi] - searchprms << :name_en if (type) - cnt = 0 - charset.each {|tch| - symbols["search_ch_#{cnt}".to_sym] = tch + '%' - cnt += 1 - } - ary = [] - searchprms.each {|prm| - subary = [] - cnt = 0 - charset.each {|tch| - subary << "( #{prm} LIKE :search_ch_#{cnt} )" - cnt += 1 - } - ary << join_queries(subary) - } - @query_string = join_queries(ary) - queries << join_queries(ary) if (0 < ary.size) - end - - - def find_terms(project_scope) - queries = [] - symbols = {} - return [] unless query_project_scope(project_scope, queries) - query_category(params[:search_category], queries) - query_search_str(params[:search_str], queries, symbols) - query_search_index(params[:search_index_ch], params[:search_index_type], - queries, symbols) - terms = nil - if (queries.empty?) - terms = Term.all - else - query_str = join_queries(queries, "AND") - terms = Term.where(query_str, symbols) - end - if (terms and params[:latest_days] and !params[:latest_days].empty?) - limitsec = Time.now.to_i - params[:latest_days].to_i * 60 * 60 * 24 - limittm = Time.at(limitsec) -# terms.delete_if {|prm| (prm.datetime < limittm)} - recent_terms = [] - terms.collect{|prm| recent_terms << prm if prm.datetime >= limittm} - recent_terms - else - terms - end - end - - - def find_project - project_id = params[:project_id] || (params[:issue] && params[:issue][:project_id]) - @project = Project.find(project_id) - rescue ActiveRecord::RecordNotFound - render_404 - end - - def find_term - @term = Term.find_by(project_id: @project.id, id: params[:id]) - render_404 unless @term - rescue - render_404 - end - - def attach_files(val, prm) - Attachment.attach_files(val, prm) - end - -end diff --git a/plugins/redmine_glossary/app/controllers/glossary_styles_controller.rb b/plugins/redmine_glossary/app/controllers/glossary_styles_controller.rb deleted file mode 100755 index f648926..0000000 --- a/plugins/redmine_glossary/app/controllers/glossary_styles_controller.rb +++ /dev/null @@ -1,61 +0,0 @@ -class GlossaryStylesController < ApplicationController - unloadable - - helper :glossary_styles - include GlossaryStylesHelper - - def search - newparams = { - :controller => 'glossary', :action => 'index', :project_id => Project.find(params[:project_id]) - } - unless (params[:search_clear]) - for prm in [:search_category, :search_str, :latest_days] - if (params[prm] and !params[prm].empty?) - if (prm == :latest_days and !(params[prm] =~ /^\d+$/)) - flash[:warning] = sprintf(l(:error_to_number), params[prm]) - else - newparams[prm] = params[prm] - end - end - end - end - redirect_to(newparams) - end - - - def edit - if (User.current.anonymous?) - if (params[:clear]) - session[:glossary_style] = nil - else - session[:glossary_style] = params[:glossary_style] - end - else - unless params[:glossary_style_id].blank? - @glossary_style = GlossaryStyle.find_by(:user_id => User.current.id) - end - - if (@glossary_style) - if (params[:clear]) - @glossary_style.set_default! - else - params[:glossary_style].each {|key,val| - @glossary_style[key] = val - } - end - else - @glossary_style = GlossaryStyle.new(params[:glossary_style]) - end - - @glossary_style.user_id = User.current.id - unless @glossary_style.save - flash[:error] = l(:notice_glossary_style_create_f) - end - end - newparams = {:controller => 'glossary', :action => 'index', - :project_id => Project.find(params[:project_id]), - :glossary_style_id => @glossary_style_id} - add_search_params(newparams) - redirect_to(newparams) - end -end diff --git a/plugins/redmine_glossary/app/controllers/glossary_terms_controller.rb b/plugins/redmine_glossary/app/controllers/glossary_terms_controller.rb new file mode 100644 index 0000000..5787509 --- /dev/null +++ b/plugins/redmine_glossary/app/controllers/glossary_terms_controller.rb @@ -0,0 +1,80 @@ +class GlossaryTermsController < ApplicationController + + before_action :find_term_from_id, only: [:show, :edit, :update, :destroy] + before_action :find_project_by_project_id, :authorize, except: [:preview] + before_action :find_attachments, only: [:preview] + + def index + @glossary_terms = GlossaryTerm.where(project_id: @project.id) + if not params[:index].nil? + @glossary_terms = @glossary_terms.search_by_name(params[:index]) + elsif not params[:index_rubi].nil? + @glossary_terms = @glossary_terms.search_by_rubi(params[:index_rubi]) + end + @grouping = params[:grouping] unless params[:grouping].nil? + end + + def new + @term = GlossaryTerm.new + end + + def create + term = GlossaryTerm.new(glossary_term_params) + term.project = @project + term.save_attachments params[:attachments] + if term.save + render_attachment_warning_if_needed term + redirect_to [@project, term], notice: l(:notice_successful_create) + end + end + + def edit + end + + def update + @term.attributes = glossary_term_params + @term.save_attachments params[:attachments] + if @term.save + render_attachment_warning_if_needed @term + redirect_to [@project, @term], notice: l(:notice_successful_update) + end + rescue ActiveRecord::StaleObjectError + flash.now[:error] = l(:notice_locking_conflict) + end + + def destroy + @term.destroy + redirect_to project_glossary_terms_path(@project) + end + + def preview + term = GlossaryTerm.find_by_id(params[:id]) + if term + @attachments += term.attachments + @previewed = term + end + @text = params[:glossary_term][:description] + render partial: 'common/preview' + end + + # Find the term whose id is the :id parameter + def find_term_from_id + @term = GlossaryTerm.find(params[:id]) + rescue ActiveRecord::RecordNotFound + render_404 + end + + def import + GlossaryTerm.import(params[:file], @project) + redirect_to project_glossary_terms_path(@project) + end + + private + + def glossary_term_params + params.require(:glossary_term).permit( + :name, :description, :category_id, + :name_en, :rubi, :abbr_whole, :datatype, :codename + ) + end +end diff --git a/plugins/redmine_glossary/app/controllers/term_categories_controller.rb b/plugins/redmine_glossary/app/controllers/term_categories_controller.rb deleted file mode 100755 index fc22392..0000000 --- a/plugins/redmine_glossary/app/controllers/term_categories_controller.rb +++ /dev/null @@ -1,75 +0,0 @@ -class TermCategoriesController < ApplicationController - unloadable - - layout 'base' - menu_item :glossary, :only => [:index, :edit, :destroy] - - before_filter :find_project, :authorize - before_filter :retrieve_glossary_style, :only => [:index] - - helper :glossary - include GlossaryHelper - helper :glossary_styles - include GlossaryStylesHelper - - - def index - @categories = TermCategory.where(project_id: @project.id).order(:position) - end - - def edit - @category = TermCategory.find_by(project_id: @project.id, id: params[:id]) - if request.patch? and @category.update_attributes(params[:category]) - flash[:notice] = l(:notice_successful_update) - redirect_to :controller => 'term_categories', :action => 'index', :project_id => @project - end - rescue ActiveRecord::RecordNotFound - render_404 - end - - def change_order - if request.post? - category = TermCategory.find_by(project_id: @project.id, id: params[:id]) - case params[:position] - when 'highest'; category.move_to_top - when 'higher'; category.move_higher - when 'lower'; category.move_lower - when 'lowest'; category.move_to_bottom - end if params[:position] - redirect_to :controller => 'term_categories', :action => 'index', :project_id => @project - end - rescue ActiveRecord::RecordNotFound - render_404 - end - - def destroy - @category = TermCategory.find_by(project_id: @project.id, id: params[:id]) - @term_count = @category.terms.size - if @term_count == 0 - @category.destroy - redirect_to :controller => 'term_categories', :action => 'index', :project_id => @project - elsif params[:todo] - reassign_to = TermCategory.find_by(project_id: @project.id, id: params[:reassign_to_id]) if params[:todo] == 'reassign' - @category.destroy(reassign_to) - redirect_to :controller => 'term_categories', :action => 'index', :project_id => @project - end - @categories = TermCategory.where(project_id: @project.id) - [@category] - rescue ActiveRecord::RecordNotFound - render_404 - end - -private - def find_project - @project = Project.find(params[:project_id]) - rescue ActiveRecord::RecordNotFound - render_404 - end - - def conditions_projects() - ary = authorized_projects(@glossary_style.project_scope, @project, - {:controller => :term_categories, :action => :edit}) - return nil if ary.empty? - return ary.collect{|proj| "project_id = #{proj.id}" }.join(" OR ") - end - -end diff --git a/plugins/redmine_glossary/app/helpers/glossary_categories_helper.rb b/plugins/redmine_glossary/app/helpers/glossary_categories_helper.rb new file mode 100644 index 0000000..23a7306 --- /dev/null +++ b/plugins/redmine_glossary/app/helpers/glossary_categories_helper.rb @@ -0,0 +1,2 @@ +module GlossaryCategoriesHelper +end diff --git a/plugins/redmine_glossary/app/helpers/glossary_helper.rb b/plugins/redmine_glossary/app/helpers/glossary_helper.rb deleted file mode 100755 index 9e8b98f..0000000 --- a/plugins/redmine_glossary/app/helpers/glossary_helper.rb +++ /dev/null @@ -1,73 +0,0 @@ -require 'glossary_import_info' - -module GlossaryHelper - - def label_param(prmname) - case prmname - when 'id' - '#' - when 'project' - I18n.t(:label_project) - when 'category' - I18n.t(:field_category) - when 'datetime' - I18n.t(:field_updated_on) - when 'author' - I18n.t(:field_author) - when 'updater' - I18n.t(:label_updater) - when 'created_on' - I18n.t(:field_created_on) - when 'updated_on' - I18n.t(:field_updated_on) - when 'description' - I18n.t(:field_description) - else - I18n.t("label.#{prmname}") - end - end - - - def param_visible?(prmname) - !Setting.plugin_redmine_glossary["hide_item_#{prmname}"] - end - - def collect_visible_params(prmary) - ary = [] - prmary.collect{|prm| ary << prm if param_visible?(prm)} - ary - end - - def default_show_params; Term.default_show_params; end - def default_searched_params; Term.default_searched_params; end - def default_sort_params; Term.default_sort_params; end - - - def params_select(form, name, prms) - vprms = collect_visible_params(prms) - options = vprms.collect{|prm| [label_param(prm), prm]} - form.select(name, options, :include_blank=>true) - end - - def params_select_tag(name, prms, defaultprm) - options = [""] - options += prms.collect{|prm| [label_param(prm), prm]} - select_tag(name, options_from_collection_for_select(options), defaultprm) - end - - - # extract tokens from the question - # eg. hello "bye bye" => ["hello", "bye bye"] - def tokenize_by_space(str) - str.scan(%r{((\s|^)"[\s\w]+"(\s|$)|\S+)}).collect {|m| - m.first.gsub(%r{(^\s*"\s*|\s*"\s*$)}, '') - } - end - - - - def updated_by(updated, author) - l(:label_updated_time_by, :author => link_to_user(author), :age => time_tag(updated)).html_safe - end - -end diff --git a/plugins/redmine_glossary/app/helpers/glossary_port_helper.rb b/plugins/redmine_glossary/app/helpers/glossary_port_helper.rb deleted file mode 100755 index ee877bb..0000000 --- a/plugins/redmine_glossary/app/helpers/glossary_port_helper.rb +++ /dev/null @@ -1,99 +0,0 @@ -module GlossaryPortHelper - - - #def glossary_csvout(csv, ic, ary) - def glossary_csvout(csv, ary) - csv << ary.collect {|c| - begin - #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') - 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, 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, fields) - end - end - export - end - - - def glossary_from_csv(portinfo, projid) - line_count = 0 - begin - #ic = Iconv.new('UTF-8', portinfo.in_encoding) - - raise l(:error_file_none) if (!portinfo.import_file) - FCSV::parse(portinfo.import_file.read) { |row| - line_count += 1 - next if (portinfo.is_first_comment and line_count == 1) - next if (row.empty?) - - name = row[portinfo.param_col('name')] - raise sprintf(l(:error_no_name), t("label.name")) unless name - - #name = ic.iconv(name) - name = Redmine::CodesetUtil.to_utf8(name, portinfo.in_encoding) - term = Term.find_by(project_id: projid, name: name) - if (term) - portinfo.upterm_num += 1 - else - term = Term.new(:name => name, :project_id => projid) - portinfo.newterm_num += 1 - end - - for col in 0 ... row.size - prm = portinfo.col_param(col) - next unless prm - #val = ic.iconv(row[col].to_s) - val = Redmine::CodesetUtil.to_utf8(row[col].to_s, portinfo.in_encoding) - case prm - when 'name' - when 'category' - unless val.empty? then - cat = TermCategory.find_by_name(val) - unless (cat) - cat = TermCategory.new(:name => val, :project_id => projid) - unless (cat.save) - raise l(:error_create_term_category) - end - portinfo.cat_num += 1 - end - term['category_id'] = cat.id - end - else - term[prm] = val - end - end - unless (term.save) - raise l(:error_create_term) - end - } - rescue => evar - portinfo.err_string = evar.to_s - if (0 < line_count) - portinfo.err_string += sprintf(l(:error_csv_import_row), line_count) - end - end - end - -end diff --git a/plugins/redmine_glossary/app/helpers/glossary_styles_helper.rb b/plugins/redmine_glossary/app/helpers/glossary_styles_helper.rb deleted file mode 100755 index 7b1b50a..0000000 --- a/plugins/redmine_glossary/app/helpers/glossary_styles_helper.rb +++ /dev/null @@ -1,107 +0,0 @@ -module GlossaryStylesHelper - - def retrieve_glossary_style - if (User.current.anonymous?) - if (session[:glossary_style]) - @glossary_style = GlossaryStyle.new(session[:glossary_style]) - end - else - if !params[:glossary_style_id].blank? - @glossary_style = GlossaryStyle.find_by(params[:glossary_style_id]) - else - @glossary_style= GlossaryStyle.find_by(:user_id => User.current.id) - end - end - - unless (@glossary_style) - @glossary_style = GlossaryStyle.new(:groupby => GlossaryStyle::GroupByCategory) - @glossary_style.user_id = User.current.id - end - - end - - def search_index_table(ary, sepcnt, proj, search_index_type = nil) - return "" if (!ary.is_a?(Array) or sepcnt <= 0) - str = '' - cnt = 0 - for ch in ary - str += '' if ((cnt != 0) and (cnt % sepcnt) == 0 ) - cnt += 1 - str += '' - end - str += '
' - if (ch and !ch.empty?) - prms = {:controller => 'glossary', :action => 'index', :project_id => proj, - :search_index_ch => ch} - prms[:search_index_type] = search_index_type if (search_index_type) - str += link_to(ch, prms) - end - str += '
' - str.html_safe - end - - def search_params - [:search_str, :search_category, :latest_days] - end - - def search_params_all - search_params + [:search_index_ch, :search_index_type] - end - - def add_search_params(prms) - search_params_all.each {|prm| - prms[prm] = params[prm] if (params[prm] and !params[prm].empty?) - } - end - - def glossary_searching? - search_params.each {|prm| - return true if (params[prm] and !params[prm].empty?) - } - return false - end - - - def authorized_projects(projscope, curproj, authcnd) - ary = [] - case projscope - when GlossaryStyle::ProjectCurrent - return [curproj] - when GlossaryStyle::ProjectMine - ary = User.current.memberships.collect(&:project).compact.uniq - when GlossaryStyle::ProjectAll - ary = Project.visible.all - end - ary.find_all {|proj| - User.current.allowed_to?(authcnd, proj) - } - end - - - def break_categories(cats) - catstrs = [] - cats.each {|cat| - catstrs << cat.name - if (cat.name.include?('/')) - str = cat.name - while (str =~ /^(.+)\/[^\/]+$/) - str = $1 - catstrs << str - end - end - } - catstrs - end - - def seach_category_options(projscope, curproj) - options = [""] - projs = authorized_projects(projscope, curproj, {:controller => :glossary, :action => :index}) - unless (projs.empty?) - querystr = projs.collect {|proj| "project_id = #{proj.id}"}.join(" OR ") - options += break_categories(TermCategory.where(querystr)).sort.uniq - end - options << "(#{l(:label_not_categorized)})" - end - - -end diff --git a/plugins/redmine_glossary/app/helpers/glossary_terms_helper.rb b/plugins/redmine_glossary/app/helpers/glossary_terms_helper.rb new file mode 100644 index 0000000..676b7c3 --- /dev/null +++ b/plugins/redmine_glossary/app/helpers/glossary_terms_helper.rb @@ -0,0 +1,2 @@ +module GlossaryTermsHelper +end diff --git a/plugins/redmine_glossary/app/helpers/term_categories_helper.rb b/plugins/redmine_glossary/app/helpers/term_categories_helper.rb deleted file mode 100755 index 08da0d2..0000000 --- a/plugins/redmine_glossary/app/helpers/term_categories_helper.rb +++ /dev/null @@ -1,2 +0,0 @@ -module TermCategoriesHelper -end diff --git a/plugins/redmine_glossary/app/models/glossary_category.rb b/plugins/redmine_glossary/app/models/glossary_category.rb new file mode 100644 index 0000000..bbc237f --- /dev/null +++ b/plugins/redmine_glossary/app/models/glossary_category.rb @@ -0,0 +1,9 @@ +class GlossaryCategory < ActiveRecord::Base + has_many :terms, class_name: 'GlossaryTerm', foreign_key: 'category_id' + belongs_to :project + + acts_as_positioned + + scope :sorted, lambda { order(:position) } + +end diff --git a/plugins/redmine_glossary/app/models/glossary_style.rb b/plugins/redmine_glossary/app/models/glossary_style.rb deleted file mode 100755 index a57a473..0000000 --- a/plugins/redmine_glossary/app/models/glossary_style.rb +++ /dev/null @@ -1,52 +0,0 @@ -class GlossaryStyle < ActiveRecord::Base - unloadable - - GroupByNone = 0 - GroupByCategory = 1 - GroupByProject = 2 - - ProjectCurrent = 0 - ProjectMine = 1 - ProjectAll = 2 - - belongs_to :project - - attr_accessible :groupby - - def grouping? - case groupby - when GroupByCategory - return true - when GroupByProject - return (project_scope != ProjectCurrent) - end - return false - end - - def set_default! - self['show_desc'] = false - self['groupby'] = 1 - self['project_scope'] = 0 - self['sort_item_0'] = '' - self['sort_item_1'] = '' - self['sort_item_2'] = '' - end - - def sort_params - ary = [] - for cnt in 0...3 - prm = self["sort_item_#{cnt}"] - if (prm and !prm.empty?) - case prm - when 'project' - next if (groupby == GroupByProject or project_scope == ProjectCurrent) - when 'category' - next if (groupby == GroupByCategory) - end - ary << prm - end - end - ary.uniq - end - -end diff --git a/plugins/redmine_glossary/app/models/glossary_term.rb b/plugins/redmine_glossary/app/models/glossary_term.rb new file mode 100644 index 0000000..66608b4 --- /dev/null +++ b/plugins/redmine_glossary/app/models/glossary_term.rb @@ -0,0 +1,59 @@ +require 'csv' + +class GlossaryTerm < ActiveRecord::Base + belongs_to :category, class_name: 'GlossaryCategory', foreign_key: 'category_id' + belongs_to :project + belongs_to :author, class_name: 'User', foreign_key: 'author_id' + belongs_to :updater, class_name: 'User', foreign_key: 'updater_id' + + # class method from Redmine::Acts::Attachable::ClassMethods + acts_as_attachable view_permission: :view_glossary_terms, edit_permission: :manage_glossary_terms, + delete_permission: :manage_glossary_terms + + acts_as_event datetime: :updated_at, + description: :description, + author: nil, + title: Proc.new {|o| "#{l(:glossary_title)} ##{o.id} - #{o.name}" }, + url: Proc.new {|o| { controller: 'glossary_terms', + action: 'show', + id: o.id, + project_id: o.project } + } + + acts_as_searchable columns: [ "#{table_name}.name", "#{table_name}.description", "#{table_name}.rubi"], + preload: [:project ], + date_column: "#{table_name}.created_at", + scope: joins(:project), + permission: :view_glossary_terms + + acts_as_activity_provider scope: joins(:project), + type: 'glossary_terms', + permission: :view_glossary_terms, + timestamp: :updated_at + + scope :search_by_name, -> (keyword) { + where 'name like ?', "#{sanitize_sql_like(keyword)}%" + } + + scope :search_by_rubi, -> (keyword) { + where 'rubi like ?', "#{sanitize_sql_like(keyword)}%" + } + + def self.csv_attributes + ["name", "name_en", "datatype", "codename", "description", "rubi", "abbr_whole"] + end + + def self.import(file, project) + CSV.foreach(file.path, headers: true, encoding: "CP932:UTF-8" ) do |row| + term = new + term.attributes = row.to_hash.slice(*csv_attributes) + term.project = project + unless row["category"].blank? + term.category = GlossaryCategory.find_by(name: row["category"]) || + GlossaryCategory.create(name: row["category"], project: project) + end + term.save! + end + end + +end diff --git a/plugins/redmine_glossary/app/models/term.rb b/plugins/redmine_glossary/app/models/term.rb deleted file mode 100755 index 64d4d3d..0000000 --- a/plugins/redmine_glossary/app/models/term.rb +++ /dev/null @@ -1,149 +0,0 @@ -class Term < ActiveRecord::Base - unloadable - - belongs_to :category, :class_name => 'TermCategory', :foreign_key => 'category_id' - belongs_to :project - belongs_to :author, :class_name => 'User', :foreign_key => 'author_id' - - validates_presence_of :name, :project - validates_length_of :name, :maximum => 255 - - acts_as_attachable - - acts_as_searchable :columns => ["#{table_name}.name", "#{table_name}.description"], - :project_key => [:project] - - acts_as_event :title => Proc.new {|o| "#{l(:glossary_title)} ##{o.id}: #{o.name}" }, - :description => Proc.new {|o| "#{o.description}"}, - :datetime => :created_on, - :type => 'terms', - :url => Proc.new {|o| {:controller => 'glossary', :action => 'show', :id => o.project, :term_id => o.id} } - - attr_accessible :project_id, :category_id, :author, :name, :name_en, :datatype, :codename, :description, - :rubi, :abbr_whole - - def author - author_id ? User.find_by_id(author_id) : nil - end - - def updater - updater_id ? User.find_by_id(updater_id) : nil - end - - def project - Project.find_by_id(project_id) - end - - def datetime - (self[:created_on] != self[:updated_on]) ? self[:updated_on] : self[:created_on] - end - - def value(prmname) - case prmname - when 'project' - (project) ? project.name : "" - when 'category' - (category) ? category : "" - when 'datetime' - datetime - else - self[prmname] - end - end - - def param_to_s(prmname) - if (prmname == 'created_on' or prmname == 'updated_on') - format_time(self[prmname]) - else - value(prmname).to_s - end - end - - def <=>(term) - id <=> term.id - end - - - def self.compare_safe(a, b, &blk) - if (!a and !b) - return 0 - elsif (!a or !b) - return -1 if a - return 1 if b - end - yield(a,b) - end - - - def self.compare_by_param(prm, a, b) - case prm - when 'project' - a.project.identifier <=> b.project.identifier - when 'category' - self.compare_safe(a.category, b.category) {|acat, bcat| - acat.position <=> bcat.position - } - when 'datetime' - self.compare_safe(a.value(prm), b.value(prm)) {|aval, bval| - (aval <=> bval) * -1 - } - when 'name' - ((a.rubi.empty?) ? a.name : a.rubi) <=> ((b.rubi.empty?) ? b.name : b.rubi) - else - self.compare_safe(a.value(prm), b.value(prm)) {|aval, bval| - aval <=> bval - } - end - end - - - - def to_s - "##{id}: #{name}" - end - - def self.find_for_macro(tname, proj, all_project = false) - if proj - term = Term.find_by(:project_id => proj.id, :name => tname) - return term if term - end - return nil unless all_project - return self.find_by_name(tname) - end - - def self.default_show_params - ['name_en', 'rubi', 'abbr_whole', 'datatype', 'codename', 'project', 'category'] - end - - def self.default_searched_params - ['name', 'name_en', 'abbr_whole', 'datatype', 'codename', 'description'] - end - - def self.default_sort_params - ['id', 'name', 'name_en', 'abbr_whole', 'datatype', 'codename', 'project', 'category', - 'datetime'] - end - - def self.hidable_params - ['name_en', 'rubi', 'abbr_whole', 'datatype', 'codename'] - end - - def self.setting_params - ['name_en', 'rubi', 'abbr_whole', 'datatype', 'codename'] - end - - def self.export_params - ['id','project', - 'name', 'name_en', 'rubi', 'abbr_whole', 'category', 'datatype', 'codename', - 'author', 'updater', 'created_on', 'updated_on', - 'description'] - end - - def self.import_params - ['name', 'name_en', 'rubi', 'abbr_whole', 'category', 'datatype', 'codename', - 'description'] - end - - - -end diff --git a/plugins/redmine_glossary/app/models/term_category.rb b/plugins/redmine_glossary/app/models/term_category.rb deleted file mode 100755 index 06b86cb..0000000 --- a/plugins/redmine_glossary/app/models/term_category.rb +++ /dev/null @@ -1,29 +0,0 @@ -class TermCategory < ActiveRecord::Base - belongs_to :project - has_many :terms, :foreign_key => 'category_id', :dependent => :nullify - - acts_as_list :scope => :project_id - - attr_accessible :name, :project_id, :position - - validates_presence_of :name - validates_uniqueness_of :name, :scope => [:project_id] - - alias :destroy_without_reassign :destroy - - # Destroy the category - # If a category is specified, terms are reassigned to this category - def destroy(reassign_to = nil) - if reassign_to && reassign_to.is_a?(TermCategory) && reassign_to.project == self.project - Term.update_all("category_id = #{reassign_to.id}", "category_id = #{id}") - end - destroy_without_reassign - end - - def <=>(category) - position <=> category.position - end - - def to_s; name end - -end diff --git a/plugins/redmine_glossary/app/views/glossary/_add_term_category_modal.html.erb b/plugins/redmine_glossary/app/views/glossary/_add_term_category_modal.html.erb deleted file mode 100755 index 2838ba1..0000000 --- a/plugins/redmine_glossary/app/views/glossary/_add_term_category_modal.html.erb +++ /dev/null @@ -1,10 +0,0 @@ -

<%=l(:label_term_category_new)%>

- -<% 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), :name => nil %> - <%= submit_tag l(:button_cancel), :name => nil, :onclick => "hideModal(this);", :type => 'button' %> -

-<% end %> -<%= form if Rails::VERSION::MAJOR >= 3 %> diff --git a/plugins/redmine_glossary/app/views/glossary/_form.html.erb b/plugins/redmine_glossary/app/views/glossary/_form.html.erb deleted file mode 100755 index 4a49e8b..0000000 --- a/plugins/redmine_glossary/app/views/glossary/_form.html.erb +++ /dev/null @@ -1,38 +0,0 @@ - -

<%= f.text_field :name, :label=>t('label.name'), :size => 100, :required => true %>

- -<% for prm in Term.setting_params %> - <% if param_visible?(prm) %> -

<%= f.text_field prm, :label=>label_param(prm), :size => 100 %>

- <% end %> -<% end %> - -
-

<%= f.select :category_id, (@term_categories.collect {|c| [c.name, c.id]}), :include_blank => true %> -<% 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') %>

-<% 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') %>

-<% end %> -
-

<%= f.text_area :description, :label=>t('label.description'), - :cols => 60, - :rows => (@term.description.blank? ? 10 : [[10, @term.description.length / 50].max, 100].min), - :accesskey => accesskey(:edit), - :class => 'wiki-edit' %>

- - - -

-

<%= render :partial => 'attachments/form' %>

- -<%= wikitoolbar_for 'term_description' %> diff --git a/plugins/redmine_glossary/app/views/glossary/_index_in_category.html.erb b/plugins/redmine_glossary/app/views/glossary/_index_in_category.html.erb deleted file mode 100755 index f57bde3..0000000 --- a/plugins/redmine_glossary/app/views/glossary/_index_in_category.html.erb +++ /dev/null @@ -1,31 +0,0 @@ - - - - -<% for prm in @show_params %> - -<% end %> - - - - -<% for term in index_in_category -%> - term"> - - -<% for prm in @show_params %> - -<% end %> - - - - -<% end %> - -
#<%=h t('label.name') %><%=h label_param(prm) %><%=h l(:field_description)%>
<%=h term.id %><%= term_link(term) %><%=h term.value(prm) %><% @paragraphs = Nokogiri::HTML.parse(term.description).css('p') %><%=textilizable @paragraphs.first.inner_html + (@paragraphs.size > 1 ? '

' : '') %>
- <% 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 %> -
-
diff --git a/plugins/redmine_glossary/app/views/glossary/_show_all_in_category.html.erb b/plugins/redmine_glossary/app/views/glossary/_show_all_in_category.html.erb deleted file mode 100755 index 7c542ca..0000000 --- a/plugins/redmine_glossary/app/views/glossary/_show_all_in_category.html.erb +++ /dev/null @@ -1,9 +0,0 @@ - -<% for term in show_all_in_category -%> -
-

<%= term_link(term) %>

-<%= render(:partial => "glossary/show_one", :object => term) %> - -
-<% end %> -
diff --git a/plugins/redmine_glossary/app/views/glossary/_show_one.html.erb b/plugins/redmine_glossary/app/views/glossary/_show_one.html.erb deleted file mode 100755 index 2caa03f..0000000 --- a/plugins/redmine_glossary/app/views/glossary/_show_one.html.erb +++ /dev/null @@ -1,21 +0,0 @@ - -<% term = show_one %> -<% if @show_params.size > 1 %> - -<% for prm in @show_params %> -<% unless term.value(prm).blank? %><% end %> -<% end %> -
<%=h label_param(prm) %>:<%= term.value(prm) %>
-<% end %> -<% unless (term.description.empty?) %> -<% if @show_params.size > 1 %><%= l(:field_description) %>:<% end %> -
-<%= textilizable term, :description, :attachments => term.attachments %> -
- -<% if term.attachments.any? %> - <%= (@is_index) ? "" : '
' %> - <%= link_to_attachments term %> -<% end %> -<% end %> - diff --git a/plugins/redmine_glossary/app/views/glossary/_sidebar.html.erb b/plugins/redmine_glossary/app/views/glossary/_sidebar.html.erb deleted file mode 100755 index 51a2d38..0000000 --- a/plugins/redmine_glossary/app/views/glossary/_sidebar.html.erb +++ /dev/null @@ -1,44 +0,0 @@ - -<% if User.current.allowed_to?(:view_terms, @project, :global => true) %> -

<%= l(:label_view) %>

- <%= render(:partial => "glossary_styles/form", - :object => @view_style) %> -
-<% end %> - - -<% if User.current.allowed_to?(:manage_terms, @project, :global => true) %> -

<%= l(:label_term) %>

- <%= link_to(l(:label_term_new), {:controller => 'glossary', :action => 'new', :project_id => @project}, :class => 'icon icon-add') %> -
-<% if (Term.find_by(:project_id => @project.id)) %> - <%= link_to_if_authorized(l(:label_move_all_terms), {:controller => 'glossary', :action => 'move_all', :project_id => @project}, :class => 'icon icon-move') %> -
-<% end %> - <%= link_to(l(:label_glossary_import_csv), {:controller => 'glossary', :action => 'import_csv', :project_id => @project}, :id => 'glossary_import_csv') %> -
-<% end %> - - -<% if User.current.allowed_to?(:manage_term_categories, @project, :global => true) %> -

<%= l(:label_term_category) %>

- <%= link_to(l(:label_term_category_new), {:controller => 'glossary', :action => 'add_term_category', :project_id => @project}, :class => 'icon icon-add') %> -
- <%= link_to(l(:label_manage_term_category), { :controller => 'term_categories', :action => 'index', :project_id => @project }, :id => 'glossary_term_categories') %> -
-<% end %> - - -<% if User.current.allowed_to?(:view_terms, @project, :global => true) %> -

<%= l(:label_glossary_style_index) %>

- -<% if params[:search_index_ch] %> -
- <%= link_to_if_authorized(l(:button_clear), {:controller => 'glossary', :action => 'index_clear', :project_id => @project}, :class => 'icon icon-reload') %> -
-<% end %> - <%= search_index_table(l(:index_ary_en), l(:index_ary_en_sep_cnt), @project, 'en') %> -
- <%= search_index_table(l(:index_ary), l(:index_ary_sep_cnt), @project) %> -
-<% end %> diff --git a/plugins/redmine_glossary/app/views/glossary/_view_term.html.erb b/plugins/redmine_glossary/app/views/glossary/_view_term.html.erb deleted file mode 100755 index a57fd5e..0000000 --- a/plugins/redmine_glossary/app/views/glossary/_view_term.html.erb +++ /dev/null @@ -1,10 +0,0 @@ - -<% content_for :sidebar do %> - <%= render :partial => 'glossary/sidebar' %> -<% end %> - -<% content_for :header_tags do %> - <%= stylesheet_link_tag 'glossary', :plugin => 'redmine_glossary' %> -<% end %> - -<% html_title(l(:glossary_title)) -%> diff --git a/plugins/redmine_glossary/app/views/glossary/add_term_category.html.erb b/plugins/redmine_glossary/app/views/glossary/add_term_category.html.erb deleted file mode 100755 index ca6a63c..0000000 --- a/plugins/redmine_glossary/app/views/glossary/add_term_category.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -

<%=l(:label_term_category_new)%>

- -<% 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)) -%> diff --git a/plugins/redmine_glossary/app/views/glossary/add_term_category.js.erb b/plugins/redmine_glossary/app/views/glossary/add_term_category.js.erb deleted file mode 100755 index 2c66a75..0000000 --- a/plugins/redmine_glossary/app/views/glossary/add_term_category.js.erb +++ /dev/null @@ -1,2 +0,0 @@ -$('#ajax-modal').html('<%= escape_javascript(render :partial => 'glossary/add_term_category_modal') %>'); -showModal('ajax-modal', '600px'); diff --git a/plugins/redmine_glossary/app/views/glossary/edit.html.erb b/plugins/redmine_glossary/app/views/glossary/edit.html.erb deleted file mode 100755 index ef1091c..0000000 --- a/plugins/redmine_glossary/app/views/glossary/edit.html.erb +++ /dev/null @@ -1,29 +0,0 @@ -

<%= l(:label_term) %> #<%= @term.id %>

- -<% form = labelled_form_for @term, :as => :term, - :url => {:action => 'edit', :project_id => @project, :id => @term}, - :html => {:class => 'tabular', :multipart => true, :id => 'term-form'} do |f| %> - <%= error_messages_for 'term' %> -
- <%= render :partial => 'glossary/form', :locals => {:f => f} %> -
- <%= submit_tag l(:button_edit) %> - <% 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 %> - -
- -<% html_title(l(:glossary_title)) -%> diff --git a/plugins/redmine_glossary/app/views/glossary/import_csv.html.erb b/plugins/redmine_glossary/app/views/glossary/import_csv.html.erb deleted file mode 100755 index 687d1f2..0000000 --- a/plugins/redmine_glossary/app/views/glossary/import_csv.html.erb +++ /dev/null @@ -1,57 +0,0 @@ -

<%=h l(:label_glossary_import_csv) %>

- - -<% form = form_tag({:controller => 'glossary', :action => 'import_csv_exec', :project_id=>@project}, - {:multipart => true}) do %> - -<%= l(:label_csv_file) %> -<%= file_field_tag 'import_file', :accept => 'text/csv', :size => '60%' %> -
-
-<% encs = l(:in_encoding_candidates) - if (encs and encs.is_a?(Array) and !encs.empty?) - enc_options = [] - encs.each {|enc| - enc_options << enc - } - %> - <%=h l(:label_file_encoding) %> - <%= select_tag("in_encoding", options_for_select(enc_options)) %> -
-<% end %> - - -
- -
- -<% - name_options = [] - options = [""] - for num in 1 ... 30 - name_options << num - options << num - end -%> -
-<%= l(:label_import_items) %> - - - -<% CsvGlossaryImportInfo.default_param_cols {|prm, col| %> - -<% } %> -
<%=h l(:label_item) %><%=h l(:label_column) %>
<%=h label_param(prm) %> -<%= select_tag("colno_#{prm}", - options_for_select((prm == 'name') ? name_options : options, col)) %> -
-* <%=h l(:message_import_item) %> -
-
- -<%= submit_tag(l(:label_import)) %> -<% end %> -<%= form if Rails::VERSION::MAJOR >= 3 %> - -<% html_title(l(:glossary_title)) -%> diff --git a/plugins/redmine_glossary/app/views/glossary/import_csv_exec.html.erb b/plugins/redmine_glossary/app/views/glossary/import_csv_exec.html.erb deleted file mode 100755 index 6224ebd..0000000 --- a/plugins/redmine_glossary/app/views/glossary/import_csv_exec.html.erb +++ /dev/null @@ -1,13 +0,0 @@ -

<%=h l(:label_csv_import_finished) %>

- - - - - - - -
<%=h l(:label_csv_file) %> : -<%=h (@import_info.import_file) ? @import_info.import_file.original_filename : "" %> -
<%=h l(:label_create_category_num) %> : <%= @import_info.cat_num %>
<%=h l(:label_create_term_num) %> : <%= @import_info.newterm_num %>
<%=h l(:label_update_term_num) %> : <%= @import_info.upterm_num %>
- -<%= render :partial => 'glossary/view_term' %> diff --git a/plugins/redmine_glossary/app/views/glossary/index.html.erb b/plugins/redmine_glossary/app/views/glossary/index.html.erb deleted file mode 100755 index de8fcb9..0000000 --- a/plugins/redmine_glossary/app/views/glossary/index.html.erb +++ /dev/null @@ -1,42 +0,0 @@ - -
- <%= link_to_if_authorized(l(:label_term_new), {:controller => 'glossary', :action => 'new', :project_id => @project}, :class => 'icon icon-add') %> -
- -<% -subtitle = "" -if params[:search_index_ch] - subtitlle = "- #{params[:search_index_ch]} -" -end %> - -

<%= t('glossary_title') %> <%= subtitlle %>

- -
-<% if User.current.allowed_to?(:view_terms, @project, :global => true) %> - <%= render(:partial => "glossary_styles/search") %> -
-<% end %> - -<% tempname = "glossary/#{@glossary_style.show_desc ? 'show_all' : 'index'}_in_category" %> -<% unless @terms.empty? %> - <% if @glossary_style.grouping? %> - <% list_number = 1 %> - <% @terms.each do |gterms| %> -

<%= "#{list_number}. #{gterms.name}" %>

- <% list_number += 1 %> - <%= render(:partial => tempname, :object => gterms.ary) %> - <% end %> - <% else %> - <%= render(:partial => tempname, :object => @terms) %> - <% end %> - - <% other_formats_links do |f| %> - <%= f.link_to 'CSV', :url => params %> - <% end %> - -<% else %> -

<%= l(:label_no_data) %>

-<% end %> - - -<%= render :partial => 'glossary/view_term' %> diff --git a/plugins/redmine_glossary/app/views/glossary/move_all.html.erb b/plugins/redmine_glossary/app/views/glossary/move_all.html.erb deleted file mode 100755 index 60cfad6..0000000 --- a/plugins/redmine_glossary/app/views/glossary/move_all.html.erb +++ /dev/null @@ -1,22 +0,0 @@ -

<%= l(:label_move_all_terms) %>

- -<% if params[:new_project_id] %> - -<% elsif @allowed_projs.blank? %> -
-<%= simple_format(l(:error_no_movement_project)) %> -
-<% else %> -<% form = form_tag({:project_id => @project}, :id => 'move_all_form') do %> - -
-

-<%= select_tag "new_project_id", - project_tree_options_for_select(@allowed_projs) %> -

-
-<%= submit_tag l(:button_move) %> -<% end %> -<%= form if Rails::VERSION::MAJOR >= 3 %> -<% end %> - diff --git a/plugins/redmine_glossary/app/views/glossary/new.html.erb b/plugins/redmine_glossary/app/views/glossary/new.html.erb deleted file mode 100755 index 70c2fd8..0000000 --- a/plugins/redmine_glossary/app/views/glossary/new.html.erb +++ /dev/null @@ -1,30 +0,0 @@ -

<%=l(:label_term_new)%>

- -<% 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' %> -
- <%= render :partial => 'glossary/form', :locals => {:f => f} %> -
- <%= submit_tag l(:button_create) %> - <%= submit_tag l(:button_create_and_continue), :name => 'continue' %> - <% 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 %> - -
- -<% html_title(l(:glossary_title)) -%> diff --git a/plugins/redmine_glossary/app/views/glossary/show.html.erb b/plugins/redmine_glossary/app/views/glossary/show.html.erb deleted file mode 100755 index a7bbd33..0000000 --- a/plugins/redmine_glossary/app/views/glossary/show.html.erb +++ /dev/null @@ -1,29 +0,0 @@ -
-<%= link_to_if_authorized(l(:button_edit), {:controller => 'glossary', :action => 'edit', :project_id => @project, :id => @term}, :class => 'icon icon-edit', :accesskey => accesskey(:edit)) %> -<%= link_to_if_authorized l(:button_delete), {:controller => 'glossary', :action => 'destroy', :project_id => @project, :id => @term}, :confirm => l(:text_are_you_sure), :method => :post, :class => 'icon icon-del' %> -
- -

<%= l(:label_term) %> #<%= @term.id %>

- -
- -

<%=h @term.name %>

-<%= render(:partial => "glossary/show_one", :object => @term) %> - -

-<%= authoring @term.created_on, @term.author %>. -<% if @term.created_on != @term.updated_on - if (@term.author_id == @term.updater_id) %> - <%= l(:label_updated_time, time_tag(@term.updated_on)).html_safe + '.' %> -<% else %> - <%= updated_by(@term.updated_on, @term.updater) + '.' %> -<% end %> -<% end %> -

- -
- - -<%= render :partial => 'glossary/view_term' %> - -<% html_title "##{@term.id}: #{@term.name}" -%> diff --git a/plugins/redmine_glossary/app/views/glossary_categories/_form.html.erb b/plugins/redmine_glossary/app/views/glossary_categories/_form.html.erb new file mode 100644 index 0000000..9d6d0ba --- /dev/null +++ b/plugins/redmine_glossary/app/views/glossary_categories/_form.html.erb @@ -0,0 +1,3 @@ +
+

<%= form.text_field :name, size: 60, required: true %>

+
diff --git a/plugins/redmine_glossary/app/views/glossary_categories/edit.html.erb b/plugins/redmine_glossary/app/views/glossary_categories/edit.html.erb new file mode 100644 index 0000000..1a23b57 --- /dev/null +++ b/plugins/redmine_glossary/app/views/glossary_categories/edit.html.erb @@ -0,0 +1,7 @@ +

<%=l :label_glossary_category %> $<%= @category.id %>

+ +<%= labelled_form_for :glossary_category, @category, +url: project_glossary_category_path do |f| %> + <%= render partial: 'glossary_categories/form', locals: {form: f} %> + <%= f.submit l(:button_edit) %> +<% end %> diff --git a/plugins/redmine_glossary/app/views/glossary_categories/index.html.erb b/plugins/redmine_glossary/app/views/glossary_categories/index.html.erb new file mode 100644 index 0000000..e9b6657 --- /dev/null +++ b/plugins/redmine_glossary/app/views/glossary_categories/index.html.erb @@ -0,0 +1,43 @@ +

<%=l :label_glossary_categories %>

+ +
+ <%= link_to_if_authorized l(:label_glossary_category_new), + { controller: :glossary_categories, action: :new, project_id: @project }, + class: 'icon icon-add' %> +
+ +<%= render partial: 'glossary_terms/sidebar' %> + + + + + + + + + + <% @categories.each do |category| %> + + + + + + <% end %> + +
#<%=l :field_name %> +
<%= category.id %><%= link_to category.name, [@project, category] %> + <%= reorder_handle(category, url: project_glossary_category_path(@project, category)) %> + <%= link_to_if_authorized l(:button_edit), { + controller: :glossary_categories, action: :edit, id: category, + project_id: @project + }, class: 'icon icon-edit' %> + <%= link_to_if_authorized l(:button_delete), { + controller: :glossary_categories, action: :destroy, id: category, + project_id: @project + }, method: :delete, data: {confirm: l(:text_are_you_sure)}, + class: 'icon icon-del' %> +
+ +<%= javascript_tag do %> + $(function() { $("table.table-sortable tbody").positionedItems(); }); +<% end %> diff --git a/plugins/redmine_glossary/app/views/glossary_categories/new.html.erb b/plugins/redmine_glossary/app/views/glossary_categories/new.html.erb new file mode 100644 index 0000000..8cae7ef --- /dev/null +++ b/plugins/redmine_glossary/app/views/glossary_categories/new.html.erb @@ -0,0 +1,7 @@ +

<%=l :label_glossary_category_new %>

+ +<%= labelled_form_for :glossary_category, @category, +url: project_glossary_categories_path do |f| %> + <%= render partial: 'glossary_categories/form', locals: {form: f} %> + <%= f.submit l(:button_create) %> +<% end %> diff --git a/plugins/redmine_glossary/app/views/glossary_categories/show.html.erb b/plugins/redmine_glossary/app/views/glossary_categories/show.html.erb new file mode 100644 index 0000000..abea1a7 --- /dev/null +++ b/plugins/redmine_glossary/app/views/glossary_categories/show.html.erb @@ -0,0 +1,17 @@ +
+ <%= link_to_if_authorized l(:button_edit), + { controller: :glossary_categories, action: :edit, project_id: @project }, + class: 'icon icon-edit' %> + <%= link_to_if_authorized l(:button_delete), + { controller: :glossary_categories, action: :destroy, + id: @category, project_id: @project }, + method: :delete, data: {confirm: l(:text_are_you_sure)}, class: 'icon icon-del' %> +
+ +<%= render partial: 'glossary_terms/sidebar' %> + +

<%=l :label_glossary_category %> #<%=@category.id %>

+ +

<%= @category.name %>

+ + diff --git a/plugins/redmine_glossary/app/views/glossary_styles/_form.html.erb b/plugins/redmine_glossary/app/views/glossary_styles/_form.html.erb deleted file mode 100755 index 62175a7..0000000 --- a/plugins/redmine_glossary/app/views/glossary_styles/_form.html.erb +++ /dev/null @@ -1,46 +0,0 @@ - -<% urlopts = {:controller => 'glossary_styles', :action => 'edit', - :project_id => @project, - :glossary_style_id => @glossary_style.id} - add_search_params(urlopts) - form = form_for @glossary_style, :url => urlopts do |f| %> - - -<%=h l(:label_project) %> -<%= - options = [] - options << [l(:label_glossary_style_project_current), GlossaryStyle::ProjectCurrent] - options << [l(:label_glossary_style_project_mine), GlossaryStyle::ProjectMine] if User.current.logged? - options << [l(:label_glossary_style_project_all), GlossaryStyle::ProjectAll] - f.select('project_scope', options) -%> - - -
<%= l(:label_grouping) %> -<% group_labels = [:label_none, :field_category, :label_project] %> -<% for gby in [GlossaryStyle::GroupByNone, - GlossaryStyle::GroupByCategory, - GlossaryStyle::GroupByProject] %> - -<% end %> -
- - -
<%= l(:label_sort) %> -<% for cnt in 0...2 %> - <%= cnt+1 %> : <%= params_select(f, "sort_item_#{cnt}", default_sort_params) %>
-<% end %> -
- - - - -
- -<%= submit_tag l(:label_view) %> -<%= submit_tag l(:button_clear), :name => 'clear' %> - -<% end %> -<%= form if Rails::VERSION::MAJOR >= 3 %> diff --git a/plugins/redmine_glossary/app/views/glossary_styles/_search.html.erb b/plugins/redmine_glossary/app/views/glossary_styles/_search.html.erb deleted file mode 100755 index d50fbd1..0000000 --- a/plugins/redmine_glossary/app/views/glossary_styles/_search.html.erb +++ /dev/null @@ -1,46 +0,0 @@ - -<% 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 %> - - -<% end %> -<%= form if Rails::VERSION::MAJOR >= 3 %> - diff --git a/plugins/redmine_glossary/app/views/glossary_styles/edit.html.erb b/plugins/redmine_glossary/app/views/glossary_styles/edit.html.erb deleted file mode 100755 index 4d3d106..0000000 --- a/plugins/redmine_glossary/app/views/glossary_styles/edit.html.erb +++ /dev/null @@ -1 +0,0 @@ -

GlossaryStyles#edit

diff --git a/plugins/redmine_glossary/app/views/glossary_terms/_form.html.erb b/plugins/redmine_glossary/app/views/glossary_terms/_form.html.erb new file mode 100644 index 0000000..280e6a4 --- /dev/null +++ b/plugins/redmine_glossary/app/views/glossary_terms/_form.html.erb @@ -0,0 +1,19 @@ +
+

<%= form.text_field :name, size: 80, required: true %>

+

<%= form.text_field :name_en, size: 80 %>

+

<%= form.text_field :rubi, size: 80 %>

+

<%= form.text_field :abbr_whole, size: 80 %>

+

<%= form.text_field :datatype, size: 80 %>

+

<%= form.text_field :codename, size: 80 %>

+

<%= form.select :category_id, GlossaryCategory.pluck(:name, :id), include_blank: true %>

+

<%= form.text_area :description, rows: 10, class: 'wiki-edit', required: false %>

+
+ +
+

+ + <%= render partial: 'attachments/form' %> +

+
+ +<%= wikitoolbar_for 'glossary_term_description' %> diff --git a/plugins/redmine_glossary/app/views/glossary_terms/_index_terms.html.erb b/plugins/redmine_glossary/app/views/glossary_terms/_index_terms.html.erb new file mode 100644 index 0000000..81015f8 --- /dev/null +++ b/plugins/redmine_glossary/app/views/glossary_terms/_index_terms.html.erb @@ -0,0 +1,28 @@ + + + + + + + + + + + <% terms.each do |term| %> + + + + + + + <% end %> + +
#<%=l :field_name %><%=l :field_category %><%=l :field_description %>
+ <%= term.id %> + + <%= link_to term.name, [@project, term] %> + + <%= term.category.try!(:name) %> + + <%= term.description %> +
diff --git a/plugins/redmine_glossary/app/views/glossary_terms/_sidebar.html.erb b/plugins/redmine_glossary/app/views/glossary_terms/_sidebar.html.erb new file mode 100644 index 0000000..c9aa6d9 --- /dev/null +++ b/plugins/redmine_glossary/app/views/glossary_terms/_sidebar.html.erb @@ -0,0 +1,61 @@ +<% content_for :sidebar do %> +

<%=l :label_view %>

+ + <%= form_with url: project_glossary_terms_path, method: :get, local: true do |form| %> +
+ <%=l :label_grouping %> + <%= form.radio_button :grouping, 1, checked: @grouping == '1' ? 'checked' : nil %> + <%= form.label :grouping, l(:label_categorized), vaule: 1 %> + <%= form.radio_button :grouping, 0, checked: @grouping == '0' ? 'checked' : nil %> + <%= form.label :grouping, l(:label_not_categorized), value: 0 %> +
+ <%= form.submit l(:label_view) %> + <% end %> + +

<%=l :label_glossary_term %>

+

<%= link_to_if_authorized l(:label_glossary_term_new), + { controller: :glossary_terms, action: :new, project_id: @project }, + class: 'icon icon-add' %>

+ + + +

<%=l :label_glossary_category %>

+

<%= link_to_if_authorized l(:label_glossary_category_new), + { controller: :glossary_categories, action: :new, project_id: @project}, + class: 'icon icon-add' %>

+ +

<%= link_to l(:label_glossary_categories), + project_glossary_categories_path %>

+ +

<%=l :label_glossary_index %>

+ + <% l(:index_en).each_line do |line| %> + + <% line.split(" ").each do |ch| %> + + <% end %> + + <% end %> +
<%= link_to ch, project_glossary_terms_path(index: ch) %>
+ + <% l(:index_rubi).each_line do |line| %> + + <% line.split(" ").each do |char| %> + + <% end %> + + <% end %> +
+ <%= link_to char, project_glossary_terms_path(index_rubi: char) %> +
+<% end %> diff --git a/plugins/redmine_glossary/app/views/glossary_terms/edit.html.erb b/plugins/redmine_glossary/app/views/glossary_terms/edit.html.erb new file mode 100644 index 0000000..aff08cc --- /dev/null +++ b/plugins/redmine_glossary/app/views/glossary_terms/edit.html.erb @@ -0,0 +1,6 @@ +

<%=l :label_glossary_term %> #<%= @term.id %>

+ +<%= labelled_form_for :glossary_term, @term, url: project_glossary_term_path, html: {multipart: true, id: 'term-form'} do |f| %> + <%= render partial: 'glossary_terms/form', locals: {form: f} %> + <%= f.submit l(:button_edit) %> +<% end %> diff --git a/plugins/redmine_glossary/app/views/glossary_terms/index.csv.ruby b/plugins/redmine_glossary/app/views/glossary_terms/index.csv.ruby new file mode 100644 index 0000000..9a28b58 --- /dev/null +++ b/plugins/redmine_glossary/app/views/glossary_terms/index.csv.ruby @@ -0,0 +1,19 @@ +require 'csv' + +CSV.generate(row_sep: "\r\n", encoding: "CP932") do |csv| + column_names = ["name", "name_en", "category", "datatype", "codename", "description", "rubi", "abbr_whole"] + csv << column_names + @glossary_terms.each do |term| + column_values = [ + term.name, + term.name_en, + term.category&.name, + term.datatype, + term.codename, + term.description, + term.rubi, + term.abbr_whole + ] + csv << column_values + end +end diff --git a/plugins/redmine_glossary/app/views/glossary_terms/index.html.erb b/plugins/redmine_glossary/app/views/glossary_terms/index.html.erb new file mode 100644 index 0000000..20056e3 --- /dev/null +++ b/plugins/redmine_glossary/app/views/glossary_terms/index.html.erb @@ -0,0 +1,28 @@ +

<%=l :label_glossary_terms %>

+ +
+ <%= link_to_if_authorized l(:label_glossary_term_new), + { controller: :glossary_terms, action: :new, project_id: @project }, + class: 'icon icon-add' %> +
+ +<%= render partial: 'sidebar' %> + +<% if @grouping == '1' %> + <% categorized_terms = @glossary_terms.reject { |t| t.category_id.nil? } %> + <% uncategorized_terms = @glossary_terms.where(category_id: nil) %> + + <% categorized_terms.group_by(&:category).each do |category, terms| %> +

<%= category.name %>

+ <%= render partial: 'index_terms', locals: {terms: terms} %> + <% end %> + +

<%=l :label_not_categorized %>

+ <%= render 'index_terms', terms: uncategorized_terms %> +<% else %> + <%= render 'index_terms', terms: @glossary_terms %> +<% end %> + +<% other_formats_links do |f| %> + <%= f.link_to_with_query_parameters 'CSV' %> +<% end %> diff --git a/plugins/redmine_glossary/app/views/glossary_terms/new.html.erb b/plugins/redmine_glossary/app/views/glossary_terms/new.html.erb new file mode 100644 index 0000000..cee8c15 --- /dev/null +++ b/plugins/redmine_glossary/app/views/glossary_terms/new.html.erb @@ -0,0 +1,11 @@ +

<%=l :label_glossary_term_new %>

+ +<%= labelled_form_for :glossary_term, @term, +url: project_glossary_terms_path, html: {multipart: true, id: 'term-form'} do |f| %> + <%= render partial: 'glossary_terms/form', locals: {form: f} %> + <%= f.submit l(:button_create) %> +<% end %> + +
+ + diff --git a/plugins/redmine_glossary/app/views/glossary_terms/show.html.erb b/plugins/redmine_glossary/app/views/glossary_terms/show.html.erb new file mode 100644 index 0000000..53d9156 --- /dev/null +++ b/plugins/redmine_glossary/app/views/glossary_terms/show.html.erb @@ -0,0 +1,63 @@ +<% content_for :header_tags do %> + <%= stylesheet_link_tag 'glossary', plugin: 'redmine_glossary' %> +<% end %> + +
+ <%= link_to_if_authorized l(:button_edit), + { controller: :glossary_terms, action: :edit, project_id: @project }, + class: 'icon icon-edit' %> + <%= link_to_if_authorized l(:button_delete), + { controller: :glossary_terms, action: :destroy, + id: @term, project_id: @project }, + method: :delete, data: {confirm: l(:text_are_you_sure)}, class: 'icon icon-del' %> +
+ +<%= render partial: 'sidebar' %> + +

<%=l :label_glossary_term %> #<%= @term.id %>

+ +

<%= @term.name %>

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
<%=l :field_name_en %>:<%= @term.name_en %>
<%=l :field_rubi %>:<%= @term.rubi %>
<%=l :field_abbr_whole %>:<%= @term.abbr_whole %>
<%=l :field_datatype %>:<%= @term.datatype %>
<%=l :field_codename %>:<%= @term.codename %>
<%=l :field_category %>:<%= @term.category.try!(:name) %> +
<%=l :field_description %>:
<%= textilizable @term, :description %>
<%=l :field_created_on %>:<%= format_time(@term.created_at) %>
<%=l :field_updated_on %>:<%= format_time(@term.updated_at) %>
+ +<%= render partial: 'attachments/links', +locals: {attachments: @term.attachments, + options: {deletable: User.current.allowed_to?(:manage_glossary_terms, @project)} +}%> diff --git a/plugins/redmine_glossary/app/views/settings/_glossary_settings.html.erb b/plugins/redmine_glossary/app/views/settings/_glossary_settings.html.erb deleted file mode 100755 index 97fc58b..0000000 --- a/plugins/redmine_glossary/app/views/settings/_glossary_settings.html.erb +++ /dev/null @@ -1,12 +0,0 @@ - -

<%= t('label_hide_item') %>

- -<% for item in Term.hidable_params %> - <% name = "hide_item_#{item}" %> - -<% end %> -
- <%= check_box_tag("settings[#{name}]", 1, @settings[name]) %> - - <%= t("label.#{item}") %> -
diff --git a/plugins/redmine_glossary/app/views/term_categories/_form.html.erb b/plugins/redmine_glossary/app/views/term_categories/_form.html.erb deleted file mode 100755 index d843f74..0000000 --- a/plugins/redmine_glossary/app/views/term_categories/_form.html.erb +++ /dev/null @@ -1,5 +0,0 @@ -<%= error_messages_for 'category' %> - -
-

<%= f.text_field :name, :size => 30, :required => true %>

-
diff --git a/plugins/redmine_glossary/app/views/term_categories/destroy.html.erb b/plugins/redmine_glossary/app/views/term_categories/destroy.html.erb deleted file mode 100755 index f7f1b53..0000000 --- a/plugins/redmine_glossary/app/views/term_categories/destroy.html.erb +++ /dev/null @@ -1,19 +0,0 @@ -

<%=l(:label_term_category)%>: <%=h @category.name %>

- -<% form = form_tag({}) do %> -
-

<%= l(:text_term_category_destroy_question, :value => @term_count) %>

-


-<% if @categories.size > 0 %> -: -<%= select_tag 'reassign_to_id', options_from_collection_for_select(@categories, 'id', 'name') %>

-<% end %> -<%= hidden_field_tag 'id', @category.id %> -
- -<%= 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)) -%> diff --git a/plugins/redmine_glossary/app/views/term_categories/edit.html.erb b/plugins/redmine_glossary/app/views/term_categories/edit.html.erb deleted file mode 100755 index 3e21c1c..0000000 --- a/plugins/redmine_glossary/app/views/term_categories/edit.html.erb +++ /dev/null @@ -1,9 +0,0 @@ -

<%=l(:label_term_category)%>

- -<% 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)) -%> diff --git a/plugins/redmine_glossary/app/views/term_categories/index.html.erb b/plugins/redmine_glossary/app/views/term_categories/index.html.erb deleted file mode 100755 index 5e6ddf7..0000000 --- a/plugins/redmine_glossary/app/views/term_categories/index.html.erb +++ /dev/null @@ -1,44 +0,0 @@ -
- <%= link_to_if_authorized(l(:label_term_category_new), {:controller => 'glossary', :action => 'add_term_category', :project_id => @project}, :class => 'icon icon-add') %> -
- - -

<%= l(:label_term_category) %>

- -<% if @categories.any? %> - - - - - - - - - - <% for category in @categories %> - <% unless category.new_record? %> - - - - - - - - <% end %> - <% end %> - -
#<%= l(:field_name) %><%= l(:field_term_counts_under_category) %>
<%=category.position%><%=h(category.name) %><%=h(category.terms.size) %> - <% if authorize_for("term_categories", "edit") %> - <%= link_to image_tag('2uparrow.png', :alt => l(:label_sort_highest)), {:controller => 'term_categories', :action => 'change_order', :project_id => @project, :id => category, :position => 'highest'}, :method => :post, :title => l(:label_sort_highest) %> - <%= link_to image_tag('1uparrow.png', :alt => l(:label_sort_higher)), {:controller => 'term_categories', :action => 'change_order', :project_id => @project, :id => category, :position => 'higher'}, :method => :post, :title => l(:label_sort_higher) %> - - <%= link_to image_tag('1downarrow.png', :alt => l(:label_sort_lower)), {:controller => 'term_categories', :action => 'change_order', :project_id => @project, :id => category, :position => 'lower'}, :method => :post, :title => l(:label_sort_lower) %> - <%= link_to image_tag('2downarrow.png', :alt => l(:label_sort_lowest)), {:controller => 'term_categories', :action => 'change_order', :project_id => @project, :id => category, :position => 'lowest'}, :method => :post, :title => l(:label_sort_lowest) %> - <% end %> - - <%= 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)) %>
-<% else %> -

<%= l(:label_no_data) %>

-<% end %> - -<%= render :partial => 'glossary/view_term' %> diff --git a/plugins/redmine_glossary/assets/images/termlink.png b/plugins/redmine_glossary/assets/images/termlink.png deleted file mode 100755 index 721cd0c..0000000 Binary files a/plugins/redmine_glossary/assets/images/termlink.png and /dev/null differ diff --git a/plugins/redmine_glossary/assets/stylesheets/glossary.css b/plugins/redmine_glossary/assets/stylesheets/glossary.css index f2b1802..3311cff 100755 --- a/plugins/redmine_glossary/assets/stylesheets/glossary.css +++ b/plugins/redmine_glossary/assets/stylesheets/glossary.css @@ -1,4 +1,4 @@ - -table.term_items th { text-align:right;vertical-align=top } -table.list th { text-align:left } -table.list td { text-align:left } +table.term th { + text-align: right; + vertical-align: top; +} diff --git a/plugins/redmine_glossary/assets/stylesheets/termlink.css b/plugins/redmine_glossary/assets/stylesheets/termlink.css deleted file mode 100755 index f7117a7..0000000 --- a/plugins/redmine_glossary/assets/stylesheets/termlink.css +++ /dev/null @@ -1,3 +0,0 @@ -.jstb_termlink { - background-image: url('../images/termlink.png'); -} diff --git a/plugins/redmine_glossary/config/locales/de.yml b/plugins/redmine_glossary/config/locales/de.yml deleted file mode 100755 index 6ffb4ed..0000000 --- a/plugins/redmine_glossary/config/locales/de.yml +++ /dev/null @@ -1,104 +0,0 @@ -# German strings go here for Rails i18n -# Initial version: 2011/09/08 -# Author: Frank Holznagel -de: - project_module_glossary: Glossar - permission_view_terms: Glossar anzeigen - permission_manage_terms: Glossar bearbeiten - permission_manage_term_categories: Glossarkategorien bearbeiten - - glossary_title: Glossar - label: - id: Nr. - name: Begriff - name_en: Englisch - category: Kategorie - datatype: "Datentyp im Programmcode" - codename: "Abk村rzung im Programmcode" - description: Beschreibung - rubi: Ruby - abbr_whole: "Ausgeschriebener Begriff (bei Abk村rzungen)" - label_updater: Updater - label_term_plural: Glossare - - label_manage: Verwalten - label_manage_term_category: Kategorien verwalten - label_not_categorized: ohne Zuordnung - - label_view: Ansicht - label_style: Stil - - label_term: Begriff - label_term_new: Neuer Begriff - label_index: Listenansicht - - label_grouping: Gruppierung - label_glossary_style_show_desc: Beschreibungen anzeigen - label_glossary_style_all_project: Alle Projekte - - label_glossary_style_project_current: Aktuelles - label_glossary_style_project_mine: Meine - label_glossary_style_project_all: Alle - - label_latest: Letzte - label_indays: Tage - - label_glossary_style_index: Index - - label_import: Importieren - label_glossary_import_csv: Aus einer CSV-Datei importieren - label_csv_file: CSV-Datei - label_csv_import_is_first_comment: die erste Zeile der Datei beim Einlesen ignorieren - label_import_items: Elemente zu Spalten zuordnen - label_item: Element - label_column: Spalte - message_import_item: Als Projekt und Benutzer f村r die importierten Begriffe werden die aktuellen Einstellungen verwendet. - label_csv_import_finished: Der CSV-Datenimport wurde erfolgreich beendet - error_import_failed: Konnte den CSV-Datenimport nicht ausf村hren - label_create_category_num: Anzahl der neu erstellten Kategorien - label_create_term_num: Anzahl der neu erstellten Begriffe - label_update_term_num: Anzahl der aktualisierten Begriffe - label_file_encoding: Zeichensatz der Datei (File encoding) - label_movement_project: Zielprojekt f村r das Verschieben - label_move_all_terms: Alle Begriffe verschieben - - label_term_category: Begriffskategorie - label_term_category_new: Neue Kategorie - - 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_assignments: Kategoriezuordnung entfernen - text_term_category_reassign_to: Kategoriezuordnung 造ndern zu - - label_hide_item: Verstecke folgende Elemente - label_tag_termlink: Link zu einem Begriff - - notice_glossary_style_create_f: Konnte die Stil-Daten des Glossars nicht anlegen - - error_term_macro_arg: Das Makro "term" ben其tigt entweder ein oder zwei Argumente (den Glossar-Begriff und optional die ID des Projekts) - error_termno_macro_arg: Das Makro "termno" ben其tigt genau ein Argument." - error_term_not_found_id: "\"%s\": Keinen Begriff mit dieser Nummer gefunden." - 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: Ung端ltige Zahl. --- %s - - error_csv_import_row: " Zeile : %d" - error_import_no_name: "\"%s\" ist unbekannt." - error_create_term_category: Konnte eine Begriffskategorie nicht speichern. - error_create_term: Konnte einen Begriff nicht speichern. - error_file_none: Dateiname fehlt. - error_no_movement_project: Kein Zielprojekt f村r das Verschieben der Begriffe. - - 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: [] diff --git a/plugins/redmine_glossary/config/locales/en.yml b/plugins/redmine_glossary/config/locales/en.yml index bc0a450..e2e0a65 100755 --- a/plugins/redmine_glossary/config/locales/en.yml +++ b/plugins/redmine_glossary/config/locales/en.yml @@ -1,103 +1,40 @@ # English strings go here for Rails i18n en: - project_module_glossary: Glossary - permission_view_terms: View Glossary - permission_manage_terms: Manage Glossary - permission_manage_term_categories: Manage Term Categories + label_glossary_terms: "Glossary terms" + label_glossary_term: "Glossary term" + label_glossary_term_new: "New glossary term" + label_glossary_term_import_csv: "Import from CSV" + label_glossary_categories: "Glossary categories" + label_glossary_category: "Glossary category" + label_glossary_category_new: "New glossary category" glossary_title: Glossary - label: - id: No. - name: Term - name_en: English - category: Category - datatype: "Data type for coding" - codename: "Abbreviation for coding" - description: Description - rubi: Ruby - abbr_whole: Whole word for Abbreviation - label_updater: Updater - label_term_plural: Glossary - - label_manage: Manage - label_manage_term_category: Manage category - label_not_categorized: Not categorized + project_module_glossary: Glossary label_view: View - label_style: Style - - label_term: Term - label_term_new: New term - label_index: List view - - label_grouping: Grouping - label_glossary_style_show_desc: Show descriptions - label_glossary_style_all_project: All projects - - label_glossary_style_project_current: Current - label_glossary_style_project_mine: Mine - label_glossary_style_project_all: All - - label_latest: Latest - label_indays: Days - - label_glossary_style_index: Index - label_import: Import - label_glossary_import_csv: Import from CSV - label_csv_file: CSV file - label_csv_import_is_first_comment: First row is comment line ? - label_import_items: Import items - label_item: Item - label_column: Column - message_import_item: For the project, creater and so on, the current value is used. - label_csv_import_finished: CSV Import finished - error_import_failed: Failed to import file. - label_create_category_num: The number of create categories - label_create_term_num: The number of create terms - label_update_term_num: The number of update terms - label_file_encoding: File encoding - label_movement_project: The movement project - label_move_all_terms: Move all terms - - label_term_category: Term category - label_term_category_new: New category - - field_term_counts_under_category: Term count + label_glossary_index: index + label_not_categorized: Not categorized + label_grouping: Grouping + label_categorized: Categorized + label_glossary_term_plural: Glossary - 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_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 - label_hide_item: Settings of hidden items - label_tag_termlink: Link to a term - - notice_glossary_style_create_f: Fail to create Glossary Style data - - error_term_macro_arg: "\"term\" macro need arguments, 1 or 2." - error_termno_macro_arg: "\"termno\" macro need only one argument." - error_term_not_found_id: "\"%s\": No term with such an No." - error_term_not_found_name: "\"%s\": No term with such a name." - error_term_not_found_name_project: "\"%s\": No term with such a name in \"%s\" project." - error_project_not_found: "\"%s\": No project of such an identifier." - error_to_number: Failed converting to number. --- %s - - error_csv_import_row: " row : %d" - error_import_no_name: "\"%s\" isn't descrived." - error_create_term_category: Failed to create Term Category. - error_create_term: Failed to create Term. - error_file_none: No File is specified. - error_no_movement_project: There is no project to which a term is moved. - - 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: [] + index_rubi: | + + + permission_view_glossary_terms: View glossary + permission_manage_glossary_terms: Manage glossary + field_name_en: English + field_abbr_whole: Whole word for Abbreviation + field_datatype: Data type for coding + field_codename: Abbreviation for coding + field_rubi: Ruby + diff --git a/plugins/redmine_glossary/config/locales/es.yml b/plugins/redmine_glossary/config/locales/es.yml deleted file mode 100755 index 331225e..0000000 --- a/plugins/redmine_glossary/config/locales/es.yml +++ /dev/null @@ -1,103 +0,0 @@ -# Spanish strings go here for Rails i18n -es: - project_module_glossary: Glosario - permission_view_terms: Ver Glosario - permission_manage_terms: Administrar Glosario - permission_manage_term_categories: Administrar Categor鱈as - - glossary_title: Glosario - label: - id: No. - name: T辿rmino - name_en: En ingl辿s - category: Categor鱈a - datatype: "Tipo de dato en c坦digo" - codename: "Abreviatura en c坦digo" - description: Descripci坦n - rubi: Ruby - abbr_whole: "Acr坦nimo de" - label_updater: Actualizador - label_term_plural: Glosario - - label_manage: Administrar - label_manage_term_category: Administrar categor鱈as - label_not_categorized: Sin categor鱈a - - label_view: Ver - label_style: Estilo - - label_term: T辿rmino - label_term_new: Nuevo t辿rmino - label_index: Ver lista - - label_grouping: Agrupar - label_glossary_style_show_desc: Mostrar descripciones - label_glossary_style_all_project: Todos los proyectos - - label_glossary_style_project_current: Actual - label_glossary_style_project_mine: M鱈os - label_glossary_style_project_all: Todos - - label_latest: ltimos - label_indays: D鱈as - - label_glossary_style_index: ndice - - label_import: Importar - label_glossary_import_csv: Importar de CSV - label_csv_file: Archivo CSV - label_csv_import_is_first_comment: La primera l鱈nea tiene comentarios de cabecera - label_import_items: Importar 鱈tems - label_item: tem - label_column: Columna - message_import_item: Se usar叩 el proyecto y usuario actual para los t辿rminos importados. - label_csv_import_finished: CSV Import finished - error_import_failed: Error al importar archivo. - label_create_category_num: N炭mero de categor鱈as creadas - label_create_term_num: N炭mero de t辿rminos creados - label_update_term_num: N炭mero de t辿rminos actualizados - label_file_encoding: Codificaci坦n de archivo - label_movement_project: Mover al proyecto - label_move_all_terms: Mover todos los t辿rminos - - label_term_category: Categor鱈as - label_term_category_new: Nueva categor鱈a - - field_term_counts_under_category: T辿rminos - - text_term_category_destroy_question: Alg炭n t辿rmino (%{value}) est叩 asignado a esta categor鱈a. 多Qu辿 quiere hacer? - text_term_category_destroy_assignments: Eliminar las asignaciones a esta categoria - text_term_category_reassign_to: Reasignar t辿rmino a esta categor鱈a - - label_hide_item: Opciones para ocultar 鱈tems - label_tag_termlink: Enlace a un t辿rmino - - notice_glossary_style_create_f: Error al crear los datos de Estilo del Glosario - - error_term_macro_arg: "La macro \"term\" requiere argumentos, 1 or 2." - error_termno_macro_arg: "La macro \"termno\" solo necesita un argumento." - error_term_not_found_id: "\"%s\": No hay ning炭n t辿rmino con ese n炭mero." - error_term_not_found_name: "\"%s\": No hay ning炭n t辿rmino con ese nombre." - error_term_not_found_name_project: "\"%s\": No hay ning炭n t辿rmino con ese nombre en el proyecto \"%s\"." - error_project_not_found: "\"%s\": No hay ning炭n proyecto con esa identificaci坦n." - error_to_number: Fallo convirtiendo a n炭mero. --- %s - - error_csv_import_row: " fila : %d" - error_import_no_name: "\"%s\" no est叩 descrito." - error_create_term_category: Error al crear Categor鱈a de T辿rminos. - error_create_term: Error al crear T辿rmino. - error_file_none: No se ha indicado ning炭n Archivo. - error_no_movement_project: No hay proyecto al que mover los t辿rminos. - - 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: [] - diff --git a/plugins/redmine_glossary/config/locales/it.yml b/plugins/redmine_glossary/config/locales/it.yml deleted file mode 100755 index ca53760..0000000 --- a/plugins/redmine_glossary/config/locales/it.yml +++ /dev/null @@ -1,103 +0,0 @@ -# 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: [] - diff --git a/plugins/redmine_glossary/config/locales/ja.yml b/plugins/redmine_glossary/config/locales/ja.yml index b6e5b56..c3c8042 100755 --- a/plugins/redmine_glossary/config/locales/ja.yml +++ b/plugins/redmine_glossary/config/locales/ja.yml @@ -1,121 +1,42 @@ -# English strings go here for Rails i18n ja: - project_module_glossary: 茯 - permission_view_terms: 茯画Η - permission_manage_terms: 茯膊∞ - permission_manage_term_categories: 茯眼膊∞ + label_glossary_terms: "茯" + label_glossary_term: "茯" + label_glossary_term_new: "茯篏" + label_glossary_term_import_csv: "CSVゃ潟若" + label_glossary_categories: "茯眼筝荀" + label_glossary_category: "茯眼" + label_glossary_category_new: "眼篏" glossary_title: 茯 - label: - name: 茯 - name_en: 沿 - category: 眼 - datatype: 若水 - codename: "潟若c潟亥腱遺" - description: 茯 - rubi: 泣 - abbr_whole: ヨ絮腱 - label_updater: 贋域 - label_term_plural: 茯 - - label_manage: 膊∞ - label_manage_term_category: 茯眼膩 - label_not_categorized: 蕁 + project_module_glossary: 茯 label_view: 茵腓 - label_style: 綵√ - - label_term: 茯 - label_term_new: 茯菴遵 - label_index: 鴻茵腓 - - label_grouping: 違若 - label_glossary_style_show_desc: 茯茵腓 - label_glossary_style_all_project: 吾с - - label_glossary_style_project_current: 潟 - label_glossary_style_project_mine: - label_glossary_style_project_all: - - label_latest: 菴 - label_indays: ヤ札 - - label_glossary_style_index: 膣√ - label_import: ゃ潟若 - label_glossary_import_csv: CSV ゃ潟若 - label_csv_file: CSV <ゃ - label_csv_import_is_first_comment: 茵潟<潟茵帥 ? - label_import_items: ュ - label_item: - label_column: 罅 - message_import_item: 吾с篏憜篏睡障 - label_csv_import_finished: ゃ潟若絎篋 - error_import_failed: ゃ潟若筝若榊障 - label_create_category_num: 篏眼 - label_create_term_num: 篏茯 - label_update_term_num: 贋違茯 - label_file_encoding: <ゃ絖潟若 - label_movement_project: 腱糸吾с - label_move_all_terms: 茯筝腱糸 + label_glossary_index: 膣√ + label_not_categorized: 蕁 + label_grouping: 違若 + label_categorized: 眼у蕁 + label_glossary_term_plural: 茯 - label_term_category: 茯眼 - label_term_category_new: 違眼 + index_rubi: | + + + + + + + + + + - field_term_counts_under_category: 蚊綵茯 - text_term_category_destroy_question: ゃ茯 (%{value}) 眼蕁障障? - text_term_category_destroy_assignments: 眼茯茹iゃ - text_term_category_reassign_to: 茯眼∫d + permission_view_glossary_terms: 茯画Η + permission_manage_glossary_terms: 茯膊∞ - label_hide_item: 茵腓冴御 - label_tag_termlink: 茯吾潟 - - notice_glossary_style_create_f: 茵腓阪就綣宴篆絖紊掩障 - - error_term_macro_arg: "\"term\" 1 障 2 ゃ綣違綽荀障" - error_termno_macro_arg: "\"termno\" с綣違筝ゆ絎" - error_term_not_found_id: "\"%s\": 絎垩茯障" - error_term_not_found_name: "\"%s\": 絎茯障" - error_term_not_found_name_project: "吾с \"%2$s\" \"%1$s\" 茯障" - error_project_not_found: "\"%s\": 絎茘ュ吾с障" - error_to_number: 医ゃ吾紊紊掩障 --- %s - - error_csv_import_row: " 茵 : %d" - error_import_no_name: "\"%s\" 荐菴違障" - error_create_term_category: 茯眼篏紊掩障 - error_create_term: 茯篏紊掩障 - error_file_none: <ゃ絎障 - error_no_movement_project: 茯腱糸純吾с障 - - 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: 5 - index_ary: [, , , , , - , , , , , - , , , , , - , , , , , - , , , , , - , , , , , - , , , , , - , "", , "", , - , , , , , - ] - index_subary: [, , , , , - [, , ], [, , ], [, , ], [, , ], [, , ], - [, , ], [, , ], [, , ], [, , ], [, , ], - [, , ], [, , ], [, , ], [, , ], [, , ], - , , , , , - [, , , , ], [, , , , ], [, , , , ], - [, , , , ], [, , , , ], - , , , , , - , "", , "", , - , , , , , - ] - - in_encoding_candidates: [UTF-8, EUC-JP, SHIFT_JIS, ISO-2022-JP] + field_name_en: 沿 + field_abbr_whole: ヨ絮腱 + field_datatype: 若水 + field_codename: 潟若c潟亥腱遺 + field_rubi: 泣 diff --git a/plugins/redmine_glossary/config/locales/pt.yml b/plugins/redmine_glossary/config/locales/pt.yml deleted file mode 100755 index f2e8340..0000000 --- a/plugins/redmine_glossary/config/locales/pt.yml +++ /dev/null @@ -1,103 +0,0 @@ -# Colocar aqui as cadeias de caracteres para o i18n do Rails -pt: - project_module_glossary: Gloss叩rio - permission_view_terms: Ver Gloss叩rio - permission_manage_terms: Gerir Gloss叩rio - permission_manage_term_categories: Gerir Categoria dos Termos - - glossary_title: Gloss叩rio - label: - id: N.尊 - name: Termo - name_en: Ingl棚s - category: Categoria - datatype: "Tipo de dados a usar no c坦digo" - codename: "Abreviatura a usar no c坦digo" - description: Descri巽達o - rubi: Ruby - abbr_whole: Palavra completa correspondente abreviatura - label_updater: Actualizador - label_term_plural: Gloss叩rio - - label_manage: Gerir - label_manage_term_category: Gerir categoria - label_not_categorized: Por categorizar - - label_view: Ver - label_style: Estilo - - label_term: Termo - label_term_new: Novo termo - label_index: Vista em lista - - label_grouping: Agrupamento - label_glossary_style_show_desc: Mostrar descri巽探es - label_glossary_style_all_project: Todos os projectos - - label_glossary_style_project_current: Corrente - label_glossary_style_project_mine: Meus - label_glossary_style_project_all: Todos - - label_latest: ltimos - label_indays: Dias - - label_glossary_style_index: ndice - - label_import: Importar - label_glossary_import_csv: Importar de CSV - label_csv_file: Ficheiro CSV - label_csv_import_is_first_comment: A primeira linha 辿 um coment叩rio? - label_import_items: Importar itens - label_item: Item - label_column: Coluna - message_import_item: Para o projecto, criador, etc., usa-se o valor corrente. - label_csv_import_finished: Importa巽達o de CSV terminada - error_import_failed: Importa巽達o de ficheiro falhou. - label_create_category_num: N炭mero de categorias criadas - label_create_term_num: N炭mero de termos criados - label_update_term_num: N炭mero de termos actualizados - label_file_encoding: Codifica巽達o do ficheiro - label_movement_project: Movimenta巽探es no projecto - label_move_all_terms: Mover todos os termos - - label_term_category: Categoria do termo - label_term_category_new: Nova categoria - - field_term_counts_under_category: Contagem de termos - - text_term_category_destroy_question: H叩 um termo ({{value}}) com esta categoria. Que deseja que se fa巽a? - text_term_category_destroy_assignments: Remover atribui巽達o categoria - text_term_category_reassign_to: Atribuir termo a esta categoria - - label_hide_item: Prefer棚ncias de atributos escondidos - label_tag_termlink: Liga巽達o a um item - - notice_glossary_style_create_f: Cria巽達o de dados de Estilo de Gloss叩rio falhou - - error_term_macro_arg: "A macro \"term\" precisa de argumentos, 1 ou 2." - error_termno_macro_arg: "A macro \"termno\" precisa de exactamente 1 argumento." - error_term_not_found_id: "\"%s\": N達o h叩 termos com esse n.尊." - error_term_not_found_name: "\"%s\": N達o h叩 termos com esse nome." - error_term_not_found_name_project: "\"%s\": N達o h叩 termos com esse nome no projecto \"%s\"." - error_project_not_found: "\"%s\": N達o h叩 qualquer projecto com esse identificador." - error_to_number: A convers達o em n炭mero falhou. --- %s - - error_csv_import_row: " linha : %d" - error_import_no_name: "\"%s\" n達o est叩 descrito." - error_create_term_category: Cria巽達o de Categoria de Termo falhou. - error_create_term: Cria巽達o de Termo falhou. - error_file_none: Faltou especificar o Ficheiro. - error_no_movement_project: Projecto para o qual mover o termo n達o existe. - - 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: [] - diff --git a/plugins/redmine_glossary/config/locales/zh.yml b/plugins/redmine_glossary/config/locales/zh.yml deleted file mode 100755 index b060bb2..0000000 --- a/plugins/redmine_glossary/config/locales/zh.yml +++ /dev/null @@ -1,103 +0,0 @@ -# English strings go here for Rails i18n -zh: - project_module_glossary: 莚莚 - permission_view_terms: ョ莚莚 - permission_manage_terms: 莚莚膊∞ - permission_manage_term_categories: 莚莚膠糸膊∞ - - glossary_title: 莚莚 - label: - id: No. - name: 莚腱 - name_en: 莚掩弱 - category: 膠 - datatype: "膽井膠糸" - codename: "莚膽" - description: 莚莚贋 - rubi: Ruby - abbr_whole: 腱 - label_updater: 贋遺査 - label_term_plural: 莚莚 - - label_manage: 膊∞ - label_manage_term_category: 膊∞莚膠糸 - label_not_categorized: 膠 - - label_view: 茹丈頵 - label_style: 桁 - - label_term: 莚 - label_term_new: 医莚 - label_index: 茵丞ず - - label_grouping: 膸 - label_glossary_style_show_desc: 丞ず颷 - label_glossary_style_all_project: 蕁合 - - label_glossary_style_project_current: 綵蕁合 - label_glossary_style_project_mine: 蕁合 - label_glossary_style_project_all: 蕁合 - - label_latest: 菴 - label_indays: 紊 - - label_glossary_style_index: 膣√ - - label_import: 絲弱 - label_glossary_import_csv: 篁CSV篁九弱 - label_csv_file: CSV篁 - label_csv_import_is_first_comment: 膃筝茵羈茵鐚 - label_import_items: 絲弱ラ臀 - label_item: 絲弱ラ々 - label_column: 絲劫 - message_import_item: 絲拷々綮坂査膈鐚綵若 - label_csv_import_finished: CSV篁九弱ュ - error_import_failed: 羈絲弱ユ篁吟 - label_create_category_num: 膠糸医産育 - label_create_term_num: 絮篋医産育 - label_update_term_num: 莚贋井育 - label_file_encoding: 篁句 - label_movement_project: 蕁合 - label_move_all_terms: 腱糸莚井育々 - - label_term_category: 莚膠糸 - label_term_category_new: 医莚膠糸 - - field_term_counts_under_category: 莚育 - - text_term_category_destroy_question: 莚(%{value})綏臥臀医膠糸莚潔筝筝罩ユ篏? - text_term_category_destroy_assignments: 絨綵莚篁莚ョ瓜筝腱糸 - text_term_category_reassign_to: 井絎莚絮膠糸 - - label_hide_item: 莅丞舟馹 - label_tag_termlink: 丈・井莚 - - notice_glossary_style_create_f: 羈綮堺莚莚桁井 - - error_term_macro_arg: "\"term\" 絎箴, 1 2" - error_termno_macro_arg: "\"termno\" 絎鋌荀筝筝違" - error_term_not_found_id: "\"%s\": 筝絖絲劫膽埇莚" - error_term_not_found_name: "\"%s\": 羃≧菴桁腱亥莚" - error_term_not_found_name_project: "\"%s\": \"%s\"蕁合筝鐚筝絖絲劫腱亥莚" - error_project_not_found: "\"%s\": 筝絖莚ユ腓榊絲劫蕁合" - error_to_number: 羈莉≫医膠糸 --- %s - - error_csv_import_row: " 茵 : %d" - error_import_no_name: "\"%s\" isn't descrived." - error_create_term_category: 羈綮堺莚膠糸 - error_create_term: 羈綮堺莚 - error_file_none: 絎篁吟 - error_no_movement_project: 綵腱糸蕁合莚桁後渇々筝綣莚莚罔≦ - - 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: [] - diff --git a/plugins/redmine_glossary/config/routes.rb b/plugins/redmine_glossary/config/routes.rb index 6d8f991..bdf1873 100755 --- a/plugins/redmine_glossary/config/routes.rb +++ b/plugins/redmine_glossary/config/routes.rb @@ -1,19 +1,17 @@ -RedmineApp::Application.routes.draw do - match 'glossary_styles/:action', :controller => :glossary_styles, :via => [ :get, :post, :put, :patch ] +# Plugin's routes +# See: http://guides.rubyonrails.org/routing.html - 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, :patch ] - match 'projects/:project_id/glossary/:id/edit', :to => 'glossary#edit', :id => /\d+/, :via => [ :get, :post, :patch ] - match 'projects/:project_id/glossary/:id/:action', :controller => :glossary, :id => /\d+/, :via => :all - 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', :controller => :glossary, :via => :all - - match 'projects/:project_id/term_categories', :to => 'term_categories#index', :via => :all - 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', :controller => :term_categories, :via => :all - match 'projects/:project_id/term_categories/:id/:action', :controller => :term_categories, :id => /\d+/, :via => :all +Rails.application.routes.draw do + resources :projects do + resources :glossary_terms do + member do + patch 'preview' + end + collection do + post 'preview' + post 'import' + end + end + resources :glossary_categories + end end - diff --git a/plugins/redmine_glossary/db/migrate/001_create_terms.rb b/plugins/redmine_glossary/db/migrate/001_create_terms.rb index c8cb3b9..9f9995a 100755 --- a/plugins/redmine_glossary/db/migrate/001_create_terms.rb +++ b/plugins/redmine_glossary/db/migrate/001_create_terms.rb @@ -1,4 +1,4 @@ -class CreateTerms < ActiveRecord::Migration +class CreateTerms < ActiveRecord::Migration[4.2] def self.up # CreateTermCategories create_table :term_categories, :force => true do |t| diff --git a/plugins/redmine_glossary/db/migrate/002_create_glossary_styles.rb b/plugins/redmine_glossary/db/migrate/002_create_glossary_styles.rb index 512477c..863c9df 100755 --- a/plugins/redmine_glossary/db/migrate/002_create_glossary_styles.rb +++ b/plugins/redmine_glossary/db/migrate/002_create_glossary_styles.rb @@ -1,4 +1,4 @@ -class CreateGlossaryStyles < ActiveRecord::Migration +class CreateGlossaryStyles < ActiveRecord::Migration[4.2] def self.up create_table :glossary_styles do |t| t.column :show_desc, :boolean, :default => false diff --git a/plugins/redmine_glossary/db/migrate/003_terms_add_columns.rb b/plugins/redmine_glossary/db/migrate/003_terms_add_columns.rb index af949fe..7d49345 100755 --- a/plugins/redmine_glossary/db/migrate/003_terms_add_columns.rb +++ b/plugins/redmine_glossary/db/migrate/003_terms_add_columns.rb @@ -1,4 +1,4 @@ -class TermsAddColumns < ActiveRecord::Migration +class TermsAddColumns < ActiveRecord::Migration[4.2] def self.up add_column :terms, :tech_en, :string, :default => '' add_column :terms, :name_cn, :string, :default => '' diff --git a/plugins/redmine_glossary/db/migrate/004_rename_glossary_terms_from_terms.rb b/plugins/redmine_glossary/db/migrate/004_rename_glossary_terms_from_terms.rb new file mode 100644 index 0000000..29c0d9d --- /dev/null +++ b/plugins/redmine_glossary/db/migrate/004_rename_glossary_terms_from_terms.rb @@ -0,0 +1,10 @@ +class RenameGlossaryTermsFromTerms < ActiveRecord::Migration[5.2] + def change + remove_column :terms, :tech_en, :string + remove_column :terms, :name_cn, :string + remove_column :terms, :name_fr, :string + rename_column :terms, :created_on, :created_at + rename_column :terms, :updated_on, :updated_at + rename_table :terms, :glossary_terms + end +end diff --git a/plugins/redmine_glossary/db/migrate/005_rename_glossary_categories_from_term_categories.rb b/plugins/redmine_glossary/db/migrate/005_rename_glossary_categories_from_term_categories.rb new file mode 100644 index 0000000..5012728 --- /dev/null +++ b/plugins/redmine_glossary/db/migrate/005_rename_glossary_categories_from_term_categories.rb @@ -0,0 +1,5 @@ +class RenameGlossaryCategoriesFromTermCategories < ActiveRecord::Migration[5.2] + def change + rename_table :term_categories, :glossary_categories + end +end \ No newline at end of file diff --git a/plugins/redmine_glossary/db/migrate/006_rename_glossary_view_settings_from_glossary_styles.rb b/plugins/redmine_glossary/db/migrate/006_rename_glossary_view_settings_from_glossary_styles.rb new file mode 100644 index 0000000..55e6248 --- /dev/null +++ b/plugins/redmine_glossary/db/migrate/006_rename_glossary_view_settings_from_glossary_styles.rb @@ -0,0 +1,5 @@ +class RenameGlossaryViewSettingsFromGlossaryStyles < ActiveRecord::Migration[5.2] + def change + rename_table :glossary_styles, :glossary_view_settings + end +end \ No newline at end of file diff --git a/plugins/redmine_glossary/init.rb b/plugins/redmine_glossary/init.rb index d7ab7ca..2cedb2b 100755 --- a/plugins/redmine_glossary/init.rb +++ b/plugins/redmine_glossary/init.rb @@ -1,80 +1,34 @@ -require 'redmine' -require 'cgi' -require 'glossary_asset_tag_helper_patch' -require 'term_link_helper' -require 'csv' -FCSV = CSV - -ActionView::Base.class_eval do - include ActionView::Helpers::TermLinkHelper +Rails.configuration.to_prepare do + require_dependency "glossary_macros" + Redmine::Activity.register :glossary_terms + Redmine::Search.available_search_types << 'glossary_terms' end - Redmine::Plugin.register :redmine_glossary do - name 'Redmine Glossary Plugin' - author 'M. Yoshida' - description "This is a Redmine plugin to create a glossary which is is a list of terms in a project" - version '0.9.2' - requires_redmine :version_or_higher => '3.0.0' - author_url 'http://yohshiy.blog.fc2.com/' - url 'http://www.r-labs.org/projects/rp-glossary/wiki/GlossaryEn' - - settings :default => { - 'hide_item_term_en' => false, - 'hide_item_codename' => false, - 'hide_item_datatype' => false, - 'hide_item_rubi' => false, - 'hide_item_abbr_whole' => false, - }, :partial => 'settings/glossary_settings' - + name 'Redmine Glossary plugin' + author 'Toru Takahashi' + description 'This is a plugin for Redmine to create a glossary that is a list of terms in a project.' + version '1.1.0' + url 'https://github.com/torutk/redmine_glossary' + author_url 'http://www.torutk.com' + requires_redmine version_or_higher: '4.0' project_module :glossary do - permission(:view_terms, {:glossary => [:index, :index_clear, :show, :show_all]}) - permission(:manage_terms, {:glossary => [:new, :edit, :destroy, :preview, - :import_csv, :import_csv_exec, :move_all]}, - :require => :member) - permission(:manage_term_categories, - {:glossary => [:add_term_category, :move_all], - :term_categories => [:index, :change_order, :edit, :destroy]}, - :require => :member) + permission :view_glossary_terms, { + glossary_terms: [:index, :show], + glossary_categories: [:index, :show] + } + permission :manage_glossary_terms, { + glossary_terms: [:new, :create, :edit, :update, :destroy, :import], + glossary_categories: [:new, :create, :edit, :update, :destroy], + }, + require: :member + end - menu(:project_menu, :glossary, - { :controller => 'glossary', :action => 'index' }, - :caption => :glossary_title, :param => :project_id) + menu :project_menu, :glossary, + { controller: :glossary_terms, action: :index }, + caption: :glossary_title, + param: :project_id end - - - -Redmine::WikiFormatting::Macros.register do - desc "Glossary term link by ID" - macro :termno do |obj, args| - raise I18n.t(:error_termno_macro_arg) if (args.size != 1) - tid = args[0].strip - term = Term.find_by_id(tid.to_i) - raise sprintf(I18n.t(:error_term_not_found_id), tid) unless term - term_link(term) - end -end - - -Redmine::WikiFormatting::Macros.register do - desc "Glossary term link" - macro :term do |obj, args| - sargs = args.map {|arg| CGI::unescapeHTML(arg.strip) } - term = nil - case sargs.size - when 1 - 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]) - raise sprintf(I18n.t(:error_project_not_found), sargs[1]) unless proj - term = Term.find_for_macro(sargs[0], proj) - else - raise I18n.t(:error_term_macro_arg) - end - (term) ? term_link(term) : term_link_new(sargs[0], proj) - end -end diff --git a/plugins/redmine_glossary/lib/glossary_asset_tag_helper_patch.rb b/plugins/redmine_glossary/lib/glossary_asset_tag_helper_patch.rb deleted file mode 100755 index 9bfd0e4..0000000 --- a/plugins/redmine_glossary/lib/glossary_asset_tag_helper_patch.rb +++ /dev/null @@ -1,23 +0,0 @@ -module ActionView - module Helpers - module AssetTagHelper - def javascript_include_tag_with_glossary(*sources) - out = javascript_include_tag_without_glossary(*sources) - if sources.is_a?(Array) and sources[0] == 'jstoolbar/textile' - out += javascript_tag <<-javascript_tag -jsToolBar.prototype.elements.termlink = { - type: 'button', - title: '#{l(:label_tag_termlink)}', - fn: { - wiki: function() { this.encloseSelection("{{term(", ")}}") } - } -} -javascript_tag - out += stylesheet_link_tag 'termlink', :plugin => 'redmine_glossary' - end - out - end - alias_method_chain :javascript_include_tag, :glossary - end - end -end diff --git a/plugins/redmine_glossary/lib/glossary_import_info.rb b/plugins/redmine_glossary/lib/glossary_import_info.rb deleted file mode 100755 index 3a83676..0000000 --- a/plugins/redmine_glossary/lib/glossary_import_info.rb +++ /dev/null @@ -1,69 +0,0 @@ -# -# glossary_import_info.rb -# -# Author : Mitsuyoshi Yoshida -# This program is freely distributable under the terms of an MIT-style license. -# - -require 'i18n' - -class GlossaryImportInfo - attr_accessor :import_file - attr_accessor :err_string - - def initialize(tbl) - @import_file = tbl[:import_file] - end - - def success? - (err_string) ? false : true - end - -end - - -class CsvGlossaryImportInfo < GlossaryImportInfo - attr_accessor :is_first_comment - attr_reader :col_max - attr_accessor :cat_num, :newterm_num, :upterm_num - attr_writer :in_encoding - - def initialize(tbl) - super(tbl) - @is_first_comment = tbl[:is_first_comment] - @in_encoding = tbl[:in_encoding] - @colno_tbl = {} - Term.import_params.each {|prm| - prmcol = tbl["colno_#{prm}"] - if (prmcol and !prmcol.empty?) - @colno_tbl[prmcol.to_i] = prm - end - } - @col_max = @colno_tbl.keys.max - @cat_num = 0 - @newterm_num = 0 - @upterm_num = 0 - end - - def in_encoding - (@in_encoding) ? @in_encoding : 'UTF-8' - end - - def col_param(colno) - @colno_tbl[colno] - end - - def param_col(prm) - @colno_tbl.each {|key, val| - return key if (val == prm) - } - nil - end - - def self.default_param_cols(&blk) - Term.import_params.each {|prm| - yield prm, (Term.export_params.index(prm)) - } - end - -end diff --git a/plugins/redmine_glossary/lib/glossary_macros.rb b/plugins/redmine_glossary/lib/glossary_macros.rb new file mode 100644 index 0000000..b1a6f88 --- /dev/null +++ b/plugins/redmine_glossary/lib/glossary_macros.rb @@ -0,0 +1,38 @@ +module GlossaryMacros + + Redmine::WikiFormatting::Macros.register do + + desc "create macro which links to glossary term by id." + macro :termno do |obj, args| + begin + raise 'no parameters' if args.count.zero? + raise 'too many parameters' if args.count > 1 + term_id = args.first + term = GlossaryTerm.find(term_id) + link_to term.name, project_glossary_term_path(@project, term) + rescue => err_msg + raise <<-TEXT.html_safe +Parameter error: #{err_msg}
+Usage: {{termno(glossary_term_id)}} +TEXT + end + end + + desc "create macro which links to glossary term by name." + macro :term do |obj, args| + begin + raise 'no parameters' if args.count.zero? + raise 'too many parameters' if args.count > 1 + term = GlossaryTerm.find_by!(name: args.first) + link_to term.name, project_glossary_term_path(@project, term) + rescue => err_msg + raise <<-TEXT.html_safe +Parameter error: #{err_msg}
+Usage: {{term(name)}} +TEXT + end + end + + end + +end diff --git a/plugins/redmine_glossary/lib/grouping_terms.rb b/plugins/redmine_glossary/lib/grouping_terms.rb deleted file mode 100755 index ff0fe39..0000000 --- a/plugins/redmine_glossary/lib/grouping_terms.rb +++ /dev/null @@ -1,50 +0,0 @@ -# -# category_terms.rb -# -# Author : Mitsuyoshi Yoshida -# This program is freely distributable under the terms of an MIT-style license. -# - -require 'i18n' - -class GroupingTerms - attr_reader :type, :target - attr_accessor :ary - - def initialize(type, target) - @type = type - @target = target - @ary = [] - end - - def name - (@target) ? @target.name : I18n.t(:label_not_categorized) - end - - def <=>(rhterm) - if (!@target and !rhterm.target) - return 0 - elsif (!@target or !rhterm.target) - return -1 if @target - return 1 if rhterm.target - end - case type - when GlossaryStyle::GroupByCategory - @target.position <=> rhterm.target.position - when GlossaryStyle::GroupByProject - @target.identifier <=> rhterm.target.identifier - end - end - - def self.flatten(gtarmsary) - flatary = [] - gtarmsary.each {|gtarmsary| - return gtarmsary unless gtarmsary.is_a?(GroupingTerms) - flatary += gtarmsary.ary - } - flatary - end - -end - - diff --git a/plugins/redmine_glossary/lib/term_link_helper.rb b/plugins/redmine_glossary/lib/term_link_helper.rb deleted file mode 100755 index b4033fe..0000000 --- a/plugins/redmine_glossary/lib/term_link_helper.rb +++ /dev/null @@ -1,35 +0,0 @@ -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 diff --git a/plugins/redmine_glossary/release_note.rwiki b/plugins/redmine_glossary/release_note.rwiki deleted file mode 100755 index 5ba750a..0000000 --- a/plugins/redmine_glossary/release_note.rwiki +++ /dev/null @@ -1,66 +0,0 @@ -h1. [Xm[g - -h2. 0.6.1 - -@\ -* pJeSe[uA WNACR\ヲ -sC -* JeStB^OAJeSK\G[C - ---- - -Feature -* In term and term categories tables, Edit and Delete link display only icons. -Bugifx -* Filtering by category. - - - -h2. 0.6.0 - -@\ -# vWFNgp -# p\ヲ\ヲ -# CfbNX -# bZ[Wt@C -## hCc (de) -## (zh) - -sC -# vWFNgI -# JeStB^[ -# JeSpW CSV o -# rake f[^x[XXV -# pWO term Wiki }Np -# & p term }N -# tKiAWJ\ヲ - ---- - -Feature -# Feature to move all terms -# Show parts of description in index lists -# Add clear button for index filter -# Add translation -## German (de) -## Simplified Chinese (zh) - -Bug fix -# Selection of project target -# Filter by categories -# CSV export when category is None -# Update database by rake -# The Wiki term macro error in wiki page except glossary page -# The Wiki term macro error of terms which have & caractor. -# Hiden settings of rubi and abbrev. - - -h2. 0.6.0 - -@\ -# Redmine 1.4.0 - ---- - -Feature -# support for Redmine 1.4 diff --git a/plugins/redmine_glossary/test/fixtures/glossary_categories.yml b/plugins/redmine_glossary/test/fixtures/glossary_categories.yml new file mode 100644 index 0000000..417b425 --- /dev/null +++ b/plugins/redmine_glossary/test/fixtures/glossary_categories.yml @@ -0,0 +1,10 @@ +color: + id: 1 + name: Color + project_id: 1 + +shape: + id: 2 + name: Shape + project_id: 1 + diff --git a/plugins/redmine_glossary/test/fixtures/glossary_styles.yml b/plugins/redmine_glossary/test/fixtures/glossary_styles.yml deleted file mode 100755 index 52727cd..0000000 --- a/plugins/redmine_glossary/test/fixtures/glossary_styles.yml +++ /dev/null @@ -1,19 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -one: - id: 1 - show_desc: - gropby: - project_scope: 1 - sort_item_0: MyString - sort_item_1: MyString - sort_item_2: MyString - user_id: 1 -two: - id: 2 - show_desc: - gropby: - project_scope: 1 - sort_item_0: MyString - sort_item_1: MyString - sort_item_2: MyString - user_id: 1 diff --git a/plugins/redmine_glossary/test/fixtures/glossary_terms.yml b/plugins/redmine_glossary/test/fixtures/glossary_terms.yml new file mode 100644 index 0000000..0e8cef5 --- /dev/null +++ b/plugins/redmine_glossary/test/fixtures/glossary_terms.yml @@ -0,0 +1,31 @@ +red: + id: 1 + project_id: 1 + category_id: 1 + name: red + +green: + id: 2 + project_id: 1 + category_id: 1 + name: green + created_at: 2018-08-08 18:18:18 + updated_at: 2018-08-08 18:18:18 + +blue: + id: 3 + project_id: 2 + category_id: 1 + name: blue + created_at: 2018-08-08 18:18:18 + updated_at: 2018-08-08 18:18:18 + +clear: + id: 4 + project_id: 1 + name: clear + created_at: 2018-08-08 18:18:18 + updated_at: 2018-08-08 18:18:18 + + + diff --git a/plugins/redmine_glossary/test/fixtures/grossary_styles.yml b/plugins/redmine_glossary/test/fixtures/grossary_styles.yml deleted file mode 100755 index 52727cd..0000000 --- a/plugins/redmine_glossary/test/fixtures/grossary_styles.yml +++ /dev/null @@ -1,19 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -one: - id: 1 - show_desc: - gropby: - project_scope: 1 - sort_item_0: MyString - sort_item_1: MyString - sort_item_2: MyString - user_id: 1 -two: - id: 2 - show_desc: - gropby: - project_scope: 1 - sort_item_0: MyString - sort_item_1: MyString - sort_item_2: MyString - user_id: 1 diff --git a/plugins/redmine_glossary/test/fixtures/term_categories.yml b/plugins/redmine_glossary/test/fixtures/term_categories.yml deleted file mode 100755 index 9d48a9e..0000000 --- a/plugins/redmine_glossary/test/fixtures/term_categories.yml +++ /dev/null @@ -1,11 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -one: - id: 1 - project_id: 1 - name: MyString - position: 1 -two: - id: 2 - project_id: 1 - name: MyString - position: 1 diff --git a/plugins/redmine_glossary/test/fixtures/term_queries.yml b/plugins/redmine_glossary/test/fixtures/term_queries.yml deleted file mode 100755 index c80628c..0000000 --- a/plugins/redmine_glossary/test/fixtures/term_queries.yml +++ /dev/null @@ -1,17 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -one: - id: 1 - show_desc: - categorized: - all_project: - search_str: - search_category: - sort_items: MyString -two: - id: 2 - show_desc: - categorized: - all_project: - search_str: - search_category: - sort_items: MyString diff --git a/plugins/redmine_glossary/test/fixtures/terms.yml b/plugins/redmine_glossary/test/fixtures/terms.yml deleted file mode 100755 index 7e0ce4b..0000000 --- a/plugins/redmine_glossary/test/fixtures/terms.yml +++ /dev/null @@ -1,25 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -one: - id: 1 - project_id: - category_id: - author_id: - updater_id: - name: - name_en: - codename: - description: - created_on: - updated_on: 2010-12-13 21:25:16 -two: - id: 2 - project_id: - category_id: - author_id: - updater_id: - name: - name_en: - codename: - description: - created_on: - updated_on: 2010-12-13 21:25:16 diff --git a/plugins/redmine_glossary/test/fixtures/view_styles.yml b/plugins/redmine_glossary/test/fixtures/view_styles.yml deleted file mode 100755 index 52727cd..0000000 --- a/plugins/redmine_glossary/test/fixtures/view_styles.yml +++ /dev/null @@ -1,19 +0,0 @@ -# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html -one: - id: 1 - show_desc: - gropby: - project_scope: 1 - sort_item_0: MyString - sort_item_1: MyString - sort_item_2: MyString - user_id: 1 -two: - id: 2 - show_desc: - gropby: - project_scope: 1 - sort_item_0: MyString - sort_item_1: MyString - sort_item_2: MyString - user_id: 1 diff --git a/plugins/redmine_glossary/test/functional/glossary_categories_controller_test.rb b/plugins/redmine_glossary/test/functional/glossary_categories_controller_test.rb new file mode 100644 index 0000000..a55a47c --- /dev/null +++ b/plugins/redmine_glossary/test/functional/glossary_categories_controller_test.rb @@ -0,0 +1,57 @@ +require File.expand_path('../../test_helper', __FILE__) + +class GlossaryCategoriesControllerTest < ActionController::TestCase + fixtures :projects, :users, :roles, :members, :member_roles + plugin_fixtures :glossary_categories + + def setup + @project = projects('projects_001') + @project.enabled_module_names = [:glossary] + roles('roles_001').add_permission! :view_glossary, :manage_glossary + end + + def test_index + @request.session[:user_id] = users('users_002').id + get :index, params: {project_id: 1} + assert_response :success + end + + def test_edit + @request.session[:user_id] = users('users_002').id + get :edit, params: {id: 1, project_id: 1} + assert_response :success + assert_select 'form', true + end + + def test_update + @request.session[:user_id] = users('users_002').id + patch :update, params: {id: 1, project_id: 1, glossary_category: {name: 'Colour'}} + category = GlossaryCategory.find(1) + assert_redirected_to project_glossary_category_path(@project, category) + assert_equal 'Colour', category.name + end + + def test_new + @request.session[:user_id] = users('users_002').id + get :new, params: {id: 1, project_id: 1} + assert_response :success + assert_select 'form', true + end + + def test_create + @request.session[:user_id] = users('users_002').id + post :create, params: { + project_id: 1, glossary_category: {name: 'Material'} + } + category = GlossaryCategory.find_by(name: 'Material') + assert_not_nil category + assert_redirected_to project_glossary_category_path(@project, category) + end + + def test_destroy + @request.session[:user_id] = users('users_002').id + delete :destroy, params: { id: 1, project_id: 1 } + assert_raise(ActiveRecord::RecordNotFound) { GlossaryCategory.find(1) } + assert_redirected_to project_glossary_categories_path(@project) + end +end diff --git a/plugins/redmine_glossary/test/functional/glossary_controller_test.rb b/plugins/redmine_glossary/test/functional/glossary_controller_test.rb deleted file mode 100755 index cfa1d4d..0000000 --- a/plugins/redmine_glossary/test/functional/glossary_controller_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class GlossaryControllerTest < ActionController::TestCase - # Replace this with your real tests. - def test_truth - assert true - end -end diff --git a/plugins/redmine_glossary/test/functional/glossary_styles_controller_test.rb b/plugins/redmine_glossary/test/functional/glossary_styles_controller_test.rb deleted file mode 100755 index c6609ee..0000000 --- a/plugins/redmine_glossary/test/functional/glossary_styles_controller_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class GlossaryStylesControllerTest < ActionController::TestCase - # Replace this with your real tests. - def test_truth - assert true - end -end diff --git a/plugins/redmine_glossary/test/functional/glossary_terms_controller_test.rb b/plugins/redmine_glossary/test/functional/glossary_terms_controller_test.rb new file mode 100644 index 0000000..cbeab24 --- /dev/null +++ b/plugins/redmine_glossary/test/functional/glossary_terms_controller_test.rb @@ -0,0 +1,59 @@ +require File.expand_path('../../test_helper', __FILE__) + +class GlossaryTermsControllerTest < ActionController::TestCase + fixtures :projects, :users, :roles, :members, :member_roles + plugin_fixtures :glossary_terms + + def setup + @project = projects('projects_001') + @project.enabled_module_names = [:glossary] + roles('roles_001').add_permission! :view_glossary, :manage_glossary + end + + def test_index + @request.session[:user_id] = users('users_002').id + get :index, params: {project_id: 1} + assert_response :success + end + + def test_edit + @request.session[:user_id] = users('users_002').id + get :edit, params: {id: 1, project_id: 1} + assert_response :success + assert_select 'form', true + end + + def test_update + @request.session[:user_id] = users('users_002').id + patch :update, params: {id: 1, project_id: 1, glossary_term: { + name: 'rosso' + }} + term = GlossaryTerm.find(1) + assert_redirected_to project_glossary_term_path(@project, term) + assert_equal 'rosso', term.name + end + + def test_new + @request.session[:user_id] = users('users_002').id + get :new, params: {project_id: 1} + assert_response :success + assert_select 'form', true + end + + def test_create + @request.session[:user_id] = users('users_002').id + post :create, params: { project_id: 1, glossary_term: { + name: 'white', category_id: 1 + }} + term = GlossaryTerm.find_by(name: 'white') + assert_not_nil term + assert_redirected_to project_glossary_term_path(@project, term) + end + + def test_destroy + @request.session[:user_id] = users('users_002').id + delete :destroy, params: {id: 1, project_id: 1} + assert_raise(ActiveRecord::RecordNotFound) { GlossaryTerm.find(1) } + assert_redirected_to project_glossary_terms_path(@project) + end +end diff --git a/plugins/redmine_glossary/test/functional/glossray_styles_controller_test.rb b/plugins/redmine_glossary/test/functional/glossray_styles_controller_test.rb deleted file mode 100755 index cd97d59..0000000 --- a/plugins/redmine_glossary/test/functional/glossray_styles_controller_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class GlossrayStylesControllerTest < ActionController::TestCase - # Replace this with your real tests. - def test_truth - assert true - end -end diff --git a/plugins/redmine_glossary/test/functional/term_categories_controller_test.rb b/plugins/redmine_glossary/test/functional/term_categories_controller_test.rb deleted file mode 100755 index d8376bc..0000000 --- a/plugins/redmine_glossary/test/functional/term_categories_controller_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class TermCategoriesControllerTest < ActionController::TestCase - # Replace this with your real tests. - def test_truth - assert true - end -end diff --git a/plugins/redmine_glossary/test/functional/term_queries_controller_test.rb b/plugins/redmine_glossary/test/functional/term_queries_controller_test.rb deleted file mode 100755 index 5bb59b4..0000000 --- a/plugins/redmine_glossary/test/functional/term_queries_controller_test.rb +++ /dev/null @@ -1,8 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class TermQueriesControllerTest < ActionController::TestCase - # Replace this with your real tests. - def test_truth - assert true - end -end diff --git a/plugins/redmine_glossary/test/test_helper.rb b/plugins/redmine_glossary/test/test_helper.rb index bd1ed0c..4193874 100755 --- a/plugins/redmine_glossary/test/test_helper.rb +++ b/plugins/redmine_glossary/test/test_helper.rb @@ -1,5 +1,29 @@ -# Load the normal Rails helper -require File.expand_path(File.dirname(__FILE__) + '/../../../../test/test_helper') +# Load the Redmine helper +require File.expand_path(File.dirname(__FILE__) + '/../../../test/test_helper') -# Ensure that we are using the temporary fixture path -Engines::Testing.set_fixture_path +module Redmine + module PluginFixturesLoader + def self.included(base) + base.class_eval do + def self.plugin_fixtures(*symbols) + ActiveRecord::FixtureSet.create_fixtures(File.dirname(__FILE__) + '/fixtures/', symbols) + end + end + end + end +end + +## functional test +unless ActionController::TestCase.included_modules.include?(Redmine::PluginFixturesLoader) + ActionController::TestCase.send :include, Redmine::PluginFixturesLoader +end + +## unit test +unless ActiveSupport::TestCase.included_modules.include?(Redmine::PluginFixturesLoader) + ActiveSupport::TestCase.send :include, Redmine::PluginFixturesLoader +end + +## integration test +unless Redmine::IntegrationTest.included_modules.include?(Redmine::PluginFixturesLoader) + Redmine::IntegrationTest.send :include, Redmine::PluginFixturesLoader +end diff --git a/plugins/redmine_glossary/test/unit/glossary_category_test.rb b/plugins/redmine_glossary/test/unit/glossary_category_test.rb new file mode 100644 index 0000000..eea9d2d --- /dev/null +++ b/plugins/redmine_glossary/test/unit/glossary_category_test.rb @@ -0,0 +1,15 @@ +# coding: utf-8 +require File.expand_path('../../test_helper', __FILE__) + +class GlossaryCategoryTest < ActiveSupport::TestCase + fixtures :glossary_categories + plugin_fixtures :glossary_categories + + def setup + @category = glossary_categories('color') + end + + def test_valid + assert @category.valid? + end +end diff --git a/plugins/redmine_glossary/test/unit/glossary_style_test.rb b/plugins/redmine_glossary/test/unit/glossary_style_test.rb deleted file mode 100755 index dc45b47..0000000 --- a/plugins/redmine_glossary/test/unit/glossary_style_test.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class GlossaryStyleTest < ActiveSupport::TestCase - fixtures :glossary_styles - - # Replace this with your real tests. - def test_truth - assert true - end -end diff --git a/plugins/redmine_glossary/test/unit/glossary_term_test.rb b/plugins/redmine_glossary/test/unit/glossary_term_test.rb new file mode 100644 index 0000000..bce67a5 --- /dev/null +++ b/plugins/redmine_glossary/test/unit/glossary_term_test.rb @@ -0,0 +1,21 @@ +require File.expand_path('../../test_helper', __FILE__) + +class GlossaryTermTest < ActiveSupport::TestCase + fixtures :glossary_terms + plugin_fixtures :glossary_terms + + def setup + @term = glossary_terms('red') + end + + def test_valid + assert @term.valid? + end + + def test_invalid_without_name + @term.name = nil + assert_raises ActiveRecord::NotNullViolation do + @term.save + end + end +end diff --git a/plugins/redmine_glossary/test/unit/grossary_style_test.rb b/plugins/redmine_glossary/test/unit/grossary_style_test.rb deleted file mode 100755 index 410a690..0000000 --- a/plugins/redmine_glossary/test/unit/grossary_style_test.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class GrossaryStyleTest < ActiveSupport::TestCase - fixtures :grossary_styles - - # Replace this with your real tests. - def test_truth - assert true - end -end diff --git a/plugins/redmine_glossary/test/unit/term_category_test.rb b/plugins/redmine_glossary/test/unit/term_category_test.rb deleted file mode 100755 index 0866643..0000000 --- a/plugins/redmine_glossary/test/unit/term_category_test.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class TermCategoryTest < ActiveSupport::TestCase - fixtures :term_categories - - # Replace this with your real tests. - def test_truth - assert true - end -end diff --git a/plugins/redmine_glossary/test/unit/term_query_test.rb b/plugins/redmine_glossary/test/unit/term_query_test.rb deleted file mode 100755 index f291df6..0000000 --- a/plugins/redmine_glossary/test/unit/term_query_test.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class TermQueryTest < ActiveSupport::TestCase - fixtures :term_queries - - # Replace this with your real tests. - def test_truth - assert true - end -end diff --git a/plugins/redmine_glossary/test/unit/term_test.rb b/plugins/redmine_glossary/test/unit/term_test.rb deleted file mode 100755 index dfba03c..0000000 --- a/plugins/redmine_glossary/test/unit/term_test.rb +++ /dev/null @@ -1,10 +0,0 @@ -require File.dirname(__FILE__) + '/../test_helper' - -class TermTest < ActiveSupport::TestCase - fixtures :terms - - # Replace this with your real tests. - def test_truth - assert true - end -end