Skip to content

Commit

Permalink
Standardize most button colors + patterns
Browse files Browse the repository at this point in the history
Closes #172
  • Loading branch information
allejo committed Jan 14, 2018
1 parent 006bd3a commit 467982f
Show file tree
Hide file tree
Showing 27 changed files with 91 additions and 30 deletions.
2 changes: 1 addition & 1 deletion assets/css/components/_buttons.scss
Expand Up @@ -2,7 +2,7 @@ $Button-Colors: (
'red': #db3434,
'blue': #3498db,
'grey': #8a8a8a,
'green': #34db6d,
'green': #00b33d,
'orange': #ff8400,
'purple': #6f34db,
'yellow': #ffb608
Expand Down
3 changes: 3 additions & 0 deletions src/Form/Creator/BanFormCreator.php
Expand Up @@ -85,6 +85,9 @@ protected function build($builder)

return $builder->add('submit', SubmitType::class, [
'label' => 'Enter Ban',
'attr' => [
'class' => 'c-button--blue pattern pattern--downward-stripes',
],
]);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Form/Creator/ConfirmationFormCreator.php
Expand Up @@ -67,7 +67,7 @@ public function create()
$cssClasses[] = 'pattern--diamonds';
} else {
$cssClasses[] = 'c-button--blue';
$cssClasses[] = 'pattern--upward-stripes';
$cssClasses[] = 'pattern--downward-stripes';
}

return $builder
Expand Down
5 changes: 4 additions & 1 deletion src/Form/Creator/MapFormCreator.php
Expand Up @@ -121,7 +121,10 @@ protected function build($builder)
}

return $builder->add('submit', SubmitType::class, [
'label' => 'Save'
'label' => 'Save',
'attr' => [
'class' => 'c-button--blue pattern pattern--downward-stripes',
],
]);
}

Expand Down
6 changes: 5 additions & 1 deletion src/Form/Creator/MatchFormCreator.php
Expand Up @@ -80,7 +80,11 @@ protected function build($builder)
'disabled' => $this->editing && $this->editing->isOfficial(),
'label' => 'Match Type',
))
->add('enter', SubmitType::class)
->add('enter', SubmitType::class, [
'attr' => [
'class' => 'c-button--blue pattern pattern--downward-stripes',
],
])
->addEventListener(FormEvents::POST_SUBMIT, [$this, 'checkUniqueRoster'])
;
}
Expand Down
6 changes: 5 additions & 1 deletion src/Form/Creator/NewsFormCreator.php
Expand Up @@ -42,7 +42,11 @@ protected function build($builder)
'draft' => 'Draft',
),
))
->add('enter', 'submit');
->add('enter', 'submit', [
'attr' => [
'class' => 'c-button--blue pattern pattern--downward-stripes',
],
]);
}

/**
Expand Down
6 changes: 5 additions & 1 deletion src/Form/Creator/PageFormCreator.php
Expand Up @@ -43,7 +43,11 @@ protected function build($builder)
'description' => "'Revision' pages are accessible by all users but not listed in the menu, " .
"while 'Disabled' pages cannot be accessed by players."
))
->add('enter', 'submit');
->add('enter', 'submit', [
'attr' => [
'class' => 'c-button--blue pattern pattern--downward-stripes',
],
]);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Form/Creator/ProfileFormCreator.php
Expand Up @@ -136,7 +136,7 @@ protected function build($builder)
$builder->add('enter', SubmitType::class, [
'label' => 'Save Profile',
'attr' => [
'class' => 'c-button--blue pattern--upward-stripes',
'class' => 'c-button--blue pattern pattern--downward-stripes',
],
]);

Expand Down
7 changes: 6 additions & 1 deletion src/Form/Creator/RoleFormCreator.php
Expand Up @@ -44,7 +44,12 @@ protected function build($builder)
'multiple' => true,
'required' => false
))
->add('enter', 'submit');
->add('enter', 'submit', [
'attr' => [
'class' => 'c-button--blue pattern pattern--downward-stripes',
],
])
;
}

/**
Expand Down
7 changes: 6 additions & 1 deletion src/Form/Creator/ServerFormCreator.php
Expand Up @@ -50,7 +50,12 @@ protected function build($builder)
->add('owner', new AdvancedModelType('Player'), array(
'constraints' => new NotBlank()
))
->add('enter', 'submit');
->add('enter', 'submit', [
'attr' => [
'class' => 'c-button--blue pattern pattern--downward-stripes',
],
])
;
}

/**
Expand Down
7 changes: 6 additions & 1 deletion src/Form/Creator/TeamFormCreator.php
Expand Up @@ -61,7 +61,12 @@ protected function build($builder)
'closed' => 'Closed',
),
))
->add('submit', 'submit');
->add('submit', 'submit', [
'attr' => [
'class' => 'c-button--blue pattern pattern--downward-stripes',
],
])
;
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Form/Creator/TeamRestorationFormCreator.php
Expand Up @@ -37,7 +37,7 @@ protected function build($builder)
->add('submit', SubmitType::class, [
'label' => 'Restore Team',
'attr' => [
'class' => 'c-button--blue pattern--upward-stripes'
'class' => 'c-button--blue pattern pattern--upward-stripes'
]
])
->addEventListener(FormEvents::POST_SUBMIT, [$this, 'checkAvailableLeader'])
Expand Down
3 changes: 2 additions & 1 deletion views/Ban/list.html.twig
Expand Up @@ -2,7 +2,8 @@

{% set pageButtons = [
{
'color': 'blue',
'color': 'green',
'pattern': 'vertical-stripes',
'url': path('ban_create'),
'icon': 'plus',
'text': 'Add Ban',
Expand Down
4 changes: 3 additions & 1 deletion views/Ban/show.html.twig
Expand Up @@ -4,13 +4,15 @@
{% set pageButtons = [
{
'color': 'grey',
'pattern': 'upward-stripes',
'url': ban.url('edit'),
'icon': 'pencil',
'text': 'Edit Ban',
'condition': me.canEdit(ban)
},
{
'color': 'grey',
'color': 'red',
'pattern': 'diamonds',
'url': ban.url('expire'),
'icon': 'unlock',
'text': 'Expire',
Expand Down
3 changes: 2 additions & 1 deletion views/Map/list.html.twig
Expand Up @@ -2,7 +2,8 @@

{% set pageButtons = [
{
'color': 'blue',
'color': 'green',
'pattern': 'vertical-stripes',
'url': path('map_add'),
'icon': 'plus',
'text': 'Add New',
Expand Down
3 changes: 2 additions & 1 deletion views/Match/list.html.twig
Expand Up @@ -4,7 +4,8 @@

{% set pageButtons = [
{
'color': 'blue',
'color': 'green',
'pattern': 'vertical-stripes',
'url': path('match_enter'),
'icon': 'plus',
'text': 'Report Match',
Expand Down
5 changes: 4 additions & 1 deletion views/Match/show.html.twig
Expand Up @@ -14,20 +14,23 @@
{% set pageButtons = [
{
'color': 'grey',
'pattern': 'upward-stripes',
'url': match.url('edit'),
'icon': 'pencil',
'text': 'Edit',
'condition': me.canEdit(match)
},
{
'color': 'orange',
'color': 'yellow',
'pattern': 'downward-stripes',
'url': match.url('recalculate'),
'icon': 'calculator',
'text': 'Recalculate ELOs',
'condition': match.official and me.canEdit(match)
},
{
'color': 'red',
'pattern': 'diamonds',
'url': match.url('delete'),
'icon': 'trash-o',
'text': 'Delete',
Expand Down
3 changes: 2 additions & 1 deletion views/News/list.html.twig
Expand Up @@ -2,7 +2,8 @@

{% set pageButtons = [
{
'color': 'blue',
'color': 'green',
'pattern': 'vertical-stripes',
'url': path('news_new'),
'icon': 'plus',
'text': 'Post New',
Expand Down
2 changes: 2 additions & 0 deletions views/News/show.html.twig
Expand Up @@ -11,13 +11,15 @@
{% set pageButtons = [
{
'color': 'grey',
'pattern': 'upward-stripes',
'url': article.url('edit'),
'icon': 'pencil',
'text': 'Edit',
'condition': me.canEdit(article)
},
{
'color': 'red',
'pattern': 'diamonds',
'url': article.url('delete'),
'icon': 'trash-o',
'text': 'Delete',
Expand Down
4 changes: 3 additions & 1 deletion views/Page/show.html.twig
Expand Up @@ -3,13 +3,15 @@
{% set pageButtons = [
{
'color': 'grey',
'pattern': 'upward-stripes',
'url': page.url('edit'),
'icon': 'pencil',
'text': 'Edit',
'condition': me.canEdit(page)
},
{
'color': 'red',
'pattern': 'diamonds',
'url': page.url('delete'),
'icon': 'trash-o',
'text': 'Delete',
Expand All @@ -29,4 +31,4 @@
{{ page.content | markdown(escapeHTML=false) }}
</section>
</div>
{% endblock %}
{% endblock %}
14 changes: 10 additions & 4 deletions views/Player/show.html.twig
Expand Up @@ -14,42 +14,48 @@

{% set pageButtons = [
{
color: 'grey',
color: 'yellow',
pattern: 'downward-stripes',
url: me.team.url('invite', false, { player: player.id }),
icon: 'plus',
text: 'Invite to team',
condition: me.isValid and not me.isTeamless and me.team.leader ~~ me
},
{
color: 'blue',
color: 'green',
pattern: 'vertical-stripes',
url: path('message_compose', { recipients: 'player:' ~ player.id }),
icon: 'send',
text: 'Send Message',
condition: me ~/~ player and me.hasPermission(constant('Permission::SEND_PRIVATE_MSG'))
},
{
color: 'blue',
color: 'grey',
pattern: 'upward-stripes',
url: player.url('edit'),
icon: 'edit',
text: 'Edit',
condition: me.canEdit(player)
},
{
color: 'blue',
color: 'grey',
pattern: 'upward-stripes',
url: path('profile_edit'),
icon: 'edit',
text: 'Edit Profile',
condition: me ~~ player
},
{
color: 'red',
pattern: 'diamonds',
url: path('ban_create_player', { player: player.id }),
icon: 'lock',
text: 'Ban',
condition: me.hasPermission(constant('Permission::ADD_BAN')) and player.ban is null
},
{
color: 'red',
pattern: 'diamonds',
url: player.ban.url('expire'),
icon: 'unlock',
text: 'Unban',
Expand Down
3 changes: 2 additions & 1 deletion views/Profile/edit.html.twig
Expand Up @@ -7,7 +7,8 @@

{% set pageButtons = [
{
'color': 'grey',
'color': 'blue',
'pattern': 'downward-stripes',
'url': player.url,
'icon': 'eye',
'text': (editingSelf) ? 'View my profile' : 'View profile',
Expand Down
3 changes: 2 additions & 1 deletion views/Server/list.html.twig
Expand Up @@ -4,7 +4,8 @@

{% set pageButtons = [
{
'color': 'blue',
'color': 'green',
'pattern': 'vertical-stripes',
'url': path('server_new'),
'icon': 'plus',
'text': 'Add Server',
Expand Down
2 changes: 2 additions & 0 deletions views/Server/show.html.twig
Expand Up @@ -7,13 +7,15 @@
{% set pageButtons = [
{
'color': 'grey',
'pattern': 'upward-stripes',
'url': server.url('edit'),
'icon': 'pencil',
'text': 'Edit',
'condition': me.canEdit(server)
},
{
'color': 'red',
'pattern': 'diamonds',
'url': server.url('delete'),
'icon': 'trash-o',
'text': 'Delete',
Expand Down
3 changes: 2 additions & 1 deletion views/Team/list.html.twig
Expand Up @@ -3,7 +3,8 @@
{% set scopeClass = "s-teams" %}
{% set pageButtons = [
{
'color': 'blue',
'color': 'green',
'pattern': 'vertical-stripes',
'url': path('team_new'),
'icon': 'plus',
'text': 'Create Team',
Expand Down

0 comments on commit 467982f

Please sign in to comment.