redmine_glossary/app/views/glossary_terms/_sidebar.html.erb
2020-01-02 19:39:20 +09:00

50 lines
1.7 KiB
Plaintext

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