1
0
Fork 0
mirror of https://github.com/wallabag/wallabag.git synced 2025-07-22 17:18:37 +00:00

Merge pull request #3024 from wallabag/store-date

Added publication date and author
This commit is contained in:
Nicolas Lœuillet 2017-04-18 13:12:28 +02:00 committed by GitHub
commit 64f1d8f77a
23 changed files with 243 additions and 17 deletions

View file

@ -121,6 +121,24 @@ class Entry
*/
private $updatedAt;
/**
* @var \DateTime
*
* @ORM\Column(name="published_at", type="datetime", nullable=true)
*
* @Groups({"entries_for_user", "export_all"})
*/
private $publishedAt;
/**
* @var array
*
* @ORM\Column(name="published_by", type="json_array", nullable=true)
*
* @Groups({"entries_for_user", "export_all"})
*/
private $publishedBy;
/**
* @ORM\OneToMany(targetEntity="Wallabag\AnnotationBundle\Entity\Annotation", mappedBy="entry", cascade={"persist", "remove"})
* @ORM\JoinTable
@ -676,4 +694,44 @@ class Entry
return $this;
}
/**
* @return \Datetime
*/
public function getPublishedAt()
{
return $this->publishedAt;
}
/**
* @param \Datetime $publishedAt
*
* @return Entry
*/
public function setPublishedAt(\Datetime $publishedAt)
{
$this->publishedAt = $publishedAt;
return $this;
}
/**
* @return string
*/
public function getPublishedBy()
{
return $this->publishedBy;
}
/**
* @param string $publishedBy
*
* @return Entry
*/
public function setPublishedBy($publishedBy)
{
$this->publishedBy = $publishedBy;
return $this;
}
}

View file

@ -79,6 +79,14 @@ class ContentProxy
$entry->setContent($html);
$entry->setHttpStatus(isset($content['status']) ? $content['status'] : '');
if (isset($content['date']) && null !== $content['date'] && '' !== $content['date']) {
$entry->setPublishedAt(new \DateTime($content['date']));
}
if (!empty($content['authors'])) {
$entry->setPublishedBy($content['authors']);
}
$entry->setLanguage(isset($content['language']) ? $content['language'] : '');
$entry->setMimetype(isset($content['content_type']) ? $content['content_type'] : '');
$entry->setReadingTime(Utils::getReadingTime($html));

View file

@ -224,6 +224,8 @@ entry:
original_article: 'original'
# annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %count% annotations'
created_at: 'Oprettelsesdato'
# published_at: 'Publication date'
# published_by: 'Published by'
new:
page_title: 'Gem ny artikel'
placeholder: 'http://website.com'

View file

@ -224,6 +224,8 @@ entry:
original_article: 'original'
annotations_on_the_entry: '{0} Keine Anmerkungen|{1} Eine Anmerkung|]1,Inf[ %count% Anmerkungen'
created_at: 'Erstellungsdatum'
# published_at: 'Publication date'
# published_by: 'Published by'
new:
page_title: 'Neuen Artikel speichern'
placeholder: 'https://website.de'

View file

@ -224,6 +224,8 @@ entry:
original_article: 'original'
annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %count% annotations'
created_at: 'Creation date'
published_at: 'Publication date'
published_by: 'Published by'
new:
page_title: 'Save new entry'
placeholder: 'http://website.com'

View file

@ -224,6 +224,8 @@ entry:
original_article: 'original'
annotations_on_the_entry: '{0} Sin anotaciones|{1} Una anotación|]1,Inf[ %count% anotaciones'
created_at: 'Fecha de creación'
# published_at: 'Publication date'
# published_by: 'Published by'
new:
page_title: 'Guardar un nuevo artículo'
placeholder: 'http://sitioweb.com'

View file

@ -224,6 +224,8 @@ entry:
original_article: 'اصلی'
annotations_on_the_entry: '{0} بدون حاشیه|{1} یک حاشیه|]1,Inf[ %nbحاشیه% annotations'
created_at: 'زمان ساخت'
# published_at: 'Publication date'
# published_by: 'Published by'
new:
page_title: 'ذخیرهٔ مقالهٔ تازه'
placeholder: 'http://website.com'

View file

@ -224,6 +224,8 @@ entry:
original_article: "original"
annotations_on_the_entry: "{0} Aucune annotation|{1} Une annotation|]1,Inf[ %count% annotations"
created_at: "Date de création"
published_at: "Date de publication"
published_by: "Publié par"
new:
page_title: "Sauvegarder un nouvel article"
placeholder: "http://website.com"

View file

@ -224,6 +224,8 @@ entry:
original_article: 'originale'
annotations_on_the_entry: '{0} Nessuna annotazione|{1} Una annotazione|]1,Inf[ %count% annotazioni'
created_at: 'Data di creazione'
# published_at: 'Publication date'
# published_by: 'Published by'
new:
page_title: 'Salva un nuovo contenuto'
placeholder: 'http://website.com'

View file

@ -224,6 +224,8 @@ entry:
original_article: 'original'
annotations_on_the_entry: "{0} Pas cap d'anotacion|{1} Una anotacion|]1,Inf[ %count% anotacions"
created_at: 'Data de creacion'
# published_at: 'Publication date'
# published_by: 'Published by'
new:
page_title: 'Enregistrar un novèl article'
placeholder: 'http://website.com'

View file

@ -224,6 +224,8 @@ entry:
original_article: 'oryginalny'
annotations_on_the_entry: '{0} Nie ma adnotacji |{1} Jedna adnotacja |]1,Inf[ %count% adnotacji'
created_at: 'Czas stworzenia'
# published_at: 'Publication date'
# published_by: 'Published by'
new:
page_title: 'Zapisz nowy wpis'
placeholder: 'http://website.com'

View file

@ -224,6 +224,8 @@ entry:
original_article: 'original'
annotations_on_the_entry: '{0} Sem anotações|{1} Uma anotação|]1,Inf[ %nbAnnotations% anotações'
created_at: 'Data de criação'
# published_at: 'Publication date'
# published_by: 'Published by'
new:
page_title: 'Salvar nova entrada'
placeholder: 'http://website.com'

View file

@ -224,6 +224,8 @@ entry:
original_article: 'original'
# annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %count% annotations'
created_at: 'Data creării'
# published_at: 'Publication date'
# published_by: 'Published by'
new:
page_title: 'Salvează un nou articol'
placeholder: 'http://website.com'

View file

@ -224,6 +224,8 @@ entry:
original_article: 'orijinal'
# annotations_on_the_entry: '{0} No annotations|{1} One annotation|]1,Inf[ %count% annotations'
created_at: 'Oluşturulma tarihi'
# published_at: 'Publication date'
# published_by: 'Published by'
new:
page_title: 'Yeni makaleyi kaydet'
placeholder: 'http://website.com'

View file

@ -44,9 +44,23 @@
<div id="article-informations">
<i class="tool icon icon-calendar" title="{{ 'entry.view.created_at'|trans }}">
{{ entry.createdAt|date('Y-m-d') }}
{{ entry.createdAt|date('Y-m-d H:i') }}
</i>
{% if entry.publishedAt is not null %}
<i class="tool icon icon-pencil2" title="{{ 'entry.view.published_at'|trans }}">
{{ entry.publishedAt|date('Y-m-d H:i') }}
</i>
{% endif %}
{% if entry.publishedBy is not empty %}
<i class="tool icon icon-users" title="{{ 'entry.view.published_by'|trans }}">
{% for author in entry.publishedBy %}
{{ author }}{% if not loop.last %}, {% endif %}
{% endfor %}
</i>
{% endif %}
<i class="tool icon icon-time">
{% set readingTime = entry.readingTime / app.user.config.readingSpeed %}
{% if readingTime > 0 %}

View file

@ -138,7 +138,7 @@
<span>scuttle</span>
</a>
</li>
{% endif %}
{% endif %}
{% if craue_setting('share_diaspora') %}
<li>
<a href="{{ craue_setting('diaspora_url') }}/bookmarklet?url={{ entry.url|url_encode }}&amp;title={{ entry.title|striptags|url_encode }}&amp;notes=&amp;v=1&amp;noui=1&amp;jump=doclose" target="_blank">
@ -226,8 +226,22 @@
</li>
<li>
<i class="material-icons" title="{{ 'entry.view.created_at'|trans }}">today</i>
{{ entry.createdAt|date('Y-m-d') }}
{{ entry.createdAt|date('Y-m-d H:i') }}
</li>
{% if entry.publishedAt is not null %}
<li>
<i class="material-icons" title="{{ 'entry.view.published_at'|trans }}">create</i>
{{ entry.publishedAt|date('Y-m-d H:i') }}
</li>
{% endif %}
{% if entry.publishedBy is not empty %}
<li>
<i class="material-icons" title="{{ 'entry.view.published_by'|trans }}">person</i>
{% for author in entry.publishedBy %}
{{ author }}{% if not loop.last %}, {% endif %}
{% endfor %}
</li>
{% endif %}
<li>
<i class="material-icons link">link</i>
<a href="{{ entry.url|e }}" target="_blank" title="{{ 'entry.view.original_article'|trans }} : {{ entry.title|striptags }}" class="tool">