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

Added publication date

This commit is contained in:
Nicolas Lœuillet 2017-04-05 22:22:16 +02:00
parent 19122cf660
commit 5e9009ce86
37 changed files with 140 additions and 23 deletions

View file

@ -121,6 +121,15 @@ class Entry
*/
private $updatedAt;
/**
* @var \DateTime
*
* @ORM\Column(name="published_at", type="datetime", nullable=true)
*
* @Groups({"entries_for_user", "export_all"})
*/
private $publishedAt;
/**
* @ORM\OneToMany(targetEntity="Wallabag\AnnotationBundle\Entity\Annotation", mappedBy="entry", cascade={"persist", "remove"})
* @ORM\JoinTable
@ -701,4 +710,24 @@ 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;
}
}

View file

@ -79,6 +79,10 @@ class ContentProxy
$entry->setContent($html);
$entry->setHttpStatus(isset($content['status']) ? $content['status'] : '');
if (isset($content['date']) && null !== $content['date']) {
$entry->setPublishedAt(new \DateTime($content['date']));
}
$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,7 @@ 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'
new:
page_title: 'Gem ny artikel'
placeholder: 'http://website.com'

View file

@ -224,6 +224,7 @@ 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'
new:
page_title: 'Neuen Artikel speichern'
placeholder: 'https://website.de'

View file

@ -224,6 +224,7 @@ 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'
new:
page_title: 'Save new entry'
placeholder: 'http://website.com'

View file

@ -224,6 +224,7 @@ 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'
new:
page_title: 'Guardar un nuevo artículo'
placeholder: 'http://sitioweb.com'

View file

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

View file

@ -224,6 +224,7 @@ 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"
new:
page_title: "Sauvegarder un nouvel article"
placeholder: "http://website.com"

View file

@ -224,6 +224,7 @@ 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'
new:
page_title: 'Salva un nuovo contenuto'
placeholder: 'http://website.com'

View file

@ -224,6 +224,7 @@ 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'
new:
page_title: 'Enregistrar un novèl article'
placeholder: 'http://website.com'

View file

@ -224,6 +224,7 @@ 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'
new:
page_title: 'Zapisz nowy wpis'
placeholder: 'http://website.com'

View file

@ -224,6 +224,7 @@ 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'
new:
page_title: 'Salvar nova entrada'
placeholder: 'http://website.com'

View file

@ -224,6 +224,7 @@ 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'
new:
page_title: 'Salvează un nou articol'
placeholder: 'http://website.com'

View file

@ -224,6 +224,7 @@ 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'
new:
page_title: 'Yeni makaleyi kaydet'
placeholder: 'http://website.com'

View file

@ -44,9 +44,15 @@
<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 %}
<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,14 @@
</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 %}
<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">