[ARVADOS] updated: 528ce62a2e3efeda48378be0b9b093a50545e034

Git user git at public.curoverse.com
Wed Jun 28 20:48:54 EDT 2017


Summary of changes:
 apps/workbench/app/controllers/users_controller.rb | 22 -------
 apps/workbench/app/views/layouts/body.html.erb     |  6 +-
 .../app/views/repositories/_show_help.html.erb     |  8 ++-
 .../views/repositories/_show_repositories.html.erb | 22 +++++--
 .../app/views/users/_repositories.html.erb         | 67 ----------------------
 .../app/views/users/repositories.html.erb          |  2 -
 6 files changed, 24 insertions(+), 103 deletions(-)
 delete mode 100644 apps/workbench/app/views/users/_repositories.html.erb
 delete mode 100644 apps/workbench/app/views/users/repositories.html.erb

       via  528ce62a2e3efeda48378be0b9b093a50545e034 (commit)
      from  259d991afb684e95a47ac77f1435b07800e83fbb (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit 528ce62a2e3efeda48378be0b9b093a50545e034
Author: radhika <radhika at curoverse.com>
Date:   Wed Jun 28 20:47:23 2017 -0400

    11870: link repositories menu item in user menu to repositories index page.
    
    Arvados-DCO-1.1-Signed-off-by: Radhika Chippada <radhika at curoverse.com>

diff --git a/apps/workbench/app/controllers/users_controller.rb b/apps/workbench/app/controllers/users_controller.rb
index 350f297..d3b8bfe 100644
--- a/apps/workbench/app/controllers/users_controller.rb
+++ b/apps/workbench/app/controllers/users_controller.rb
@@ -256,28 +256,6 @@ class UsersController < ApplicationController
     end
   end
 
-  def repositories
-    # all repositories accessible by current user
-    all_repositories = Hash[Repository.all.order('name asc').collect {|repo| [repo.uuid, repo]}]
-
-    @my_repositories = [] # we want them ordered as owned and the rest
-    @repo_writable = {}
-
-    # owned repos
-    all_repositories.each do |_, repo|
-      if repo.owner_uuid == current_user.uuid
-        @repo_writable[repo.uuid] = 'can_write'
-        @my_repositories << repo
-      end
-    end
-
-    # rest of the repos
-    handled = @my_repositories.map(&:uuid)
-    all_repositories.each do |_, repo|
-      @my_repositories << repo if !repo.uuid.in?(handled)
-    end
-  end
-
   def virtual_machines
     @my_vm_logins = {}
     Link.where(tail_uuid: @object.uuid,
diff --git a/apps/workbench/app/views/layouts/body.html.erb b/apps/workbench/app/views/layouts/body.html.erb
index 456f15f..0357866 100644
--- a/apps/workbench/app/views/layouts/body.html.erb
+++ b/apps/workbench/app/views/layouts/body.html.erb
@@ -62,11 +62,7 @@
                     <i class="fa fa-lg fa-terminal fa-fw"></i> Virtual machines
                   <% end %>
                 </li>
-                <li role="menuitem">
-                  <%= link_to repositories_user_path(current_user), role: 'menu-item' do %>
-                    <i class="fa fa-lg fa-code-fork fa-fw"></i> Repositories
-                  <% end %>
-                </li>
+                <li role="menuitem"><a href="/repositories" role="menuitem"><i class="fa fa-lg fa-code-fork fa-fw"></i> Repositories </a></li>
                 <li role="menuitem"><a href="/current_token" role="menuitem"><i class="fa fa-lg fa-ticket fa-fw"></i> Current token</a></li>
                 <li role="menuitem">
                   <%= link_to ssh_keys_user_path(current_user), role: 'menu-item' do %>
diff --git a/apps/workbench/app/views/repositories/_show_help.html.erb b/apps/workbench/app/views/repositories/_show_help.html.erb
index 50ec880..0983d87 100644
--- a/apps/workbench/app/views/repositories/_show_help.html.erb
+++ b/apps/workbench/app/views/repositories/_show_help.html.erb
@@ -1,4 +1,10 @@
-<% if (example = @objects.select(&:push_url).first) %>
+<%
+    filters = @filters + [["owner_uuid", "=", current_user.uuid]]
+    example = Repository.all.order("name ASC").limit(1).filter(filters).results.first
+    example = Repository.all.order("name ASC").limit(1).results.first if !example
+%>
+
+<% if example %>
 
 <p>
 Sample git quick start:
diff --git a/apps/workbench/app/views/repositories/_show_repositories.html.erb b/apps/workbench/app/views/repositories/_show_repositories.html.erb
index d522293..1a74eab 100644
--- a/apps/workbench/app/views/repositories/_show_repositories.html.erb
+++ b/apps/workbench/app/views/repositories/_show_repositories.html.erb
@@ -1,18 +1,28 @@
 <%= render partial: "add_repository_modal" %>
 
 <div class="container" style="width: 100%">
-  <div class="pull-right">
-    <%= link_to raw('<i class="fa fa-plus"></i> Add new repository'), "#",
-                    {class: 'btn btn-xs btn-primary', 'data-toggle' => "modal",
-                     'data-target' => '#add-repository-modal'}  %>
+  <div class="row">
+    <div class="col-md-pull-9 pull-left">
+      <p>
+        When you are using an Arvados virtual machine, you should clone the https:// URLs. This will authenticate automatically using your API token.
+      </p>
+      <p>
+        In order to clone git repositories using SSH, <%= link_to ssh_keys_user_path(current_user) do%> add an SSH key to your account<%end%> and clone the git@ URLs.
+      </p>
+    </div>
+    <div class="col-md-pull-3 pull-right">
+      <%= link_to raw('<i class="fa fa-plus"></i> Add new repository'), "#",
+                      {class: 'btn btn-xs btn-primary', 'data-toggle' => "modal",
+                       'data-target' => '#add-repository-modal'}  %>
+    </div>
   </div>
 
   <div>
     <table class="table table-condensed table-fixedlayout repositories-table">
       <colgroup>
-        <col style="width: 5%" />
+        <col style="width: 10%" />
         <col style="width: 30%" />
-        <col style="width: 60%" />
+        <col style="width: 55%" />
         <col style="width: 5%" />
       </colgroup>
       <thead>
diff --git a/apps/workbench/app/views/users/_repositories.html.erb b/apps/workbench/app/views/users/_repositories.html.erb
deleted file mode 100644
index ba91b9c..0000000
--- a/apps/workbench/app/views/users/_repositories.html.erb
+++ /dev/null
@@ -1,67 +0,0 @@
-<div class="panel panel-default">
-  <div class="panel-heading">
-    <div class="pull-right">
-      <%= link_to raw('<i class="fa fa-plus"></i> Add new repository'), "#",
-                   {class: 'btn btn-xs btn-primary', 'data-toggle' => "modal",
-                    'data-target' => '#add-repository-modal'}  %>
-    </div>
-    <h4 class="panel-title">
-      <%= link_to repositories_user_path(current_user) do%>
-        Repositories
-      <%end%>
-    </h4>
-  </div>
-
-  <div id="manage_repositories" class="panel-body">
-    <p>
-      When you are using an Arvados virtual machine, you should clone the https:// URLs. This will authenticate automatically using your API token.
-    </p>
-    <p>
-      In order to clone git repositories using SSH, <%= link_to ssh_keys_user_path(current_user) do%> add an SSH key to your account<%end%> and clone the git@ URLs.
-    </p>
-
-    <% if !@my_repositories.any? %>
-      You do not seem to have access to any repositories. If you would like to request access, please contact your system admin.
-    <% else %>
-      <table class="table repositories-table">
-        <colgroup>
-          <col style="width: 5%" />
-          <col style="width: 30%" />
-          <col style="width: 60%" />
-          <col style="width: 5%" />
-        </colgroup>
-        <thead>
-          <tr>
-            <th></th>
-            <th> Name </th>
-            <th> URL </th>
-            <th></th>
-          </tr>
-        </thead>
-        <tbody>
-          <% @my_repositories.andand.each do |repo| %>
-            <tr>
-              <td>
-                <%= render :partial => "show_object_button", :locals => {object: repo, size: 'xs' } %>
-              </td>
-              <td style="word-break:break-all;">
-                <%= repo[:name] %>
-              </td>
-              <td style="word-break:break-all;">
-                <code><%= repo.http_fetch_url %></code><br/>
-                <code><%= @repo_writable[repo.uuid] ? repo.push_url : repo.fetch_url %></code>
-              </td>
-              <td>
-                <% if repo.editable? %>
-                    <%= link_to(repository_path(id: repo.uuid), method: :delete, class: 'btn btn-sm', data: {confirm: "Really delete '#{repo.name || repo.uuid}'?"}) do %>
-                        <i class="fa fa-fw fa-trash-o"></i>
-                    <% end %>
-                <% end %>
-              </td>
-            </tr>
-          <% end %>
-        </tbody>
-      </table>
-    <% end %>
-  </div>
-</div>
diff --git a/apps/workbench/app/views/users/repositories.html.erb b/apps/workbench/app/views/users/repositories.html.erb
deleted file mode 100644
index 98a1715..0000000
--- a/apps/workbench/app/views/users/repositories.html.erb
+++ /dev/null
@@ -1,2 +0,0 @@
-<%= render :partial => 'repositories' %>
-<%= render partial: "add_repository_modal" %>

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list