fmsystem-commits
[Top][All Lists]
Advanced

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

[Fmsystem-commits] [14785] organize filter


From: Sigurd Nes
Subject: [Fmsystem-commits] [14785] organize filter
Date: Mon, 29 Feb 2016 21:35:13 +0000

Revision: 14785
          http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=14785
Author:   sigurdne
Date:     2016-02-29 21:35:13 +0000 (Mon, 29 Feb 2016)
Log Message:
-----------
organize filter

Modified Paths:
--------------
    trunk/controller/templates/base/component.xsl

Modified: trunk/controller/templates/base/component.xsl
===================================================================
--- trunk/controller/templates/base/component.xsl       2016-02-29 19:59:09 UTC 
(rev 14784)
+++ trunk/controller/templates/base/component.xsl       2016-02-29 21:35:13 UTC 
(rev 14785)
@@ -21,14 +21,23 @@
                <xsl:value-of select="datatable_name"/>
        </h2>
        <div id="receipt"></div>
-       <xsl:call-template name="icon_color_map" />
-       <xsl:apply-templates select="form" />
-       <xsl:apply-templates select="paging"/>
-       <div id="list_flash">
-               <xsl:call-template name="msgbox"/>
+
+       <div class="pure-g">
+               <div class="pure-u-1 pure-u-md-1-2">
+                       <xsl:apply-templates select="form" />
+               </div>
+               <div class="pure-u-1 pure-u-md-1-2">
+                       <xsl:call-template name="icon_color_map" />
+               </div>
        </div>
-       <xsl:apply-templates select="datatable"/> 
-       <xsl:apply-templates select="form/list_actions"/>
+
+
+               <xsl:apply-templates select="paging"/>
+               <div id="list_flash">
+                       <xsl:call-template name="msgbox"/>
+               </div>
+               <xsl:apply-templates select="datatable"/>
+               <xsl:apply-templates select="form/list_actions"/>
        
 </xsl:template>
 
@@ -51,154 +60,203 @@
 
 
 <xsl:template match="toolbar">
-       <div id="toolbar">
-               <table>
-                       <tr>
+       <style id='toggle-box-css' type='text/css' scoped='scoped'>
+               .toggle-box {
+               display: none;
+               }
+
+               .toggle-box + label {
+               cursor: pointer;
+               display: block;
+               font-weight: bold;
+               line-height: 21px;
+               margin-bottom: 5px;
+               }
+
+               .toggle-box + label + #toolbar {
+               display: none;
+               margin-bottom: 10px;
+               }
+
+               .toggle-box:checked + label + #toolbar {
+               display: block;
+               }
+
+               .toggle-box + label:before {
+               background-color: #4F5150;
+               -webkit-border-radius: 10px;
+               -moz-border-radius: 10px;
+               border-radius: 10px;
+               color: #FFFFFF;
+               content: "+";
+               display: block;
+               float: left;
+               font-weight: bold;
+               height: 20px;
+               line-height: 20px;
+               margin-right: 5px;
+               text-align: center;
+               width: 20px;
+               }
+
+               .toggle-box:checked + label:before {
+               content: "\2212";
+               }
+       </style>
+       <div id="active_filters"></div>
+
+       <input class="toggle-box" id="header1" type="checkbox" />
+       <label for="header1">
+               <xsl:value-of select="php:function('lang', 'filter')"/>
+       </label>
+
+       <div id="toolbar" xmlns:php="http://php.net/xsl";>
+               <table id="toolbar_table" class="pure-table">
+                       <thead>
+                               <tr>
+                                       <th>
+                                               <xsl:value-of 
select="php:function('lang', 'name')"/>
+                                       </th>
+                                       <th>
+                                               <xsl:value-of 
select="php:function('lang', 'item')"/>
+                                       </th>
+                               </tr>
+                       </thead>
+                       <tbody>
                                <xsl:for-each select="item">
-                                       <xsl:variable name="filter_key" 
select="concat('filter_', name)"/>
-                                       <xsl:variable name="filter_key_name" 
select="concat(concat('filter_', name), '_name')"/>
-                                       <xsl:variable name="filter_key_id" 
select="concat(concat('filter_', name), '_id')"/>
+                                       <tr>
+                                               <td>
+
+                                                       <label>
+                                                               <xsl:attribute 
name="for">
+                                                                       
<xsl:value-of select="phpgw:conditional(not(name), '', name)"/>
+                                                               </xsl:attribute>
+                                                               <xsl:value-of 
select="phpgw:conditional(not(text), '', text)"/>
+                                                       </label>
+                                               </td>
+                                               <td>
+                                                       <xsl:variable 
name="filter_key" select="concat('filter_', name)"/>
+                                                       <xsl:variable 
name="filter_key_name" select="concat(concat('filter_', name), '_name')"/>
+                                                       <xsl:variable 
name="filter_key_id" select="concat(concat('filter_', name), '_id')"/>
                
-                                       <xsl:choose>
-                                               <xsl:when test="type = 
'date-picker'">
-                                                       <td>
-                                                               <div 
class="date-picker">
-                                                                       <input 
id="filter_{name}" name="filter_{name}" type="text">
+                                                       <xsl:choose>
+                                                               <xsl:when 
test="type = 'date-picker'">
+                                                                       <div 
class="date-picker">
+                                                                               
<input id="filter_{name}" name="filter_{name}" type="text">
+                                                                               
        <xsl:attribute name="value">
+                                                                               
                <xsl:value-of select="../../../filters/*[local-name() = 
$filter_key]"/>
+                                                                               
        </xsl:attribute>
+                                                                               
</input>
+                                                                       </div>
+                                                               </xsl:when>
+                                                               <xsl:when 
test="type = 'filter'">
+                                                                       
<xsl:variable name="name">
+                                                                               
<xsl:value-of select="name"/>
+                                                                       
</xsl:variable>
+                                       
+                                                                       <select 
id="{$name}" name="{$name}" width="250" style="width: 250px">
+                                                                               
<xsl:attribute name="onchange">
+                                                                               
        <xsl:value-of select="phpgw:conditional(not(onchange), '', onchange)"/>
+                                                                               
</xsl:attribute>
+                                                                               
<xsl:for-each select="list">
+                                                                               
        <xsl:variable name="id">
+                                                                               
                <xsl:value-of select="id"/>
+                                                                               
        </xsl:variable>
+                                                                               
        <option value="{$id}">
+                                                                               
                <xsl:if test="selected = '1'">
+                                                                               
                        <xsl:attribute name="selected">
+                                                                               
                                <xsl:text>selected</xsl:text>
+                                                                               
                        </xsl:attribute>
+                                                                               
                </xsl:if>
+                                                                               
                <xsl:value-of select="name"/>
+                                                                               
        </option>
+                                                                               
</xsl:for-each>
+                                                                       
</select>
+                                                               </xsl:when>
+                                                               <xsl:otherwise>
+                                                                       <input 
id="innertoolbar">
+                                                                               
<xsl:attribute name="type">
+                                                                               
        <xsl:value-of select="phpgw:conditional(not(type), '', type)"/>
+                                                                               
</xsl:attribute>
+                                                                               
<xsl:attribute name="name">
+                                                                               
        <xsl:value-of select="phpgw:conditional(not(name), '', name)"/>
+                                                                               
</xsl:attribute>
+                                                                               
<xsl:attribute name="onclick">
+                                                                               
        <xsl:value-of select="phpgw:conditional(not(onclick), '', onclick)"/>
+                                                                               
</xsl:attribute>
                                                                                
<xsl:attribute name="value">
-                                                                               
        <xsl:value-of select="../../../filters/*[local-name() = $filter_key]"/>
+                                                                               
        <xsl:value-of select="phpgw:conditional(not(value), '', value)"/>
                                                                                
</xsl:attribute>
+                                                                               
<xsl:attribute name="href">
+                                                                               
        <xsl:value-of select="phpgw:conditional(not(href), '', href)"/>
+                                                                               
</xsl:attribute>
+                                                                               
<xsl:attribute name="class">
+                                                                               
        <xsl:value-of select="phpgw:conditional(not(class), '', class)"/>
+                                                                               
</xsl:attribute>
                                                                        </input>
-                                                               </div>
-                                                       </td>
-                                               </xsl:when>
-                                               <xsl:when test="type = 
'filter'">
-                                                       <td>
-                                                               <xsl:variable 
name="name">
-                                                                       
<xsl:value-of select="name"/>
-                                                               </xsl:variable>
-                                       
-                                                               <select 
id="{$name}" name="{$name}">
-                                                                       
<xsl:attribute name="onchange">
-                                                                               
<xsl:value-of select="phpgw:conditional(not(onchange), '', onchange)"/>
-                                                                       
</xsl:attribute>
-                                                                       
<xsl:for-each select="list">
-                                                                               
<xsl:variable name="id">
-                                                                               
        <xsl:value-of select="id"/>
-                                                                               
</xsl:variable>
-                                                                               
<option value="{$id}">
-                                                                               
        <xsl:if test="selected = '1'">
-                                                                               
                <xsl:attribute name="selected">
-                                                                               
                        <xsl:text>selected</xsl:text>
-                                                                               
                </xsl:attribute>
-                                                                               
        </xsl:if>
-                                                                               
        <xsl:value-of select="name"/>
-                                                                               
</option>
-                                                                       
</xsl:for-each>
-                                                               </select>
-                                                       </td>
-                                               </xsl:when>
-                                               <xsl:otherwise>
-                                                       <td valign="top">
-                                                               <input 
id="innertoolbar">
-                                                                       
<xsl:attribute name="type">
-                                                                               
<xsl:value-of select="phpgw:conditional(not(type), '', type)"/>
-                                                                       
</xsl:attribute>
-                                                                       
<xsl:attribute name="name">
-                                                                               
<xsl:value-of select="phpgw:conditional(not(name), '', name)"/>
-                                                                       
</xsl:attribute>
-                                                                       
<xsl:attribute name="onclick">
-                                                                               
<xsl:value-of select="phpgw:conditional(not(onclick), '', onclick)"/>
-                                                                       
</xsl:attribute>
-                                                                       
<xsl:attribute name="value">
-                                                                               
<xsl:value-of select="phpgw:conditional(not(value), '', value)"/>
-                                                                       
</xsl:attribute>
-                                                                       
<xsl:attribute name="href">
-                                                                               
<xsl:value-of select="phpgw:conditional(not(href), '', href)"/>
-                                                                       
</xsl:attribute>
-                                                                       
<xsl:attribute name="class">
-                                                                               
<xsl:value-of select="phpgw:conditional(not(class), '', class)"/>
-                                                                       
</xsl:attribute>
-                                                               </input>
-                                                       </td>
-                                               </xsl:otherwise>
-                                       </xsl:choose>
+                                                               </xsl:otherwise>
+                                                       </xsl:choose>
+                                               </td>
+                                       </tr>
                                </xsl:for-each>
-                       </tr>
-                       <xsl:if test="item/text and normalize-space(item/text)">
-                               <thead>
-                                       <tr>
-                                               <xsl:for-each select="item">
-                                                       <td>
-                                                               <xsl:if 
test="name">
-                                                                       <label>
-                                                                               
<xsl:attribute name="for">
-                                                                               
        <xsl:value-of select="phpgw:conditional(not(name), '', name)"/>
-                                                                               
</xsl:attribute>
-                                                                               
<xsl:value-of select="phpgw:conditional(not(text), '', text)"/>
-                                                                       </label>
-                                                               </xsl:if>
-                                                       </td>
-                                               </xsl:for-each>
-                                       </tr>
-                               </thead>
-                       </xsl:if>
+                       </tbody>
                </table>
        </div>
 </xsl:template>
 
 <xsl:template match="datatable">
-<style>
-#components {
-    font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
-    width: 100%;
-    border-collapse: collapse;
-}
+       <style>
+               #components {
+               font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
+               width: 100%;
+               border-collapse: collapse;
+               }
 
-#components td, #components th {
-    font-size: 1em;
-    border: 1px solid #98bf21;
-    padding: 3px 7px 2px 7px;
-}
+               #components td, #components th {
+               font-size: 1em;
+               border: 1px solid #98bf21;
+               padding: 3px 7px 2px 7px;
+               }
 
-#components th {
-    font-size: 1.1em;
-    text-align: left;
-    padding-top: 5px;
-    padding-bottom: 4px;
-    background-color: green;
-    color: #ffffff;
-}
+               #components th {
+               font-size: 1.1em;
+               text-align: left;
+               padding-top: 5px;
+               padding-bottom: 4px;
+               background-color: green;
+               color: #ffffff;
+               }
 
-#components tr.alt td {
-    color: #000000;
-    background-color: #EAF2D3;
-}
-#summary {
-    font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
-    width: 100%;
-    border-collapse: collapse;
-}
+               #components tr.alt td {
+               color: #000000;
+               background-color: #EAF2D3;
+               }
+               #summary {
+               font-family: "Trebuchet MS", Arial, Helvetica, sans-serif;
+               width: 100%;
+               border-collapse: collapse;
+               }
 
-#summary td, #summary th {
-    font-size: 1em;
-    border: 1px solid #98bf21;
-    padding: 3px 7px 2px 7px;
-}
+               #summary td, #summary th {
+               font-size: 1em;
+               border: 1px solid #98bf21;
+               padding: 3px 7px 2px 7px;
+               }
 
-#summary th {
-    font-size: 1.1em;
-    text-align: left;
-    padding-top: 5px;
-    padding-bottom: 4px;
-    background-color: green;
-    color: #ffffff;
-}
+               #summary th {
+               font-size: 1.1em;
+               text-align: left;
+               padding-top: 5px;
+               padding-bottom: 4px;
+               background-color: green;
+               color: #ffffff;
+               }
 
-#summary tr.alt td {
-    color: #000000;
-    background-color: #EAF2D3;
-}
-</style>
+               #summary tr.alt td {
+               color: #000000;
+               background-color: #EAF2D3;
+               }
+       </style>
 
        <xsl:call-template name="datasource-definition" />
 </xsl:template>




reply via email to

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