myexperiment-hackers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[myexperiment-hackers] [3633] branches/packs: added ability to add descr


From: noreply
Subject: [myexperiment-hackers] [3633] branches/packs: added ability to add descriptions
Date: Tue, 27 Aug 2013 22:34:15 +0000 (UTC)

Revision
3633
Author
dgc
Date
2013-08-27 22:34:14 +0000 (Tue, 27 Aug 2013)

Log Message

added ability to add descriptions

Modified Paths

Diff

Modified: branches/packs/app/controllers/annotations_controller.rb (3632 => 3633)


--- branches/packs/app/controllers/annotations_controller.rb	2013-08-27 14:12:42 UTC (rev 3632)
+++ branches/packs/app/controllers/annotations_controller.rb	2013-08-27 22:34:14 UTC (rev 3633)
@@ -47,7 +47,7 @@
 
       parameters[parameter["symbol"]] = case parameter["type"]
 
-      when "string"
+      when "string", "textarea"
         RDF::Literal(params[parameter["symbol"]])
       when "resource"
         pack.research_object.find_using_path(params[parameter["symbol"]]).uri

Modified: branches/packs/app/controllers/packs_controller.rb (3632 => 3633)


--- branches/packs/app/controllers/packs_controller.rb	2013-08-27 14:12:42 UTC (rev 3632)
+++ branches/packs/app/controllers/packs_controller.rb	2013-08-27 22:34:14 UTC (rev 3633)
@@ -481,6 +481,8 @@
 
     @title = @statements.query(address@hidden, RDF::DC.title, nil]).first_value || @item.folder_entry.entry_name
 
+    @description = @statements.query(address@hidden, RDF::DC.description, nil]).first_value
+
     unless @item
       render_404("Pack item not found.")
       return

Modified: branches/packs/app/views/annotations/_breadcrumbs.html.erb (3632 => 3633)


--- branches/packs/app/views/annotations/_breadcrumbs.html.erb	2013-08-27 14:12:42 UTC (rev 3632)
+++ branches/packs/app/views/annotations/_breadcrumbs.html.erb	2013-08-27 22:34:14 UTC (rev 3633)
@@ -1,7 +1,12 @@
 <li><%= link_to("Packs", packs_path) -%></li>
 <li><%= link_to(h(@pack.title), polymorphic_path(@pack)) -%></li>
-<li><%= link_to("Annotations", polymorphic_path(address@hidden, :annotations])) -%></li>
 
+<% if controller.action_name == "index" %>
+  <li>Annotations</li>
+<% else %>
+  <li><%= link_to("Annotations", polymorphic_path(address@hidden, :annotations])) -%></li>
+<% end %>
+
 <% case controller.action_name; when "new" %>
   <li>New</li>
 <% when "show" %>

Modified: branches/packs/app/views/annotations/_form.html.erb (3632 => 3633)


--- branches/packs/app/views/annotations/_form.html.erb	2013-08-27 14:12:42 UTC (rev 3632)
+++ branches/packs/app/views/annotations/_form.html.erb	2013-08-27 22:34:14 UTC (rev 3633)
@@ -10,6 +10,8 @@
       <td><%= parameter["label"] -%></td>
       <% case parameter["type"] ; when "string" %>
         <td><%= text_field_tag(parameter["symbol"], values[parameter["symbol"]]) -%></td>
+      <% when "textarea" %>
+        <td><%= text_area_tag(parameter["symbol"], values[parameter["symbol"]]) -%></td>
       <% when "resource" %>
         <td><%= text_field_tag(parameter["symbol"], values[parameter["symbol"]]) -%></td>
       <% end %>

Modified: branches/packs/app/views/packs/item_show.html.erb (3632 => 3633)


--- branches/packs/app/views/packs/item_show.html.erb	2013-08-27 14:12:42 UTC (rev 3632)
+++ branches/packs/app/views/packs/item_show.html.erb	2013-08-27 22:34:14 UTC (rev 3633)
@@ -28,6 +28,14 @@
   </tr>
 </table>
 
+<h2>Description</h2>
+
+<% if @description %>
+  <p><%=h simple_format(@description) -%></p>
+<% end %>
+
+<p><%= link_to('[Add description]', new_pack_annotation_path(@pack, { :template => 'description', :resource => @item.ore_path })) -%></p>
+
 <h1>Debug</h1>
 
 <div id="tabsContainer" class="tabsContainer"></div>

Modified: branches/packs/config/default_settings.yml (3632 => 3633)


--- branches/packs/config/default_settings.yml	2013-08-27 14:12:42 UTC (rev 3632)
+++ branches/packs/config/default_settings.yml	2013-08-27 22:34:14 UTC (rev 3633)
@@ -1524,6 +1524,26 @@
     targets:
     - :resource
 
+  description:
+
+    label: description
+
+    parameters:
+
+    - label:  Resource
+      type:   resource 
+      symbol: :resource
+
+    - label:  Description
+      type:   textarea
+      symbol: :description
+
+    required_statements:
+    - [:resource, "<http://purl.org/dc/terms/description>", :description]
+
+    targets:
+    - :resource
+
 wf_ro_service_uri: "http://www.example.com/wf-ro/jobs"
 wf_ro_service_bearer_token: "bearer-token"
 

Modified: branches/packs/public/stylesheets/styles.css (3632 => 3633)


--- branches/packs/public/stylesheets/styles.css	2013-08-27 14:12:42 UTC (rev 3632)
+++ branches/packs/public/stylesheets/styles.css	2013-08-27 22:34:14 UTC (rev 3633)
@@ -2664,6 +2664,7 @@
 
 .annotation TD {
   text-align: left;
+  vertical-align: top;
 }
 
 .annotation .type {
@@ -2674,6 +2675,11 @@
   content: ":";
 }
 
-.annotation INPUT {
+.annotation INPUT,
+.annotation TEXTAREA {
   width: 500px;
 }
+
+.annotation TEXTAREA {
+  height: 100px;
+}

reply via email to

[Prev in Thread] Current Thread [Next in Thread]