Skip to content

Commit

Permalink
Use the button style for action links
Browse files Browse the repository at this point in the history
  • Loading branch information
georgyangelov committed Sep 20, 2016
1 parent 9efe87a commit 43d9013
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 7 deletions.
4 changes: 3 additions & 1 deletion app/assets/stylesheets/_layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ abbr { border-bottom: 1px dotted $dark-border; }
table.data-table { @include data-table; }

.main h1 { @include heading-1; margin-bottom: 1em; }
.action { @include action; }

.action { @include button; }
.action.primary { @include primary-button; }

.no-records,
.requires-authentication { color: $disabled; font-style: italic; }
Expand Down
4 changes: 3 additions & 1 deletion app/assets/stylesheets/_mixins.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
font-weight: normal;
padding: 8px 16px;

&:hover { background-color: $subtitle-color; color: white; }
&:hover { background-color: $subtitle-color; color: white; text-decoration: none; }
}

@mixin primary-button {
@include button;

background-color: $subtitle-color;
color: white;

&:hover { background-color: darken($subtitle-color, 10%); text-decoration: none; }
}

@mixin replace-with-image($img, $width, $height) {
Expand Down
2 changes: 1 addition & 1 deletion app/views/announcements/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
%h1 Новини

- if admin?
= link_to 'Нова', new_announcement_path, class: :action
= link_to 'Нова', new_announcement_path, class: [:action, :primary]

- unless @announcements.empty?
- @announcements.each do |announcement|
Expand Down
2 changes: 1 addition & 1 deletion app/views/challenges/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#challenges
%h1 Предизвикателства
= admin_only do
= link_to 'Ново', new_challenge_path, class: :action
= link_to 'Ново', new_challenge_path, class: [:action, :primary]

%ul
- @challenges.each do |challenge|
Expand Down
2 changes: 1 addition & 1 deletion app/views/tasks/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#tasks
%h1 Задачи
= admin_only do
= link_to 'Нова', new_task_path, class: :action
= link_to 'Нова', new_task_path, class: [:action, :primary]

%ul
- @tasks.each do |task|
Expand Down
2 changes: 1 addition & 1 deletion app/views/topics/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%h1 Форуми

%p= link_to 'Нова тема', new_topic_path, class: :action if logged_in?
%p= link_to 'Нова тема', new_topic_path, class: [:action, :primary] if logged_in?

%table.topics
%thead
Expand Down
2 changes: 1 addition & 1 deletion app/views/vouchers/index.html.haml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
%h1 Ваучъри
= link_to 'Добави нови', new_voucher_path, class: :action
= link_to 'Добави нови', new_voucher_path, class: [:action, :primary]

%table.data-table
%thead
Expand Down

0 comments on commit 43d9013

Please sign in to comment.