Browse the code

 

Differences between 604 and 605 on /.
Number of edited files: 3 (0 added, 0 deleted and 3 modified)
Revision 605

About 2 months and 22 days ago.

* Updated the template for the download page of a project
Added file(s) Deleted file(s) Modified file(s)

 

Old New Code
1
1
<h1><?=i18n('Download');?></h1>
2
2

                                        
3
3
<div class="feed"><?=$feed;?></div>
 
4
  <? if ($has_version): ?>
4
5

                                        
5
 
<? if ($has_version): ?>
6
 
  <table style="width: 100%;">
7
 
    <caption><?=i18n('Available files');?></caption>
8
 
    <thead>
9
 
      <tr>
10
 
        <th colspan="3" style="width: 30%;">Filename</th>
11
 
        <th style="width: 17%;"><?=i18n('Hash (md5)');?></th>
12
 
        <th style="width: 5%;"><?=i18n('Size');?></th>
13
 
        <th style="width: 10%;"><?=i18n('Downloads');?></th>
14
 
        <th style="width: 12%;"><?=i18n('Date added');?></th>
15
 
      </tr>
16
 
    </thead>
 
6
    <? $vid = 0; ?>
17
7
    <? foreach ($all_versions_array as $version => $downloads): ?>
18
 
      <tbody>
19
 
        <tr class="background_normal">
20
 
          <td class="border_bottom_dotted" style="width: 11%;" colspan="2">
21
 
            <ul>
22
 
              <li>
23
 
                <a href="project/<?=$_dbname;?>/download#null" onclick="javascript:hideorshow('<?=$version;?>');" style="display: block;width: 100%;" class="pheader"><strong><?=$version;?></strong></a>
 
8

                                    
 
9
      <? if ($vid == 0): ?>
 
10
        <div class="prettylist_box">
 
11
          <h2 style="overflow: visible;"><?=i18n('Last available version: %(v)s', array('v' => $version));?>
 
12
            <span class="version_tag" style="background-color: #<?=$downloads[0]['color'];?>;">
 
13
              <strong/><?=$downloads[0]['state'];?></strong></span>
 
14
            <span class="download_tag">
 
15
              <i class="fas fa-download fa-fw"></i> <?=i18nNumber($downloads[2]['number'], $lang);?></span>
 
16
          </h2>
 
17

                                    
 
18
          <ul class="prettylist_content">
 
19
            <? $i = 0; ?>
 
20
            <? foreach ($downloads[1] as $v): ?>
 
21
              <li class="prettylist_browsing">
 
22
                <span class="date"><i class="fas fa-clock fa-fw"></i><?=$v['date'];?></span>
 
23
                <? if ($v['size'] != '-'): ?>
 
24
                  <span class="date"><i class="fas fa-file-archive fa-fw"></i><?=$v['size'];?></span>
 
25
                <? endif; ?>
 
26
                <span class="download"><i class="fas fa-download fa-fw"></i><?=$v['number'];?></span>
 
27

                                    
 
28
                <h4><a href="<?=$v['url'];?>"><?=$v['title'];?></a></h4>
 
29
                <? if ($v['hash'] != '-'): ?>
 
30
                  <span class="second"><?=i18n('Hash (MD5): %(hash)s', array('hash' => '<em>'.$v['hash'].'</em>'));?></span>
 
31
                <? endif; ?>
 
32
                <span class="desc"><?=$v['text'];?></span>
24
33
              </li>
25
 
            </ul>
26
 
          </td>
27
 
          <td class="border_bottom_dotted center" style="background-color: #<?=$downloads[0]['color'];?>;width: 10%;">
28
 
            <?=$downloads[0]['state'];?>
29
 
          </td>
30
 
          <td class="border_bottom_dotted">&nbsp;</td>
31
 
          <td class="border_bottom_dotted">&nbsp;</td>
32
 
          <td class="border_bottom_dotted center"><strong><?=i18nNumber($downloads[2]['number'], $lang);?></strong></td>
33
 
          <td class="border_bottom_dotted">&nbsp;</td>
34
 
        </tr>
35
 
      </tbody>
36
 
      <tbody id="down<?=$version;?>">
37
 
        <? $i = 0; ?>
38
 
        <? foreach ($downloads[1] as $v): ?>
39
 
          <? (($i & 1) ? $cl = 'background_table_second' : $cl = 'background_table_first'); ?>
40
 
          <tr>
41
 
            <td style="padding: 5px 5px 5px 5px;">
42
 
              <a href="<?=$v['url'];?>"><strong><?=$v['title'];?></strong></a>
43
 
            </td>
44
 
            <td colspan="2">
45
 
              <span class="text_minus">
46
 
                <?=$v['text'];?>
47
 
              </span>
48
 
            </td>
49
 
            <td class="center"><span class="text_minus"><?=$v['hash'];?></span></td>
50
 
            <td class="center"><?=$v['size'];?></td>
51
 
            <td class="center"><?=$v['number'];?></td>
52
 
            <td class="center"><?=$v['date'];?></td>
53
 
          </tr>
54
 
          <? $i ++; ?>
55
 
        <? endforeach; ?>
56
 
      </tbody>
 
34
              <? $i ++; ?>
 
35
            <? endforeach; ?>
 
36
          </ul>
 
37
        </div>
 
38
      <? elseif ($vid == 1): ?>
 
39
          <h2><?=i18n('Older versions available');?></h2>
 
40
      <? endif; ?>
 
41

                                    
 
42
      <? if ($vid > 0): ?>
 
43
        <div class="prettylist_box">
 
44
          <h2 style="overflow: visible;"><a href="project/<?=$_dbname;?>/download#null" onclick="javascript:hideorshow('<?=$version;?>');"><?=$version;?></a>
 
45
            <span class="version_tag" style="background-color: #<?=$downloads[0]['color'];?>;">
 
46
              <strong/><?=$downloads[0]['state'];?></strong></span>
 
47
            <span class="download_tag">
 
48
              <i class="fas fa-download fa-fw"></i> <?=i18nNumber($downloads[2]['number'], $lang);?></span>
 
49
          </h2>
 
50

                                    
 
51
          <ul class="prettylist_content" id="down<?=$version;?>">
 
52
            <? $i = 0; ?>
 
53
            <? foreach ($downloads[1] as $v): ?>
 
54
              <li class="prettylist_browsing">
 
55
                <span class="date"><i class="fas fa-clock fa-fw"></i><?=$v['date'];?></span>
 
56
                <? if ($v['size'] != '-'): ?>
 
57
                  <span class="date"><i class="fas fa-file-archive fa-fw"></i><?=$v['size'];?></span>
 
58
                <? endif; ?>
 
59
                <span class="download"><i class="fas fa-download fa-fw"></i><?=$v['number'];?></span>
 
60

                                    
 
61
                <h4><a href="<?=$v['url'];?>"><?=$v['title'];?></a></h4>
 
62
                <? if ($v['hash'] != '-'): ?>
 
63
                  <span class="second"><?=i18n('Hash (MD5): %(hash)s', array('hash' => '<em>'.$v['hash'].'</em>'));?></span>
 
64
                <? endif; ?>
 
65
                <span class="desc"><?=$v['text'];?></span>
 
66
              </li>
 
67
              <? $i ++; ?>
 
68
            <? endforeach; ?>
 
69
          </ul>
 
70
        </div>
 
71
      <? endif; ?>
 
72

                                    
 
73
      <? $vid ++; ?>
57
74
    <? endforeach; ?>
58
 
  </table>
59
75

                                        
60
 
<? else: ?>
61
 
  <em><?=i18n('This project has no version. You could not download it!');?></em>
62
 
<? endif; ?>
 
76
  <? else: ?>
 
77
    <em><?=i18n('This project has no version. You could not download it!');?></em>
 
78
  <? endif; ?>
63
79

                                        
64
80
<script type="text/javascript">
65
81
function onload()
80
96
    formconf = document.getElementById('down' + version);
81
97

                                        
82
98
    if (formconf.style.display == 'none')
83
 
        formconf.style.display = 'table-row-group';
 
99
        formconf.style.display = 'block';
84
100
    else
85
101
        formconf.style.display = 'none';
86
102
}
87
 
</script>
 
103
</script>
88
104

                                        

 

Old New Code
17
17
class View {
18
18
    private $ct_session, $ct_db, $page, $error, $langlist, $lang;
19
19
    public $metatags, $maincontent;
20
 
    
 
20

                                    
21
21
    function __construct($session, $db, $page, $error, $langlist, $lang)
22
22
    {
23
23
        // Variables
32
32
        {
33
33
            Header ('Status: 301 Moved Permanently', false, 301);
34
34
            Header ('Location: '.CT_BASEURL.'projects');
35
 
            exit(); 
 
35
            exit();
36
36
        }
37
37

                                        
38
38
        if (!mb_ereg("^[0-9a-z_-]+$", $this->page[2]))
163
163
        // Downloads: home
164
164
        $construct['__tpl__'] = 'download.tpl';
165
165
        $construct['_dbname'] = $this->dbname;
 
166
        $construct['_project_name'] = $this->name;
166
167

                                        
167
168
        $construct['all_versions_array'] = array();
168
169

                                        
225
226
                        $hash = '-';
226
227
                    }
227
228

                                        
228
 
                    $date = i18nDate($down['date'], $this->lang);
 
229
                    $date = i18nDate($down['date'], $this->lang, TRUE);
229
230

                                        
230
231
                    $construct['all_versions_array'][$ver['version']][2]['number'] += $down['downloads'];
231
232

                                        
239
240
                              'hash'    => $hash,
240
241
                              'size'    => $size));
241
242
                }
 
243

                                    
 
244
                //$first_version_show = array_shift($construct['all_versions_array']);
 
245

                                    
242
246
            }
243
247

                                        
 
248

                                    
 
249

                                    
 
250

                                    
244
251
            $construct['versions_list'] = '';
245
252
            $i = 1;
246
253
            foreach($export_versions as $key => $value)
256
263
        return $construct;
257
264
    }
258
265
}
259
 
?>
 
266
?>
260
267

                                        

 

Old New Code
550
550
  list-style-image: none;
551
551
}
552
552

                                        
 
553
ul.prettylist_content span.second {
 
554
  font-size: 0.80em;
 
555
  color: {color_600};
 
556
  float: right;
 
557
}
 
558

                                    
553
559
li.prettylist_browsing {
554
560
  border-bottom: 1px solid {color_200};
555
561
  padding: 10px;
712
718
  width: 80%;
713
719
}
714
720

                                        
 
721
span.version_tag, span.download_tag {
 
722
  margin-left: 30px;
 
723
  padding: 5px 15px 5px 15px;
 
724
  border-radius: 5px;
 
725
  text-transform: lowercase;
 
726
  font-size: 0.80em;
 
727
  color: {color_400};
 
728
}
715
729

                                        
 
730
span.download_tag {
 
731
  background-color: {color_100};
 
732
  color: {color_500};
 
733
}
716
734

                                        
717
735

                                        
718
736

                                        
721
739

                                        
722
740

                                        
723
741

                                        
724
 

                                    
725
 

                                    
726
742
/* ??? -- reste de l'ancienne css --  */
727
743

                                        
728
744

                                        
729
745