Merge pull request #4347 from wallabag/article-stats-grey

🎨 Changed visibility for article stats
This commit is contained in:
Nicolas Lœuillet 2020-04-22 15:12:37 +02:00 committed by GitHub
commit 6bd8f626e4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 21 additions and 18 deletions

View file

@ -111,7 +111,7 @@
flex-flow: row wrap; flex-flow: row wrap;
.stats { .stats {
font-size: 0.8em; font-size: 0.7em;
margin: 8px 5px 5px; margin: 8px 5px 5px;
li { li {
@ -122,6 +122,7 @@
i.material-icons { i.material-icons {
color: #3e3e3e; color: #3e3e3e;
margin-right: 3px; margin-right: 3px;
font-size: 18px;
} }
} }
@ -138,10 +139,12 @@
} }
.chip { .chip {
background-color: $blueAccentColor; background-color: #9e9e9e;
padding: 0 15px 0 10px; padding: 0 15px 0 10px;
margin: auto 2px; margin: auto 2px;
border-radius: 6px; border-radius: 6px;
height: 18px;
line-height: 18px;
a, a,
i { i {
@ -150,8 +153,8 @@
i.material-icons { i.material-icons {
float: right; float: right;
font-size: 20px; font-size: 16px;
line-height: 32px; line-height: 18px;
padding-left: 8px; padding-left: 8px;
} }
} }

View file

@ -1,5 +1,5 @@
{% set readingTime = entry.readingTime / app.user.config.readingSpeed * 200 %} {% set readingTime = entry.readingTime / app.user.config.readingSpeed * 200 %}
<i class="material-icons">timer</i> <i class="material-icons grey-text">timer</i>
{% if readingTime > 0 %} {% if readingTime > 0 %}
<span>{{ 'entry.list.reading_time_minutes_short'|trans({'%readingTime%': readingTime|round}) }}</span> <span>{{ 'entry.list.reading_time_minutes_short'|trans({'%readingTime%': readingTime|round}) }}</span>
{% else %} {% else %}

View file

@ -223,46 +223,46 @@
{% block content %} {% block content %}
<div id="article"> <div id="article">
<header class="mbm"> <header class="mbm">
<h1><span{% if entry.language is defined and entry.language is not null %} lang="{{ entry.getHTMLLanguage() }}"{% endif %}>{{ entry.title|striptags|default('entry.default_title'|trans)|raw }}</span> <a href="{{ path('edit', { 'id': entry.id }) }}" title="{{ 'entry.view.edit_title'|trans }}"></a></h1> <h1><span{% if entry.language is defined and entry.language is not null %} lang="{{ entry.getHTMLLanguage() }}"{% endif %}>{{ entry.title|striptags|default('entry.default_title'|trans)|raw }}</span> <a href="{{ path('edit', { 'id': entry.id }) }}" title="{{ 'entry.view.edit_title'|trans }}"><i class="material-icons grey-text">create</i></a></h1>
</header> </header>
<aside> <aside>
<div class="tools"> <div class="tools grey-text">
<ul class="stats"> <ul class="stats">
<li> <li>
{% include "@WallabagCore/themes/material/Entry/_reading_time.html.twig" with {'entry': entry} only %} {% include "@WallabagCore/themes/material/Entry/_reading_time.html.twig" with {'entry': entry} only %}
</li> </li>
<li> <li>
<i class="material-icons" title="{{ 'entry.view.created_at'|trans }}">today</i> <i class="material-icons grey-text" title="{{ 'entry.view.created_at'|trans }}">today</i>
{{ entry.createdAt|date('Y-m-d H:i') }} {{ entry.createdAt|date('Y-m-d H:i') }}
</li> </li>
{% if entry.publishedAt is not null %} {% if entry.publishedAt is not null %}
<li> <li>
<i class="material-icons" title="{{ 'entry.view.published_at'|trans }}">create</i> <i class="material-icons grey-text" title="{{ 'entry.view.published_at'|trans }}">create</i>
{{ entry.publishedAt|date('Y-m-d H:i') }} {{ entry.publishedAt|date('Y-m-d H:i') }}
</li> </li>
{% endif %} {% endif %}
{% if entry.publishedBy is not empty %} {% if entry.publishedBy is not empty %}
<li> <li>
<i class="material-icons" title="{{ 'entry.view.published_by'|trans }}">person</i> <i class="material-icons grey-text" title="{{ 'entry.view.published_by'|trans }}">person</i>
{% for author in entry.publishedBy %} {% for author in entry.publishedBy %}
{{ author|raw }}{% if not loop.last %}, {% endif %} {{ author|raw }}{% if not loop.last %}, {% endif %}
{% endfor %} {% endfor %}
</li> </li>
{% endif %} {% endif %}
<li> <li>
<i class="material-icons">link</i> <i class="material-icons grey-text">link</i>
<a href="{{ entry.url|e }}" target="_blank" rel="noopener" title="{{ 'entry.view.original_article'|trans }} : {{ entry.title|striptags }}" class="tool"> <a href="{{ entry.url|e }}" target="_blank" rel="noopener" title="{{ 'entry.view.original_article'|trans }} : {{ entry.title|striptags }}" class="tool grey-text">
{{ entry.domainName|removeWww }} {{ entry.domainName|removeWww }}
</a> </a>
</li> </li>
<li> <li>
<i class="material-icons">comment</i> <i class="material-icons grey-text">comment</i>
{{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }} {{ 'entry.view.annotations_on_the_entry'|transchoice(entry.annotations | length) }}
</li> </li>
{% if entry.originUrl is not empty %} {% if entry.originUrl is not empty %}
<li> <li>
<i class="material-icons" title="{{ 'entry.view.provided_by'|trans }}">launch</i> <i class="material-icons grey-text" title="{{ 'entry.view.provided_by'|trans }}">launch</i>
<a href="{{ entry.originUrl|e }}" target="_blank" rel="noopener" class="tool"> <a href="{{ entry.originUrl|e }}" target="_blank" rel="noopener" class="tool grey-text">
{{ entry.originUrl|striptags|removeSchemeAndWww|truncate(32) }} {{ entry.originUrl|striptags|removeSchemeAndWww|truncate(32) }}
</a> </a>
</li> </li>

View file

@ -527,7 +527,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$this->assertGreaterThan(1, $title = $crawler->filter('div[id=article] h1')->extract(['_text'])); $this->assertGreaterThan(1, $title = $crawler->filter('div[id=article] h1')->extract(['_text']));
$this->assertContains('My updated title hehe :)', $title[0]); $this->assertContains('My updated title hehe :)', $title[0]);
$this->assertGreaterThan(1, $stats = $crawler->filter('div[class=tools] ul[class=stats] li a[class=tool]')->extract(['_text'])); $this->assertGreaterThan(1, $stats = $crawler->filter('div[class="tools grey-text"] ul[class=stats] li a[class="tool grey-text"]')->extract(['_text']));
$this->assertContains('example.io', trim($stats[1])); $this->assertContains('example.io', trim($stats[1]));
} }
@ -562,7 +562,7 @@ class EntryControllerTest extends WallabagCoreTestCase
$this->assertGreaterThan(1, $title); $this->assertGreaterThan(1, $title);
$this->assertContains('My updated title hehe :)', $title[0]); $this->assertContains('My updated title hehe :)', $title[0]);
$stats = $crawler->filter('div[class=tools] ul[class=stats] li a[class=tool]')->extract(['_text']); $stats = $crawler->filter('div[class="tools grey-text"] ul[class=stats] li a[class="tool grey-text"]')->extract(['_text']);
$this->assertCount(1, $stats); $this->assertCount(1, $stats);
$this->assertNotContains('example.io', trim($stats[0])); $this->assertNotContains('example.io', trim($stats[0]));
} }

File diff suppressed because one or more lines are too long