Author: olamy
Date: Mon Jan 30 22:14:43 2012
New Revision: 1238041

URL: http://svn.apache.org/viewvc?rev=1238041&view=rev
Log:
[MRM-1576] display settings in a popover.

Modified:
    
archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties
    
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html
    
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js
    
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/proxy-connectors.html

Modified: 
archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties
URL: 
http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties?rev=1238041&r1=1238040&r2=1238041&view=diff
==============================================================================
--- 
archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties
 (original)
+++ 
archiva/trunk/archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties
 Mon Jan 30 22:14:43 2012
@@ -23,6 +23,7 @@
 #default common
 id=id
 warning.not.undone.operation=WARNING: This operation can not be undone.
+none=none
 
 managedrepository.delete.content=Delete Content too ?
 
@@ -43,4 +44,9 @@ managedrepository.stats.newFileCount=New
 
 
 # remote repositories screen
-remoterepository.downloadremoteindex.now=Download Remote Index Now
\ No newline at end of file
+remoterepository.downloadremoteindex.now=Download Remote Index Now
+
+
+#proxy connector
+proxy-connectors.grid.remoterepo.settings.popover.title=Settings
+proxy-connectors.remoterepo.settings.networkproxy=Network Proxy
\ No newline at end of file

Modified: 
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html
URL: 
http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html?rev=1238041&r1=1238040&r2=1238041&view=diff
==============================================================================
--- 
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html
 (original)
+++ 
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/index.html
 Mon Jan 30 22:14:43 2012
@@ -18,7 +18,7 @@
 
 <div id="topbar-menu-container"></div>
 
-<div class="container-fluid" style="min-height: 400px">
+<div class="container-fluid" style="min-height: 450px">
   <div class="sidebar" id="sidebar-content"></div>
 
   <div class="content">

Modified: 
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js
URL: 
http://svn.apache.org/viewvc/archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js?rev=1238041&r1=1238040&r2=1238041&view=diff
==============================================================================
--- 
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js
 (original)
+++ 
archiva/trunk/archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/proxy-connectors.js
 Mon Jan 30 22:14:43 2012
@@ -98,7 +98,7 @@ $(function() {
                                         return repo.id()==id;
                                       }
                             );
-      return ($.isArray(managedRepository) && managedRepository.length>0) 
?managedRepository[0]:new ManagedRepository();
+      return ($.isArray(managedRepository) && managedRepository.length>0) ? 
managedRepository[0]:new ManagedRepository();
     }
 
     getRemoteRepository=function(id){
@@ -107,11 +107,37 @@ $(function() {
                                         return repo.id()==id;
                                       }
                             );
-      return ($.isArray(remoteRepository) && remoteRepository.length>0) 
?remoteRepository[0]:new RemoteRepository();
+      return ($.isArray(remoteRepository) && remoteRepository.length>0) ? 
remoteRepository[0]:new RemoteRepository();
     }
 
-    getProxyConnector=function(sourceRepoId,targetRepoId){
-      ici
+    this.getProxyConnector=function(sourceRepoId,targetRepoId){
+      var proxyConnector=$.grep(self.proxyConnectors(),
+                                      function(proxyConnector,idx){
+                                        return 
proxyConnector.sourceRepoId()==sourceRepoId
+                                            && 
proxyConnector.targetRepoId==targetRepoId;
+                                      }
+                                  );
+      return ($.isArray(proxyConnector) && proxyConnector.length>0) ? 
proxyConnector[0]:new ProxyConnector();
+    }
+
+    showSettings=function(sourceRepoId,targetRepoId){
+      //proxy-connectors-grid-remoterepo-settings-edit-internal-central
+      var 
targetImgId="#proxy-connectors-grid-remoterepo-settings-edit-"+sourceRepoId+"-"+targetRepoId;
+      //proxy-connectors.grid-remoterepo-settings-content-internal-central
+      var 
targetContentId="#proxy-connectors-grid-remoterepo-settings-content-"+sourceRepoId+"-"+targetRepoId;
+      $(targetContentId).html("");
+      
$(targetContentId).append($("#proxy-connectors-remote-settings-popover-tmpl").tmpl(self.getProxyConnector(sourceRepoId,targetRepoId)));
+      $(targetImgId).attr("data-content",$(targetContentId).html());
+      $(targetImgId).popover(
+          {
+            placement: "left",
+            html: true,
+            title: "popover-title"
+          }
+      );
+
+      $(targetImgId).popover('show');
+
     }
 
     this.displayGrid=function(){

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=1238041&r1=1238040&r2=1238041&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
 Mon Jan 30 22:14:43 2012
@@ -68,9 +68,40 @@
             <p>${targetRepoId}</p>
             <p>${getRemoteRepository(targetRepoId).name()}</p>
             <p>${getRemoteRepository(targetRepoId).url()}</p>
+            <p>
+              <a 
popover-title="${$.i18n.prop('proxy-connectors.grid.remoterepo.settings.popover.title')}"
+                 data-bind="event: { mouseover: function(){ 
showSettings(val,targetRepoId)},}"
+                 
id="proxy-connectors-grid-remoterepo-settings-edit-${val}-${targetRepoId}" 
href="#">
+                  ${$.i18n.prop('edit')}
+                 </a>
+              <div 
id="proxy-connectors-grid-remoterepo-settings-content-${val}-${targetRepoId}" 
style="display:none"></div>
+            </p>
           </blockquote>
           {{/each}}
       </td>
     </tr>
   {{/each}}
+</script>
+
+<script id='proxy-connectors-remote-settings-popover-tmpl' 
type='text/x-jquery-tmpl'>
+  <div>
+    {{if proxyId()}}
+      ${$.i18n.prop('proxy-connectors.remoterepo.settings.networkproxy')}: 
${proxyId()}
+    {{else}}
+      ${$.i18n.prop('proxy-connectors.remoterepo.settings.networkproxy')}: 
${$.i18n.prop('none')}
+    {{/if}}
+    <table>
+      <thead>
+        <th colspan="2">Policies</th>
+      </thead>
+      <tbody>
+        {{each policies().entry}}
+        <tr>
+          <td>${$value.key}</td>
+          <td>${$value.value}</td>
+        </tr>
+        {{/each}}
+      </tbody>
+    </table>
+  </div>
 </script>
\ No newline at end of file


Reply via email to