Commit 6de7aebf4e58a32cf72b811a3e67d2192d054f40
1 parent
d0fa2ba7
Exists in
theme-brasil-digital-from-staging
and in
9 other branches
move css definitions to stylesheet file; improve html structure for listing triples
Showing
2 changed files
with
56 additions
and
45 deletions
Show diff stats
plugins/virtuoso/public/style.css
1 | .virtuoso-triples-template .template { | 1 | .virtuoso-triples-template .template { |
2 | margin: 10px 0; | 2 | margin: 10px 0; |
3 | } | 3 | } |
4 | + | ||
5 | +#virtuoso-triples-management input[type="text"] { | ||
6 | + width: 100% | ||
7 | +} | ||
8 | + | ||
9 | +#virtuoso-triples-management textarea { | ||
10 | + width: 99%; | ||
11 | +} | ||
12 | + | ||
13 | +#virtuoso-triples-management ul { | ||
14 | + list-style-type: none; | ||
15 | + padding: 0; | ||
16 | +} | ||
17 | + | ||
18 | +#virtuoso-triples-management #triples-list { | ||
19 | + border-top: 1px solid #CCC; | ||
20 | + padding-top: 15px; | ||
21 | +} | ||
22 | + | ||
23 | +#triples-list > li + li { | ||
24 | + border-top: 1px solid #CCC; | ||
25 | + margin-top: 20px; | ||
26 | + padding-top: 15px; | ||
27 | +} |
plugins/virtuoso/views/virtuoso_plugin_admin/triple_management.html.erb
1 | -<h1><%= _('Virtuoso settings : Triples Management')%></h1> | 1 | +<div id="virtuoso-triples-management"> |
2 | + <h1><%= _('Virtuoso settings » Triples Management')%></h1> | ||
2 | 3 | ||
3 | -<%= form_tag('/admin/plugin/virtuoso/triple_management', :method => 'post') do %> | ||
4 | - | ||
5 | - <%= labelled_form_field(_('Default Graph IRI:'), text_field_tag(:graph_uri, @graph_uri, :style => 'width: 100%' ) ) %> | ||
6 | - | ||
7 | - <%= labelled_form_field(_('Query SPARQL:'), text_area_tag(:query, @query, { :rows => 7, :style => 'width: 99%' } )) %> | ||
8 | - | ||
9 | - <% button_bar do %> | ||
10 | - <%= submit_button(:search, _('Search')) %> | 4 | + <%= form_tag('/admin/plugin/virtuoso/triple_management', :method => 'post') do %> |
5 | + <%= labelled_form_field(_('Default Graph IRI:'), text_field_tag(:graph_uri, @graph_uri) ) %> | ||
6 | + <%= labelled_form_field(_('Query SPARQL:'), text_area_tag(:query, @query, :rows => 7)) %> | ||
7 | + <% button_bar do %> | ||
8 | + <%= submit_button(:search, _('Search')) %> | ||
9 | + <% end %> | ||
11 | <% end %> | 10 | <% end %> |
12 | 11 | ||
13 | -<% end %> | ||
14 | - | ||
15 | -<style> | ||
16 | -.triple + .triple { | ||
17 | - border-top: 1px solid #CCC; | ||
18 | - margin-top: 20px; | ||
19 | - padding-top: 15px; | ||
20 | -} | ||
21 | -</style> | ||
22 | - | ||
23 | -<% unless @triples.empty? %> | ||
24 | - | ||
25 | - <hr /> | 12 | + <% unless @triples.empty? %> |
26 | 13 | ||
27 | <%= form_tag('/admin/plugin/virtuoso/triple_update', :method => 'post') do %> | 14 | <%= form_tag('/admin/plugin/virtuoso/triple_update', :method => 'post') do %> |
28 | - | ||
29 | <%= hidden_field_tag(:graph_uri, @graph_uri) %> | 15 | <%= hidden_field_tag(:graph_uri, @graph_uri) %> |
30 | 16 | ||
31 | - <% @triples.each { |triple| %> | ||
32 | - | ||
33 | - <div class="triple"> | ||
34 | - | ||
35 | - <div class="triple-subject" style="margin: 3px 0 3px 0;"> | ||
36 | - <label class="formlabel"><%= _('Subject:') %></label> | ||
37 | - <%= hidden_field_tag('triples[][from[subject]]', triple[:s].to_s) %> | ||
38 | - <%= text_field_tag('triples[][to[subject]]', triple[:s].to_s, :style => 'width: 99%;') %> | ||
39 | - </div> | ||
40 | - | ||
41 | - <div class="triple-predicate" style="margin: 3px 0 3px 0;"> | ||
42 | - <label class="formlabel"><%= _('Predicate:') %></label> | ||
43 | - <%= hidden_field_tag('triples[][from[predicate]]', triple[:p].to_s) %> | ||
44 | - <%= text_field_tag('triples[][to[predicate]]', triple[:p].to_s, :style => 'width: 99%;') %> | ||
45 | - </div> | 17 | + <ul id="triples-list"> |
46 | 18 | ||
47 | - <div class="triple-object" style="margin: 3px 0 3px 0;"> | ||
48 | - <label class="formlabel"><%= _('Object:') %></label> | ||
49 | - <%= hidden_field_tag('triples[][from[object]]', triple[:o].to_s) %> | ||
50 | - <%= text_field_tag('triples[][to[object]]', triple[:o].to_s, :style => 'width: 99%;') %> | ||
51 | - </div> | 19 | + <% @triples.each { |triple| %> |
52 | 20 | ||
53 | - </div> | 21 | + <li> |
22 | + <ul class="triple"> | ||
23 | + <li> | ||
24 | + <%= hidden_field_tag('triples[][from[subject]]', triple[:s].to_s) %> | ||
25 | + <%= labelled_form_field(_('Subject:'), text_field_tag('triples[][to[subject]]', triple[:s].to_s) ) %> | ||
26 | + </li> | ||
27 | + <li> | ||
28 | + <%= hidden_field_tag('triples[][from[predicate]]', triple[:p].to_s) %> | ||
29 | + <%= labelled_form_field(_('Predicate:'), text_field_tag('triples[][to[predicate]]', triple[:p].to_s) ) %> | ||
30 | + </li> | ||
31 | + <li> | ||
32 | + <%= hidden_field_tag('triples[][from[object]]', triple[:o].to_s) %> | ||
33 | + <%= labelled_form_field(_('Object:'), text_field_tag('triples[][to[object]]', triple[:o].to_s) ) %> | ||
34 | + </li> | ||
35 | + </ul> | ||
36 | + </li> | ||
54 | 37 | ||
55 | <% } %> | 38 | <% } %> |
56 | 39 | ||
40 | + </ul> | ||
41 | + | ||
57 | <% button_bar do %> | 42 | <% button_bar do %> |
58 | <%= submit_button(:save, _('Save')) %> | 43 | <%= submit_button(:save, _('Save')) %> |
59 | <% end %> | 44 | <% end %> |
60 | 45 | ||
61 | <% end %> | 46 | <% end %> |
62 | 47 | ||
63 | -<% end %> | 48 | + <% end %> |
49 | + | ||
50 | +</div> |