Skip to content

Commit a435406

Browse files
committed
better 'accept answer' styles
1 parent dfa80b0 commit a435406

2 files changed

Lines changed: 26 additions & 8 deletions

File tree

app/assets/stylesheets/questions.css.scss

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,13 +77,31 @@
7777
}
7878

7979
.answers {
80-
margin: 0;
80+
margin: 0 0 2em 0;
8181
.answer {
82+
@include clearfix;
8283
position: relative;
8384
list-style-type: none;
8485
padding: 1em 1em;
8586
border-bottom: 1px solid #ddd;
86-
87+
88+
.choose {
89+
float: left;
90+
opacity: 0.5;
91+
}
92+
.links {
93+
float: right;
94+
padding-top: 0.75em;
95+
a {
96+
margin-left: 0.5em;
97+
}
98+
}
99+
}
100+
.answer:hover {
101+
background-color: #f3f3f3;
102+
.choose {
103+
opacity: 1;
104+
}
87105
}
88106
}
89107
.selected-answer {

app/views/answers/_list.html.haml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@
66
:markdown
77
#{list.description}
88

9-
- if can?(:update, @question) && (@question.solution_id != list.id)
10-
.choose
11-
= simple_form_for(@question, :url => question_path(@question)) do |f|
12-
= f.hidden_field :solution_id, :value => list.id
13-
= f.button :submit, :value => "This answers my question!", :class => "primary btn"
14-
159
.links
1610
- if can? :update, list
1711
= link_to 'Edit', edit_question_answer_path(@question, list)
1812
- if can? :destroy, list
1913
= link_to 'Delete', question_answer_path(@question, list), :confirm => 'Are you sure?', :method => :delete
14+
15+
- if can?(:update, @question) && (@question.solution_id != list.id)
16+
.choose
17+
= simple_form_for(@question, :url => question_path(@question)) do |f|
18+
= f.hidden_field :solution_id, :value => list.id
19+
= f.button :submit, :value => "This answers my question!", :class => "primary btn"

0 commit comments

Comments
 (0)