Skip to content

Commit dfa80b0

Browse files
committed
icons and question styles
1 parent f3d44d8 commit dfa80b0

8 files changed

Lines changed: 38 additions & 80 deletions

File tree

app/assets/images/accepted.png

2.34 KB
Loading

app/assets/images/asked.png

3.07 KB
Loading

app/assets/stylesheets/home.css.scss

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -10,57 +10,6 @@
1010
}
1111

1212
.body-home {
13-
#stars {
14-
z-index: 100;
15-
width: 960px;
16-
margin: auto;
17-
position: relative;
18-
/* overflow: hidden;*/
19-
20-
.star, .moon {
21-
position: absolute;
22-
left: 0;
23-
width:67px;
24-
height: 200px;
25-
margin-top: -50px;
26-
background: url("/assets/star.png");
27-
28-
-webkit-animation: sway 2.5s ease-in-out infinite alternate;
29-
}
30-
31-
.star1 {
32-
left: -50px;
33-
top: -70px;
34-
}
35-
.moon {
36-
background: url("/assets/moon.png");
37-
left: -20px;
38-
top: -30px;
39-
}
40-
.star2 {
41-
left: 10px;
42-
}
43-
.star3 {
44-
left: 35px;
45-
top: -50px;
46-
}
47-
.star4 {
48-
left: auto;
49-
right: 20px;
50-
top: -80px;
51-
}
52-
.star5 {
53-
left: auto;
54-
right: -10px;
55-
top: -10px;
56-
}
57-
.star6 {
58-
left: auto;
59-
right: -50px;
60-
top: -50px;
61-
}
62-
}
63-
6413
#home-splash {
6514
border-top: 1px solid $heading + #444;
6615
.container {

app/assets/stylesheets/layout.css.scss

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
1+
html {
2+
background: $heading;
3+
}
4+
15
body {
26
background: $background url("square_bg.png") fixed;
37
}
48

59
.topbar {
610
position: relative;
711
height: auto;
8-
box-shadow: 0px 1px 10px rgba(0,0,0,0.5);
12+
@include box-shadow(0px 1px 10px rgba(0,0,0,0.5));
913
border-bottom: 1px solid $heading + #444;
1014
}
1115

@@ -59,6 +63,7 @@ header .topbar-inner {
5963
background: white;
6064
border-radius: 0 0 8px 8px;
6165
padding: 40px 18px 18px;
66+
@include box-shadow(0 2px 10px 0px rgba(0,0,0,0.45));
6267
}
6368

6469
.two-column {

app/assets/stylesheets/questions.css.scss

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@
1717
li {
1818
@include clearfix;
1919
list-style-type: none;
20+
padding-left: 2.5em;
2021
padding-bottom: 1em;
2122
border-bottom: 1px solid #ddd;
2223
margin-bottom: 1em;
24+
background: url("asked.png") 0 6px no-repeat;
2325

2426
.answer-count {
2527
text-align: center;
@@ -30,15 +32,7 @@
3032
}
3133
@include columns(1);
3234
padding: 6px
33-
}
34-
.unanswered, .unanswered h3 {
35-
color: $orangered;
36-
}
37-
.answered, .answered h3 {
38-
background: $green;
39-
color: white;
40-
}
41-
35+
}
4236
.summary {
4337
@include columns(9, last);
4438

@@ -51,6 +45,21 @@
5145
}
5246
}
5347
}
48+
49+
.unanswered {
50+
.answer-count, .answer-count h3 {
51+
color: $orangered;
52+
}
53+
}
54+
.answered, .accepted {
55+
.answer-count, .answer-count h3 {
56+
color: $green - #333;
57+
}
58+
}
59+
.accepted {
60+
background-image: url("accepted.png");
61+
}
62+
5463
}
5564

5665
.question {
@@ -72,18 +81,12 @@
7281
.answer {
7382
position: relative;
7483
list-style-type: none;
75-
padding: 1em 1em 0;
76-
border-bottom: 1px solid #ddd;
77-
margin-bottom: 1em;
84+
padding: 1em 1em;
85+
border-bottom: 1px solid #ddd;
7886

79-
.links {
80-
position: absolute;
81-
top: 1em;
82-
right: 1em;
83-
}
8487
}
8588
}
86-
.selected-answer{
87-
background: #ffc;
89+
.selected-answer {
90+
background: rgba(158, 183,68, 0.1) url("accepted.png") 99% 0.5em no-repeat;
8891
}
8992
}

app/views/answers/_list.html.haml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +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+
915
.links
1016
- if can? :update, list
1117
= link_to 'Edit', edit_question_answer_path(@question, list)
1218
- if can? :destroy, list
1319
= 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-
= simple_form_for(@question, :url => question_path(@question)) do |f|
17-
= f.hidden_field :solution_id, :value => list.id
18-
= f.button :submit, :value => "This answers my question!", :class => "primary btn"

app/views/layouts/application.html.haml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
!!!
33
%html
44
%head
5-
%title Hackety Hack!
5+
- title = yield :title
6+
%title #{title.blank? ? "" : "#{title} | "}Hackety Hack!
67

78
<meta name="viewport" content="width=device-width, initial-scale=1"/>
89
/ <link rel="stylesheet" href="http://twitter.github.com/bootstrap/assets/css/bootstrap-1.2.0.min.css">
@@ -31,7 +32,6 @@
3132
= link_to "x", "#", :class => "close"
3233

3334
#content{:class => @content_class}
34-
- title = yield :title
3535
- unless title.empty?
3636
%h1.title= title
3737

app/views/questions/_list.html.haml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
%li.item{:id=>list.id}
2-
.answer-count{:class => list.answers.count > 0 ? "answered" : "unanswered"}
1+
%li.item{:id=>list.id, :class => list.answers.count > 0 ? (list.solution_id.nil? ? "answered" : "accepted") : "unanswered"}
2+
.answer-count
33
%h3= list.answers.count
44
#{list.answers.count == 1 ? "answer" : "answers"}
55
.summary

0 commit comments

Comments
 (0)