fmsystem-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Fmsystem-commits] [10763] Added expand list on groups for add cases


From: Torstein
Subject: [Fmsystem-commits] [10763] Added expand list on groups for add cases
Date: Wed, 06 Feb 2013 09:06:25 +0000

Revision: 10763
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=10763
Author:   vator
Date:     2013-02-06 09:06:25 +0000 (Wed, 06 Feb 2013)
Log Message:
-----------
Added expand list on groups for add cases

Modified Paths:
--------------
    trunk/controller/js/controller/custom_ui.js
    trunk/controller/templates/base/check_list/add_case.xsl

Modified: trunk/controller/js/controller/custom_ui.js
===================================================================
--- trunk/controller/js/controller/custom_ui.js 2013-02-06 09:04:44 UTC (rev 
10762)
+++ trunk/controller/js/controller/custom_ui.js 2013-02-06 09:06:25 UTC (rev 
10763)
@@ -17,6 +17,21 @@
                        $(this).parent().parent().addClass('active');
                }
        });
+  
+  $(".expand-trigger").live("click", function(){
+    
+    var parentNode = $(this).closest("li");
+    
+               if( $(parentNode).hasClass('expanded')){
+                       $(parentNode).find(".expand_list").slideUp("slow");
+                       $(parentNode).find("img").first().attr("src", 
"controller/images/arrow_right.png");
+                       $(parentNode).removeClass('expanded');
+               }else{
+                       $(parentNode).find(".expand_list").slideDown("slow");
+                       $(parentNode).find("img").first().attr("src", 
"controller/images/arrow_down.png");
+                       $(parentNode).addClass('expanded');
+               }
+       });
        
        
        /* ==========================  EXPANDING/COLLAPSING ALL LISTS 
====================== */
@@ -26,18 +41,18 @@
                $(this).addClass("focus");
                $(".collapse_all").removeClass("focus");
                        
-               $("ul.expand_list").find(".expand_item").slideDown("slow");
-               $("ul.expand_list").find(".expand_item").addClass("active");
-               $("ul.expand_list").find("li h4 img").attr("src", 
"controller/images/arrow_down.png");
+               $(".expand_list").slideDown("slow");
+               $(".expand_list").addClass("expanded");
+               $(".expand-trigger img").attr("src", 
"controller/images/arrow_down.png");
        });
        
        $(".collapse_all").live("click", function(){
                $(this).addClass("focus");
                $(".expand_all").removeClass("focus");
                
-               $("ul.expand_list").find(".expand_item").slideUp("slow");
-               $("ul.expand_list").find(".expand_item").removeClass("active");
-               $("ul.expand_list").find("li h4 img").attr("src", 
"controller/images/arrow_right.png");
+               $(".expand_list").slideUp("slow");
+               $(".expand_list").removeClass("expanded");
+               $(".expand-trigger img").attr("src", 
"controller/images/arrow_right.png");
        });
        
 });
\ No newline at end of file

Modified: trunk/controller/templates/base/check_list/add_case.xsl
===================================================================
--- trunk/controller/templates/base/check_list/add_case.xsl     2013-02-06 
09:04:44 UTC (rev 10762)
+++ trunk/controller/templates/base/check_list/add_case.xsl     2013-02-06 
09:06:25 UTC (rev 10763)
@@ -81,13 +81,13 @@
                
                <xsl:variable name="action_url"><xsl:value-of 
select="php:function('get_phpgw_link', '/index.php', 
'menuaction:controller.uicase.add_case,phpgw_return_as:json')" /></xsl:variable>
 
-               <ul class="control_groups">
+               <ul class="add-cases">
                        <xsl:for-each select="control_groups_with_items_array">
                        <xsl:choose>
                                <xsl:when test="control_items/child::node()">
                                        <li>
-                                               <h3><xsl:value-of 
select="control_group/group_name"/></h3>                              
-                                               <ul class="expand_list">
+                                               <h3 class="expand-trigger"><img 
src="controller/images/arrow_right.png" /><xsl:value-of 
select="control_group/group_name"/></h3>                                
+                                               <ul class="expand_list" 
style="display:none;">
                                                        <xsl:for-each 
select="control_items">
                                                                <li>
                                                                        
<h4><img src="controller/images/arrow_right.png" /><span><xsl:value-of 
select="title"/></span></h4>     
@@ -97,16 +97,32 @@
                                                                                
                        <xsl:variable name="control_item_id"><xsl:value-of 
select="id"/></xsl:variable>
                                                                                
                        <input type="hidden" name="control_item_id" 
value="{$control_item_id}" /> 
                                                                                
                        <input name="check_list_id" 
type="hidden"><xsl:attribute name="value"><xsl:value-of 
select="//check_list/id"/></xsl:attribute></input>
-                                                                               
                    <input name="status" type="hidden" value="0" />
-                                                                               
                        <input name="type" type="hidden" 
value="control_item_type_1" />
-                                                                               
                            
-                                                                               
                <div>
-                                                                               
                        <label class="comment">Beskrivelse av sak</label>
-                                                                               
                            <textarea name="case_descr">
+                                                                               
                  <input name="status" type="hidden" value="0" />
+                          <input name="type" type="hidden" 
value="control_item_type_1" />
+                                                                               
                          
+                          <!--  WHAT TO DO -->
+                          <div class="row what-to-do">
+                            <label>Hva skal sjekkes:</label> 
+                            <div>
+                              <xsl:value-of select="what_to_do"/>
+                            </div>
+                          </div>
+
+                          <!--  HOW TO DO -->
+                          <div class="row how-to-do">
+                            <label>Utførelsesbeskrivelse:</label> 
+                            <div>
+                              <xsl:value-of select="how_to_do"/>
+                            </div>
+                          </div>
+                            
+                                                                               
            <div>
+                            <label class="comment">Beskrivelse av sak</label>
+                                                                               
                          <textarea name="case_descr">
                                                                                
                                        <xsl:value-of select="comment"/>
                                                                                
                                </textarea>
                                                                                
                        </div>
-                                                                               
                        <input type="submit" class="btn not_active" 
name="save_control" value="Lagre sak" />
+                                                                               
                        <input type="submit" class="btn" name="save_control" 
value="Lagre sak" />
                                                                                
                </form>
                                                                                
        </xsl:when>
                                                                                
        <xsl:when test="type = 'control_item_type_2'">
@@ -141,7 +157,7 @@
                                                                                
                                 </textarea>
                                                                                
                   </div>
                                                                                
               <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'register_error')" /></xsl:variable>
-                                                                               
                   <input type="submit" name="save_control" value="Lagre 
måling" class="not_active" title="{$lang_save}" />
+                                                                               
                   <input type="submit" name="save_control" value="Lagre 
måling" title="{$lang_save}" />
                                                                                
                </form>
                                                                                
        </xsl:when>
                                                                                
        <xsl:when test="type = 'control_item_type_3'">
@@ -177,7 +193,7 @@
                                                                                
                                 </textarea>
                                                                                
                   </div>
                                                                                
               <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'register_error')" /></xsl:variable>
-                                                                               
                   <input type="submit" name="save_control" value="Lagre 
sak/måling" class="not_active" title="{$lang_save}" />
+                                                                               
                   <input type="submit" name="save_control" value="Lagre 
sak/måling" title="{$lang_save}" />
                                                                                
                </form>
                                                                                
        </xsl:when>
                                                                                
        <xsl:when test="type = 'control_item_type_4'">
@@ -213,11 +229,10 @@
                                                                                
                                 </textarea>
                                                                                
                   </div>
                                                                                
               <xsl:variable name="lang_save"><xsl:value-of 
select="php:function('lang', 'register_error')" /></xsl:variable>
-                                                                               
                   <input type="submit" name="save_control" value="Lagre 
sak/måling" class="not_active" title="{$lang_save}" />
+                                                                               
                   <input type="submit" name="save_control" value="Lagre 
sak/måling" title="{$lang_save}" />
                                                                                
                </form>
                                                                                
        </xsl:when>
                                                                                
</xsl:choose>   
-                                                                       
                                                                </li>
                                                        </xsl:for-each>
                                                </ul>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]