Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

Commit

Permalink
added changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
guigur committed Aug 15, 2018
1 parent 3697994 commit 2071fa2
Show file tree
Hide file tree
Showing 7 changed files with 430 additions and 118 deletions.
271 changes: 154 additions & 117 deletions guigur.com/.idea/workspace.xml

Large diffs are not rendered by default.

@@ -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));
}
}
159 changes: 159 additions & 0 deletions guigur.com/src/GuigurFrontBundle/Entity/Changelogs.php
@@ -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;
}
}

@@ -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
{
}
Expand Up @@ -33,4 +33,7 @@ LaSuiteDeTed:
defaults: { _controller: GuigurFrontBundle:TED:index }
Experiments:
path: /Experiments
defaults: { _controller: GuigurFrontBundle:Experiment:index }
defaults: { _controller: GuigurFrontBundle:Experiment:index }
Changelog:
path: /Changelog
defaults: { _controller: GuigurFrontBundle:Changelog:index }
@@ -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 %}
43 changes: 43 additions & 0 deletions guigur.com/web/css/custom.css
Expand Up @@ -150,3 +150,46 @@ html {
transition: color 0.23s ease;
font-size: 4rem;
}

/* Changelog stuff */

.changelog_card {
transition: 0.3s;
margin: 1.5em;

}

.changelog_card:hover {
background: lightgray;

}

.changelog_card-body {
padding:8px;
}

.changelog {
display: inline-block;
padding-left: 1em;
padding-right: 1em;
}

.changelog_added
{
background: lightgreen;
}

.changelog_removed
{
background: indianred;
}

.changelog_modified
{
background: orange;
}

.changelog_datetime
{
float: right;
}

0 comments on commit 2071fa2

Please sign in to comment.