This repository was archived by the owner on Apr 12, 2020. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44
55use Gitonomy \ChangeLog \Node \Version ;
66
7- class ChangeLog
7+ class ChangeLog implements \IteratorAggregate
88{
99 protected $ versions ;
1010
@@ -53,4 +53,9 @@ static public function fromArray(array $array)
5353
5454 return $ changelog ;
5555 }
56+
57+ public function getIterator ()
58+ {
59+ return new \ArrayIterator ($ this ->versions );
60+ }
5661}
Original file line number Diff line number Diff line change 22
33namespace Gitonomy \ChangeLog \Node ;
44
5- class Version
5+ class Version implements \IteratorAggregate
66{
77 protected $ version ;
88 protected $ date ;
@@ -62,4 +62,9 @@ static public function fromArray(array $array)
6262
6363 return $ version ;
6464 }
65+
66+ public function getIterator ()
67+ {
68+ return new \ArrayIterator ($ this ->features );
69+ }
6570}
Original file line number Diff line number Diff line change 1010 <div class =" span4" >
1111 <h3 >Stable release</h3 >
1212 <p >
13- <a class =" btn btn-large btn-success" href =" /downloads/v0.2 .tar.gz" ><i class =" icon-file icon-white" ></i > Download stable version (v0.2 )</a >
13+ <a class =" btn btn-large btn-success" href =" /downloads/v0.3 .tar.gz" ><i class =" icon-file icon-white" ></i > Download stable version (v0.3 )</a >
1414 </p >
1515 </div >
1616 <div class =" span4" >
2020 </p >
2121 </div >
2222 </div >
23+ <h2 >Changelog</h2 >
24+
25+ {% for version in changeLog %}
26+ <legend >
27+ {% if version .date == ' ' %}
28+ master
29+ {% else %}
30+ v{{ version .version }} ({{ version .date }})
31+ {% endif %}
32+ </legend >
33+ <table class =" table" >
34+ <thead >
35+ <tr >
36+ <th >level</th >
37+ <th >feature</th >
38+ </tr >
39+ </thead >
40+ <tbody >
41+ {% for feature in version .features %}
42+ <tr >
43+ <td >
44+ {% if feature .level is sameas (' security' ) %}
45+ <i class =" icon-bullhorn" ></i >
46+ {% elseif feature .level is sameas (' new' ) %}
47+ <i class =" icon-gift" ></i >
48+ {% elseif feature .level is sameas (' fix' ) %}
49+ <i class =" icon-ban-circle" ></i >
50+ {% endif %}
51+ </td >
52+ <td >{{ feature .feature }}</td >
53+ </tr >
54+ {% endfor %}
55+ </tbody >
56+ </table >
57+ {% endfor %}
2358{% endblock %}
Original file line number Diff line number Diff line change 3030->bind ('demo ' );
3131
3232$ app ->get ('/download ' , function () use ($ app ) {
33- return $ app ['twig ' ]->render ('pages/download.html.twig ' );
33+ $ changeLog = $ app ['gitonomy.changelog ' ];
34+ $ currentVersion = $ changeLog ->getLastStableVersion ();
35+
36+ return $ app ['twig ' ]->render ('pages/download.html.twig ' , array (
37+ 'changeLog ' => $ changeLog ,
38+ ));
3439})
3540->bind ('download ' );
3641
You can’t perform that action at this time.
0 commit comments