~quickshotdevs/quickshot/other

« back to all changes in this revision

Viewing changes to apiv1.0/pages/homepage.php

  • Committer: Luke Jennings
  • Date: 2010-06-29 11:32:20 UTC
  • Revision ID: ubuntujenkins@googlemail.com-20100629113220-3k8q6y59hwdq0urz
added the bot and apiv1.0 folder

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?php
 
2
    require('includes/local_variables.php');
 
3
    require('includes/functions.php');
 
4
    $needed_entries = list_manifest($config_path);
 
5
    $existing_languages = array();
 
6
    $directory = opendir($data_path);
 
7
    while($filename = readdir($directory)){
 
8
        if(substr($filename, -4) == '.png'){
 
9
            list($e_name, $e_language,) = explode('@', substr($filename, 0, -4));
 
10
            if(in_array($e_name, $needed_entries)){
 
11
                if(!array_key_exists($e_language, $existing_languages)){
 
12
                    $existing_languages[$e_language] = array();
 
13
                }
 
14
                $existing_languages[$e_language][] = $e_name;
 
15
            }
 
16
        }
 
17
    }
 
18
    closedir($directory);
 
19
?>
 
20
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
 
21
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
22
<!--
 
23
# Ubuntu Manual
 
24
# Copyright (C) 2010 Daker & UMP TEAM <adnane AT ubuntu-manual DOT org>
 
25
 
26
# This program is free software: you can redistribute it and/or modify
 
27
# it under the terms of the GNU Affero General Public License as
 
28
# published by the Free Software Foundation, either version 3 of the
 
29
# License, or (at your option) any later version.
 
30
 
31
# This program is distributed in the hope that it will be useful,
 
32
# but WITHOUT ANY WARRANTY; without even the implied warranty of
 
33
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
34
# GNU Affero General Public License for more details.
 
35
 
36
# You should have received a copy of the GNU Affero General Public License
 
37
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
 
38
-->
 
39
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr" dir="ltr">
 
40
<head>
 
41
  <meta http-equiv="content-type" content="text/html;charset=utf-8" />
 
42
        <title>Ubuntu Manual - Quickshot - capture progress</title>
 
43
                <link rel="shortcut icon" href="favicon.png" />
 
44
                <meta name="description" content="Quickshot is a python application designed to make it easy for all users to capture translated screenshots using an intuitive and semi-automated step-by-step process." />
 
45
                <meta name="robots" content="noodp,noydir" />
 
46
                <link rel="stylesheet" type="text/css" href="/css/style.css" />
 
47
                <script language="javascript" src="/js/prototype.js"></script>
 
48
                                <script language="javascript" src="/js/alert.js"></script>
 
49
</head>
 
50
<body>
 
51
<div id="page">
 
52
        <div id="header"></div>
 
53
        <div id="shadowcaster">
 
54
                <div id="navbar">
 
55
                        <span class="home">
 
56
                                        <a href="/" >Home</a>
 
57
                        </span>
 
58
                </div>
 
59
                <div id="content">
 
60
                        <h2>Quickshot - capture progress</h2>
 
61
                        <div>
 
62
                                 <table style="width: 100%;" border="0">
 
63
                                            <?php
 
64
                                                $needed_count = count($needed_entries);
 
65
                                
 
66
                                                foreach($languages as $short => $name){
 
67
                                                   
 
68
                                                    $language_entries = array();
 
69
                                                    if(array_key_exists($short, $existing_languages)){
 
70
                                                        $language_entries = array_unique($existing_languages[$short]);
 
71
                                                    }
 
72
                                                    
 
73
                                                    $entries_count = count($language_entries);
 
74
                                                        
 
75
                                                    $percent = round($entries_count / $needed_count, 3);
 
76
                                                    
 
77
                                                    echo '<tr style="height:25px;">';
 
78
                                                        echo '<td style="width:250px;">';
 
79
                                                        if($entries_count > 0){
 
80
                                                          echo'<a href="#" onclick="togView(\'tr_'.htmlentities($short).'\');return false;"><img style="padding:0; border:0;" src="images/bullet.png" alt="ok" /></a>&nbsp;';
 
81
                                                        }
 
82
                                                        echo $name.'</td>';
 
83
                                                        echo '<td style="width:300px;">Progress: '.($percent * 100).'% ('.$entries_count.'/'.$needed_count.')</td>';
 
84
                                                        echo '<td style="width:250px;"><div id="progress-live">';
 
85
                                                        echo '          <div id="progress-bar">';
 
86
                                                        if($entries_count > 0){
 
87
                                                                echo '                  <div id="progress-level" style="width: '.intval($percent * 100).'%;"></div>';
 
88
                                                        }
 
89
                                                        echo '          </div>';
 
90
                                                        echo '  </div></td>';
 
91
                                                    echo '</tr>';
 
92
                                                    
 
93
                                                    if($entries_count > 0){
 
94
                                                        echo '<tr id="tr_'.$short.'" style="display:none;">';
 
95
                                                            echo '<td colspan="3">';
 
96
                                                                if($entries_count == $needed_count){
 
97
                                                                    $zipfile_path = $data_path.$short.'.zip';
 
98
                                                                    if(file_exists($zipfile_path)){
 
99
                                                                        echo 'Last zipfile update: '.date("F d Y H:i.s.", filemtime($zipfile_path));
 
100
                                                                        echo '<br/>';
 
101
                                                                        echo 'You can <a href="'.htmlentities($zipfile_path).'">download it</a> or <a href="api/download/'.urlencode($short).'">rebuild the archive</a>.';
 
102
                                                                    }else{
 
103
                                                                        echo 'No zipfile exists. You can <a href="api/download/'.urlencode($short).'">build a new archive</a>.';
 
104
                                                                    }
 
105
                                                                }else{
 
106
                                                                        $js_command = 'uplAlert(\'<br /> <br />'.implode(' <b>-</b> ', array_diff($needed_entries, $language_entries)).'\',\'Screencaps needed:\'); return false;';
 
107
                                                                        echo 'This language is partially complete. You can <a href="#" onclick="'.$js_command.'">view all needed screencaps</a>.';
 
108
                                                                    echo '</div>';
 
109
                                                                }
 
110
                                                            echo '</td>';
 
111
                                                        echo '</tr>';
 
112
                                                    }
 
113
                                                }
 
114
                                            ?>
 
115
                                </table>
 
116
                                
 
117
                        </div>
 
118
        
 
119
                        <div id='footer'>
 
120
                                <hr />
 
121
                                <span style='float:left'>Copyright &copy; 2010 The Ubuntu Manual Team &ndash; Some rights reserved</span>
 
122
 
 
123
                                <span style='float:right'>All of our work is licensed under Creative Commons Attribution Share-Alike</span>
 
124
                        </div>
 
125
                </div>
 
126
        </div>
 
127
</div>
 
128
</body>
 
129
</html>