Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Show statistics broken down by wiki family on event page
Remove unused 'event_valid' field from event table. Add message indicating event is missing required options before statistics can be generated. Change font to Roboto, and remove unused font file. Bug: https://phabricator.wikimedia.org/T192579
- Loading branch information
1 parent
92bde74
commit f529e9c
Showing
17 changed files
with
397 additions
and
184 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<?php | ||
|
||
namespace Application\Migrations; | ||
|
||
use Doctrine\DBAL\Migrations\AbstractMigration; | ||
use Doctrine\DBAL\Schema\Schema; | ||
|
||
/** | ||
* Auto-generated Migration: Please modify to your needs! | ||
*/ | ||
class Version20180723164137 extends AbstractMigration | ||
{ | ||
/** | ||
* @param Schema $schema | ||
*/ | ||
public function up(Schema $schema) | ||
{ | ||
// this up() migration is auto-generated, please modify it to your needs | ||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); | ||
|
||
$this->addSql('ALTER TABLE event DROP event_valid'); | ||
} | ||
|
||
/** | ||
* @param Schema $schema | ||
*/ | ||
public function down(Schema $schema) | ||
{ | ||
// this down() migration is auto-generated, please modify it to your needs | ||
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on \'mysql\'.'); | ||
|
||
$this->addSql('ALTER TABLE event ADD event_valid TINYINT(1) DEFAULT \'1\' NOT NULL'); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
{% import 'macros/layout.html.twig' as layout %} | ||
|
||
{% set content %} | ||
{% if isOrganizer %} | ||
{{ form_errors(form) }} | ||
|
||
{# Valid participants should be shown below invalid ones. #} | ||
{% set validParticipants = [] %} | ||
|
||
{{ form_start(form, {'method': 'post', 'attr': {'class': 'form-horizontal save-participants-form', 'autocomplete': 'off'}}) }} | ||
{% for participant in form.participants %} | ||
{% set invalidParticipant = false %} | ||
{% if not(participant.vars.valid) %} | ||
{% set invalidParticipant = true %} | ||
{% endif %} | ||
|
||
{% set participantRow %} | ||
<div class="form-group participant-row{% if invalidParticipant %} has-error{% endif %}"> | ||
<div class="col-sm-4"> | ||
{{ form_widget(participant, {'attr': {'class': 'user-input'}}) }} | ||
{% if invalidParticipant %} | ||
<span class="font-awesome invalid-input"></span> | ||
{% else %} | ||
<span class="font-awesome valid-input"></span> | ||
{% endif %} | ||
</div> | ||
<div class="col-sm-2"> | ||
<button type="button" class="btn btn-default remove-participant"> | ||
{{ msg('remove') }} | ||
</button> | ||
</div> | ||
</div> | ||
{% endset %} | ||
|
||
{## | ||
# If invalid, show immediately, otherwise merge into valid ones that | ||
# will show below the invalid ones. | ||
#} | ||
{% if invalidParticipant %} | ||
{{ participantRow }} | ||
{% else %} | ||
{% set validParticipants = validParticipants|merge([participantRow]) %} | ||
{% endif %} | ||
{% endfor %} | ||
|
||
{# Render valid participants. #} | ||
{% for row in validParticipants %} | ||
{{ row }} | ||
{% endfor %} | ||
|
||
<div class="col-sm-6 col-sm-offset-6 save-participants-btn"> | ||
{{ form_widget(form.submit, {'label': msg('save-participants'), 'attr': {'class': 'btn-primary'}}) }} | ||
</div> | ||
|
||
<div class="form-group col-sm-6 event-add-participants"> | ||
<label for="form_new_participants">{{ msg('add-more-participants') }}</label> | ||
{{ form_widget(form.new_participants, {'attr': {'class': 'event-new-participants', 'rows': 10}}) }} | ||
</div> | ||
{% if form.participants|length == 0 %} | ||
<div class="col-sm-6"> | ||
{{ form_widget(form.submit, {'label': msg('save-participants'), 'attr': {'class': 'btn-primary'}}) }} | ||
</div> | ||
{% endif %} | ||
|
||
{{ form_row(form._token) }} | ||
{{ form_end(form, {'render_rest': false}) }} | ||
{% else %} | ||
{% for participant in event.participants %} | ||
<div class="participant-row"> | ||
{{ participant.username }} | ||
</div> | ||
{% endfor %} | ||
{% endif %} | ||
{% endset %} | ||
|
||
{{ | ||
layout.eventAccordion( | ||
'participants', | ||
event.numParticipants ~ ' ' ~ msg('num-participants', [event.numParticipants]), | ||
content | ||
) | ||
}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
{% set metricOrder = [] %} | ||
<table class="table table-hover gm-table event-wiki-stats event-wiki-stats--grouped"> | ||
<thead> | ||
<tr> | ||
<th class="col-lg-3"></th> | ||
{% set sortableMetrics = ['pages-created', 'pages-improved'] %} | ||
{% set columnCount = 1 %} | ||
{% for metric, offset in availableMetrics %} | ||
{% if metric not in commonMetrics and event.statistic(metric) is defined %} | ||
{% set columnCount = columnCount + 1 %} | ||
{% set stat = event.statistic(metric) %} | ||
{% set metricOrder = metricOrder|merge([stat.metric]) %} | ||
{% set hasDesc = msgExists(stat.metric ~ '-desc', [stat.offset]) %} | ||
<th class="col-lg-3"> | ||
<div class="{% if stat.metric in sortableMetrics %} sort-link sort-link--{{ stat.metric }}{% endif %}{% if hasDesc %} event-metric-desc{% endif %}" {% if hasDesc %} data-toggle="tooltip" data-placement="top" title="{{ msg(stat.metric ~ '-desc', [stat.offset]) }}"{% endif %} data-column="{{ stat.metric }}"> | ||
{{ msg(stat.metric, [stat.offset]) }} | ||
</div> | ||
</th> | ||
{% endif %} | ||
{% endfor %} | ||
{% for i in columnCount..3 %} | ||
<th class="col-lg-3"></th> | ||
{% endfor %} | ||
</tr> | ||
{% if wikis|length > 1 %} | ||
<tr> | ||
<th>{{ msg('totals') }}</th> | ||
{% for metric in metricOrder %} | ||
<th>{{ event.statistic(metric).value|num_format }}</th> | ||
{% endfor %} | ||
</tr> | ||
{% endif %} | ||
</thead> | ||
<tbody> | ||
{% for wiki in wikis %} | ||
<tr> | ||
<td class="sort-entry--domain" data-value="{{ wiki.domain }}"> | ||
{{ wiki.domain }} | ||
</td> | ||
{% for metric in metricOrder %} | ||
{% set stat = wiki.statistic(metric) %} | ||
<td class="sort-entry--{{ metric }}" data-value="{{ stat != null ? stat.value : -1 }}"> | ||
{% if stat != null %} | ||
{{ stat.value|num_format }} | ||
{% else %} | ||
— | ||
{% endif %} | ||
</td> | ||
{% endfor %} | ||
{% for i in columnCount..3 %} | ||
<td class="col-lg-3"></td> | ||
{% endfor %} | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> |
Oops, something went wrong.