]> source.dussan.org Git - archiva.git/commitdiff
more documentation
authorOlivier Lamy <olamy@apache.org>
Sat, 21 Jan 2012 00:05:17 +0000 (00:05 +0000)
committerOlivier Lamy <olamy@apache.org>
Sat, 21 Jan 2012 00:05:17 +0000 (00:05 +0000)
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1234213 13f79535-47bb-0310-9956-ffa450edef68

archiva-modules/archiva-web/archiva-webapp-js/src/main/webapp/js/archiva/templates/menu.html
archiva-modules/archiva-web/archiva-webapp-js/src/site/apt/template-loading.apt
archiva-modules/archiva-web/archiva-webapp-js/src/site/resources/images/start-screen.png
archiva-modules/archiva-web/archiva-webapp-js/src/site/xdoc/index.xml

index a7637c9f27402defcb4d0aabd144230c7248644f..50d1750b0ccceed8d34c035ea91702be65d0914c 100644 (file)
@@ -16,7 +16,7 @@
   ~ specific language governing permissions and limitations
   ~ under the License.
 -->
-  <div class='well' id="main-menu" redback-permissions="{permissions: ['archiva-manage-users']}" style="display: none">
+  <div class='well' id="main-menu" redback-permissions="{permissions: ['archiva-manage-users','archiva-manage-configuration']}" style="display: none">
     <ul class="navigation">
       <li style="display: none" redback-permissions="{permissions: ['archiva-manage-users']}">
         <a href="#" id="menu-users-list-a" onclick="displayUsersGrid()">${$.i18n.prop('users.list')}</a>
index 1f7e114a39fda6536d4d7ee992c73347a5c31bdf..462a1a698538ed7fc105a0576289633210c2a739 100644 (file)
 ~~ NOTE: For help with the syntax of this file, see:
 ~~ http://maven.apache.org/guides/mini/guide-apt-format.html
 
-How javascript templates are loaded on application loading
\ No newline at end of file
+Html/Javascript templates loading
+
+  Templates are loaded on application loaded and added in the hidden div #html-fragments.
+
+  They are loaded using requirejs and the text plugin.
+
+  archiva tamplates are loaded as it:
+
++-------------------------
+require(["text!archiva/templates/menu.html","text!archiva/templates/topbar.html","text!archiva/templates/message.html",
+          "text!archiva/templates/modal.html","text!archiva/templates/grids-generics.html","text!archiva/templates/repositories.html"],
+  function(menu,topbar,message,modal,grids_generics,repositories) {
+
+    // template loading
+    $.tmpl( menu, $.i18n.map ).appendTo("#html-fragments");
+    $.tmpl( topbar, $.i18n.map ).appendTo("#html-fragments");
+    $.tmpl( modal, $.i18n.map ).appendTo("#html-fragments");
+    $("#html-fragments").append(message);
+    $("#html-fragments").append(grids_generics);
+    $("#html-fragments").append(repositories);
+  }
+);
++-------------------------
+
+  Note some templates which are only simple html which only need i18n are executed immediatly the others are only inserted in #html-fragments.
\ No newline at end of file
index 6dd681f7a2e2bfbc4290e06c4c0c84be7a09eece..f177e364bb8a2ea624f1a42e6a36ee6371efe9ed 100644 (file)
Binary files a/archiva-modules/archiva-web/archiva-webapp-js/src/site/resources/images/start-screen.png and b/archiva-modules/archiva-web/archiva-webapp-js/src/site/resources/images/start-screen.png differ
index d4ea2914ebaacba91ccecb07f5e719b71445f21c..9a32b39f1957c96d4b51f34fa85ebad415d13506 100644 (file)
           <br/>
           This main page is divided in 3 parts:
           <p>
-          <a href="images/start-screen.png" class="single_image" title="Start Page">
-            <img src="images/start-screen.png" width="150" height="93" style="border: 1px solid silver; margin-left: 0.25em; margin-bottom: 0.25em" alt="" /><br/>
-            Start Page
-          </a>
+            <a href="images/start-screen.png" class="single_image" title="Start Page">
+              <img src="images/start-screen.png" width="150" height="93" style="border: 1px solid silver; margin-left: 0.25em; margin-bottom: 0.25em" alt="" /><br/>
+              Start Page
+            </a>
           </p>
+          <p>
+            <ul>
+              <li>#topbar-menu-container is populated with the template js/archiva/templates/topbar.html.</li>
+              <li>#sidebar-content is populated with the template js/archiva/templates/menu.html.</li>
+              <li>#main-content is the place where screen will appear.</li>
+              <li>hidden #html-fragments will contains loaded templates.</li>
+            </ul>
+          </p>
+          <p>
+            Link are visible/hide depending on needed redback karmas.
+            You can configure redback operations needed for a link using the attribute redback-permissions in your html element
+            (by default element needed karma must be marked display: none):
+            <source>
+<![CDATA[
+Support array: at least one operation is needed:
+<div .... redback-permissions="{permissions: ['archiva-manage-users','archiva-manage-configuration']}" style="display: none">
+Support single value:
+<li style="display: none" redback-permissions="{permissions: ['archiva-manage-users']}">
+]]>
+            </source>
+
+          </p>
+        </p>
+      </subsection>
+      <subsection name="Sources organisation">
+        <p>
+          Sources are located in src/main/webapp :
+          <ul>
+            <li>css</li>
+            <li>images</li>
+            <li>js</li>
+          </ul>
         </p>
+        <subsection name="js directory">
+          <p>
+            Root directory contains external libraries.
+          </p>
+          <p>
+            archiva directory contains archiva js files with a subdirectory templates which contains templates
+          </p>
+          <p>
+            redback directory contains redback js files with a subdirectory templates which contains templates
+          </p>
+        </subsection>
       </subsection>
     </section>
   </body>