myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [3655] branches/packs: added provenance informati


From: noreply
Subject: [myexperiment-hackers] [3655] branches/packs: added provenance information to annotations
Date: Mon, 2 Sep 2013 01:52:30 +0000 (UTC)

Revision
3655
Author
dgc
Date
2013-09-02 01:52:30 +0000 (Mon, 02 Sep 2013)

Log Message

added provenance information to annotations

Modified Paths

Diff

Modified: branches/packs/app/helpers/packs_helper.rb (3654 => 3655)


--- branches/packs/app/helpers/packs_helper.rb	2013-09-02 01:37:12 UTC (rev 3654)
+++ branches/packs/app/helpers/packs_helper.rb	2013-09-02 01:52:30 UTC (rev 3655)
@@ -121,4 +121,19 @@
 
     generic
   end
+
+  def user_link(uri)
+
+    # Get absolute URI.
+    uri = URI.parse(Conf.base_uri).merge(uri).to_s
+
+    # Match it up with the users
+    resource = parse_resource_uri(uri)
+
+    if resource && resource[0] == User
+      link_to(User.find(resource[1]).name, uri)
+    else
+      link_to(uri, uri)
+    end
+  end
 end

Modified: branches/packs/app/views/packs/_annotation.html.erb (3654 => 3655)


--- branches/packs/app/views/packs/_annotation.html.erb	2013-09-02 01:37:12 UTC (rev 3654)
+++ branches/packs/app/views/packs/_annotation.html.erb	2013-09-02 01:52:30 UTC (rev 3655)
@@ -20,5 +20,12 @@
       <% end %>
     </table>
   <% end %>
+
+  <div class="provenance">
+    Created by
+    <span class="contributor"><%= user_link(annotation[:annotation].creator_uri) -%></span>
+    on
+    <span class="date"><%= datetime(annotation[:annotation].created_at, false) -%></span>
+  </div>
 </div>
 

Modified: branches/packs/public/stylesheets/styles.css (3654 => 3655)


--- branches/packs/public/stylesheets/styles.css	2013-09-02 01:37:12 UTC (rev 3654)
+++ branches/packs/public/stylesheets/styles.css	2013-09-02 01:52:30 UTC (rev 3655)
@@ -2691,3 +2691,8 @@
 .annotation TEXTAREA {
   height: 100px;
 }
+
+.annotation .provenance {
+  text-align: right;
+  font-size: 10px;
+}

reply via email to

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