myexperiment-hackers
[Top][All Lists]
Advanced

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

[myexperiment-hackers] [3267] branches/wf4ever: Make Finn's folder stuff


From: noreply
Subject: [myexperiment-hackers] [3267] branches/wf4ever: Make Finn's folder stuff work in rails 2
Date: Fri, 14 Dec 2012 16:56:22 +0000 (UTC)

Revision
3267
Author
stain
Date
2012-12-14 16:56:22 +0000 (Fri, 14 Dec 2012)

Log Message

Make Finn's folder stuff work in rails 2

Modified Paths

Added Paths

Removed Paths

Diff

Modified: branches/wf4ever/app/controllers/folders_controller.rb (3266 => 3267)


--- branches/wf4ever/app/controllers/folders_controller.rb	2012-12-14 16:56:15 UTC (rev 3266)
+++ branches/wf4ever/app/controllers/folders_controller.rb	2012-12-14 16:56:22 UTC (rev 3267)
@@ -35,6 +35,9 @@
     @ro = ROSRS::ResearchObject.new(@session, params[:ro_uri])
     folder = ROSRS::Folder.new(@ro, params[:folder_uri])
     @contents = folder.contents.map {|fe| [fe.resource.uri, fe.name]}
+    respond_to do |format|
+      format.js { render :json => @contents }
+    end
     # Renders folder_contents.js.erb
    end
 

Added: branches/wf4ever/app/views/folders/_breadcrumbs.html.erb ( => )


Modified: branches/wf4ever/app/views/folders/_navigation.html.erb
===================================================================
--- branches/wf4ever/app/views/folders/_navigation.html.erb	2012-12-14 16:56:15 UTC (rev 3266)
+++ branches/wf4ever/app/views/folders/_navigation.html.erb	2012-12-14 16:56:22 UTC (rev 3267)
@@ -1,18 +1,18 @@
 <div id="nav-tabs" class="yui-navset">
     <ul class="yui-nav">
         <li class="selected"><a href="" View</em></a></li>
-        <!---<li><a href=""
+        <!--<li><a href=""
     </ul>
     <div class="yui-content">
         <div>
-          <!---<div id="tree-controls">
+          <!--<div id="tree-controls">
             <a id="expand_all" href="" All</a> | <a id="collapse_all" href="" All</a>
-          </div> --->
+          </div> -->
           <div id="tree"></div>
         </div>
-        <!---<div id="relations">
+        <!--<div id="relations">
           <img src="" style="width:200px; height:200px"/>
-        </div>--->
+        </div>-->
     </div>
 </div>
 
@@ -23,7 +23,7 @@
   // Handle users clicking on nodes
   tree.subscribe("labelClick", function(node) {
     if(node.data.uri != null) {
-      $('#open-url').text(node.data.uri);
+      alert("You clicked " + node.data.uri);     
     }
   });
 
@@ -32,7 +32,7 @@
 
   function loadNodeData(node, fnLoadComplete)  {
     var nodeLabel = encodeURI(node.label);
-    var sUrl = "<%= get_folder_url -%>?folder_uri=" + node.data.uri + "&ro_uri=" + "<%= @ro.uri -%>";
+    var sUrl = "<%= folder_contents_url -%>?folder_uri=" + node.data.uri + "&ro_uri=" + "<%= @ro.uri -%>";
     var callback = {
       success: function(oResponse) {
         var oResults = eval("(" + oResponse.responseText + ")");

Deleted: branches/wf4ever/app/views/folders/folder_contents.js.erb (3266 => 3267)


--- branches/wf4ever/app/views/folders/folder_contents.js.erb	2012-12-14 16:56:15 UTC (rev 3266)
+++ branches/wf4ever/app/views/folders/folder_contents.js.erb	2012-12-14 16:56:22 UTC (rev 3267)
@@ -1 +0,0 @@
-<%= @contents.to_json.html_safe -%>

Modified: branches/wf4ever/app/views/folders/index.html.erb (3266 => 3267)


--- branches/wf4ever/app/views/folders/index.html.erb	2012-12-14 16:56:15 UTC (rev 3266)
+++ branches/wf4ever/app/views/folders/index.html.erb	2012-12-14 16:56:22 UTC (rev 3267)
@@ -11,7 +11,7 @@
     <div id="demo" class="yui-navset">
       <div class="yui-content">
         <h3><-- Click on a folder to expand it and see its contents.</h3>
-        <%= form_tag mockups_folder_url do %>
+        <% form_tag folders_url do %>
           <p>
             <strong>RO URI</strong>:<br/>
             <%= text_field_tag(:ro_uri, params[:ro_uri], :size => 100) %> <%= submit_tag("Go") %>

Modified: branches/wf4ever/app/views/layouts/_myexperiment.rhtml (3266 => 3267)


--- branches/wf4ever/app/views/layouts/_myexperiment.rhtml	2012-12-14 16:56:15 UTC (rev 3266)
+++ branches/wf4ever/app/views/layouts/_myexperiment.rhtml	2012-12-14 16:56:22 UTC (rev 3267)
@@ -8,8 +8,11 @@
   <% if @lod_rdf %><link rel="alternate" href="" @lod_rdf -%>" type="application/rdf+xml" title="RDF+XML" /><% end %>
   <% if @lod_xml %><link rel="alternate" href="" @lod_xml -%>" type="application/xml" title="REST XML" /><% end %>
   <link rel="shortcut icon" href="" type="image/x-icon"/>
-  <%= stylesheet_link_tag 'reset-fonts-grids', 'base-min', 'acts_as_taggable_stylesheet', 'star_rating', 'gadgets', address@hidden"stylesheets"] %>
-  <%= _javascript__include_tag :defaults, "boxover.js" %>
+  <%= stylesheet_link_tag 'reset-fonts-grids', 'base-min', 'acts_as_taggable_stylesheet', 'star_rating', 'gadgets', 
+    'yui/datatable', 'yui/datatable-skin', 'yui/tabview', 'yui/treeview-base', 'yui/treeview-folders', 'yui/yui_override',
+    address@hidden"stylesheets"] %>
+  <%= _javascript__include_tag :defaults, "boxover.js", "yui/yahoo-dom-event.js", "yui/connection.js", "yui/datasource.js", 
+    "yui/datatable.js", "yui/element.js", "yui/tabview.js", "yui/treeview.js" %>
 
   <% if controller.action_name.downcase == "timeline" %>
     <script src="" type="text/_javascript_"></script>

Modified: branches/wf4ever/config/routes.rb (3266 => 3267)


--- branches/wf4ever/config/routes.rb	2012-12-14 16:56:15 UTC (rev 3266)
+++ branches/wf4ever/config/routes.rb	2012-12-14 16:56:22 UTC (rev 3267)
@@ -202,12 +202,12 @@
   map.research_object_resources '/research_objects/:id/resources', :controller => 'research_objects', :action ="" 'resource_index', :conditions => { :method => :get }
   map.research_object_resource  '/research_objects/:id/resources/:resource_path', :controller => 'research_objects', :action ="" 'resource_show',  :conditions => { :method => :get }, :requirements => { :resource_path => /.*/ }
 
-    # Finn's folder stuff'
-  map.resources :folders
-
+    # Finn's folder stuff
+  map.folder_contents '/folders/folder_contents', :controller => 'folders', :action ="" 'folder_contents'
+  map.resources :folders  
   
   # content_types
-  map.resources :content_types
+  map.resources :content_types 
 
   # all downloads and viewings
   map.resources :downloads, :viewings

Modified: branches/wf4ever/public/stylesheets/yui/treeview-folders.css (3266 => 3267)


--- branches/wf4ever/public/stylesheets/yui/treeview-folders.css	2012-12-14 16:56:15 UTC (rev 3266)
+++ branches/wf4ever/public/stylesheets/yui/treeview-folders.css	2012-12-14 16:56:22 UTC (rev 3267)
@@ -1,41 +1,41 @@
 /* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */
 
 /* first or middle sibling, no children */
-.ygtvtn { background: url(yui/folders/tn.gif) 0 0 no-repeat; width:17px; height:22px; }
+.ygtvtn { background: url(../../images/../../images/yui/folders/tn.gif) 0 0 no-repeat; width:17px; height:22px; }
 
 /* first or middle sibling, collapsable */
-.ygtvtm { background: url(yui/folders/tm.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer }
+.ygtvtm { background: url(../../images/yui/folders/tm.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer }
 
 /* first or middle sibling, collapsable, hover */
-.ygtvtmh { background: url(yui/folders/tmh.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer }
+.ygtvtmh { background: url(../../images/yui/folders/tmh.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer }
 
 /* first or middle sibling, expandable */
-.ygtvtp { background: url(yui/folders/tp.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer }
+.ygtvtp { background: url(../../images/yui/folders/tp.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer }
 
 /* first or middle sibling, expandable, hover */
-.ygtvtph { background: url(yui/folders/tph.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer }
+.ygtvtph { background: url(../../images/yui/folders/tph.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer }
 
 /* last sibling, no children */
-.ygtvln { background: url(yui/folders/ln.gif) 0 0 no-repeat; width:17px; height:22px; }
+.ygtvln { background: url(../../images/yui/folders/ln.gif) 0 0 no-repeat; width:17px; height:22px; }
 
 /* Last sibling, collapsable */
-.ygtvlm { background: url(yui/folders/lm.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer }
+.ygtvlm { background: url(../../images/yui/folders/lm.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer }
 
 /* Last sibling, collapsable, hover */
-.ygtvlmh { background: url(yui/folders/lmh.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer }
+.ygtvlmh { background: url(../../images/yui/folders/lmh.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer }
 
 /* Last sibling, expandable */
-.ygtvlp { background: url(yui/folders/lp.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer }
+.ygtvlp { background: url(../../images/yui/folders/lp.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer }
 
 /* Last sibling, expandable, hover */
-.ygtvlph { background: url(yui/folders/lph.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer }
+.ygtvlph { background: url(../../images/yui/folders/lph.gif) 0 0 no-repeat; width:34px; height:22px; cursor:pointer }
 
 /* Loading icon */
-.ygtvloading { background: url(yui/folders/loading.gif) 0 0 no-repeat; width:16px; height:22px; }
+.ygtvloading { background: url(../../images/yui/folders/loading.gif) 0 0 no-repeat; width:16px; height:22px; }
 
 /* the style for the empty cells that are used for rendering the depth 
  * of the node */
-.ygtvdepthcell { background: url(yui/folders/vline.gif) 0 0 no-repeat; width:17px; height:22px; }
+.ygtvdepthcell { background: url(../../images/yui/folders/vline.gif) 0 0 no-repeat; width:17px; height:22px; }
 
 .ygtvblankdepthcell { width:17px; height:22px; }
 

Modified: branches/wf4ever/public/stylesheets/yui/yui_override.css (3266 => 3267)


--- branches/wf4ever/public/stylesheets/yui/yui_override.css	2012-12-14 16:56:15 UTC (rev 3266)
+++ branches/wf4ever/public/stylesheets/yui/yui_override.css	2012-12-14 16:56:22 UTC (rev 3267)
@@ -12,3 +12,7 @@
 table.ygtvtable {
   width: 100%;
 }
+/* Undo styles.css */
+.ygtvtable td, .ygtvtable th {
+  text-align: left;
+}
\ No newline at end of file

reply via email to

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