/dev/adei-asec

To get this branch, use:
bzr branch http://darksoft.org/webbzr/dev/adei-asec

« back to all changes in this revision

Viewing changes to xslt/download.xsl

  • Committer: Suren A. Chilingaryan
  • Date: 2011-03-15 02:47:05 UTC
  • mfrom: (210.1.3 adei)
  • Revision ID: csa@dside.dyndns.org-20110315024705-qljn30gwin8yrkne
Integration of work of students with fixes

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="utf-8"?>
 
2
<xsl:stylesheet version="1.0"  xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
 
3
<xsl:output method="html" encoding="utf-8"/>  
 
4
  <xsl:template match="result">
 
5
  <div>
 
6
   <div><h1>Download Manager</h1></div>
 
7
    <table>
 
8
      <tr>            
 
9
        <th width="18%">User</th>
 
10
        <th>Data</th>
 
11
        <th width="20%">Added</th>          
 
12
        <th width="25%">Progress</th>
 
13
        <th width="100px">Tools</th>          
 
14
      </tr>
 
15
        <xsl:for-each select="download">
 
16
          <xsl:if test="@sort='true'">
 
17
            <tr>
 
18
            <td>
 
19
              <div>
 
20
                <xsl:value-of select="@user"/>
 
21
              </div>
 
22
              <xsl:if test="@owner != 'true'">
 
23
                <div class="dlsort_down" title="Sort downloads from this IP down" style="cursor:pointer" onmouseover="document.body.style.cursor='default'">
 
24
                  <xsl:attribute name="onclick">javascript:dlmanager.SortBy('<xsl:value-of select="@user"/>')</xsl:attribute>
 
25
                </div>
 
26
              </xsl:if>
 
27
            </td>  
 
28
            <td>
 
29
             <div class="downloadData" style=" min-width: 200px;">
 
30
              <table>
 
31
                <tr>
 
32
                  <td><u>Source:</u></td>       
 
33
                  <td style="white-space: no-wrap;"><xsl:value-of select="@dl_name"/><br></br></td>
 
34
                </tr><tr>
 
35
                  <td><u>Window:</u></td>
 
36
                  <td style=""><xsl:value-of select="@detwindow"/><br></br></td>
 
37
                </tr><tr>
 
38
                  <td><u>Format:</u></td>
 
39
                  <td style=""><xsl:value-of select="@format"/><br></br></td>
 
40
                </tr>
 
41
              </table>
 
42
             </div>
 
43
            </td>
 
44
            <td><xsl:value-of select="@startdate"/></td>
 
45
            <td>        
 
46
              <xsl:if test="@status='Queue'">   
 
47
                <div class="progress_container" id="progress_container">
 
48
                <div class="progressQueue">Queue</div></div>
 
49
                <div style="font-size:11px">
 
50
                  <xsl:attribute name="id">fcount<xsl:value-of select="@dl_id"/></xsl:attribute>
 
51
                </div>        
 
52
              </xsl:if>
 
53
              <xsl:if test="@status='ERROR'">   
 
54
                <div class="progress_container" id="progress_container">
 
55
                    <div class="progressQueue"><font color="#FF0000">Error!</font></div>
 
56
                </div>  
 
57
              </xsl:if>
 
58
              <xsl:if test="@status='Finalizing'"> 
 
59
                <div class="progress_container" id="progress_container">
 
60
                    <div class="progress" id="progress">Finalizing file...</div>
 
61
                </div>      
 
62
              </xsl:if>
 
63
              <xsl:if test="@status='Ready'"> 
 
64
                <div class="progress_container" id="progress_container">
 
65
                    <div class="progressReady" id="progressReady">Complete (
 
66
                        <xsl:if test="@filesize='0.1'"> &#60;1mb)</xsl:if> 
 
67
                        <xsl:if test="@filesize!='0.1'"><xsl:value-of select="@filesize"/>mb)</xsl:if>
 
68
                    </div>
 
69
                </div>          
 
70
              </xsl:if>
 
71
                <xsl:if test="@status='Preparing'">     
 
72
                <div class="progress_container" id="progress_container">
 
73
                    <div class="progress" style="width:0%">
 
74
                        <xsl:attribute name="id">progress<xsl:value-of select="@dl_id"/></xsl:attribute>
 
75
                    </div>
 
76
                </div>
 
77
                <div style="font-size:11px">
 
78
                  <xsl:attribute name="id">fcount<xsl:value-of select="@dl_id"/></xsl:attribute>
 
79
                </div>
 
80
              </xsl:if>
 
81
            </td>       
 
82
            <td>
 
83
            <div class="buttoncontainer" borderwidth="0">
 
84
              <table cellspacing="0" cellpadding="0"><tr>
 
85
                <td><div class="previewimg" title="Show graph" style="cursor:pointer;">
 
86
                  <xsl:attribute name="onclick">javascrip:tooltip.Show(event,'<xsl:value-of select="@dl_id"/>')</xsl:attribute>
 
87
                </div></td>
 
88
                <td><div class="infoimg" title="Show details" style="cursor:pointer" >
 
89
                  <xsl:attribute name="onclick">javascript:tooltipdet.Show(event,'<xsl:value-of select="@dl_id"/>', 'true')</xsl:attribute>
 
90
                </div></td>
 
91
                <td><div class="downloadimg" title="Download file" style="cursor:pointer">
 
92
                  <xsl:if test="@status='Ready'">
 
93
                    <xsl:attribute name="onclick">javascript:data_export.StartDownload('<xsl:value-of select="@dl_id"/>','<xsl:value-of select="@format"/>','<xsl:value-of select="@dl_name"/>','<xsl:value-of select="@ctype"/>')</xsl:attribute>
 
94
                  </xsl:if>
 
95
                </div></td>
 
96
                <td><div class="deleteimg" title="Delete download" style="cursor:pointer">
 
97
                  <xsl:attribute name="onclick">javascript:dlmanager.RemoveDownload('<xsl:value-of select="@dl_id"/>')</xsl:attribute>  
 
98
                </div></td>
 
99
              </tr></table>           
 
100
            </div>
 
101
            <div title="Uncheck to prevent deleting download automatically when unused">
 
102
              <xsl:attribute name="onmouseover">javascript:showText('auto_delete<xsl:value-of select="@dl_id"/>')</xsl:attribute>
 
103
              <xsl:attribute name="onmouseout">javascript:clearText('auto_delete<xsl:value-of select="@dl_id"/>')</xsl:attribute>
 
104
              <div style="float:right; margin-right:1px; width:20px;">          
 
105
                <input type="checkbox">
 
106
                    <xsl:attribute name="name">auto_delete_cb<xsl:value-of select="@dl_id"/></xsl:attribute>
 
107
                    <xsl:if test="@auto_delete='true'">
 
108
                        <xsl:attribute name="checked"></xsl:attribute>
 
109
                    </xsl:if>           
 
110
                    <xsl:attribute name="onclick">javascript:dlmanager.ToggleAutodelete('<xsl:value-of select="@dl_id"/>')</xsl:attribute>
 
111
                </input>
 
112
              </div>
 
113
              <div style="/*float:left;*/ text-align:left;">
 
114
                <xsl:attribute name="id">auto_delete<xsl:value-of select="@dl_id"/></xsl:attribute>                    
 
115
              </div>
 
116
            </div>
 
117
            </td>
 
118
            </tr>  
 
119
          </xsl:if>      
 
120
        </xsl:for-each>      
 
121
    </table>    
 
122
    <div style="text-align:center"><h4>Downloads from different IP</h4></div>
 
123
    <table>
 
124
      <tr>            
 
125
        <th width="18%">User</th>
 
126
        <th>Data</th>
 
127
        <th width="20%">Added</th>          
 
128
        <th width="25%">Progress</th>
 
129
        <th width="100px">Tools</th>          
 
130
      </tr>
 
131
      <xsl:for-each select="download">
 
132
          <xsl:if test="@sort='rest'">
 
133
            <tr>
 
134
             <td><div><xsl:value-of select="@user"/></div>          
 
135
              <div class="dlsort" title="Sort downloads from this IP up" style="cursor:pointer" onmouseover="document.body.style.cursor='default'">
 
136
                <xsl:attribute name="onclick">javascript:dlmanager.SortBy('<xsl:value-of select="@user"/>')</xsl:attribute>
 
137
              </div>       
 
138
            </td>  
 
139
            <td>
 
140
            <div class="downloadData" style=" min-width: 200px;">
 
141
              <table>
 
142
                <tr>
 
143
                  <td><u>Source:</u></td>       
 
144
                  <td style="white-space: no-wrap;"><xsl:value-of select="@dl_name"/><br></br></td>
 
145
                </tr><tr>
 
146
                  <td><u>Window:</u></td>
 
147
                  <td style=""><xsl:value-of select="@detwindow"/><br></br></td>
 
148
                </tr><tr>
 
149
                  <td><u>Format:</u></td>
 
150
                  <td style=""><xsl:value-of select="@format"/><br></br></td>
 
151
                </tr>
 
152
              </table>
 
153
            </div>
 
154
            </td>
 
155
            <td><xsl:value-of select="@startdate"/></td>
 
156
            <td>        
 
157
              <xsl:if test="@status='Queue'">   
 
158
                <div class="progress_container" id="progress_container">
 
159
                <div class="progressQueue">Queue</div></div>    
 
160
              </xsl:if>
 
161
              <xsl:if test="@status='ERROR'">   
 
162
                <div class="progress_container" id="progress_container">
 
163
                <div class="progressQueue"><font color="#FF0000">Error!</font></div></div>      
 
164
              </xsl:if>
 
165
              <xsl:if test="@status='Finalizing'"> 
 
166
                <div class="progress_container" id="progress_container">
 
167
                <div class="progress" id="progress">Finalizing file...</div></div>
 
168
              </xsl:if>
 
169
              <xsl:if test="@status='Ready'"> 
 
170
                <div class="progress_container" id="progress_container">
 
171
                <div class="progressReady" id="progressReady">Complete (
 
172
                  <xsl:if test="@filesize='0.1'"> &#60;1mb)</xsl:if> 
 
173
                  <xsl:if test="@filesize!='0.1'"><xsl:value-of select="@filesize"/>mb)</xsl:if>
 
174
                </div></div>
 
175
              </xsl:if>
 
176
                <xsl:if test="@status='Preparing'">     
 
177
                <div class="progress_container" id="progress_container">
 
178
                <div class="progress" style="width:0%">
 
179
                  <xsl:attribute name="id">progress<xsl:value-of select="@dl_id"/></xsl:attribute>
 
180
                </div></div>
 
181
                <div style="font-size:11px">
 
182
                  <xsl:attribute name="id">fcount<xsl:value-of select="@dl_id"/></xsl:attribute>
 
183
                </div>
 
184
              </xsl:if>
 
185
            </td>       
 
186
            <td>
 
187
            <div class="buttoncontainer">
 
188
              <table cellspacing="0" cellpadding="0"><tr>
 
189
                <td><div class="previewimg" title="Show graph" style="cursor:pointer">
 
190
                  <xsl:attribute name="onclick">javascrip:tooltip.Show(event,'<xsl:value-of select="@dl_id"/>')</xsl:attribute>
 
191
                </div></td>
 
192
                <td><div class="infoimg" title="Show details" style="cursor:pointer">
 
193
                  <xsl:attribute name="onclick">javascript:tooltipdet.Show(event,'<xsl:value-of select="@dl_id"/>', 'true')</xsl:attribute>
 
194
                </div></td>
 
195
                <td><div class="downloadimg" title="Download file" style="cursor:pointer">
 
196
                  <xsl:if test="@status='Ready'">
 
197
                    <xsl:attribute name="onclick">javascript:data_export.StartDownload('<xsl:value-of select="@dl_id"/>','<xsl:value-of select="@format"/>','<xsl:value-of select="@dl_name"/>','<xsl:value-of select="@ctype"/>')</xsl:attribute>
 
198
                  </xsl:if>
 
199
                </div></td>
 
200
                <td><div class="deleteimg" title="Delete download" style="cursor:pointer">
 
201
                  <xsl:attribute name="onclick">javascript:dlmanager.RemoveDownload('<xsl:value-of select="@dl_id"/>')</xsl:attribute>  
 
202
                </div></td>
 
203
              </tr></table>
 
204
             <div title="Uncheck to prevent deleting download automatically when unused">
 
205
            <xsl:attribute name="onmouseover">javascript:showText('auto_delete<xsl:value-of select="@dl_id"/>')</xsl:attribute>
 
206
            <xsl:attribute name="onmouseout">javascript:clearText('auto_delete<xsl:value-of select="@dl_id"/>')</xsl:attribute>
 
207
              <div style="float:right; margin-right:1px; width:20px">           
 
208
                <input type="checkbox">
 
209
                <xsl:attribute name="name">auto_delete_cb<xsl:value-of select="@dl_id"/></xsl:attribute>
 
210
                <xsl:if test="@auto_delete='true'">
 
211
                  <xsl:attribute name="checked"></xsl:attribute>
 
212
                </xsl:if>               
 
213
                <xsl:attribute name="onclick">javascript:dlmanager.ToggleAutodelete('<xsl:value-of select="@dl_id"/>')</xsl:attribute>
 
214
                </input>
 
215
              </div>
 
216
              <div style="/*float:left;*/ text-align:left;">
 
217
                <xsl:attribute name="id">auto_delete<xsl:value-of select="@dl_id"/></xsl:attribute>                    
 
218
              </div>
 
219
            </div>              
 
220
            </div>
 
221
            </td>
 
222
           </tr>  
 
223
          </xsl:if>     
 
224
      </xsl:for-each>     
 
225
    </table>    
 
226
    <script type="text/javascript">      
 
227
        dlmanagerstart();
 
228
        showText = function(id){
 
229
          document.getElementById(id).innerHTML="Auto delete";
 
230
        }
 
231
        clearText = function(id){
 
232
          document.getElementById(id).innerHTML="";
 
233
        }       
 
234
    </script>
 
235
  </div>
 
236
  </xsl:template> 
 
237
</xsl:stylesheet>