Corrección de errores y mejoras en la visualización del glosario
This commit is contained in:
parent
693eb3ee50
commit
c6568888b1
9 changed files with 25 additions and 19 deletions
|
@ -355,9 +355,10 @@ class GlossaryController < ApplicationController
|
|||
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)
|
||||
}
|
||||
# terms.delete_if {|prm| (prm.datetime < limittm)}
|
||||
recent_terms = []
|
||||
terms.collect{|prm| recent_terms << prm if prm.datetime >= limittm}
|
||||
recent_terms
|
||||
else
|
||||
terms
|
||||
end
|
||||
|
|
|
@ -34,9 +34,8 @@ module GlossaryHelper
|
|||
|
||||
def collect_visible_params(prmary)
|
||||
ary = []
|
||||
prmary {|prm|
|
||||
ary << prm if param_visible?(prm)
|
||||
}
|
||||
prmary.collect{|prm| ary << prm if param_visible?(prm)}
|
||||
ary
|
||||
end
|
||||
|
||||
def default_show_params; Term.default_show_params; end
|
||||
|
@ -45,7 +44,8 @@ module GlossaryHelper
|
|||
|
||||
|
||||
def params_select(form, name, prms)
|
||||
options = prms.collect{|prm| [label_param(prm), prm]}
|
||||
vprms = collect_visible_params(prms)
|
||||
options = vprms.collect{|prm| [label_param(prm), prm]}
|
||||
form.select(name, options, :include_blank=>true)
|
||||
end
|
||||
|
||||
|
|
|
@ -22,7 +22,7 @@ module GlossaryStylesHelper
|
|||
|
||||
def search_index_table(ary, sepcnt, proj, search_index_type = nil)
|
||||
return "" if (!ary.is_a?(Array) or sepcnt <= 0)
|
||||
str = '<table><tr>'
|
||||
str = '<table id="glossary_index"><tr>'
|
||||
cnt = 0
|
||||
for ch in ary
|
||||
str += '</tr><tr>' if ((cnt != 0) and (cnt % sepcnt) == 0 )
|
||||
|
|
|
@ -5,6 +5,5 @@
|
|||
<%= render(:partial => "glossary/show_one", :object => term) %>
|
||||
|
||||
</div>
|
||||
<br />
|
||||
<% end %>
|
||||
<br />
|
||||
|
|
|
@ -1,12 +1,16 @@
|
|||
|
||||
<% term = show_one %>
|
||||
<% if !@show_params.empty? %>
|
||||
<table class="term_items">
|
||||
<% for prm in @show_params %>
|
||||
<tr><th><%=h label_param(prm) %>:</th><td><%= term.value(prm) %></td></tr>
|
||||
<% end %>
|
||||
</table>
|
||||
<% end %>
|
||||
<% unless (term.description.empty?) %>
|
||||
<% if !@show_params.empty? %>
|
||||
<strong><%=l(:field_description)%></strong>:
|
||||
<% end %>
|
||||
<div class="wiki">
|
||||
<%= textilizable term, :description, :attachments => term.attachments %>
|
||||
</div>
|
||||
|
|
|
@ -15,16 +15,16 @@
|
|||
<%= link_to_if_authorized(l(:label_move_all_terms), {:controller => 'glossary', :action => 'move_all', :project_id => @project}, :class => 'icon icon-move') %>
|
||||
<br />
|
||||
<% end %>
|
||||
<%= link_to(l(:label_glossary_import_csv), {:controller => 'glossary', :action => 'import_csv', :project_id => @project}) %>
|
||||
<%= link_to(l(:label_glossary_import_csv), {:controller => 'glossary', :action => 'import_csv', :project_id => @project}, :id => 'glossary_import_csv') %>
|
||||
<br />
|
||||
<% end %>
|
||||
|
||||
|
||||
<% if User.current.allowed_to?(:manage_term_categories, @project, :global => true) %>
|
||||
<h3><%= l(:label_term_category) %></h3>
|
||||
<%= link_to l(:label_term_category_new), {:controller => 'glossary', :action => 'add_term_category', :project_id => @project}, :class => 'icon icon-add' %>
|
||||
<%= link_to(l(:label_term_category_new), {:controller => 'glossary', :action => 'add_term_category', :project_id => @project}, :class => 'icon icon-add') %>
|
||||
<br />
|
||||
<%= link_to l(:label_manage_term_category), { :controller => 'term_categories', :action => 'index', :project_id => @project } %>
|
||||
<%= link_to(l(:label_manage_term_category), { :controller => 'term_categories', :action => 'index', :project_id => @project }, :id => 'glossary_term_categories') %>
|
||||
<br />
|
||||
<% end %>
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@ if params[:search_index_ch]
|
|||
subtitlle = "- #{params[:search_index_ch]} -"
|
||||
end %>
|
||||
|
||||
<h1><%= t('glossary_title') %> <%= subtitlle %> </h1>
|
||||
<h2><%= t('glossary_title') %> <%= subtitlle %> </h2>
|
||||
|
||||
<br />
|
||||
<% if User.current.allowed_to?(:view_terms, @project, :global => true) %>
|
||||
|
@ -22,7 +22,7 @@ end %>
|
|||
<% if @glossary_style.grouping? %>
|
||||
<% list_number = 1 %>
|
||||
<% @terms.each do |gterms| %>
|
||||
<h2><%= "#{list_number}. #{gterms.name}" %></h2>
|
||||
<h3><%= "#{list_number}. #{gterms.name}" %></h3>
|
||||
<% list_number += 1 %>
|
||||
<%= render(:partial => tempname, :object => gterms.ary) %>
|
||||
<% end %>
|
||||
|
|
|
@ -6,9 +6,6 @@
|
|||
form = form_for @glossary_style, :url => urlopts do |f| %>
|
||||
|
||||
|
||||
<label> <%= f.check_box "show_desc" %> <%= l(:label_glossary_style_show_desc) %> </label>
|
||||
<br />
|
||||
|
||||
<%=h l(:label_project) %>
|
||||
<%=
|
||||
options = []
|
||||
|
@ -37,6 +34,11 @@
|
|||
<% end %>
|
||||
</fieldset>
|
||||
|
||||
|
||||
<label id="show_desc"> <%= f.check_box "show_desc" %> <%= l(:label_glossary_style_show_desc) %> </label>
|
||||
|
||||
<br />
|
||||
|
||||
<%= submit_tag l(:label_view) %>
|
||||
<%= submit_tag l(:button_clear), :name => 'clear' %>
|
||||
|
||||
|
|
|
@ -6,9 +6,9 @@
|
|||
<div id="glossary_search" class="hide-when-print">
|
||||
<fieldset id="filters" class="collapsible <%= (glossary_searching?) ? "" : "collapsed" %>">
|
||||
<legend onclick="toggleFieldset(this);"><%= l(:label_filter_plural) %></legend>
|
||||
<div style="<%= (glossary_searching?) ? "" : "display: none;" %>">
|
||||
<div style="<%= (glossary_searching?) ? '' : 'display: none;' %>">
|
||||
|
||||
<table>
|
||||
<table id="glossary_search_params">
|
||||
|
||||
<tr><th><%=h l(:label_search) %></th>
|
||||
<td>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue