This repository has been archived by the owner on Jul 20, 2023. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
430 additions
and
118 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
19 changes: 19 additions & 0 deletions
19
guigur.com/src/GuigurFrontBundle/Controller/ChangelogController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
namespace GuigurFrontBundle\Controller; | ||
|
||
use Symfony\Bundle\FrameworkBundle\Controller\Controller; | ||
use GuigurFrontBundle\Entity\CatchPhrase; | ||
|
||
class ChangelogController extends Controller | ||
{ | ||
public function indexAction() | ||
{ | ||
$Changelogs = $this->getDoctrine() | ||
->getRepository('GuigurFrontBundle:Changelogs') | ||
->findAll(); | ||
|
||
$catchPhrase = $this->get('guigur.catchphrase')->requestCatchPhrase('changelog'); | ||
return $this->render('GuigurFrontBundle:Default:changelog.html.twig', array("Catchphrase" => $catchPhrase, "Changelogs" => $Changelogs)); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
<?php | ||
|
||
namespace GuigurFrontBundle\Entity; | ||
|
||
use Doctrine\ORM\Mapping as ORM; | ||
|
||
/** | ||
* Changelogs | ||
* | ||
* @ORM\Table(name="change_logs") | ||
* @ORM\Entity(repositoryClass="GuigurFrontBundle\Repository\ChangeLogsRepository") | ||
*/ | ||
class Changelogs | ||
{ | ||
/** | ||
* @var int | ||
* | ||
* @ORM\Column(name="id", type="integer") | ||
* @ORM\Id | ||
* @ORM\GeneratedValue(strategy="AUTO") | ||
*/ | ||
private $id; | ||
|
||
/** | ||
* @var string | ||
* | ||
* @ORM\Column(name="title", type="string", length=255) | ||
*/ | ||
private $title; | ||
|
||
/** | ||
* @var string | ||
* | ||
* @ORM\Column(name="text", type="string", length=255) | ||
*/ | ||
private $text; | ||
|
||
/** | ||
* @var \DateTime | ||
* | ||
* @ORM\Column(name="postedDatetime", type="datetimetz") | ||
*/ | ||
private $postedDatetime; | ||
|
||
/** | ||
* @var string | ||
* | ||
* @ORM\Column(name="commit", type="string", length=255, unique=true) | ||
*/ | ||
private $commit; | ||
|
||
|
||
/** | ||
* Get id | ||
* | ||
* @return int | ||
*/ | ||
public function getId() | ||
{ | ||
return $this->id; | ||
} | ||
|
||
/** | ||
* Set title | ||
* | ||
* @param string $title | ||
* | ||
* @return Changelogs | ||
*/ | ||
public function setTitle($title) | ||
{ | ||
$this->title = $title; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Get title | ||
* | ||
* @return string | ||
*/ | ||
public function getTitle() | ||
{ | ||
return $this->title; | ||
} | ||
|
||
/** | ||
* Set text | ||
* | ||
* @param string $text | ||
* | ||
* @return Changelogs | ||
*/ | ||
public function setText($text) | ||
{ | ||
$this->text = $text; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Get text | ||
* | ||
* @return string | ||
*/ | ||
public function getText() | ||
{ | ||
return $this->text; | ||
} | ||
|
||
/** | ||
* Set postedDatetime | ||
* | ||
* @param \DateTime $postedDatetime | ||
* | ||
* @return Changelogs | ||
*/ | ||
public function setPostedDatetime($postedDatetime) | ||
{ | ||
$this->postedDatetime = $postedDatetime; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Get postedDatetime | ||
* | ||
* @return \DateTime | ||
*/ | ||
public function getPostedDatetime() | ||
{ | ||
return $this->postedDatetime; | ||
} | ||
|
||
/** | ||
* Set commit | ||
* | ||
* @param string $commit | ||
* | ||
* @return Changelogs | ||
*/ | ||
public function setCommit($commit) | ||
{ | ||
$this->commit = $commit; | ||
|
||
return $this; | ||
} | ||
|
||
/** | ||
* Get commit | ||
* | ||
* @return string | ||
*/ | ||
public function getCommit() | ||
{ | ||
return $this->commit; | ||
} | ||
} | ||
|
13 changes: 13 additions & 0 deletions
13
guigur.com/src/GuigurFrontBundle/Repository/ChangeLogsRepository.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace GuigurFrontBundle\Repository; | ||
|
||
/** | ||
* ChangeLogsRepository | ||
* | ||
* This class was generated by the Doctrine ORM. Add your own custom | ||
* repository methods below. | ||
*/ | ||
class ChangeLogsRepository extends \Doctrine\ORM\EntityRepository | ||
{ | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
38 changes: 38 additions & 0 deletions
38
guigur.com/src/GuigurFrontBundle/Resources/views/Default/changelog.html.twig
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{% extends "base.html.twig" %} | ||
{% block body %} | ||
<div class="col-md-12"> | ||
<h1 class="page-header"> | ||
Changelog <br /> | ||
<small>{{ Catchphrase.phrase }}</small> | ||
</h1> | ||
{% for Changelog in Changelogs %} | ||
{% set textLines = Changelog.text|split(',') %} | ||
<div class="row"> | ||
<div class="col-md-8 col-md-offset-2 col-sm-12"> | ||
<div class="changelog_card"> | ||
<div class="changelog_card-body"> | ||
<h4 class="card-title">{{ Changelog.title }}</h4> | ||
<p class="card-text"></p> | ||
{% for textLine in textLines %} | ||
{% if textLine|first|lower == '+' %} | ||
<span class="changelog changelog_added">{{ textLine }}</span> | ||
{% elseif textLine|first|lower == '-' %} | ||
<span class="changelog changelog_removed">{{ textLine }}</span> | ||
{% elseif textLine|first|lower == '*' %} | ||
<span class="changelog changelog_modified">{{ textLine }}</span> | ||
{% else %} | ||
<span class="changelog">{{ textLine }}</span> | ||
{% endif %} | ||
<br /> | ||
{% endfor %} | ||
<br /> | ||
<a href="#" class="btn btn-primary">Voir le commit : {{ Changelog.commit }}</a> | ||
<span class="changelog_datetime">{{ Changelog.postedDatetime|date("d/m/Y") }}</span> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<hr> | ||
{% endfor %} | ||
</div> | ||
{% endblock body %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters