new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
new Craue\ConfigBundle\CraueConfigBundle(),
new Lexik\Bundle\MaintenanceBundle\LexikMaintenanceBundle(),
- new Wallabag\CommentBundle\WallabagCommentBundle(),
+ new Wallabag\AnnotationBundle\WallabagAnnotationBundle(),
];
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
-wallabag_comment:
+wallabag_annotation:
type : rest
- resource: "@WallabagCommentBundle/Resources/config/routing_comments.yml"
+ resource: "@WallabagAnnotationBundle/Resources/config/routing_annotations.yml"
wallabag_import:
resource: "@WallabagImportBundle/Controller/"
In each article you read, you can write annotations. It's easier to understand with some pictures.
-Select the part of the article that you want to comment and click on the pencil:
+Select the part of the article that you want to annotate and click on the pencil:
.. image:: ../../img/user/annotations_1.png
:alt: Select your text
:align: center
-Then, write your comment:
+Then, write your annotation:
.. image:: ../../img/user/annotations_2.png
- :alt: Write your comment
+ :alt: Write your annotation
:align: center
-The text is now highlighted and you can read your comment if you move the mouse cursor over it.
+The text is now highlighted and you can read your annotation if you move the mouse cursor over it.
.. image:: ../../img/user/annotations_3.png
- :alt: Read your comment
+ :alt: Read your annotation
:align: center
-You can create as many comments as you wish.
+You can create as many annotations as you wish.
-Commentaires
-============
+Annotations
+===========
-Sur chaque article que vous lisez, vous pouvez écrire des commentaires. Puisqu'une image vaut mieux qu'un long discours,
+Sur chaque article que vous lisez, vous pouvez écrire des annotations. Puisqu'une image vaut mieux qu'un long discours,
voici ce que ça donne.
-Sélectionnez la zone du texte que vous souhaitez commenter et cliquez sur le crayon :
+Sélectionnez la zone du texte que vous souhaitez annoter et cliquez sur le crayon :
.. image:: ../../img/user/annotations_1.png
- :alt: Select your text
+ :alt: Sélectionnez votre texte
:align: center
-Ensuite, écrivez votre commentaire :
+Ensuite, écrivez votre annotation :
.. image:: ../../img/user/annotations_2.png
- :alt: Write your comment
+ :alt: Écrivez votre annotation
:align: center
-Le texte est maintenant surligné et vous pouvez lire le commentaire en le survolant avec votre souris.
+Le texte est maintenant surligné et vous pouvez lire le annotation en le survolant avec votre souris.
.. image:: ../../img/user/annotations_3.png
- :alt: Read your comment
+ :alt: Lisez votre annotation
:align: center
-Vous pouvez créer autant de commentaires que vous le souhaitez.
+Vous pouvez créer autant de annotations que vous le souhaitez.
<?php
-namespace Wallabag\CommentBundle\Controller;
+namespace Wallabag\AnnotationBundle\Controller;
use FOS\RestBundle\Controller\FOSRestController;
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
-use Wallabag\CommentBundle\Entity\Comment;
+use Wallabag\AnnotationBundle\Entity\Annotation;
use Wallabag\CoreBundle\Entity\Entry;
-class WallabagCommentController extends FOSRestController
+class WallabagAnnotationController extends FOSRestController
{
/**
- * Retrieve comments for an entry.
+ * Retrieve annotations for an entry.
*
* @ApiDoc(
* requirements={
*/
public function getAnnotationsAction(Entry $entry)
{
- $commentRows = $this
+ $annotationRows = $this
->getDoctrine()
- ->getRepository('WallabagCommentBundle:Comment')
- ->findCommentsByPageId($entry->getId(), $this->getUser()->getId());
- $total = count($commentRows);
- $comments = array('total' => $total, 'rows' => $commentRows);
+ ->getRepository('WallabagAnnotationBundle:Annotation')
+ ->findAnnotationsByPageId($entry->getId(), $this->getUser()->getId());
+ $total = count($annotationRows);
+ $annotations = array('total' => $total, 'rows' => $annotationRows);
- $json = $this->get('serializer')->serialize($comments, 'json');
+ $json = $this->get('serializer')->serialize($annotations, 'json');
return $this->renderJsonResponse($json);
}
/**
- * Creates a new comment.
+ * Creates a new annotation.
*
* @param Entry $entry
*
* @ApiDoc(
* requirements={
* {"name"="ranges", "dataType"="array", "requirement"="\w+", "description"="The range array for the annotation"},
- * {"name"="quote", "dataType"="string", "required"=false, "description"="Optional, quote for the comment"},
+ * {"name"="quote", "dataType"="string", "required"=false, "description"="Optional, quote for the annotation"},
* {"name"="text", "dataType"="string", "required"=true, "description"=""},
* }
* )
$em = $this->getDoctrine()->getManager();
- $comment = new Comment($this->getUser());
+ $annotation = new Annotation($this->getUser());
- $comment->setText($data['text']);
+ $annotation->setText($data['text']);
if (array_key_exists('quote', $data)) {
- $comment->setQuote($data['quote']);
+ $annotation->setQuote($data['quote']);
}
if (array_key_exists('ranges', $data)) {
- $comment->setRanges($data['ranges']);
+ $annotation->setRanges($data['ranges']);
}
- $comment->setEntry($entry);
+ $annotation->setEntry($entry);
- $em->persist($comment);
+ $em->persist($annotation);
$em->flush();
- $json = $this->get('serializer')->serialize($comment, 'json');
+ $json = $this->get('serializer')->serialize($annotation, 'json');
return $this->renderJsonResponse($json);
}
/**
- * Updates a comment.
+ * Updates an annotation.
*
* @ApiDoc(
* requirements={
- * {"name"="comment", "dataType"="string", "requirement"="\w+", "description"="The comment ID"}
+ * {"name"="annotation", "dataType"="string", "requirement"="\w+", "description"="The annotation ID"}
* }
* )
*
- * @ParamConverter("comment", class="WallabagCommentBundle:Comment")
+ * @ParamConverter("annotation", class="WallabagAnnotationBundle:Annotation")
*
* @return Response
*/
- public function putAnnotationAction(Comment $comment, Request $request)
+ public function putAnnotationAction(Annotation $annotation, Request $request)
{
$data = json_decode($request->getContent(), true);
if (!is_null($data['text'])) {
- $comment->setText($data['text']);
+ $annotation->setText($data['text']);
}
$em = $this->getDoctrine()->getManager();
$em->flush();
- $json = $this->get('serializer')->serialize($comment, 'json');
+ $json = $this->get('serializer')->serialize($annotation, 'json');
return $this->renderJsonResponse($json);
}
/**
- * Removes a comment.
+ * Removes an annotation.
*
* @ApiDoc(
* requirements={
- * {"name"="comment", "dataType"="string", "requirement"="\w+", "description"="The comment ID"}
+ * {"name"="annotation", "dataType"="string", "requirement"="\w+", "description"="The annotation ID"}
* }
* )
*
- * @ParamConverter("comment", class="WallabagCommentBundle:Comment")
+ * @ParamConverter("annotation", class="WallabagAnnotationBundle:Annotation")
*
* @return Response
*/
- public function deleteAnnotationAction(Comment $comment)
+ public function deleteAnnotationAction(Annotation $annotation)
{
$em = $this->getDoctrine()->getManager();
- $em->remove($comment);
+ $em->remove($annotation);
$em->flush();
- $json = $this->get('serializer')->serialize($comment, 'json');
+ $json = $this->get('serializer')->serialize($annotation, 'json');
return $this->renderJsonResponse($json);
}
--- /dev/null
+<?php
+
+namespace Wallabag\AnnotationBundle\DataFixtures\ORM;
+
+use Doctrine\Common\DataFixtures\AbstractFixture;
+use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
+use Doctrine\Common\Persistence\ObjectManager;
+use Wallabag\AnnotationBundle\Entity\Annotation;
+
+class LoadAnnotationData extends AbstractFixture implements OrderedFixtureInterface
+{
+ /**
+ * {@inheritdoc}
+ */
+ public function load(ObjectManager $manager)
+ {
+ $annotation1 = new Annotation($this->getReference('admin-user'));
+ $annotation1->setEntry($this->getReference('entry1'));
+ $annotation1->setText('This is my annotation /o/');
+ $annotation1->setQuote('content');
+
+ $manager->persist($annotation1);
+
+ $this->addReference('annotation1', $annotation1);
+
+ $annotation2 = new Annotation($this->getReference('admin-user'));
+ $annotation2->setEntry($this->getReference('entry2'));
+ $annotation2->setText('This is my 2nd annotation /o/');
+ $annotation2->setQuote('content');
+
+ $manager->persist($annotation2);
+
+ $this->addReference('annotation2', $annotation2);
+
+ $manager->flush();
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getOrder()
+ {
+ return 35;
+ }
+}
<?php
-namespace Wallabag\CommentBundle\DependencyInjection;
+namespace Wallabag\AnnotationBundle\DependencyInjection;
use Symfony\Component\Config\Definition\Builder\TreeBuilder;
use Symfony\Component\Config\Definition\ConfigurationInterface;
public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
- $rootNode = $treeBuilder->root('wallabag_comment');
+ $rootNode = $treeBuilder->root('wallabag_annotation');
return $treeBuilder;
}
<?php
-namespace Wallabag\CommentBundle\DependencyInjection;
+namespace Wallabag\AnnotationBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
-class WallabagCommentExtension extends Extension
+class WallabagAnnotationExtension extends Extension
{
/**
* {@inheritdoc}
<?php
-namespace Wallabag\CommentBundle\Entity;
+namespace Wallabag\AnnotationBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use JMS\Serializer\Annotation\ExclusionPolicy;
use Wallabag\CoreBundle\Entity\Entry;
/**
- * Comment.
+ * Annotation.
*
- * @ORM\Table(name="comment")
- * @ORM\Entity(repositoryClass="Wallabag\CommentBundle\Repository\CommentRepository")
+ * @ORM\Table(name="annotation")
+ * @ORM\Entity(repositoryClass="Wallabag\AnnotationBundle\Repository\AnnotationRepository")
* @ORM\HasLifecycleCallbacks()
* @ExclusionPolicy("none")
*/
-class Comment
+class Annotation
{
/**
* @var int
/**
* @Exclude
*
- * @ORM\ManyToOne(targetEntity="Wallabag\CoreBundle\Entity\Entry", inversedBy="comments")
+ * @ORM\ManyToOne(targetEntity="Wallabag\CoreBundle\Entity\Entry", inversedBy="annotations")
* @ORM\JoinColumn(name="entry_id", referencedColumnName="id")
*/
private $entry;
*
* @param string $text
*
- * @return Comment
+ * @return Annotation
*/
public function setText($text)
{
*
* @param string $quote
*
- * @return Comment
+ * @return Annotation
*/
public function setQuote($quote)
{
*
* @param array $ranges
*
- * @return Comment
+ * @return Annotation
*/
public function setRanges($ranges)
{
*
* @param string $user
*
- * @return Comment
+ * @return Annotation
*/
public function setUser($user)
{
*
* @param Entry $entry
*
- * @return Comment
+ * @return Annotation
*/
public function setEntry($entry)
{
$this->entry = $entry;
- $entry->setComment($this);
+ $entry->setAnnotation($this);
return $this;
}
--- /dev/null
+<?php
+
+namespace Wallabag\AnnotationBundle\Repository;
+
+use Doctrine\ORM\EntityRepository;
+
+/**
+ * AnnotationRepository.
+ */
+class AnnotationRepository extends EntityRepository
+{
+ /**
+ * Return a query builder to used by other getBuilderFor* method.
+ *
+ * @param int $userId
+ *
+ * @return QueryBuilder
+ */
+ private function getBuilderByUser($userId)
+ {
+ return $this->createQueryBuilder('a')
+ ->leftJoin('a.user', 'u')
+ ->andWhere('u.id = :userId')->setParameter('userId', $userId)
+ ->orderBy('a.id', 'desc')
+ ;
+ }
+
+ /**
+ * Retrieves all annotations for a user.
+ *
+ * @param int $userId
+ *
+ * @return QueryBuilder
+ */
+ public function getBuilderForAllByUser($userId)
+ {
+ return $this
+ ->getBuilderByUser($userId)
+ ;
+ }
+
+ /**
+ * Get annotation for this id.
+ *
+ * @param int $annotationId
+ *
+ * @return array
+ */
+ public function findAnnotationById($annotationId)
+ {
+ return $this->createQueryBuilder('a')
+ ->andWhere('a.id = :annotationId')->setParameter('annotationId', $annotationId)
+ ->getQuery()->getSingleResult()
+ ;
+ }
+
+ /**
+ * Find annotations for entry id.
+ *
+ * @param int $entryId
+ * @param int $userId
+ *
+ * @return array
+ */
+ public function findAnnotationsByPageId($entryId, $userId)
+ {
+ return $this->createQueryBuilder('a')
+ ->where('a.entry = :entryId')->setParameter('entryId', $entryId)
+ ->andwhere('a.user = :userId')->setParameter('userId', $userId)
+ ->getQuery()->getResult()
+ ;
+ }
+
+ /**
+ * Find last annotation for a given entry id. Used only for tests.
+ *
+ * @param int $entryId
+ *
+ * @return array
+ */
+ public function findLastAnnotationByPageId($entryId, $userId)
+ {
+ return $this->createQueryBuilder('a')
+ ->where('a.entry = :entryId')->setParameter('entryId', $entryId)
+ ->andwhere('a.user = :userId')->setParameter('userId', $userId)
+ ->orderBy('a.id', 'DESC')
+ ->setMaxResults(1)
+ ->getQuery()
+ ->getOneOrNullResult();
+ }
+}
--- /dev/null
+annotations:
+ type: rest
+ resource: "WallabagAnnotationBundle:WallabagAnnotation"
+ name_prefix: annotations_
<?php
-namespace Wallabag\CommentBundle\Tests\Controller;
+namespace Wallabag\AnnotationBundle\Tests\Controller;
-use Wallabag\CommentBundle\Tests\WallabagCommentTestCase;
+use Wallabag\AnnotationBundle\Tests\WallabagAnnotationTestCase;
-class CommentControllerTest extends WallabagCommentTestCase
+class AnnotationControllerTest extends WallabagAnnotationTestCase
{
- public function testGetComments()
+ public function testGetAnnotations()
{
- $comment = $this->client->getContainer()
+ $annotation = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
- ->getRepository('WallabagCommentBundle:Comment')
+ ->getRepository('WallabagAnnotationBundle:Annotation')
->findOneBy(array('user' => 1));
- if (!$comment) {
+ if (!$annotation) {
$this->markTestSkipped('No content found in db.');
}
$this->logInAs('admin');
- $crawler = $this->client->request('GET', 'annotations/'.$comment->getEntry()->getId().'.json');
+ $crawler = $this->client->request('GET', 'annotations/'.$annotation->getEntry()->getId().'.json');
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
$content = json_decode($this->client->getResponse()->getContent(), true);
$this->assertEquals(1, $content['total']);
- $this->assertEquals($comment->getText(), $content['rows'][0]['text']);
+ $this->assertEquals($annotation->getText(), $content['rows'][0]['text']);
}
- public function testSetcomment()
+ public function testSetAnnotation()
{
$this->logInAs('admin');
$headers = array('CONTENT_TYPE' => 'application/json');
$content = json_encode(array(
- 'text' => 'my comment',
+ 'text' => 'my annotation',
'quote' => 'my quote',
'range' => '[{"start":"","startOffset":24,"end":"","endOffset":31}]',
));
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
- $comment = $this->client->getContainer()
+ $annotation = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
- ->getRepository('WallabagCommentBundle:Comment')
- ->findLastCommentByPageId($entry->getId(), 1);
+ ->getRepository('WallabagAnnotationBundle:Annotation')
+ ->findLastAnnotationByPageId($entry->getId(), 1);
- $this->assertEquals('my comment', $comment->getText());
+ $this->assertEquals('my annotation', $annotation->getText());
}
- public function testEditcomment()
+ public function testEditAnnotation()
{
- $comment = $this->client->getContainer()
+ $annotation = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
- ->getRepository('WallabagCommentBundle:Comment')
+ ->getRepository('WallabagAnnotationBundle:Annotation')
->findOneBy(array('user' => 1));
$this->logInAs('admin');
$headers = array('CONTENT_TYPE' => 'application/json');
$content = json_encode(array(
- 'text' => 'a modified comment',
+ 'text' => 'a modified annotation',
));
- $crawler = $this->client->request('PUT', 'annotations/'.$comment->getId().'.json', array(), array(), $headers, $content);
+ $crawler = $this->client->request('PUT', 'annotations/'.$annotation->getId().'.json', array(), array(), $headers, $content);
$this->assertEquals(200, $this->client->getResponse()->getStatusCode());
$content = json_decode($this->client->getResponse()->getContent(), true);
- $this->assertEquals('a modified comment', $content['text']);
+ $this->assertEquals('a modified annotation', $content['text']);
- $commentUpdated = $this->client->getContainer()
+ $annotationUpdated = $this->client->getContainer()
->get('doctrine.orm.entity_manager')
- ->getRepository('WallabagCommentBundle:Comment')
- ->findCommentById($comment->getId());
- $this->assertEquals('a modified comment', $commentUpdated->getText());
+ ->getRepository('WallabagAnnotationBundle:Annotation')
+ ->findAnnotationById($annotation->getId());
+ $this->assertEquals('a modified annotation', $annotationUpdated->getText());
}
}
<?php
-namespace Wallabag\CommentBundle\Tests;
+namespace Wallabag\AnnotationBundle\Tests;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\BrowserKit\Cookie;
-abstract class WallabagCommentTestCase extends WebTestCase
+abstract class WallabagAnnotationTestCase extends WebTestCase
{
/**
* @var Client
--- /dev/null
+<?php
+
+namespace Wallabag\AnnotationBundle;
+
+use Symfony\Component\HttpKernel\Bundle\Bundle;
+
+class WallabagAnnotationBundle extends Bundle
+{
+}
+++ /dev/null
-<?php
-
-namespace Wallabag\CoreBundle\DataFixtures\ORM;
-
-use Doctrine\Common\DataFixtures\AbstractFixture;
-use Doctrine\Common\DataFixtures\OrderedFixtureInterface;
-use Doctrine\Common\Persistence\ObjectManager;
-use Wallabag\CommentBundle\Entity\Comment;
-
-class LoadCommentData extends AbstractFixture implements OrderedFixtureInterface
-{
- /**
- * {@inheritdoc}
- */
- public function load(ObjectManager $manager)
- {
- $comment1 = new Comment($this->getReference('admin-user'));
- $comment1->setEntry($this->getReference('entry1'));
- $comment1->setText('This is my comment /o/');
- $comment1->setQuote('content');
-
- $manager->persist($comment1);
-
- $this->addReference('comment1', $comment1);
-
- $comment2 = new Comment($this->getReference('admin-user'));
- $comment2->setEntry($this->getReference('entry2'));
- $comment2->setText('This is my 2nd comment /o/');
- $comment2->setQuote('content');
-
- $manager->persist($comment2);
-
- $this->addReference('comment2', $comment2);
-
- $manager->flush();
- }
-
- /**
- * {@inheritdoc}
- */
- public function getOrder()
- {
- return 35;
- }
-}
+++ /dev/null
-<?php
-
-namespace Wallabag\CommentBundle\Repository;
-
-use Doctrine\ORM\EntityRepository;
-
-/**
- * CommentRepository.
- *
- * This class was generated by the Doctrine ORM. Add your own custom
- * repository methods below.
- */
-class CommentRepository extends EntityRepository
-{
- /**
- * Return a query builder to used by other getBuilderFor* method.
- *
- * @param int $userId
- *
- * @return QueryBuilder
- */
- private function getBuilderByUser($userId)
- {
- return $this->createQueryBuilder('c')
- ->leftJoin('c.user', 'u')
- ->andWhere('u.id = :userId')->setParameter('userId', $userId)
- ->orderBy('c.id', 'desc')
- ;
- }
-
- /**
- * Retrieves all comments for a user.
- *
- * @param int $userId
- *
- * @return QueryBuilder
- */
- public function getBuilderForAllByUser($userId)
- {
- return $this
- ->getBuilderByUser($userId)
- ;
- }
-
- /**
- * Get comment for this id.
- *
- * @param int $commentId
- *
- * @return array
- */
- public function findCommentById($commentId)
- {
- return $this->createQueryBuilder('c')
- ->andWhere('c.id = :commentId')->setParameter('commentId', $commentId)
- ->getQuery()->getSingleResult()
- ;
- }
-
- /**
- * Find comments for entry id.
- *
- * @param int $entryId
- * @param int $userId
- *
- * @return array
- */
- public function findCommentsByPageId($entryId, $userId)
- {
- return $this->createQueryBuilder('c')
- ->where('c.entry = :entryId')->setParameter('entryId', $entryId)
- ->andwhere('c.user = :userId')->setParameter('userId', $userId)
- ->getQuery()->getResult()
- ;
- }
-
- /**
- * Find last comment for a given entry id. Used only for tests.
- *
- * @param int $entryId
- *
- * @return array
- */
- public function findLastCommentByPageId($entryId, $userId)
- {
- return $this->createQueryBuilder('c')
- ->where('c.entry = :entryId')->setParameter('entryId', $entryId)
- ->andwhere('c.user = :userId')->setParameter('userId', $userId)
- ->orderBy('c.id', 'DESC')
- ->setMaxResults(1)
- ->getQuery()
- ->getOneOrNullResult();
- }
-}
+++ /dev/null
-annotations:
- type: rest
- resource: "WallabagCommentBundle:WallabagComment"
- name_prefix: annotations_
+++ /dev/null
-<?php
-
-namespace Wallabag\CommentBundle;
-
-use Symfony\Component\HttpKernel\Bundle\Bundle;
-
-class WallabagCommentBundle extends Bundle
-{
-}
use JMS\Serializer\Annotation\XmlRoot;
use Symfony\Component\Validator\Constraints as Assert;
use Wallabag\UserBundle\Entity\User;
-use Wallabag\CommentBundle\Entity\Comment;
+use Wallabag\AnnotationBundle\Entity\Annotation;
/**
* Entry.
private $updatedAt;
/**
- * @ORM\OneToMany(targetEntity="Wallabag\CommentBundle\Entity\Comment", mappedBy="entry", cascade={"persist", "remove"})
+ * @ORM\OneToMany(targetEntity="Wallabag\AnnotationBundle\Entity\Annotation", mappedBy="entry", cascade={"persist", "remove"})
* @ORM\JoinTable
*
* @Groups({"entries_for_user", "export_all"})
*/
- private $comments;
+ private $annotations;
/**
* @var string
}
/**
- * @return ArrayCollection<Comment>
+ * @return ArrayCollection<Annotation>
*/
- public function getComments()
+ public function getAnnotations()
{
- return $this->comments;
+ return $this->annotations;
}
/**
- * @param Comment $comment
+ * @param Annotation $annotation
*/
- public function setComment(Comment $comment)
+ public function setAnnotation(Annotation $annotation)
{
- $this->comments[] = $comment;
+ $this->annotations[] = $annotation;
}
/**
Delete: 'Supprimer'
"{0} There is no entry.|{1} There is one entry.|]1,Inf[ There are %count% entries.": "{0} Il n'y a pas d'articles.|{1} Il y a un article.|]1,Inf[ Il y a %count% articles."
http://website: "http://siteweb"
-"{0} No annotations|{1} One annotation|]1,Inf[ %nbComments% annotations": "{0} Aucune annotation|{1} Une annotation|]1,Inf[ %nbComments% annotations"
+"{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations": "{0} Aucune annotation|{1} Une annotation|]1,Inf[ %nbAnnotations% annotations"
# Edit entry
Edit an entry: "Éditer un article"
<li><a href="mailto:hello@wallabag.org?subject=Wrong%20display%20in%20wallabag&body={{ entry.url|url_encode }}" title="{% trans %}Does this article appear wrong?{% endtrans %}" class="tool bad-display icon icon-delete"><span>{% trans %}Does this article appear wrong?{% endtrans %}</span></a></li>
</ul>
</div>
- {% set nbComments = entry.comments | length %}
- <span class="tool link mdi-communication-comment"> {% transchoice nbComments %}{0} No annotations|{1} One annotation|]1,Inf[ %nbComments% annotations{% endtranschoice %}</span>
+ {% set nbAnnotations = entry.annotations | length %}
+ <span class="tool link mdi-communication-comment"> {% transchoice nbAnnotations %}{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations{% endtranschoice %}</span>
<aside class="tags">
{% for tag in entry.tags %}
<span class="mdi-action-label-outline">{{ tag.label }}</span> <a href="{{ path('remove_tag', { 'entry': entry.id, 'tag': tag.id }) }}"><i>✘</i></a>
prefix: '',
urls: {
create: '{{ path('annotations_post_annotation', { 'entry': entry.id }) }}',
- update: '{{ path('annotations_put_annotation', { 'comment': 'idComment' }) }}',
- destroy: '{{ path('annotations_delete_annotation', { 'comment': 'idComment' }) }}',
+ update: '{{ path('annotations_put_annotation', { 'annotation': 'idAnnotation' }) }}',
+ destroy: '{{ path('annotations_delete_annotation', { 'annotation': 'idAnnotation' }) }}',
search: '{{ path('annotations_get_annotations', { 'entry': entry.id }) }}'
}
});
</header>
<aside>
<a href="{{ entry.url|e }}" target="_blank" title="{% trans %}original{% endtrans %} : {{ entry.title|e }}" class="tool link mdi-content-link"> <span>{{ entry.domainName|removeWww }}</span></a>
- {% set nbComments = entry.comments | length %}
- <span class="tool link mdi-communication-comment"> {% transchoice nbComments %}{0} No annotations|{1} One annotation|]1,Inf[ %nbComments% annotations{% endtranschoice %}</span>
+ {% set nbAnnotations = entry.annotations | length %}
+ <span class="tool link mdi-communication-comment"> {% transchoice nbAnnotations %}{0} No annotations|{1} One annotation|]1,Inf[ %nbAnnotations% annotations{% endtranschoice %}</span>
<div id="list">
{% for tag in entry.tags %}
<div class="chip">
prefix: '',
urls: {
create: '{{ path('annotations_post_annotation', { 'entry': entry.id }) }}',
- update: '{{ path('annotations_put_annotation', { 'comment': 'idComment' }) }}',
- destroy: '{{ path('annotations_delete_annotation', { 'comment': 'idComment' }) }}',
+ update: '{{ path('annotations_put_annotation', { 'annotation': 'idAnnotation' }) }}',
+ destroy: '{{ path('annotations_delete_annotation', { 'annotation': 'idAnnotation' }) }}',
search: '{{ path('annotations_get_annotations', { 'entry': entry.id }) }}'
}
});