This repository has been archived by the owner on Nov 9, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor sports panel to symfony world
- Loading branch information
1 parent
a5cc995
commit 1943655
Showing
17 changed files
with
545 additions
and
326 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,36 @@ | ||
<?php | ||
|
||
namespace Runalyze\Migrations; | ||
|
||
use Doctrine\DBAL\Migrations\AbstractMigration; | ||
use Doctrine\DBAL\Schema\Schema; | ||
use Symfony\Component\DependencyInjection\ContainerAwareInterface; | ||
use Symfony\Component\DependencyInjection\ContainerInterface; | ||
|
||
class Version20170430165000 extends AbstractMigration implements ContainerAwareInterface | ||
{ | ||
/** @var ContainerInterface|null */ | ||
private $container; | ||
|
||
public function setContainer(ContainerInterface $container = null) | ||
{ | ||
$this->container = $container; | ||
} | ||
|
||
/** | ||
* @param Schema $schema | ||
*/ | ||
public function up(Schema $schema) | ||
{ | ||
$prefix = $this->container->getParameter('database_prefix'); | ||
|
||
$this->addSql('DELETE FROM `'.$prefix.'plugin_conf` WHERE `config`="show_as_table"'); | ||
} | ||
|
||
/** | ||
* @param Schema $schema | ||
*/ | ||
public function down(Schema $schema) | ||
{ | ||
} | ||
} |
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,25 @@ | ||
|
||
<div class="panel-heading"> | ||
<div class="panel-menu"> | ||
{% block panelHeadingMenu %} | ||
{% endblock %} | ||
</div> | ||
|
||
<h1 class="link clap" rel="{{ pluginId }}">{% block pluginTitle %}{% endblock %}</h1> | ||
|
||
<div class="hover-icons"> | ||
{% block panelHeadingIcons %} | ||
{% spaceless %} | ||
<a data-size="small" class="window" href="{{ url('plugin-config', {'id': pluginId}) }}"><i class="fa fa-fw fa-cog"></i></a> | ||
<span class="link up" rel="{{ pluginId }}"><i class="fa fa-fw fa-arrow-up"></i></span> | ||
<span class="link down" rel="{{ pluginId }}"><i class="fa fa-fw fa-arrow-down"></i></span> | ||
<span class="link" onclick="Runalyze.reloadPlugin('{{ pluginId }}');"><i class="fa fa-fw fa-refresh"></i></span> | ||
{% endspaceless %} | ||
{% endblock %} | ||
</div> | ||
</div> | ||
|
||
<div class="panel-content{% if panelContentNoPadding|default(false) %} nopadding{% endif %}"> | ||
{% block panelContent %} | ||
{% endblock %} | ||
</div> |
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,47 @@ | ||
{% extends 'my/panels/base.html.twig' %} | ||
|
||
{% from '_macro/utilities.html.twig' import boxedValue, boxedValueFor %} | ||
|
||
{% set panelContentNoPadding = true %} | ||
|
||
{% block pluginTitle %} | ||
{{ 'Sports'|trans }} | ||
{% endblock %} | ||
|
||
{% block panelHeadingMenu %} | ||
<ul> | ||
<li class="with-submenu"> | ||
<span class="link">{{ 'Month'|trans }}</span> | ||
<ul class="submenu"> | ||
<li><a class="change" target="sports" href="#sports_0">{{ 'Week'|trans }}</a></li> | ||
<li class="triggered"><a class="triggered change" target="sports" href="#sports_1">{{ 'Month'|trans }}</a></li> | ||
<li><a class="change" target="sports" href="#sports_2">{{ 'Year'|trans }}</a></li> | ||
<li><a class="change" target="sports" href="#sports_3">{{ 'Total'|trans }}</a></li> | ||
</ul> | ||
</li> | ||
</ul> | ||
{% endblock %} | ||
|
||
{% block panelContent %} | ||
<div id="sports"> | ||
{% for stats in [weekStatistics, monthStatistics, yearStatistics, totalStatistics] %} | ||
{# @var stats \Runalyze\Bundle\CoreBundle\Model\Sport\SportStatistics #} | ||
<div id="sports_{{ loop.index0 }}" class="change"{% if loop.index0 != 1 %} style="display:none;"{% endif %}> | ||
{% if stats.count %} | ||
<div class="boxed-values at-bottom"> | ||
{% for stat in stats.statistics %} | ||
{# @var stat \Runalyze\Bundle\CoreBundle\Model\Sport\SportStatistic #} | ||
{% if stat.sport.distances and stat.areMostActivitiesWithDistance %} | ||
{{ boxedValueFor(distance(stat.totalDistance), stat.sport.name, '50%', stat.sport.img) }} | ||
{% else %} | ||
{{ boxedValue(stat.totalDuration|duration, '', stat.sport.name, '50%', stat.sport.img) }} | ||
{% endif %} | ||
{% endfor %} | ||
</div> | ||
{% else %} | ||
<div class="panel-content"><p><em>{{ 'No data available since %date%.'|trans({'%date%': stats.startDate.format('d.m.Y')}) }}</em></p></div> | ||
{% endif %} | ||
</div> | ||
{% endfor %} | ||
</div> | ||
{% endblock %} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.