Skip to content

Commit

Permalink
ArticleInfo: add user links to authorship section; add rank column
Browse files Browse the repository at this point in the history
  • Loading branch information
MusikAnimal committed Jan 19, 2018
1 parent 09b1f0f commit 065a300
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 8 deletions.
8 changes: 4 additions & 4 deletions app/Resources/views/articleInfo/result.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -473,13 +473,13 @@
{{ wiki.userLink(editor, project) }}
</td>
<td>
{% if enabled('ec') %}
<a href="{{ path('ec', { 'project': project.domain, 'username': editor }) }}">{{ msg('tool-ec') }}</a>
{% endif %}
&middot;
{% if enabled('topedits') %}
<a href="{{ path('topedits', { 'project': project.domain, 'username': editor, 'namespace': page.namespace, 'article': page.titleWithoutNamespace }) }}">{{ msg('tool-topedits') }}</a>
{% endif %}
&middot;
{% if enabled('ec') %}
<a href="{{ path('ec', { 'project': project.domain, 'username': editor }) }}">{{ msg('tool-ec') }}</a>
{% endif %}
</td>
<td class="sort-entry--edits" data-value="{{ stats.all }}">
{{ stats.all|num_format }}
Expand Down
20 changes: 16 additions & 4 deletions app/Resources/views/articleInfo/textshares.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@
{% else %}
<table class="table table-bordered table-hover table-striped textshares-table toggle-table">
<thead>
{% for key in ['username', 'characters', 'percentage'] %}
{% for key in ['rank', 'username', 'links', 'characters', 'percentage'] %}
<th>
<span class="sort-link sort-link--{{ key }}" data-column="{{ key }}">
<span{% if key != 'links' %} class="sort-link sort-link--{{ key }}" data-column="{{ key }}"{% endif %}>
{{ msg(key)|capitalize_first }}
<span class="glyphicon glyphicon-sort"></span>
{% if key != "links" %}<span class="glyphicon glyphicon-sort"></span>{% endif %}
</span>
</th>
{% endfor %}
Expand All @@ -64,13 +64,23 @@
{% set totalPercentage = totalPercentage + values.percentage %}
{% set totalCount = totalCount + values.count %}
<tr>
<td class="sort-entry--rank" data-value="{{ loop.index }}">{{ loop.index }}</td>
<td class="sort-entry--username" data-value="{{ username }}">
<span class="textshares-toggle toggle-table--toggle" data-index="{{ loop.index0 }}" data-key="{{ username }}">
<span class="glyphicon glyphicon-remove"></span>
<span class="color-icon" style="background:{{ chartColor(loop.index0) }}"></span>
</span>
{{ wiki.userLink(username, project) }}
</td>
<td>
{% if enabled('topedits') %}
<a href="{{ path('topedits', { 'project': project.domain, 'username': username, 'namespace': page.namespace, 'article': page.titleWithoutNamespace }) }}">{{ msg('tool-topedits') }}</a>
{% endif %}
&middot;
{% if enabled('ec') %}
<a href="{{ path('ec', { 'project': project.domain, 'username': username }) }}">{{ msg('tool-ec') }}</a>
{% endif %}
</td>
<td class="sort-entry--characters" data-value="{{ values.count }}">
{{ values.count|num_format }}
</td>
Expand All @@ -81,13 +91,15 @@
{% endfor %}
</tbody>
{% if textshares.totalAuthors > 10 and is_sub_request == true %}
<tfoot><tr>
<tfoot><tr class="show-more-row">
<td></td>
<td>
<a href="{{ path('ArticleInfoAuthorshipResult', {project:project.domain, article:page.title})}}">
{{ (textshares.totalAuthors - 10)|num_format }}
{{ msg('num-others', [textshares.totalAuthors - 10]) }}
</a>
</td>
<td></td>
<td>
{{ (textshares.totalCount - totalCount)|num_format }}
</td>
Expand Down

0 comments on commit 065a300

Please sign in to comment.