Skip to content

Commit d374078

Browse files
committed
question index layout and basic styles, added optional sidebar layout to all pages
1 parent c3b7c3b commit d374078

14 files changed

Lines changed: 134 additions & 104 deletions

Gemfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ gem 'inherited_resources'
2626
gem 'simple_form', :git => "https://github.com/bitzesty/bootstrap_form.git"
2727
gem "semantic_menu", :git => "git://github.com/michaek/semantic_menu.git"
2828

29+
gem 'will_paginate' # Pagination
30+
gem 'rdiscount' # Markdown
31+
32+
2933
group :development do
3034
# Use unicorn as the web server
3135
gem 'unicorn'

Gemfile.lock

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ GEM
158158
thor (~> 0.14.6)
159159
raindrops (0.7.0)
160160
rake (0.9.2)
161+
rdiscount (1.6.8)
161162
rdoc (3.9.4)
162163
responders (0.6.4)
163164
rspec (2.6.0)
@@ -205,6 +206,7 @@ GEM
205206
raindrops (~> 0.6)
206207
warden (1.0.5)
207208
rack (>= 1.0)
209+
will_paginate (3.0.1)
208210
xpath (0.1.4)
209211
nokogiri (~> 1.3)
210212

@@ -229,10 +231,12 @@ DEPENDENCIES
229231
mocha
230232
mongo_mapper
231233
rails (= 3.1.0.rc6)
234+
rdiscount
232235
rspec-rails
233236
sass-rails (~> 3.1.0.rc)
234237
semantic_menu!
235238
simple_form!
236239
sqlite3
237240
uglifier
238241
unicorn
242+
will_paginate

app/assets/stylesheets/answers.css.scss

Lines changed: 0 additions & 3 deletions
This file was deleted.

app/assets/stylesheets/application.css.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,4 @@
1212
@import "layout.css.scss";
1313
@import "forms.css.scss";
1414
@import "content.css.scss";
15-
@import "answers.css.scss";
15+
@import "questions.css.scss";

app/assets/stylesheets/content.css.scss

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@
1717
}
1818

1919
img.new_program {
20-
float: left;
2120
@include columns(5);
22-
margin-right: $gridGutterWidth*2;
2321
}
2422
img.lesson {
25-
float: right;
2623
@include columns(8);
24+
float: right;
25+
margin-right: 0;
2726
margin-left: $gridGutterWidth*2;
2827

2928
}
@@ -33,10 +32,4 @@
3332
border: none;
3433
margin-bottom: 0;
3534
}
36-
}
37-
38-
.links {
39-
position: absolute;
40-
top: 6px;
41-
right: 0;
42-
}
35+
}

app/assets/stylesheets/layout.css.scss

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,18 @@ header .topbar-inner {
3535

3636
.container {
3737
position: relative;
38+
}
39+
}
40+
41+
.two-column {
42+
#content {
43+
@include columns(13);
3844
}
45+
46+
#sidebar {
47+
@include columns(3, true);
48+
}
49+
3950
}
4051

4152
.alert-message {

app/assets/stylesheets/lib/bootstrap/preboot.scss

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ $white: #fff;
2121
// Accent Colors
2222
$blue: #04BFBF;
2323
$blueDark: #008a8a;
24-
$green: #46a546;
24+
$green: #C0D966 - #111;
2525
$red: #9d261d;
2626
$yellow: #ffc40d;
2727
$orange: #f89406;
@@ -127,8 +127,17 @@ $analog2: spin($baseColor, -22);
127127
margin: 0 auto;
128128
@include clearfix;
129129
}
130-
@mixin columns($columnSpan: 1) {
130+
@mixin columns($columnSpan: 1, $last: false) {
131131
width: ($gridColumnWidth * $columnSpan) + ($gridGutterWidth * ($columnSpan - 1));
132+
display: inline;
133+
float: left;
134+
135+
@if $last {
136+
margin-right: 0;
137+
}
138+
@else {
139+
margin-right: $gridGutterWidth;
140+
}
132141
}
133142

134143
@mixin offset($columnOffset: 1) {

app/assets/stylesheets/lib/bootstrap/scaffolding.scss

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -3,62 +3,6 @@
33
* Basic and global styles for generating a grid system, structural layout, and page templates
44
* ------------------------------------------------------------------------------------------- */
55

6-
7-
// GRID SYSTEM
8-
// -----------
9-
10-
.row {
11-
@include clearfix;
12-
margin-left: -1 * $gridGutterWidth;
13-
14-
// Find all .span# classes within .row and give them the necessary properties for grid columns (supported by all browsers back to IE7)
15-
// Credit to @dhg for the idea
16-
[class^="span"] {
17-
display: inline;
18-
float: left;
19-
margin-left: $gridGutterWidth;
20-
}
21-
22-
// Default columns
23-
.span1 { @include columns(1); }
24-
.span2 { @include columns(2); }
25-
.span3 { @include columns(3); }
26-
.span4 { @include columns(4); }
27-
.span5 { @include columns(5); }
28-
.span6 { @include columns(6); }
29-
.span7 { @include columns(7); }
30-
.span8 { @include columns(8); }
31-
.span9 { @include columns(9); }
32-
.span10 { @include columns(10); }
33-
.span11 { @include columns(11); }
34-
.span12 { @include columns(12); }
35-
.span13 { @include columns(13); }
36-
.span14 { @include columns(14); }
37-
.span15 { @include columns(15); }
38-
.span16 { @include columns(16); }
39-
40-
// Offset column options
41-
.offset1 { @include offset(1); }
42-
.offset2 { @include offset(2); }
43-
.offset3 { @include offset(3); }
44-
.offset4 { @include offset(4); }
45-
.offset5 { @include offset(5); }
46-
.offset6 { @include offset(6); }
47-
.offset7 { @include offset(7); }
48-
.offset8 { @include offset(8); }
49-
.offset9 { @include offset(9); }
50-
.offset10 { @include offset(10); }
51-
.offset11 { @include offset(11); }
52-
.offset12 { @include offset(12); }
53-
54-
// Unique column sizes for 16-column grid
55-
.span-one-third { width: 300px; }
56-
.span-two-thirds { width: 620px; }
57-
.offset-one-third { margin-left: 340px; }
58-
.offset-two-thirds { margin-left: 660px; }
59-
}
60-
61-
626
// STRUCTURAL LAYOUT
637
// -----------------
648

app/assets/stylesheets/lib/bootstrap/type.scss

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,12 @@ h2 {
4141
font-size: 14px;
4242
}
4343
}
44+
4445
h3, h4, h5, h6 {
45-
line-height: $baseline * 2;
46+
/* line-height: $baseline * 2;*/
47+
margin-bottom: 0.5em;
4648
}
49+
4750
h3 {
4851
font-size: 18px;
4952
small {
Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
.questions, .question {
2+
.meta {
3+
font-style: italic;
4+
padding-bottom: 0.75em;
5+
}
6+
}
7+
8+
.questions {
9+
margin: 0;
10+
li {
11+
@include clearfix;
12+
list-style-type: none;
13+
padding-bottom: 1em;
14+
border-bottom: 1px solid #eee;
15+
margin-bottom: 1em;
16+
17+
.answer-count {
18+
text-align: center;
19+
font-size: 0.85em;
20+
h3 {
21+
margin: 0;
22+
font-size: 2em;
23+
}
24+
@include columns(1);
25+
padding: 6px
26+
}
27+
.unanswered, .unanswered h3 {
28+
color: $red;
29+
}
30+
.answered, .answered h3 {
31+
background: $green;
32+
color: white;
33+
}
34+
35+
.summary {
36+
@include columns(11, last);
37+
38+
h2 {
39+
line-height: 1;
40+
margin-bottom: 0.15em;
41+
}
42+
.description {
43+
padding-right: 3em;
44+
}
45+
}
46+
}
47+
}
48+
49+
.question {
50+
.selected-answer{
51+
background-color:yellow;
52+
}
53+
}

0 commit comments

Comments
 (0)