Ahora sólo se muestra el primer párrafo de la definición de cada término del glosario en la vista de tabla

This commit is contained in:
Manuel Cillero 2019-01-30 18:39:57 +01:00
parent 4ebcf2c462
commit d491f8c5fc
4 changed files with 8 additions and 10 deletions

View file

@ -11,13 +11,13 @@
<tbody> <tbody>
<% for term in index_in_category -%> <% for term in index_in_category -%>
<tr class="<%= cycle("odd", "even") %> term"> <tr class="<%= cycle("odd", "even") %> term">
<td><%=h term.id %></td> <td><%=h term.id %></td>
<td><%= term_link(term) %></td> <td><%= term_link(term) %></td>
<% for prm in @show_params %> <% for prm in @show_params %>
<td><%=h term.value(prm) %></td> <td><%=h term.value(prm) %></td>
<% end %> <% end %>
<!--td><%=h truncate(term.description, :length=>50) %></td--> <!--td><%=h truncate(term.description, :length=>50) %></td-->
<td><%=textilizable term.description %></td> <td><% @paragraphs = Nokogiri::HTML.parse(term.description).css('p') %><%=textilizable @paragraphs.first.inner_html + (@paragraphs.size > 1 ? '<p>…</p>' : '') %></td>
<td align="right" width="40px"> <td align="right" width="40px">
<% if term.project_id == @project.id %> <% 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('edit.png'), {:action => 'edit', :project_id => @project, :id => term}, :title => l(:button_edit)) %>

View file

@ -1,16 +1,14 @@
<% term = show_one %> <% term = show_one %>
<% if !@show_params.empty? %> <% if @show_params.size > 1 %>
<table class="term_items"> <table class="term_items">
<% for prm in @show_params %> <% for prm in @show_params %>
<tr><th><%=h label_param(prm) %>:</th><td><%= term.value(prm) %></td></tr> <% unless term.value(prm).blank? %><tr><th><%=h label_param(prm) %>:</th><td><%= term.value(prm) %></td></tr><% end %>
<% end %> <% end %>
</table> </table>
<% end %> <% end %>
<% unless (term.description.empty?) %> <% unless (term.description.empty?) %>
<% if !@show_params.empty? %> <% if @show_params.size > 1 %><strong><%= l(:field_description) %></strong>:<% end %>
<strong><%=l(:field_description)%></strong>:
<% end %>
<div class="wiki"> <div class="wiki">
<%= textilizable term, :description, :attachments => term.attachments %> <%= textilizable term, :description, :attachments => term.attachments %>
</div> </div>

View file

@ -9,7 +9,7 @@ es:
label: label:
id: No. id: No.
name: Término name: Término
name_en: Inglés name_en: En inglés
category: Categoría category: Categoría
datatype: "Tipo de dato en código" datatype: "Tipo de dato en código"
codename: "Abreviatura en código" codename: "Abreviatura en código"

View file

@ -1502,10 +1502,10 @@ table.term_items tr th {
#glossary_style_project_scope { #glossary_style_project_scope {
margin-left: 1em; margin-left: 1em;
} }
.edit_glossary_style #grouping { form[class$="glossary_style"] #grouping {
margin-top: 4px; margin-top: 4px;
} }
.edit_glossary_style #grouping label { form[class$="glossary_style"] #grouping label {
display: block; display: block;
text-transform: capitalize; text-transform: capitalize;
} }