Browse the code

 

Differences between 605 and 606 on /.
Number of edited files: 6 (1 added, 0 deleted and 5 modified)
Revision 606

About 1 month and 2 days ago.

* Added Chart.js lib
* Updated roadmap UX
Added file(s) Deleted file(s) Modified file(s)

 

Old New Code
25
25
RewriteCond %{REQUEST_URI} !^/inc/templates/([a-z-]+)/images/.*$
26
26
RewriteCond %{REQUEST_URI} !^/inc/templates/([a-z-]+)/fonts/.*$
27
27
RewriteCond %{REQUEST_URI} !^/inc/libs/fontawesome/.*$
 
28
RewriteCond %{REQUEST_URI} !^/inc/libs/Chart.js$
28
29
RewriteCond %{REQUEST_URI} !^/robots.txt?$
29
30
RewriteRule ^(.*)$ index.php [QSA,L]
30
31

                                        

 

Old New Code
1
 
<Files ~ "\.(css|png|otf|ttf)$">
 
1
<Files ~ "\.(css|png|otf|ttf|js)$">
2
2
  Require all granted
3
3
</Files>
4
4

                                        
5
 
Require all denied
 
5
Require all denied
6
6

                                        

 

Old New Code
1
 
<table class="legends" style="float: right;">
2
 
  <tr>
3
 
    <td class="legends_box_pbar_left"></td>
4
 
    <td style="padding-right: 30px;"><span style="font-size: 0.8em;"><?=i18n('Issues closed');?></span></td>
 
1
<h1><?=i18n('Roadmap');?></h1>
5
2

                                        
6
 
    <td class="legends_box_pbar_right"></td>
7
 
    <td style="padding-right: 30px;"><span style="font-size: 0.8em;"><?=i18n('Issues still open');?></span></td>
8
 
  </tr>
9
 
</table>
 
3
<div class="content_left_main">
 
4
  <?=$widget;?>
10
5

                                        
11
 
<h1><?=i18n('Roadmap');?></h1>
 
6
  <div class="spacer">&nbsp;</div>
 
7
</div>
12
8

                                        
13
 
<table style="width: 100%;margin-bottom: 20px;">
14
 
  <tr>
15
 
    <td style="width: 65%;vertical-align: top;padding-right: 30px;" class="border_right">
16
 
      <h2 id="milestones"><?=i18n('Milestone');?></h2>
17
9

                                        
18
 
      <div id="htab0">
19
 
      <?=$widget;?>
20
 
      </div>
 
10
<div class="content_sidebar">
 
11
  <h3><?=i18n('Overall progression');?></h3>
 
12
  <div class="progressbar" style="height: 10px;">
 
13
    <div class="progressbar_left" style="width:<?=$global_closed;?>px;">&nbsp;</div>
 
14
    <div class="progressbar_right" style="width:<?=$global_open;?>px;">&nbsp;</div>
 
15
  </div>
 
16
  <span style="margin-top: -2px;padding-left: 5px;float: right;"><strong><?=$global_percent;?>%</strong></span>
21
17

                                        
22
 
    </td>
23
 
    <td style="vertical-align: top;padding-left: 15px;">
24
 
      <h3 style="margin-top: 0px;margin-bottom: 15px;padding-top: 15px;"><?=i18n('Overall progression');?></h3>
 
18
  <div class="spacer">&nbsp;</div><div class="spacer">&nbsp;</div>
25
19

                                        
26
 
      <table style="width: 100%;">
27
 
        <tr>
28
 
          <td>
29
 
            <div class="progressbar" style="height: 10px;">
30
 
              <div class="progressbar_left" style="width:<?=$global_closed;?>px;">&nbsp;</div>
31
 
              <div class="progressbar_right" style="width:<?=$global_open;?>px;">&nbsp;</div>
32
 
            </div>
33
 
          </td>
34
 
          <td style="width: 60px;">
35
 
            <span style="font-weight: bold;"><?=$global_percent;?>%</span>
36
 
          </td>
37
 
        </tr>
38
 
      </table>
 
20
  <h3><?=i18n('Statistics');?></h3>
 
21
  <ul class="actiontools">
 
22
    <li><a href="project/<?=$_dbname;?>/bugs/?nbbugs=30"><i class="fas fa-tasks fa-fw"></i><?=i18n('%(all_bugs)s bugs filed', array('all_bugs' => '<strong>'.$all_bugs.'</strong>'));?></a></li>
 
23
    <li><a href="project/<?=$_dbname;?>/bugs/?nbbugs=30&amp;active=1&amp;waiting=1&amp;unconfirmed=1"><i class="fas fa-folder-open fa-fw"></i><?=i18n('%(ope_bugs)s open bugs', array('ope_bugs' => '<strong>'.$ope_bugs.'</strong>'));?></a></li>
 
24
    <li><a href="project/<?=$_dbname;?>/bugs/?nbbugs=30&amp;closed=1"><i class="fas fa-folder fa-fw"></i><?=i18n('%(res_bugs)s closed bugs', array('res_bugs' => '<strong>'.$res_bugs.'</strong>'));?></a></li>
 
25
    <li><a href="project/<?=$_dbname;?>/bugs/?nbbugs=30&amp;withversion=1&amp;version="><i class="fas fa-exclamation fa-fw"></i><?=i18n('%(unv_bugs)s unversioned bugs', array('unv_bugs' => '<strong>'.$unv_bugs.'</strong>'));?></a></li>
 
26
    <li><a href="project/<?=$_dbname;?>/bugs/?nbbugs=30&amp;onlyfeaturerequest=1&amp;active=1&amp;waiting=1&amp;unconfirmed=1"><i class="fas fa-question-circle fa-fw"></i><?=i18n('%(fea_bugs)s opened feature requests', array('fea_bugs' => '<strong>'.$fea_bugs.'</strong>'));?></a></li>
 
27
  </ul>
39
28

                                        
40
 
      <h3 style="margin-top: 0px;margin-bottom: 15px;padding-top: 15px;"><?=i18n('Statistics');?></h3>
 
29
  <div class="spacer">&nbsp;</div>
41
30

                                        
42
 
      <ul class="actiontools">
43
 
        <li><a href="project/<?=$_dbname;?>/bugs/?nbbugs=30" style="background-image: url('public/images/icons/project-bug-all.png');"><?=i18n('%(all_bugs)s bugs filed', array('all_bugs' => '<strong>'.$all_bugs.'</strong>'));?></a></li>
44
 
        <li><a href="project/<?=$_dbname;?>/bugs/?nbbugs=30&amp;active=1&amp;waiting=1&amp;unconfirmed=1" style="background-image: url('public/images/icons/project-bug-open.png');"><?=i18n('%(ope_bugs)s open bugs', array('ope_bugs' => '<strong>'.$ope_bugs.'</strong>'));?></a></li>
45
 
        <li><a href="project/<?=$_dbname;?>/bugs/?nbbugs=30&amp;closed=1" style="background-image: url('public/images/icons/project-bug-close.png');"><?=i18n('%(res_bugs)s closed bugs', array('res_bugs' => '<strong>'.$res_bugs.'</strong>'));?></a></li>
46
 
        <li><a href="project/<?=$_dbname;?>/bugs/?nbbugs=30&amp;withversion=1&amp;version=" style="background-image: url('public/images/icons/project-bug-orphan.png');"><?=i18n('%(unv_bugs)s unversioned bugs', array('unv_bugs' => '<strong>'.$unv_bugs.'</strong>'));?></a></li>
47
 
        <li><a href="project/<?=$_dbname;?>/bugs/?nbbugs=30&amp;onlyfeaturerequest=1&amp;active=1&amp;waiting=1&amp;unconfirmed=1" style="background-image: url('public/images/icons/project-bug-feature.png');"><?=i18n('%(fea_bugs)s opened feature requests', array('fea_bugs' => '<strong>'.$fea_bugs.'</strong>'));?></a></li>
48
 
      </ul>
 
31
  <h3><?=i18n('Distribution');?></h3>
49
32

                                        
50
 
      <h3 style="margin-top: 0px;margin-bottom: 15px;padding-top: 15px;"><?=i18n('Distribution');?></h3>
 
33
<canvas id="doughnut-chart" width="100" height="100"></canvas>
 
34
<script type="text/javascript">
 
35
function getRandomColor() {
 
36
    var letters = '0123456789ABCDEF'.split('');
 
37
    var color = '#';
 
38
    for (var i = 0; i < 6; i++ ) {
 
39
        color += letters[Math.floor(Math.random() * 16)];
 
40
    }
 
41
    return color;
 
42
}
51
43

                                        
52
 
      <img src="svg/project/<?=$_dbname;?>/pie/<?=$stats_repart_total;?>/100x80/<?=$stats_repart;?>" alt="pie" />
 
44
new Chart(document.getElementById("doughnut-chart"), {
 
45
    type: 'doughnut',
 
46
    data: {
 
47
      labels: [<? foreach ($stats_repart_array as $key => $value): ?>
 
48
                 "<?=$key;?>",
 
49
               <? endforeach; ?>
 
50
              ],
 
51
      datasets: [
 
52
        {
 
53
          data: [<? foreach ($stats_repart_array as $key => $value): ?>
 
54
                   "<?=$value;?>",
 
55
                 <? endforeach; ?>
 
56
                ],
 
57
          backgroundColor: [<? foreach ($stats_repart_array as $key => $value): ?>
 
58
                 getRandomColor(),
 
59
               <? endforeach; ?>
 
60
               ]
 
61
        }
 
62
      ]
 
63
    }
 
64
});
 
65
</script>
53
66

                                        
54
 
      <h3 style="margin-top: 0px;margin-bottom: 15px;padding-top: 25px;"><?=i18n('Progression');?></h3>
 
67
  <div class="spacer">&nbsp;</div>
55
68

                                        
56
 
      <table style="width: 100%;">
57
 
        <? $i=1; ?>
58
 
        <? foreach ($stats_dev_prog as $admin => $values): ?>
59
 
          <tr>
60
 
            <td style="width: 16px;vertical-align: center;line-height: 5px;">
61
 
              <a href="project/<?=$_dbname;?>/bugs/?nbbugs=30&amp;active=1&amp;waiting=1&amp;unconfirmed=1&amp;assignedto=1&amp;assignedusers=<?=$values['id'];?>"><img src="public/images/icons/project-bug-show.png" alt="project bug" /></a>
62
 
            </td>
63
 
            <td style="font-size: 0.8em;">
64
 
              <?=$values['nickname'];?>
65
 
            </td>
66
 
            <td style="min-width: 85px;">
67
 
                <div class="progressbar" style="height: 10px;">
68
 
                  <div class="progressbar_left" style="width:<?=floor($values['bar_closed'] * 0.8);?>px;">&nbsp;</div>
69
 
                  <div class="progressbar_right" style="width:<?=floor($values['bar_open'] * 0.8);?>px;">&nbsp;</div>
70
 
                </div>
71
 
                &nbsp;&nbsp;
72
 
                <span style="font-weight: bold;"><?=$values['bar_percent'];?>%</span>
73
 
            </td>
74
 
          </tr>
75
 
          <? $i++; ?>
76
 
        <? endforeach; ?>
77
 
      </table>
 
69
  <h3><?=i18n('Progression');?></h3>
78
70

                                        
79
 
    </td>
80
 
  </tr>
81
 
</table>
 
71
  <table style="width: 100%;">
 
72
    <? $i=1; ?>
 
73
    <? foreach ($stats_dev_prog as $admin => $values): ?>
 
74
      <tr>
 
75
        <td style="width: 16px;vertical-align: center;line-height: 5px;">
 
76
          <a href="project/<?=$_dbname;?>/bugs/?nbbugs=30&amp;active=1&amp;waiting=1&amp;unconfirmed=1&amp;assignedto=1&amp;assignedusers=<?=$values['id'];?>"><img src="public/images/icons/project-bug-show.png" alt="project bug" /></a>
 
77
        </td>
 
78
        <td style="font-size: 0.8em;">
 
79
          <?=$values['nickname'];?>
 
80
        </td>
 
81
        <td style="min-width: 85px;">
 
82
            <div class="progressbar" style="height: 10px;">
 
83
              <div class="progressbar_left" style="width:<?=floor($values['bar_closed'] * 0.8);?>px;">&nbsp;</div>
 
84
              <div class="progressbar_right" style="width:<?=floor($values['bar_open'] * 0.8);?>px;">&nbsp;</div>
 
85
            </div>
 
86
            &nbsp;&nbsp;
 
87
            <span style="font-weight: bold;"><?=$values['bar_percent'];?>%</span>
 
88
        </td>
 
89
      </tr>
 
90
      <? $i++; ?>
 
91
    <? endforeach; ?>
 
92
  </table>
 
93

                                    
 
94
</div>
82
95

                                        

 

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]))
72
72
        $this->config->update('projects', 'overall-popularity', $new_overall);
73
73

                                        
74
74
        // Meta tags
75
 
        $this->metatags = array('title' => i18n('Roadmap - %(name)s', array('name' => $this->name)));
 
75
        $this->metatags = array('title' => i18n('Roadmap - %(name)s', array('name' => $this->name)),
 
76
                                'javascript' => 'inc/libs/Chart.js');
76
77
    }
77
78

                                        
78
79
    function showFeed()
107
108
        $classed = $versions;
108
109
        usort($classed, 'invertedvsort');
109
110

                                        
 
111
        $available_status = array('planned'     => i18n('Planned'),
 
112
                                  'development' => i18n('Development'),
 
113
                                  'testing'     => i18n('Testing'),
 
114
                                  'alpha'       => i18n('Alpha'),
 
115
                                  'beta'        => i18n('Beta'),
 
116
                                  'stable'      => i18n('Stable'),
 
117
                                  'abandonned'  => i18n('Abandonned'));
 
118

                                    
 
119
        $colors = array('planned'     => 'AFEEEE',
 
120
                        'development' => 'E0FFFF',
 
121
                        'testing'     => 'FAEBD7',
 
122
                        'alpha'       => 'EEE9BF',
 
123
                        'beta'        => 'FFFACD',
 
124
                        'stable'      => 'C1FFC1',
 
125
                        'abandonned'  => 'EEE8AA');
 
126

                                    
110
127
        // By milestone
111
128
        $construct['widget'] = '';
112
129

                                        
117
134
            if (count($downloads) >= 1)
118
135
            {
119
136
                $version = htmlspecialchars($_version['version']);
120
 
            
121
 
                $construct['widget'] .= '<h3 style="padding-top: 15px;"><a href="project/'.$this->dbname.'/bugs/?nbbugs=30&amp;withmilestone=1&amp;milestone='.$version.'">'.$version.'</a></h3>';
122
137

                                        
123
138
                $total_bugs = $this->project_bugs->countReports($this->id, $version, '', TRUE);
124
139

                                        
132
147
                $open_bugs_percent = ($open * 100 / $total_bugs);
133
148
                $closed_bugs_percent = ($closed * 100 / $total_bugs);
134
149

                                        
135
 
                $construct['widget'] .= '
136
 
                <div class="progressbar">
137
 
                  <div class="progressbar_left" style="width: '.(int)( $closed_bugs_percent * 5 ).'px;">
 
150
                $color = $colors[$_version['status']];
 
151
                $state = $available_status[$_version['status']];
 
152

                                    
 
153
                $construct['widget'] .= '<div class="prettylist_box"><h2 style="overflow: visible;"><a href="project/'.$this->dbname.'/bugs/?nbbugs=30&amp;withmilestone=1&amp;milestone='.$version.'">'.$version.'</a>
 
154
                <span class="version_tag" style="background-color: #'.$color.';"><strong/>'.$state.'</strong></span>
 
155
                <span class="download_tag"><i class="fas fa-spinner fa-fw"></i> '.(int)$closed_bugs_percent.'%</span>
 
156
                </h2>
 
157

                                    
 
158
                <ul class="prettylist_content">
 
159
                  <li>
 
160

                                    
 
161
                <div class="progressbar" style="height: 15px;">
 
162
                  <div class="progressbar_left" style="width: '.(int)( $closed_bugs_percent * 2).'px;">
138
163
                    <a href="project/'.$this->dbname.'/bugs/?nbbugs=30&amp;withmilestone=1&amp;milestone='.$version.'&amp;closed=1">&nbsp;</a></div>
139
164

                                        
140
 
                  <div class="progressbar_right" style="width: '.(int)( $open_bugs_percent * 5 ).'px;">
 
165
                  <div class="progressbar_right" style="width: '.(int)( $open_bugs_percent * 2).'px;">
141
166
                    <a href="project/'.$this->dbname.'/bugs/?nbbugs=30&amp;withmilestone=1&amp;milestone='.$version.'&amp;active=1&amp;waiting=1&amp;unconfirmed=1">&nbsp;</a></div>
142
167
                </div>
143
168

                                        
144
 
                <div style="margin-top: 10px;">
145
 
                  <span style="padding-left: 20px;font-weight: bold;">'.(int)$closed_bugs_percent.'%</span>
146
 
                </div>
147
 

                                    
148
 
                <div style="margin-bottom: 30px;padding-top: 5px;">'.
 
169
                <div style="margin-top: 10px;"><span style="margin-left: 20px;">'.
149
170
                i18n('%(done)s bug(s) on %(total)s are closed.',
150
171
                     array('done'  => '<strong>'.$closed.'</strong>',
151
 
                           'total' => '<strong>'.$total_bugs.'</strong>')).'&nbsp;</div>';
 
172
                           'total' => '<strong>'.$total_bugs.'</strong>')).
 
173
                '</span></div>
 
174

                                    
 
175
                    </li>
 
176
                  </ul>
 
177
                </div>
 
178
                <div class="spacer">&nbsp;</div>';
152
179
            }
153
180
        }
154
181

                                        
255
282
        {
256
283
            if ($i > 3 && count($stats_repart) > 4)
257
284
            {
258
 
                $others_sum += $value;            
 
285
                $others_sum += $value;
259
286
            }
260
287
            else
261
288
            {
269
296
        $construct['stats_repart_total'] = ((count($stats_repart) > 4) ? $contribs_sum + $others_sum : $contribs_sum);
270
297
        $construct['stats_repart'] = ((count($stats_repart) > 4) ? $contribs_str.i18n('Others').':'.$others_sum : $contribs_str);
271
298

                                        
 
299
        $construct['stats_repart_array'] = $stats_repart;
 
300

                                    
272
301
        $construct['stats_dev_prog'] = array();
273
302
        foreach ($construct['admins'] as $admin)
274
303
            if (array_key_exists($admin, $stats_dev_prog))
277
306
        return $construct;
278
307
    }
279
308
}
280
 
?>
 
309
?>
281
310

                                        

 

Old New Code
718
718
  width: 80%;
719
719
}
720
720

                                        
 
721
/* TAGS FOR H TITLE */
721
722
span.version_tag, span.download_tag {
722
723
  margin-left: 30px;
723
724
  padding: 5px 15px 5px 15px;
732
733
  color: {color_500};
733
734
}
734
735

                                        
 
736
/* PROGRESS BAR */
 
737
#page .progressbar {
 
738
  padding: 1px;
 
739
  border: 1px {color_600} solid;
 
740
  border-radius: 3px;
 
741
  float: left;
 
742
  height: 20px;
 
743
}
735
744

                                        
 
745
#page .legends_box_pbar_left, #page .progressbar_left {
 
746
  background-color: {color_800};
 
747
  background: linear-gradient(to bottom, {color_600} 0%,{color_700} 50%,{color_800} 51%,{color_900} 100%);
 
748
}
736
749

                                        
 
750
#page .legends_box_pbar_right, #page .progressbar_right {
 
751
  background-color: {color_200};
 
752
  background: linear-gradient(to bottom, {color_50} 0%,{color_100} 50%,{color_200} 51%,{color_300} 100%);
 
753
}
737
754

                                        
 
755
#page .progressbar_left, #page .progressbar_right {
 
756
  float: left;
 
757
  height: 100%;
 
758
  border-radius: 2px;
 
759
}
738
760

                                        
 
761
#page .progressbar a {
 
762
  display: block;
 
763
  height: 100%;
 
764
}
739
765

                                        
 
766
#page .progressbar a:hover {
 
767
  text-decoration: none;
 
768
}
740
769

                                        
741
770

                                        
 
771

                                    
 
772

                                    
 
773

                                    
 
774

                                    
742
775
/* ??? -- reste de l'ancienne css --  */
743
776

                                        
744
777

                                        
1172
1205
  border: 1px #ccc solid;
1173
1206
}
1174
1207

                                        
1175
 
#page .progressbar {
1176
 
  padding: 1px;
1177
 
  border: 1px #8e8e8e solid;
1178
 
  border-radius: 3px;
1179
 
  float: left;
1180
 
  height: 20px;
1181
 
}
1182
1208

                                        
1183
 
#page .legends_box_pbar_left, #page .progressbar_left {
1184
 
  background-color: #4f94cd;
1185
 
  background: linear-gradient(to bottom, #609ed2 0%,#72a9d7 50%,#4f94cd 51%,#72a9d7 100%);
1186
 
}
1187
1209

                                        
1188
 
#page .legends_box_pbar_right, #page .progressbar_right {
1189
 
  background-color: #f1f1f1;
1190
 
  background: linear-gradient(to bottom, #ffffff 0%,#f1f1f1 50%,#e1e1e1 51%,#f6f6f6 100%);
1191
 
}
1192
 

                                    
1193
 
#page .progressbar_left, #page .progressbar_right {
1194
 
  float: left;
1195
 
  height: 100%;
1196
 
  border-radius: 2px;
1197
 
}
1198
 

                                    
1199
 
#page .progressbar a {
1200
 
  display: block;
1201
 
  height: 100%;
1202
 
}
1203
 

                                    
1204
 
#page .progressbar a:hover {
1205
 
  text-decoration: none;
1206
 
}
1207
 

                                    
1208
1210
#page div.filterbox span.title {
1209
1211
  display: block;
1210
1212
  text-align: center;
1211
1213