Actualizar plugin Glossary a 1.1.0
This commit is contained in:
parent
24560c8598
commit
b9e569d03f
103 changed files with 954 additions and 2967 deletions
|
@ -0,0 +1,19 @@
|
|||
<div class="box tabular">
|
||||
<p><%= form.text_field :name, size: 80, required: true %></p>
|
||||
<p><%= form.text_field :name_en, size: 80 %></p>
|
||||
<p><%= form.text_field :rubi, size: 80 %></p>
|
||||
<p><%= form.text_field :abbr_whole, size: 80 %></p>
|
||||
<p><%= form.text_field :datatype, size: 80 %></p>
|
||||
<p><%= form.text_field :codename, size: 80 %></p>
|
||||
<p><%= form.select :category_id, GlossaryCategory.pluck(:name, :id), include_blank: true %></p>
|
||||
<p><%= form.text_area :description, rows: 10, class: 'wiki-edit', required: false %></p>
|
||||
</div>
|
||||
|
||||
<div class="box">
|
||||
<p>
|
||||
<label><%=l :label_attachment_plural %></label>
|
||||
<%= render partial: 'attachments/form' %>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<%= wikitoolbar_for 'glossary_term_description' %>
|
|
@ -0,0 +1,28 @@
|
|||
<table class="list">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th><%=l :field_name %></th>
|
||||
<th><%=l :field_category %></th>
|
||||
<th><%=l :field_description %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% terms.each do |term| %>
|
||||
<tr>
|
||||
<td class="id">
|
||||
<%= term.id %>
|
||||
</td>
|
||||
<td class="name">
|
||||
<%= link_to term.name, [@project, term] %>
|
||||
</td>
|
||||
<td class="roles">
|
||||
<%= term.category.try!(:name) %>
|
||||
</td>
|
||||
<td class="description">
|
||||
<%= term.description %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
|
@ -0,0 +1,61 @@
|
|||
<% content_for :sidebar do %>
|
||||
<h3><%=l :label_view %></h3>
|
||||
|
||||
<%= form_with url: project_glossary_terms_path, method: :get, local: true do |form| %>
|
||||
<fieldset>
|
||||
<legend><%=l :label_grouping %></legend>
|
||||
<%= 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 %>
|
||||
</fieldset>
|
||||
<%= form.submit l(:label_view) %>
|
||||
<% end %>
|
||||
|
||||
<h3><%=l :label_glossary_term %></h3>
|
||||
<p><%= link_to_if_authorized l(:label_glossary_term_new),
|
||||
{ controller: :glossary_terms, action: :new, project_id: @project },
|
||||
class: 'icon icon-add' %></p>
|
||||
|
||||
<fieldset class="collapsible collapsed">
|
||||
<legend onclick="toggleFieldset(this);" class="icon icon-collapsed">
|
||||
<%=l :label_glossary_term_import_csv %>
|
||||
</legend>
|
||||
<div style="display: none;">
|
||||
<%= form_with url: import_project_glossary_terms_path, method: :post, local: true do |form| %>
|
||||
<%= form.file_field :file %>
|
||||
<%= form.submit l(:label_import) %>
|
||||
<% end %>
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
<h3><%=l :label_glossary_category %></h3>
|
||||
<p><%= link_to_if_authorized l(:label_glossary_category_new),
|
||||
{ controller: :glossary_categories, action: :new, project_id: @project},
|
||||
class: 'icon icon-add' %></p>
|
||||
|
||||
<p><%= link_to l(:label_glossary_categories),
|
||||
project_glossary_categories_path %></p>
|
||||
|
||||
<h3><%=l :label_glossary_index %></h3>
|
||||
<table>
|
||||
<% l(:index_en).each_line do |line| %>
|
||||
<tr>
|
||||
<% line.split(" ").each do |ch| %>
|
||||
<td><%= link_to ch, project_glossary_terms_path(index: ch) %></td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<table>
|
||||
<% l(:index_rubi).each_line do |line| %>
|
||||
<tr>
|
||||
<% line.split(" ").each do |char| %>
|
||||
<td>
|
||||
<%= link_to char, project_glossary_terms_path(index_rubi: char) %>
|
||||
</td>
|
||||
<% end %>
|
||||
</tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<% end %>
|
|
@ -0,0 +1,6 @@
|
|||
<h2><%=l :label_glossary_term %> #<%= @term.id %></h2>
|
||||
|
||||
<%= 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 %>
|
|
@ -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
|
|
@ -0,0 +1,28 @@
|
|||
<h2><%=l :label_glossary_terms %></h2>
|
||||
|
||||
<div class="contextual">
|
||||
<%= link_to_if_authorized l(:label_glossary_term_new),
|
||||
{ controller: :glossary_terms, action: :new, project_id: @project },
|
||||
class: 'icon icon-add' %>
|
||||
</div>
|
||||
|
||||
<%= 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| %>
|
||||
<h3><%= category.name %></h3>
|
||||
<%= render partial: 'index_terms', locals: {terms: terms} %>
|
||||
<% end %>
|
||||
|
||||
<h3><%=l :label_not_categorized %></h3>
|
||||
<%= 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 %>
|
|
@ -0,0 +1,11 @@
|
|||
<h2><%=l :label_glossary_term_new %></h2>
|
||||
|
||||
<%= 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 %>
|
||||
|
||||
<div id="preview" class="wiki"></div>
|
||||
|
||||
|
|
@ -0,0 +1,63 @@
|
|||
<% content_for :header_tags do %>
|
||||
<%= stylesheet_link_tag 'glossary', plugin: 'redmine_glossary' %>
|
||||
<% end %>
|
||||
|
||||
<div class="contextual">
|
||||
<%= 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' %>
|
||||
</div>
|
||||
|
||||
<%= render partial: 'sidebar' %>
|
||||
|
||||
<h2><%=l :label_glossary_term %> #<%= @term.id %></h2>
|
||||
|
||||
<h3><%= @term.name %></h3>
|
||||
|
||||
<table class="term">
|
||||
<tr>
|
||||
<th><%=l :field_name_en %>:</th>
|
||||
<td><%= @term.name_en %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%=l :field_rubi %>:</th>
|
||||
<td><%= @term.rubi %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%=l :field_abbr_whole %>:</th>
|
||||
<td><%= @term.abbr_whole %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%=l :field_datatype %>:</th>
|
||||
<td><%= @term.datatype %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%=l :field_codename %>:</th>
|
||||
<td><%= @term.codename %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%=l :field_category %>:</th>
|
||||
<td><%= @term.category.try!(:name) %>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%=l :field_description %>:</th>
|
||||
<td><div class="wiki"><%= textilizable @term, :description %></div></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%=l :field_created_on %>:</th>
|
||||
<td><%= format_time(@term.created_at) %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%=l :field_updated_on %>:</th>
|
||||
<td><%= format_time(@term.updated_at) %></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<%= render partial: 'attachments/links',
|
||||
locals: {attachments: @term.attachments,
|
||||
options: {deletable: User.current.allowed_to?(:manage_glossary_terms, @project)}
|
||||
}%>
|
Loading…
Add table
Add a link
Reference in a new issue