aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorNicolas Lœuillet <nicolas@loeuillet.org>2017-04-06 09:36:20 +0200
committerNicolas Lœuillet <nicolas@loeuillet.org>2017-04-09 15:24:51 +0200
commit7b0b3622ab2dd909028481b294c91f88a5682671 (patch)
treecf9a9b432a8f123b8cf7400e387ba3113e8c8cc4 /src
parent5e9009ce86a366001616fad5b28cb59dc20ee4df (diff)
downloadwallabag-7b0b3622ab2dd909028481b294c91f88a5682671.tar.gz
wallabag-7b0b3622ab2dd909028481b294c91f88a5682671.tar.zst
wallabag-7b0b3622ab2dd909028481b294c91f88a5682671.zip
Added author of article
Diffstat (limited to 'src')
-rw-r--r--src/Wallabag/CoreBundle/Entity/Entry.php29
-rw-r--r--src/Wallabag/CoreBundle/Helper/ContentProxy.php6
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.da.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.de.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.en.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.es.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.it.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml1
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig10
-rw-r--r--src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig10
16 files changed, 64 insertions, 3 deletions
diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php
index 54f74a14..8d385eb4 100644
--- a/src/Wallabag/CoreBundle/Entity/Entry.php
+++ b/src/Wallabag/CoreBundle/Entity/Entry.php
@@ -131,6 +131,15 @@ class Entry
131 private $publishedAt; 131 private $publishedAt;
132 132
133 /** 133 /**
134 * @var array
135 *
136 * @ORM\Column(name="published_by", type="json_array", nullable=true)
137 *
138 * @Groups({"entries_for_user", "export_all"})
139 */
140 private $publishedBy;
141
142 /**
134 * @ORM\OneToMany(targetEntity="Wallabag\AnnotationBundle\Entity\Annotation", mappedBy="entry", cascade={"persist", "remove"}) 143 * @ORM\OneToMany(targetEntity="Wallabag\AnnotationBundle\Entity\Annotation", mappedBy="entry", cascade={"persist", "remove"})
135 * @ORM\JoinTable 144 * @ORM\JoinTable
136 * 145 *
@@ -730,4 +739,24 @@ class Entry
730 739
731 return $this; 740 return $this;
732 } 741 }
742
743 /**
744 * @return string
745 */
746 public function getPublishedBy()
747 {
748 return $this->publishedBy;
749 }
750
751 /**
752 * @param string $publishedBy
753 *
754 * @return Entry
755 */
756 public function setPublishedBy($publishedBy)
757 {
758 $this->publishedBy = $publishedBy;
759
760 return $this;
761 }
733} 762}
diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php
index 56358665..d45aef88 100644
--- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php
+++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php
@@ -79,10 +79,14 @@ class ContentProxy
79 $entry->setContent($html); 79 $entry->setContent($html);
80 $entry->setHttpStatus(isset($content['status']) ? $content['status'] : ''); 80 $entry->setHttpStatus(isset($content['status']) ? $content['status'] : '');
81 81
82 if (isset($content['date']) && null !== $content['date']) { 82 if (isset($content['date']) && null !== $content['date'] && '' !== $content['date']) {
83 $entry->setPublishedAt(new \DateTime($content['date'])); 83 $entry->setPublishedAt(new \DateTime($content['date']));
84 } 84 }
85 85
86 if (!empty($content['authors'])) {
87 $entry->setPublishedBy($content['authors']);
88 }
89
86 $entry->setLanguage(isset($content['language']) ? $content['language'] : ''); 90 $entry->setLanguage(isset($content['language']) ? $content['language'] : '');
87 $entry->setMimetype(isset($content['content_type']) ? $content['content_type'] : ''); 91 $entry->setMimetype(isset($content['content_type']) ? $content['content_type'] : '');
88 $entry->setReadingTime(Utils::getReadingTime($html)); 92 $entry->setReadingTime(Utils::getReadingTime($html));
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
index a8802efc..3e841a18 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.da.yml
@@ -225,6 +225,7 @@ entry:
225 # annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %count% annotations' 225 # annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %count% annotations'
226 created_at: 'Oprettelsesdato' 226 created_at: 'Oprettelsesdato'
227 # published_at: 'Publication date' 227 # published_at: 'Publication date'
228 # published_by: 'Published by'
228 new: 229 new:
229 page_title: 'Gem ny artikel' 230 page_title: 'Gem ny artikel'
230 placeholder: 'http://website.com' 231 placeholder: 'http://website.com'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
index fa2b9fcb..3358b5d3 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.de.yml
@@ -225,6 +225,7 @@ entry:
225 annotations_on_the_entry: '{0} Keine Anmerkungen|{1} Eine Anmerkung|]1,Inf[ %count% Anmerkungen' 225 annotations_on_the_entry: '{0} Keine Anmerkungen|{1} Eine Anmerkung|]1,Inf[ %count% Anmerkungen'
226 created_at: 'Erstellungsdatum' 226 created_at: 'Erstellungsdatum'
227 # published_at: 'Publication date' 227 # published_at: 'Publication date'
228 # published_by: 'Published by'
228 new: 229 new:
229 page_title: 'Neuen Artikel speichern' 230 page_title: 'Neuen Artikel speichern'
230 placeholder: 'https://website.de' 231 placeholder: 'https://website.de'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
index bc2a90a5..30f44350 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.en.yml
@@ -225,6 +225,7 @@ entry:
225 annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %count% annotations' 225 annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %count% annotations'
226 created_at: 'Creation date' 226 created_at: 'Creation date'
227 published_at: 'Publication date' 227 published_at: 'Publication date'
228 published_by: 'Published by'
228 new: 229 new:
229 page_title: 'Save new entry' 230 page_title: 'Save new entry'
230 placeholder: 'http://website.com' 231 placeholder: 'http://website.com'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
index da516ee8..363c94fb 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.es.yml
@@ -225,6 +225,7 @@ entry:
225 annotations_on_the_entry: '{0} Sin anotaciones|{1} Una anotación|]1,Inf[ %count% anotaciones' 225 annotations_on_the_entry: '{0} Sin anotaciones|{1} Una anotación|]1,Inf[ %count% anotaciones'
226 created_at: 'Fecha de creación' 226 created_at: 'Fecha de creación'
227 # published_at: 'Publication date' 227 # published_at: 'Publication date'
228 # published_by: 'Published by'
228 new: 229 new:
229 page_title: 'Guardar un nuevo artículo' 230 page_title: 'Guardar un nuevo artículo'
230 placeholder: 'http://sitioweb.com' 231 placeholder: 'http://sitioweb.com'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
index 0a3bebe4..972c2a5d 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fa.yml
@@ -225,6 +225,7 @@ entry:
225 annotations_on_the_entry: '{0} بدون حاشیه|{1} یک حاشیه|]1,Inf[ %nbحاشیه% annotations' 225 annotations_on_the_entry: '{0} بدون حاشیه|{1} یک حاشیه|]1,Inf[ %nbحاشیه% annotations'
226 created_at: 'زمان ساخت' 226 created_at: 'زمان ساخت'
227 # published_at: 'Publication date' 227 # published_at: 'Publication date'
228 # published_by: 'Published by'
228 new: 229 new:
229 page_title: 'ذخیرهٔ مقالهٔ تازه' 230 page_title: 'ذخیرهٔ مقالهٔ تازه'
230 placeholder: 'http://website.com' 231 placeholder: 'http://website.com'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
index 468a9af9..04b1eeef 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.fr.yml
@@ -225,6 +225,7 @@ entry:
225 annotations_on_the_entry: "{0} Aucune annotation|{1} Une annotation|]1,Inf[ %count% annotations" 225 annotations_on_the_entry: "{0} Aucune annotation|{1} Une annotation|]1,Inf[ %count% annotations"
226 created_at: "Date de création" 226 created_at: "Date de création"
227 published_at: "Date de publication" 227 published_at: "Date de publication"
228 published_by: "Publié par"
228 new: 229 new:
229 page_title: "Sauvegarder un nouvel article" 230 page_title: "Sauvegarder un nouvel article"
230 placeholder: "http://website.com" 231 placeholder: "http://website.com"
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
index e7b0ea8a..7f6787c9 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.it.yml
@@ -225,6 +225,7 @@ entry:
225 annotations_on_the_entry: '{0} Nessuna annotazione|{1} Una annotazione|]1,Inf[ %count% annotazioni' 225 annotations_on_the_entry: '{0} Nessuna annotazione|{1} Una annotazione|]1,Inf[ %count% annotazioni'
226 created_at: 'Data di creazione' 226 created_at: 'Data di creazione'
227 # published_at: 'Publication date' 227 # published_at: 'Publication date'
228 # published_by: 'Published by'
228 new: 229 new:
229 page_title: 'Salva un nuovo contenuto' 230 page_title: 'Salva un nuovo contenuto'
230 placeholder: 'http://website.com' 231 placeholder: 'http://website.com'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
index 1937dfce..5a760b87 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.oc.yml
@@ -225,6 +225,7 @@ entry:
225 annotations_on_the_entry: "{0} Pas cap d'anotacion|{1} Una anotacion|]1,Inf[ %count% anotacions" 225 annotations_on_the_entry: "{0} Pas cap d'anotacion|{1} Una anotacion|]1,Inf[ %count% anotacions"
226 created_at: 'Data de creacion' 226 created_at: 'Data de creacion'
227 # published_at: 'Publication date' 227 # published_at: 'Publication date'
228 # published_by: 'Published by'
228 new: 229 new:
229 page_title: 'Enregistrar un novèl article' 230 page_title: 'Enregistrar un novèl article'
230 placeholder: 'http://website.com' 231 placeholder: 'http://website.com'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
index cb644045..b2df8a0a 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pl.yml
@@ -225,6 +225,7 @@ entry:
225 annotations_on_the_entry: '{0} Nie ma adnotacji |{1} Jedna adnotacja |]1,Inf[ %count% adnotacji' 225 annotations_on_the_entry: '{0} Nie ma adnotacji |{1} Jedna adnotacja |]1,Inf[ %count% adnotacji'
226 created_at: 'Czas stworzenia' 226 created_at: 'Czas stworzenia'
227 # published_at: 'Publication date' 227 # published_at: 'Publication date'
228 # published_by: 'Published by'
228 new: 229 new:
229 page_title: 'Zapisz nowy wpis' 230 page_title: 'Zapisz nowy wpis'
230 placeholder: 'http://website.com' 231 placeholder: 'http://website.com'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml
index 16803549..fb8c4d29 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.pt.yml
@@ -225,6 +225,7 @@ entry:
225 annotations_on_the_entry: '{0} Sem anotações|{1} Uma anotação|]1,Inf[ %nbAnnotations% anotações' 225 annotations_on_the_entry: '{0} Sem anotações|{1} Uma anotação|]1,Inf[ %nbAnnotations% anotações'
226 created_at: 'Data de criação' 226 created_at: 'Data de criação'
227 # published_at: 'Publication date' 227 # published_at: 'Publication date'
228 # published_by: 'Published by'
228 new: 229 new:
229 page_title: 'Salvar nova entrada' 230 page_title: 'Salvar nova entrada'
230 placeholder: 'http://website.com' 231 placeholder: 'http://website.com'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
index 539482f8..d702159a 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.ro.yml
@@ -225,6 +225,7 @@ entry:
225 # annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %count% annotations' 225 # annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %count% annotations'
226 created_at: 'Data creării' 226 created_at: 'Data creării'
227 # published_at: 'Publication date' 227 # published_at: 'Publication date'
228 # published_by: 'Published by'
228 new: 229 new:
229 page_title: 'Salvează un nou articol' 230 page_title: 'Salvează un nou articol'
230 placeholder: 'http://website.com' 231 placeholder: 'http://website.com'
diff --git a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
index a3e1cca7..6525afac 100644
--- a/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
+++ b/src/Wallabag/CoreBundle/Resources/translations/messages.tr.yml
@@ -225,6 +225,7 @@ entry:
225 # annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %count% annotations' 225 # annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %count% annotations'
226 created_at: 'Oluşturulma tarihi' 226 created_at: 'Oluşturulma tarihi'
227 # published_at: 'Publication date' 227 # published_at: 'Publication date'
228 # published_by: 'Published by'
228 new: 229 new:
229 page_title: 'Yeni makaleyi kaydet' 230 page_title: 'Yeni makaleyi kaydet'
230 placeholder: 'http://website.com' 231 placeholder: 'http://website.com'
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig
index 8bc7b54c..426ce91c 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/baggy/Entry/entry.html.twig
@@ -47,12 +47,20 @@
47 {{ entry.createdAt|date('Y-m-d H:i') }} 47 {{ entry.createdAt|date('Y-m-d H:i') }}
48 </i> 48 </i>
49 49
50 {% if entry.publishedAt is not null %} 50 {% if entry.publishedAt is not null %}
51 <i class="tool icon icon-pencil2" title="{{ 'entry.view.published_at'|trans }}"> 51 <i class="tool icon icon-pencil2" title="{{ 'entry.view.published_at'|trans }}">
52 {{ entry.publishedAt|date('Y-m-d H:i') }} 52 {{ entry.publishedAt|date('Y-m-d H:i') }}
53 </i> 53 </i>
54 {% endif %} 54 {% endif %}
55 55
56 {% if entry.publishedBy is not empty %}
57 <i class="tool icon icon-users" title="{{ 'entry.view.published_by'|trans }}">
58 {% for author in entry.publishedBy %}
59 {{ author }}{% if not loop.last %}, {% endif %}
60 {% endfor %}
61 </i>
62 {% endif %}
63
56 <i class="tool icon icon-time"> 64 <i class="tool icon icon-time">
57 {% set readingTime = entry.readingTime / app.user.config.readingSpeed %} 65 {% set readingTime = entry.readingTime / app.user.config.readingSpeed %}
58 {% if readingTime > 0 %} 66 {% if readingTime > 0 %}
diff --git a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig
index c72a22c0..8be5fd0d 100644
--- a/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig
+++ b/src/Wallabag/CoreBundle/Resources/views/themes/material/Entry/entry.html.twig
@@ -228,12 +228,20 @@
228 <i class="material-icons" title="{{ 'entry.view.created_at'|trans }}">today</i> 228 <i class="material-icons" title="{{ 'entry.view.created_at'|trans }}">today</i>
229 {{ entry.createdAt|date('Y-m-d H:i') }} 229 {{ entry.createdAt|date('Y-m-d H:i') }}
230 </li> 230 </li>
231 {% if entry.publishedAt is not null %} 231 {% if entry.publishedAt is not null %}
232 <li> 232 <li>
233 <i class="material-icons" title="{{ 'entry.view.published_at'|trans }}">create</i> 233 <i class="material-icons" title="{{ 'entry.view.published_at'|trans }}">create</i>
234 {{ entry.publishedAt|date('Y-m-d H:i') }} 234 {{ entry.publishedAt|date('Y-m-d H:i') }}
235 </li> 235 </li>
236 {% endif %} 236 {% endif %}
237 {% if entry.publishedBy is not empty %}
238 <li>
239 <i class="material-icons" title="{{ 'entry.view.published_by'|trans }}">person</i>
240 {% for author in entry.publishedBy %}
241 {{ author }}{% if not loop.last %}, {% endif %}
242 {% endfor %}
243 </li>
244 {% endif %}
237 <li> 245 <li>
238 <i class="material-icons link">link</i> 246 <i class="material-icons link">link</i>
239 <a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.view.original_article'|trans }} : {{ entry.title|striptags }}" class="tool"> 247 <a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.view.original_article'|trans }} : {{ entry.title|striptags }}" class="tool">