archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r1243819 - in /archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js: archiva/ archiva/templates/ redback/templates/
Date Tue, 14 Feb 2012 08:20:58 GMT
Author: olamy
Date: Tue Feb 14 08:20:58 2012
New Revision: 1243819

URL: http://svn.apache.org/viewvc?rev=1243819&view=rev
Log:
use an icon for edit link in grids

Modified:
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/network-proxies.html
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/repositories.html
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/repository-groups.html
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/roles-tmpl.html
    archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/user-grids.html

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js?rev=1243819&r1=1243818&r2=1243819&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js
Tue Feb 14 08:20:58 2012
@@ -33,24 +33,51 @@ $(function() {
     this.modified=ko.observable(false);
   }
 
-  RepositoryGroupViewModel=function(){
+  RepositoryGroupViewModel=function(repositoryGroup,update,repositoryGroupsViewModel){
+    this.repositoryGroup=repositoryGroup;
+    this.update=update;
+    this.repositoryGroupsViewModel=null;
+  }
+
+  RepositoryGroupsViewModel=function(){
+    var self=this;
     this.repositoryGroups=ko.observableArray([]);
     this.managedRepositories=ko.observableArray([]);
 
-    findManagedRepository=function(id){
+    this.findManagedRepository=function(id){
       return findManagedRepository(id,self.managedRepositories());
     }
+
+    this.deleteRepositoryGroup=function(repositoryGroup){
+      $.log("deleteRepositoryGroup:"+repositoryGroup.id());
+    }
+
+    this.editRepositoryGroup=function(repositoryGroup){
+      $.log("editRepositoryGroup:"+repositoryGroup.id());
+      var repositoryGroupViewModel=new RepositoryGroupViewModel(repositoryGroup,true,self);
+      activateRepositoryGroupEditTab();
+      ko.applyBindings(repositoryGroupViewModel,$("#main-content #repository-groups-edit"
).get(0));
+    }
+
+    repositoryMoved=function(){
+      $.log("repositoryMoved");
+    }
+
+    getManagedRepository=function(id){
+      $.log("getManagedRepository:"+id);
+      return findManagedRepository(self.managedRepositories());
+    }
   }
 
   displayRepositoryGroups=function(){
     screenChange();
     var mainContent = $("#main-content");
     mainContent.html(mediumSpinnerImg());
-    this.repositoryGroupViewModel=new RepositoryGroupViewModel();
+    this.repositoryGroupsViewModel=new RepositoryGroupsViewModel();
     var self=this;
 
     loadManagedRepositories(function(data) {
-      self.repositoryGroupViewModel.managedRepositories(mapManagedRepositories(data));
+      self.repositoryGroupsViewModel.managedRepositories(mapManagedRepositories(data));
 
       $.ajax("restServices/archivaServices/repositoryGroupService/getRepositoriesGroups",
{
           type: "GET",
@@ -58,9 +85,9 @@ $(function() {
           success: function(data) {
             var mappedRepositoryGroups=mapRepositoryGroups(data);
             mainContent.html($("#repositoryGroupsMain").tmpl());
-            self.repositoryGroupViewModel.repositoryGroups(mappedRepositoryGroups);
+            self.repositoryGroupsViewModel.repositoryGroups(mappedRepositoryGroups);
             //ko.applyBindings(repositoryGroupViewModel,mainContent.find("#repository-groups-table"
).get(0));
-            ko.applyBindings(repositoryGroupViewModel,mainContent.get(0));
+            ko.applyBindings(repositoryGroupsViewModel,mainContent.find("#repository-groups-view"
).get(0));
 
           }
         }
@@ -71,6 +98,27 @@ $(function() {
 
   }
 
+  activateRepositoryGroupsGridTab=function(){
+    var mainContent = $("#main-content");
+    mainContent.find("#repository-groups-view-tabs-content div[class*='tab-pane']").removeClass("active");
+    mainContent.find("#repository-groups-view-tabs li").removeClass("active");
+
+    mainContent.find("#repository-groups-view").addClass("active");
+    mainContent.find("#repository-groups-view-tabs-li-grid").addClass("active");
+    mainContent.find("#repository-groups-view-tabs-li-edit a").html($.i18n.prop("add"));
+
+  }
+
+  activateRepositoryGroupEditTab=function(){
+    var mainContent = $("#main-content");
+
+    mainContent.find("#repository-groups-view-tabs-content div[class*='tab-pane']").removeClass("active");
+    mainContent.find("#repository-groups-view-tabs li").removeClass("active");
+
+    mainContent.find("#repository-groups-edit").addClass("active");
+    mainContent.find("#repository-groups-view-tabs-li-edit").addClass("active");
+  }
+
   mapRepositoryGroups=function(data){
     if (data == null){
       return new Array();

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/network-proxies.html
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/network-proxies.html?rev=1243819&r1=1243818&r2=1243819&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/network-proxies.html
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/network-proxies.html
Tue Feb 14 08:20:58 2012
@@ -71,7 +71,9 @@
         {{/if}}
           <td>${row.useNtlm()}</td>
           <td>
-            <a href="#" data-bind="click: function(){ editNetworkProxy(row) }">${$.i18n.prop('edit')}</a>
+            <a href="#" data-bind="click: function(){ editNetworkProxy(row) }">
+              <img src="images/edit-find-22-22.png" title="${$.i18n.prop('edit')}">
+            </a>
           </td>
           <td>
             <a href="#" data-bind="click: function(){ removeNetworkProxy(row) }">

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html?rev=1243819&r1=1243818&r2=1243819&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html
Tue Feb 14 08:20:58 2012
@@ -81,7 +81,7 @@
       </td>
       <td>
         <a data-bind="click: function(){ editProxyConnector(row)}" href="#">
-           ${$.i18n.prop('edit')}
+          <img src="images/edit-find-22-22.png" title="${$.i18n.prop('edit')}">
         </a>
       </td>
       <td>
@@ -98,7 +98,7 @@
       </td>
       <td>
         {{if orderChangeAware(row)}}
-          <a href="#" class="btn btn-warning" data-bind="click: function(){ displayOrderEdit(row)}">
+          <a href="#" class="btn btn-info" data-bind="click: function(){ displayOrderEdit(row)}">
               ${$.i18n.prop('proxy-connectors.order.edit')}
           </a>
         {{/if}}

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/repositories.html
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/repositories.html?rev=1243819&r1=1243818&r2=1243819&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/repositories.html
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/repositories.html
Tue Feb 14 08:20:58 2012
@@ -120,7 +120,11 @@
                 <img src="images/view-refresh-22-22.png" title="${$.i18n.prop('managedrepository.scan.now')}"/>
               </a>
             </td>
-            <td><a href="#" data-bind="click: function(){ editManagedRepository(row)
}">${$.i18n.prop('edit')}</a></td>
+            <td>
+              <a href="#" data-bind="click: function(){ editManagedRepository(row) }">
+                <img src="images/edit-find-22-22.png" title="${$.i18n.prop('edit')}">
+              </a>
+            </td>
             <td>
               <a href="#" data-bind="click: function(){ removeManagedRepository(row) }">
                 <img src="images/edit-cut-22-22.png" title="${$.i18n.prop('delete')}"/>
@@ -317,12 +321,14 @@
   </thead>
   <tbody>
       {{each(i, row) itemsOnCurrentPage()}}
-          <tr>
+          <tr data-bind="css:{ 'modified': row.modified()}">
             {{each(j, columnDefinition) columns}}
               <td>${ typeof columnDefinition.rowText == 'function' ? columnDefinition.rowText(row)
: row[columnDefinition.rowText] }</td>
             {{/each}}
             <td>
-              <a href="#" data-bind="click: function(){ editRemoteRepository(row) }">${$.i18n.prop('edit')}</a>
+              <a href="#" data-bind="click: function(){ editRemoteRepository(row) }">
+                <img src="images/edit-find-22-22.png" title="${$.i18n.prop('edit')}">
+              </a>
             </td>
             <td>
               <a href="#" data-bind="click: function(){ removeRemoteRepository(row) }">
@@ -352,7 +358,7 @@
     <form id="remote-repository-edit-form" class="form-horizontal">
       <fieldset id="remote-repository-edit-fieldset">
         <div class="control-group">
-          <label class="control-label" for="name">${$.i18n.prop('id')}</label>
+          <label class="control-label" for="id">${$.i18n.prop('id')}</label>
           <div class="controls">
             {{if update}}
               <span class="uneditable-input">${$data.remoteRepository.id}</span>

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/repository-groups.html
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/repository-groups.html?rev=1243819&r1=1243818&r2=1243819&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/repository-groups.html
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/repository-groups.html
Tue Feb 14 08:20:58 2012
@@ -20,32 +20,36 @@
   <div class="page-header">
     <h2>${$.i18n.prop('repository.groups.list')}</h2>
   </div>
-  <div id="repository-groups-table" data-bind='template:{name:"repository-groups-table-tmpl"}'>
+  <ul id="repository-groups-view-tabs" class="nav nav-tabs">
+    <li id="repository-groups-view-tabs-li-grid" class="active">
+      <a data-toggle="tab" href="#repository-groups-view" id="repository-groups-view-tabs-a-network-proxies-grid">${$.i18n.prop('repository-groups.grid.tab.title')}</a>
+    </li>
+    <li id="repository-groups-view-tabs-li-edit">
+      <a data-toggle="tab" href="#repository-groups-edit" id="repository-groups-view-tabs-a-edit">${$.i18n.prop('add')}</a>
+    </li>
 
-  </div>
-  <br/><br/>
-    <table class="table table-striped table-bordered">
-      <thead>
-        <th>group</th>
-        <th>repos</th>
-      </thead>
-      <tbody>
-        <div id="repository-groups-table-bind" data-bind="foreach: repositoryGroups">
-          <tr>
-            <td data-bind="value: $data.id"></td>
-          </tr>
+  </ul>
+  <div id="repository-groups-view-tabs-content" class="tab-content">
+    <div id="repository-groups-view" class="tab-pane active">    
+      <div id="repository-groups-table" data-bind='template:{name:"repository-groups-table-tmpl"}'>
+      </div>
+    </div>
+    <div id="repository-groups-edit" class="tab-pane active">
+        <div id="repository-groups-edit-div" data-bind='template:{name:"repository-group-edit-tmpl"}'></div>
+        <div id="repository-groups-edit-order-div"
+             data-bind="sortable: { template: 'repository-group-edit-order-tmpl',data:repositoryGroup.repositories,afterMove:
repositoryMoved}">
         </div>
-      </tbody>
-    </table>
-
-  </div>
+    </div>
+  </div>  
 </script>
 
 <script id="repository-groups-table-tmpl" type="text/html">
   <table class="table table-striped table-bordered">
     <thead>
-      <th>group</th>
-      <th>repos</th>
+      <th>${$.i18n.prop('repository.groups.groups.grid.header')}</th>
+      <th>${$.i18n.prop('repository.groups.repositories.grid.header')}</th>
+      <th>${$.i18n.prop('edit')}</th>
+      <th>${$.i18n.prop('delete')}</th>
     </thead>
     <tbody>
     {{each(i, repositoryGroup) repositoryGroups}}
@@ -58,8 +62,42 @@
           {{/each}}
           </ul>
         </td>
+        <td>
+          <a href="#" data-bind="click: function(){editRepositoryGroup(repositoryGroup)}">
+            <img src="images/edit-find-22-22.png" title="${$.i18n.prop('edit')}">
+          </a>
+        </td>
+        <td>
+          <a href="#" data-bind="click: function(){deleteRepositoryGroup(repositoryGroup)}">
+            <img src="images/edit-cut-22-22.png" title="${$.i18n.prop('delete')}"/>
+          </a>
+        </td>
       </tr>
     {{/each}}
     </tbody>
   </table>
+</script>
+
+<script id="repository-group-edit-tmpl" type="text/html">
+  <form id="repository-group-edit-form" class="form-horizontal">
+    <fieldset id="repository-group-edit-fieldset">
+      <div class="control-group">
+        <label class="control-label" for="id">${$.i18n.prop('id')}</label>
+        <div class="controls">
+          {{if update}}
+            <span class="uneditable-input">${repositoryGroup.id}</span>
+          {{else}}
+            <input type="text" class="xlarge required" id="id" name="id" size="50"
+                   data-bind="value: repositoryGroup.id,css:{'uneditable-input': update},readonly:update"/>
+          {{/if}}
+        </div>
+      </div>
+    </fieldset>
+  </form>
+</script>
+
+<script id="repository-group-edit-order-tmpl" type="text/html">
+  <div class="well draggable-item">
+    ${$data}-${managedRepository.name()}
+  </div>
 </script>
\ No newline at end of file

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/roles-tmpl.html
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/roles-tmpl.html?rev=1243819&r1=1243818&r2=1243819&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/roles-tmpl.html
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/roles-tmpl.html
Tue Feb 14 08:20:58 2012
@@ -204,7 +204,9 @@
               </td>
               {{/each}}
               <td>
-                <a id="edit-role-${row.name()}" href="#" data-bind="click: function(){
editRole(row) }">${$.i18n.prop('edit')}</a>
+                <a id="edit-role-${row.name()}" href="#" data-bind="click: function(){
editRole(row) }">
+                  <img src="images/edit-find-22-22.png" title="${$.i18n.prop('edit')}">
+                </a>
               </td>
               <td>
                 {{if row.modified()}}

Modified: archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/user-grids.html
URL: http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/user-grids.html?rev=1243819&r1=1243818&r2=1243819&view=diff
==============================================================================
--- archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/user-grids.html
(original)
+++ archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/redback/templates/user-grids.html
Tue Feb 14 08:20:58 2012
@@ -34,7 +34,11 @@
               {{each(j, columnDefinition) columns}}
               <td>${ typeof columnDefinition.rowText == 'function' ? columnDefinition.rowText(row)
: row[columnDefinition.rowText] }</td>
               {{/each}}
-              <td id="users-grid-user-id-${row.username()}"><a href="#" data-bind="click:
function(){ editUserBox(row) }">Edit</a></td>
+              <td id="users-grid-user-id-${row.username()}">
+                <a href="#" data-bind="click: function(){ editUserBox(row) }">
+                  <img src="images/edit-find-22-22.png" title="${$.i18n.prop('edit')}">
+                </a>
+              </td>
               {{if row.username()=="admin" || row.username()=="guest"}}
                 <td></td>
               {{else}}



Mime
View raw message