]> source.dussan.org Git - archiva.git/commitdiff
[MRM-1575] rewrite repositories group page
authorOlivier Lamy <olamy@apache.org>
Tue, 14 Feb 2012 23:00:22 +0000 (23:00 +0000)
committerOlivier Lamy <olamy@apache.org>
Tue, 14 Feb 2012 23:00:22 +0000 (23:00 +0000)
add save button in the edit page

git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1244262 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/repository-groups.js
archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/repository-groups.html

index 00d1c6fa5a32359b0162803db4cacd50c6a34aea..eb16a21bda13d01a5f937ccaff35b38da7ac827c 100644 (file)
@@ -52,7 +52,9 @@ $(function() {
       self.repositoryGroup.repositories(repositories);
       self.repositoryGroup.modified(true);
     }
-
+    this.saveRepositoryGroup=function(repositoryGroup){
+      self.repositoryGroupsViewModel.saveRepositoryGroup(repositoryGroup);
+    }
   }
 
   RepositoryGroupsViewModel=function(){
@@ -76,7 +78,7 @@ $(function() {
     }
 
     this.saveRepositoryGroup=function(repositoryGroup){
-        repositoryGroup.managedRepositories([]);
+        clearUserMessages();
         $.ajax("restServices/archivaServices/repositoryGroupService/updateRepositoryGroup",
           {
             type: "POST",
index 51e29a2866f0299f769b26e2d8a8b8d46ddd7330..88581d9a5300c3b416a82b563510df3ddb09f6ba 100644 (file)
       </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.managedRepositories,afterMove: repositoryMoved}">
-        </div>
+      <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.managedRepositories,afterMove: repositoryMoved}">
+      </div>
     </div>
   </div>  
 </script>
@@ -87,6 +87,7 @@
 </script>
 
 <script id="repository-group-edit-tmpl" type="text/html">
+  <div class="row-fluid">
   {{if update}}
     <div class="dotted span7">
       <blockquote>
       </blockquote>
     </div>
   {{else}}
-  <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">
-            <input type="text" class="xlarge required" id="id" name="id" size="50"
+    <div class="dotted span7">
+      <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">
+              <input type="text" class="xlarge required" id="id" name="id" size="50"
                    data-bind="value: repositoryGroup.id,css:{'uneditable-input': update},readonly:update"/>
-        </div>
-      </div>
-    </fieldset>
-  </form>
+            </div>
+          </div>
+        </fieldset>
+      </form>
+    </div>
   {{/if}}
+  {{if repositoryGroup.modified()}}
+    <div class="span3">
+      <a href="#" class="btn btn-warning" data-bind="click: function(){saveRepositoryGroup(repositoryGroup)}">${$.i18n.prop('save')}</a>
+    </div>
+    <br/>
+  {{/if}}
+  </div>
 </script>
 
 <script id="repository-group-edit-order-tmpl" type="text/html">