Scarab commit: svn commit: r10770 - trunk/src/webapp: WEB-INF/templates/viewIssue scripts skins skins/images

Hussayn Dabbous <[email protected]>
Newsgroups gmane.comp.java.scarab.cvs
Message-ID <[email protected]>
Author: dabbous
Date: 2009-07-05 15:45:57-0700
New Revision: 10770

Added:
   trunk/src/webapp/scripts/guiUtils.js   (contents, props changed)
   trunk/src/webapp/skins/images/button_begin.png   (contents, props changed)
   trunk/src/webapp/skins/images/button_end.png   (contents, props changed)
Modified:
   trunk/src/webapp/WEB-INF/templates/viewIssue/ViewIssueBody.vm
   trunk/src/webapp/WEB-INF/templates/viewIssue/ViewIssueTab2.vm
   trunk/src/webapp/scripts/scarabutil.js
   trunk/src/webapp/skins/classic.css

Log:
SCB2977: rearranged the personell buttons

Modified: trunk/src/webapp/WEB-INF/templates/viewIssue/ViewIssueBody.vm
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/webapp/WEB-INF/templates/viewIssue/ViewIssueBody.vm?view=diff&pathrev=10770&r1=10769&r2=10770
==============================================================================
--- trunk/src/webapp/WEB-INF/templates/viewIssue/ViewIssueBody.vm	(original)
+++ trunk/src/webapp/WEB-INF/templates/viewIssue/ViewIssueBody.vm	2009-07-05 15:45:57-0700
@@ -88,33 +88,125 @@
     $renderer.render("viewIssue", "ViewIssueTab5.vm")
   #end
 
+
+  ## ==========================================================================
+  ## Create the bottom navigation buttons:
+  ##
+  ## Issue self assign to personell list
+  ## Issue self remove from personell list
+  ## Issue move
+  ## Issue copy
+  ## Issue remove
+  ## ==========================================================================
   <div class="functnbar2" style="white-space:nowrap;">
     <table border="0" style="margin:0px;padding:0px;" cellspacing="0" cellpadding="0">
       <tr>
+      
+
+        ## -----------------
+        ## Issue self assign
+        ## -----------------
+        #set ($userAttVals = $currentIssue.UserAttributeValues)
+        #set ($myselfInList = false)
+        #foreach ($attVal in $userAttVals)
+          #set ($userId = $attVal.UserId)
+          #set ($assignedUser = $scarabR.getUser($userId))
+          #if  ($data.User.userId.equals($userId))
+            #set ($myselfInList = true)
+            #set ($myattid = $attVal.AttributeId)
+          #end
+        #end
+      
+        #if ($canEdit)
+          #if ($scarabR.hasPermission($scarabG.Permission.ISSUE__ASSIGN, $module))
+
+            <td>    
+              ## ============================================================================
+              ## Find all selectable User Attributes in the given context.
+              ## Note: If a userAttribute/user combination is allready in the list, 
+              ## it can not be selected anymore here.
+              ## ============================================================================
+              #set ($options = [] )
+              #foreach ($selectUserAttr in $module.getUserAttributes($currentIssue.issueType))
+               #if ($!data.User.hasPermission($selectUserAttr.Permission, $module))
+                 #set ($attid = $selectUserAttr.AttributeId)
+                 #if ($myattid != $attid) ## if this attribute/user is already in list, discard it
+                   #set ($selectUserAttrName = $module.getRModuleAttribute($selectUserAttr,$currentIssue.issueType).displayValue)
+                   #set ($dummy = $options.add($selectUserAttr))
+                 #end
+               #end
+              #end
+
+              #if ( $options.size() == 1)
+                ## Just create a button. We do not need a selector box in this case.
+                #foreach ($selectUserAttr in $options)
+                  #set ($attid = $selectUserAttr.AttributeId)
+                  #set ($selectUserAttrName = $module.getRModuleAttribute($selectUserAttr,$currentIssue.issueType).displayValue)
+                  <input type="hidden" name="myself_attribute" value="$selectUserAttr.AttributeId"/>
+                  <input type="submit" class="button" name="eventSubmit_doAddmyself" value="$l10n.AssignMyself $selectUserAttrName" />
+                #end
+         
+              #elseif ( $options.size() > 1 )
+                ## Create a selection box
+                <input type="submit" name="eventSubmit_doAddmyself" value="$l10n.AssignMyself"  class="button" />
+                <select name="myself_attribute">
+                  #foreach ($selectUserAttr in $options)
+                    #set ($attid = $selectUserAttr.AttributeId)
+                    #set ($selectUserAttrName = $module.getRModuleAttribute($selectUserAttr,$currentIssue.issueType).displayValue)
+                    <option value="$selectUserAttr.AttributeId">$selectUserAttrName</option>
+                  #end
+                </select>
+              #end
+              </td>
+
+              ## ------------------------------------
+              ## Issue self remove
+              ## ------------------------------------    
+              #if ($myselfInList)
+                <td>
+                  <input type="submit" name="eventSubmit_doRemovemyself" value="$l10n.RemoveMe" class="button" />
+                </td>
+              #end
+             #end
+        #end
+              
+        ## ------------------------------------------
+        ## Issue move 
+        ## Issue copy
+        ## Issue remove
+        ## ------------------------------------------
+        <td style="align:right;color:white; width:100%;" />
         #if ($showCopyButton || $showMoveButton)
           #if ($showMoveButton)
-            <td> <input type="submit" value="$l10n.MoveIssue" name="eventSubmit_doMove" />&#160;</td>
+            <td style="align:right;color:white">
+              <input style="align:right;" type="submit" value="$l10n.MoveIssue" name="eventSubmit_doMove" class="button" />
+            </td>
           #end
           #if ($showCopyButton)
-            <td><input type="submit" value="$l10n.CopyIssue" name="eventSubmit_doCopy" /></td>
+            <td style="align:right;color:white">
+              <input style="align:right;" type="submit" value="$l10n.CopyIssue" name="eventSubmit_doCopy" class="button" />
+            </td>
           #end
           #if ($hasDeletePermission)
-            <td><input type="submit" value="$l10n.DeleteIssue" name="eventSubmit_doDeleteissue" /></td>
+            <td style="align:right;color:white">
+              <input style="align:right;" type="submit" value="$l10n.DeleteIssue" name="eventSubmit_doDeleteissue" class="button" />
+            </td>
           #end
         #end
-        <td width="100%"/>
-        <td>
-          <a title="$l10n.IssueRSSFeed"
+        <td style="align:right;color:white">
+          <a style="align:right;color:white" title="$l10n.IssueRSSFeed"
            href="$link.setPage('RSSDataExport.vm')/feedType/IssueFeed/issueId/$currentIssue.UniqueId/type/rss_2.0"><img align="middle" src="$staticLink.setPath('/images/icon_rss.gif')" border="0"/></a>
         </td>
-        <td>
-          <a title="$l10n.IssueATOMFeed"
+        <td style="align:right;color:white" >
+          <a style="align:right;color:white" title="$l10n.IssueATOMFeed"
            href="$link.setPage('RSSDataExport.vm')/feedType/IssueFeed/issueId/$currentIssue.UniqueId/type/atom_0.3"><img align="middle" src="$staticLink.setPath('/images/icon_atom.gif')" border="0"/></a>
         </td>
-        <td>
+        <td style="align:right;color:white" >
           <a style="align:right;color:white" title="$l10n.BookmarkToThisIssue"
            href="$link.getIssueIdAbsoluteLink($currentIssue)"><img align="middle" src="$staticLink.setPath('/images/icon_url.gif')" alt="$l10n.SessionInfoLink $currentIssue.UniqueId" border="0"/></a>
         </td>
+        
+        
       </tr>
     </table>
   </div>

Modified: trunk/src/webapp/WEB-INF/templates/viewIssue/ViewIssueTab2.vm
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/webapp/WEB-INF/templates/viewIssue/ViewIssueTab2.vm?view=diff&pathrev=10770&r1=10769&r2=10770
==============================================================================
--- trunk/src/webapp/WEB-INF/templates/viewIssue/ViewIssueTab2.vm	(original)
+++ trunk/src/webapp/WEB-INF/templates/viewIssue/ViewIssueTab2.vm	2009-07-05 15:45:57-0700
@@ -36,76 +36,15 @@
       </tr>
     #end
 
-    #* Commenting out to implement simple-assign, later
-    #if ($userAttVals.size() % 2 > 0)
-      <tr class="a">
-    #else
-      <tr class="b">
-    #end
-        <td>&nbsp;</td>
-        <td>&nbsp;</td>
-        <td><input type="text" name="add_user" value="" /></td>
-        <td><select name="user_attr_id" size="">
-          #foreach ($selectUserAttr in $module.getUserAttributes($currentIssue.issueType))
-            #set ($selectUserAttrName = $module.getRModuleAttribute($selectUserAttr,$currentIssue.issueType).displayValue)
-            <option value="$selectUserAttr.AttributeId">$selectUserAttrName:</option>
-          #end
-          </select>
-        </td>
-      </tr>
-    *#
 
-</table>
+  </table>
 
-#if ($canEdit)
-  <div class="functnbar3">
-   ##<input type="submit" value="$l10n.AddNew" name="eventSubmit_doAssign" />&#160;
-   ##<input type="submit" value="$l10n.DeleteSelected" name="eventSubmit_doUnassign" />&#160;
-   #if ($scarabR.hasPermission($scarabG.Permission.ISSUE__ASSIGN, $module))
-    <input type="submit" value="$l10n.EditList" name="eventSubmit_doEditassignees" />&nbsp;
-
-    ## ============================================================================
-    ## Find all selectable User Attributes in the given context.
-    ## Note: If a userAttribute/user combination is allready in the list, 
-    ## it can not be selected anymore here.
-    ## ============================================================================
-    #set ($options = [] )
-    #foreach ($selectUserAttr in $module.getUserAttributes($currentIssue.issueType))
-     #if ($!data.User.hasPermission($selectUserAttr.Permission, $module))
-       #set ($attid = $selectUserAttr.AttributeId)
-       #if ($myattid != $attid) ## if this attribute/user is already in list, discard it
-         #set ($selectUserAttrName = $module.getRModuleAttribute($selectUserAttr,$currentIssue.issueType).displayValue)
-         #set ($dummy = $options.add($selectUserAttr))
-       #end
-     #end
-    #end
-
-    #if ( $options.size() == 1)
-      ## Just create a button. We do not need a selector box in this case.
-      #foreach ($selectUserAttr in $options)
-        #set ($attid = $selectUserAttr.AttributeId)
-        #set ($selectUserAttrName = $module.getRModuleAttribute($selectUserAttr,$currentIssue.issueType).displayValue)
-        <input type="hidden" name="myself_attribute" value="$selectUserAttr.AttributeId"/>
-        <input type="submit" name="eventSubmit_doAddmyself" value="$l10n.AssignMyself $selectUserAttrName" />
+  #if ($canEdit)
+    <div class="functnbar3">
+      #if ($scarabR.hasPermission($scarabG.Permission.ISSUE__ASSIGN, $module))
+        <input type="submit" value="$l10n.EditList" name="eventSubmit_doEditassignees" />&nbsp;
       #end
-         
-    #elseif ( $options.size() > 1 )
-      ## Create a selection box
-      <input type="submit" name="eventSubmit_doAddmyself" value="$l10n.AssignMyself" />
-      <select name="myself_attribute">
-        #foreach ($selectUserAttr in $options)
-          #set ($attid = $selectUserAttr.AttributeId)
-          #set ($selectUserAttrName = $module.getRModuleAttribute($selectUserAttr,$currentIssue.issueType).displayValue)
-          <option value="$selectUserAttr.AttributeId">$selectUserAttrName</option>
-        #end
-      </select>
-    #end
-    
-    #if ($myselfInList)
-      <input type="submit" name="eventSubmit_doRemovemyself" value="$l10n.RemoveMe" />
-    #end
-   #end
-  </div>
-#end
+    </div>
+  #end
 
 </div>
\ No newline at end of file

Added: trunk/src/webapp/scripts/guiUtils.js
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/webapp/scripts/guiUtils.js?view=markup&pathrev=10770
==============================================================================
--- (empty file)
+++ trunk/src/webapp/scripts/guiUtils.js	2009-07-05 15:45:57-0700
@@ -0,0 +1,64 @@
+// =============================
+// functions for dynamic buttons
+// =============================
+
+  function addLoadEvent(func) {
+  	var oldonload = window.onload;
+  	if (typeof window.onload != 'function') {
+  		//alert(func);
+  		window.onload = func;
+  	}
+  	else {
+  		//alert("b");
+  		window.onload = function() {
+  			if (oldonload) {
+  			    oldonload();
+  			}
+  			func();
+  		}
+  	}
+  }
+
+  function getElementsByClass(searchClass,node,tag) {
+  	var classElements = new Array();
+  	if ( node == null )
+  		node = document;
+  	if ( tag == null )
+  		tag = '*';
+  	var els = node.getElementsByTagName(tag);
+  	var elsLen = els.length;
+  	var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
+  	for (i = 0, j = 0; i < elsLen; i++) {
+  		if ( pattern.test(els[i].className) ) {
+  			classElements[j] = els[i];
+  			j++;
+  		}
+  	}
+  	return classElements;
+  }
+
+  function insertAfter(newElement, targetElement) {
+  	var parent = targetElement.parentNode;
+  	if (parent.lastChild == targetElement) {
+  		parent.appendChild(newElement);
+  	}
+  	else {
+  		parent.insertBefore(newElement, targetElement.nextSibling);
+  	}
+  }
+
+  function buttonEndings() {
+	//alert("lookup buttons");
+  	if (!document.getElementsByTagName) {
+  		return false
+  	}
+  	var buttons = getElementsByClass("button");
+  	/* loop through all buttons and attach a child div */
+  	for (i=0; i < buttons.length; i++) {
+  		var div = document.createElement("div");
+  		div.className = "buttonEnding";
+  		insertAfter(div, buttons[i]);
+  	}
+  }
+ 
+addLoadEvent(buttonEndings);

Modified: trunk/src/webapp/scripts/scarabutil.js
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/webapp/scripts/scarabutil.js?view=diff&pathrev=10770&r1=10769&r2=10770
==============================================================================
--- trunk/src/webapp/scripts/scarabutil.js	(original)
+++ trunk/src/webapp/scripts/scarabutil.js	2009-07-05 15:45:57-0700
@@ -121,6 +121,7 @@
 function initializeTreeview() {
   collapseAll(["ol"]);
   //openBookMark();
+  buttonEndings();
 }
 
 
@@ -186,3 +187,4 @@
     
     setTimeout("stickyNavigationBar()",500);
   }
+

Modified: trunk/src/webapp/skins/classic.css
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/webapp/skins/classic.css?view=diff&pathrev=10770&r1=10769&r2=10770
==============================================================================
--- trunk/src/webapp/skins/classic.css	(original)
+++ trunk/src/webapp/skins/classic.css	2009-07-05 15:45:57-0700
@@ -148,6 +148,33 @@
 	color:#6d9cc1;
 }
 
+
+/* ====================================================== */
+/* Button section                                         */
+/* ====================================================== */
+
+input.button {
+    padding-left: 5px;
+    margin-right: 5px;
+    border: 0;
+    background: url(images/button_begin.png) no-repeat;
+    color: #333;
+    height: 22px;
+    /* used to catch the buttonEnding */
+    position: relative;
+    cursor: pointer;
+}
+
+.buttonEnding {
+    position: absolute;
+    display: inline;
+    margin-left: -10px;
+    width: 10px;
+    height: 22px;
+    background: url(images/button_end.png) no-repeat;
+}
+
+
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 /* ==== From here on downwards the refactoring must still take place. ==== */
 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

Added: trunk/src/webapp/skins/images/button_begin.png
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/webapp/skins/images/button_begin.png?view=markup&pathrev=10770
==============================================================================
Binary file. No diff available.

Added: trunk/src/webapp/skins/images/button_end.png
Url: http://scarab.tigris.org/source/browse/scarab/trunk/src/webapp/skins/images/button_end.png?view=markup&pathrev=10770
==============================================================================
Binary file. No diff available.

------------------------------------------------------
http://scarab.tigris.org/ds/viewMessage.do?dsForumId=3577&dsMessageId=2368186
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.