Skip to content
This repository was archived by the owner on Apr 12, 2020. It is now read-only.
/ website Public archive

Commit

Permalink
add changelog in download page
Browse files Browse the repository at this point in the history
  • Loading branch information
juliendidier committed Jan 18, 2013
1 parent d4cecc2 commit f55e9e3
Show file tree
Hide file tree
Showing 4 changed files with 54 additions and 4 deletions.
7 changes: 6 additions & 1 deletion src/Gitonomy/ChangeLog/ChangeLog.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

use Gitonomy\ChangeLog\Node\Version;

class ChangeLog
class ChangeLog implements \IteratorAggregate
{
protected $versions;

Expand Down Expand Up @@ -53,4 +53,9 @@ static public function fromArray(array $array)

return $changelog;
}

public function getIterator()
{
return new \ArrayIterator($this->versions);
}
}
7 changes: 6 additions & 1 deletion src/Gitonomy/ChangeLog/Node/Version.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace Gitonomy\ChangeLog\Node;

class Version
class Version implements \IteratorAggregate
{
protected $version;
protected $date;
Expand Down Expand Up @@ -62,4 +62,9 @@ static public function fromArray(array $array)

return $version;
}

public function getIterator()
{
return new \ArrayIterator($this->features);
}
}
37 changes: 36 additions & 1 deletion views/pages/download.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="span4">
<h3>Stable release</h3>
<p>
<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>
<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>
</p>
</div>
<div class="span4">
Expand All @@ -20,4 +20,39 @@
</p>
</div>
</div>
<h2>Changelog</h2>

{% for version in changeLog %}
<legend>
{% if version.date == '' %}
master
{% else %}
v{{ version.version }} ({{ version.date }})
{% endif %}
</legend>
<table class="table">
<thead>
<tr>
<th>level</th>
<th>feature</th>
</tr>
</thead>
<tbody>
{% for feature in version.features %}
<tr>
<td>
{% if feature.level is sameas ('security') %}
<i class="icon-bullhorn"></i>
{% elseif feature.level is sameas ('new') %}
<i class="icon-gift"></i>
{% elseif feature.level is sameas ('fix') %}
<i class="icon-ban-circle"></i>
{% endif %}
</td>
<td>{{ feature.feature }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% endfor %}
{% endblock %}
7 changes: 6 additions & 1 deletion web/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@
->bind('demo');

$app->get('/download', function() use($app) {
return $app['twig']->render('pages/download.html.twig');
$changeLog = $app['gitonomy.changelog'];
$currentVersion = $changeLog->getLastStableVersion();

return $app['twig']->render('pages/download.html.twig', array(
'changeLog' => $changeLog,
));
})
->bind('download');

Expand Down

0 comments on commit f55e9e3

Please sign in to comment.