Diff
Modified: branches/packs/app/controllers/annotations_controller.rb (3700 => 3701)
--- branches/packs/app/controllers/annotations_controller.rb 2013-09-10 16:04:31 UTC (rev 3700)
+++ branches/packs/app/controllers/annotations_controller.rb 2013-09-11 01:01:12 UTC (rev 3701)
@@ -20,7 +20,7 @@
@graph = load_graph(@annotation.ao_body.content_blob.data, :content_type => @annotation.ao_body.content_type)
- @annotation_template, @parameters = @context.research_object.find_template_from_graph(@graph, Conf.ro_templates)
+ @annotation = @context.research_object.annotation_with_template(@annotation)
end
def create
Modified: branches/packs/app/controllers/packs_controller.rb (3700 => 3701)
--- branches/packs/app/controllers/packs_controller.rb 2013-09-10 16:04:31 UTC (rev 3700)
+++ branches/packs/app/controllers/packs_controller.rb 2013-09-11 01:01:12 UTC (rev 3701)
@@ -525,10 +525,8 @@
@authorised_to_download = Authorization.check("download", @pack, current_user)
@pack_entry_url = url_for : false,
- :host => base_host,
+ :host => Conf.hostname,
:id => @pack.id
-
- @base_host = base_host
else
render_401("You are not authorized to access this pack.")
end
Modified: branches/packs/app/models/research_object.rb (3700 => 3701)
--- branches/packs/app/models/research_object.rb 2013-09-10 16:04:31 UTC (rev 3700)
+++ branches/packs/app/models/research_object.rb 2013-09-11 01:01:12 UTC (rev 3701)
@@ -621,20 +621,24 @@
graph
end
- def annotations_with_templates_aux(annotations)
+ def annotation_with_template(annotation)
- annotations.uniq.map do |annotation|
+ graph = load_graph(annotation.ao_body.content_blob.data, :content_type => annotation.ao_body.content_type)
- graph = load_graph(annotation.ao_body.content_blob.data, :content_type => annotation.ao_body.content_type)
+ template, parameters = find_template_from_graph(graph, Conf.ro_templates)
- template, parameters = find_template_from_graph(graph, Conf.ro_templates)
+ {
+ :annotation => annotation,
+ :graph => graph,
+ :template => template,
+ :parameters => parameters
+ }
+ end
- {
- :annotation => annotation,
- :graph => graph,
- :template => template,
- :parameters => parameters
- }
+ def annotations_with_templates_aux(annotations)
+
+ annotations.uniq.map do |annotation|
+ annotation_with_template(annotation)
end
end
Modified: branches/packs/app/views/annotations/new.html.erb (3700 => 3701)
--- branches/packs/app/views/annotations/new.html.erb 2013-09-10 16:04:31 UTC (rev 3700)
+++ branches/packs/app/views/annotations/new.html.erb 2013-09-11 01:01:12 UTC (rev 3701)
@@ -1,13 +1,13 @@
-<h1>New annotation</h1>
+<h1>New annotation in <%=h @context.label -%></h1>
<% form_tag(polymorphic_path(address@hidden, :annotations])) do |f| -%>
- <%= render(:partial => "form", :locals => {
- :research_object => @context.research_object,
- :template => params[:template],
- :annotation_template => @annotation_template,
- :values => params,
- :add_button => true } ) -%>
+ <div class="new-annotation">
+ <%= render(:partial => "form", :locals => {
+ :research_object => @context.research_object,
+ :template => params[:template],
+ :annotation_template => @annotation_template,
+ :values => params,
+ :add_button => true } ) -%>
+ </div>
<% end %>
-<h2>Debug</h2>
-<pre><%=h @annotation_template.to_yaml -%></pre>
Modified: branches/packs/app/views/annotations/show.html.erb (3700 => 3701)
--- branches/packs/app/views/annotations/show.html.erb 2013-09-10 16:04:31 UTC (rev 3700)
+++ branches/packs/app/views/annotations/show.html.erb 2013-09-11 01:01:12 UTC (rev 3701)
@@ -1,6 +1,6 @@
<h1>Annotation</h1>
-<h2>Debug</h2>
+<div>
+ <%= render(:partial => 'annotations/annotation', :locals => { :context => @context, :annotation => @annotation, :source => nil } ) -%>
+</div>
-<pre><%=h @annotation_template.to_yaml -%></pre>
-<pre><%=h @parameters.to_yaml -%></pre>
Modified: branches/packs/app/views/packs/_add_item.rhtml (3700 => 3701)
--- branches/packs/app/views/packs/_add_item.rhtml 2013-09-10 16:04:31 UTC (rev 3700)
+++ branches/packs/app/views/packs/_add_item.rhtml 2013-09-11 01:01:12 UTC (rev 3701)
@@ -1,11 +1,11 @@
<% if logged_in? -%>
- <% if @error_message -%>
- <p class="error_text" style="padding: 0 0.8em;"><%= @error_message -%></p>
+ <% if error_message -%>
+ <p class="error_text" style="padding: 0 0.8em;"><%= error_message -%></p>
<br/>
<% end -%>
- <% form_tag quick_add_pack_url(@pack) do -%>
+ <% form_tag quick_add_pack_url(context) do -%>
<table class="quick_add">
<tr class="uri">
@@ -24,9 +24,9 @@
<option value="">select from your contributions...</option>
<% contributions.each do |c| -%>
<% if ["workflow", "blob", "pack"].include? c.contributable_type.downcase -%>
- <% show = (c.contributable.class.to_s == 'Pack' ? (@pack.id != c.contributable.id) : true) -%> <!-- prevents from displaying current pack in the list of things that are enabled to be added to the current pack -->
+ <% show = (c.contributable.class.to_s == 'Pack' ? (context.id != c.contributable.id) : true) -%> <!-- prevents from displaying current pack in the list of things that are enabled to be added to the current pack -->
<% if show -%>
- <option value="<%= contributable_url(c.contributable_id, c.contributable_type, @base_host) -%>">
+ <option value="<%= contributable_url(c.contributable_id, c.contributable_type, Conf.hostname) -%>">
<%= "#{visible_name c.contributable_type}: #{contributable_name(c.contributable_id, c.contributable_type)}" -%>
</option>
<% end %>
@@ -45,9 +45,9 @@
<option value="">select from your favourites...</option>
<% bookmarks.each do |b| -%>
<% if ["workflow", "blob", "pack"].include? b.bookmarkable_type.downcase -%>
- <% show = (b.bookmarkable_type == 'Pack' ? (@pack.id != b.bookmarkable_id) : true) -%> <!-- prevents from displaying current pack in the list of things that are enabled to be added to the current pack -->
+ <% show = (b.bookmarkable_type == 'Pack' ? (context.id != b.bookmarkable_id) : true) -%> <!-- prevents from displaying current pack in the list of things that are enabled to be added to the current pack -->
<% if show -%>
- <option value="<%= contributable_url(b.bookmarkable_id, b.bookmarkable_type, @base_host) -%>">
+ <option value="<%= contributable_url(b.bookmarkable_id, b.bookmarkable_type, Conf.hostname) -%>">
<%= "#{visible_name b.bookmarkable_type}: #{contributable_name(b.bookmarkable_id, b.bookmarkable_type)}" -%>
</option>
<% end %>
@@ -69,14 +69,14 @@
<tr>
<td class="label">Folder</td>
<td>
- <%= select_tag(:folder, options_for_select(['(automatic)'] + @ore_directories)) -%>
+ <%= select_tag(:folder, options_for_select(['(automatic)'] + ore_directories)) -%>
</td>
</tr>
<tr>
<td></td>
<td class="submit">
- <%= submit_tag "Add item", :disable_with => "..." -%>
+ <%= submit_tag "Add item" -%>
</td>
</tr>
Modified: branches/packs/app/views/packs/show.rhtml (3700 => 3701)
--- branches/packs/app/views/packs/show.rhtml 2013-09-10 16:04:31 UTC (rev 3700)
+++ branches/packs/app/views/packs/show.rhtml 2013-09-11 01:01:12 UTC (rev 3701)
@@ -10,7 +10,7 @@
<li><%= icon('manage', edit_pack_path(@pack), nil, nil, 'Manage Pack') -%></li>
<% end -%>
<% end %>
- <li><%= icon('folder', pack_items_path(@pack), nil, nil, 'Items') -%></li>
+ <li><%= icon('folder', pack_items_path(@pack), nil, nil, 'View Items') -%></li>
<li><%= icon('annotations', pack_annotations_path(@pack), nil, nil, 'Annotations') -%></li>
<li><%= icon('disk', download_pack_path(@pack), nil, nil, "Download") %></li>
<% if false %>
@@ -61,13 +61,9 @@
<h2>Description</h2>
<% unless @pack.description.blank? %>
- <div class="contribution_description">
+ <div>
<%= @pack.description_html %>
</div>
- <% if mine?(@pack) %>
- <br/>
- <p style="text-align: right; color: #666666;">[ <%= link_to "edit", edit_pack_path(@pack) %> ]</p>
- <% end %>
<% else %>
<p class="none_text">
Not set
@@ -114,9 +110,10 @@
Add an Item
</h2>
<a name="add_item"></a>
- <%= render :partial => "add_item", :locals => { :pack => @pack } -%>
+ <%= render :partial => "add_item", :locals => { :context => @pack, :ore_directories => @ore_directories, :error_message => @error_message, :source => nil } -%>
<% end %>
+ <% if false %>
<h2>Debug</h2>
<div id="tabsContainer" class="tabsContainer"></div>
@@ -158,7 +155,6 @@
</div>
</div>
- <% if false %>
<div class="tabContainer">
<div class="tabTitle">RDF Statements</div>
<div class="tabContent">
Modified: branches/packs/public/stylesheets/styles.css (3700 => 3701)
--- branches/packs/public/stylesheets/styles.css 2013-09-10 16:04:31 UTC (rev 3700)
+++ branches/packs/public/stylesheets/styles.css 2013-09-11 01:01:12 UTC (rev 3701)
@@ -2705,3 +2705,8 @@
vertical-align: middle;
}
+.new-annotation > TABLE {
+ margin: 32px auto;
+ padding: 8px;
+}
+