Skip to content

Commit ccacdb4

Browse files
committed
added sidebars, style faq
1 parent a435406 commit ccacdb4

9 files changed

Lines changed: 110 additions & 62 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,18 @@
11
p {
22
margin: 0;
33
padding-bottom: 0.5em;
4+
}
5+
6+
#faq {
7+
h2 {
8+
line-height: 1.15;
9+
padding: 0.5em 0;
10+
margin: 0.5em 0;
11+
border-bottom: 1px solid #ccc;
12+
border-top: 1px solid #ccc;
13+
}
14+
h1 {
15+
margin-top: 1em;
16+
color: $heading;
17+
}
418
}

app/assets/stylesheets/layout.css.scss

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,23 @@ header .topbar-inner {
7373

7474
#sidebar {
7575
@include columns(5, true);
76+
.edit, .delete {
77+
margin-bottom: 1em;
78+
}
79+
section {
80+
@include border-radius(8px);
81+
background: #f3f3f3;
82+
margin-bottom: 8px;
83+
padding: 1.5em;
84+
}
7685
}
7786

7887
}
7988

89+
p, h1,h2,h3,h4,h5 {
90+
color: #555;
91+
}
92+
8093
.alert-message {
8194
margin-top: -18px;
8295
margin-bottom: 30px;

app/controllers/application_controller.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,9 @@ def title t=nil
66
@title = t unless t.blank?
77
@title
88
end
9+
10+
rescue_from CanCan::AccessDenied do |exception|
11+
redirect_to login_url, :alert => exception.message
12+
end
13+
914
end

app/views/layouts/application.html.haml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,16 @@
2727
#content-wrap{:class => @page_class}
2828
.container{:class => sidebar.empty? ? "one-column" : "two-column"}
2929
- if flash[:notice]
30-
.container.alert-message.success
30+
.alert-message.success
3131
#{flash[:notice]}
32-
= link_to "x", "#", :class => "close"
32+
- if flash[:alert]
33+
.alert-message.alert
34+
#{flash[:alert]}
3335

34-
#content{:class => @content_class}
35-
- unless title.empty?
36-
%h1.title= title
36+
- unless title.empty?
37+
%h1.title= title
3738

39+
#content{:class => @content_class}
3840
= yield
3941

4042
- unless sidebar.empty?

app/views/questions/index.html.haml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,8 @@
55
Questions
66

77
- content_for :sidebar do
8-
- if can? :create, Question
9-
%section.ask
10-
= link_to "Ask a Question", new_resource_path, :class => "btn success"
11-
- unless @support
12-
%section.support
13-
%h2 Support
14-
%p Having a problem running Hackety Hack? Found a bug? Check out our #{link_to "support section", support_questions_path}.
15-
8+
= render :partial => "shared/ask"
9+
= render :partial => "shared/support"
1610

1711
%ul.questions
1812
= render :partial => "list", :collection => collection

app/views/questions/show.html.haml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33
= resource.title
44

55
- content_for :sidebar do
6-
 
76
- if can? :update, resource
8-
= link_to 'Edit', edit_resource_path
7+
= link_to 'Edit', edit_resource_path, :class => "edit btn"
98
- if can? :destroy, resource
10-
= link_to 'Delete', resource_path, :confirm => 'Are you sure?', :method => :delete
9+
= link_to 'Delete', resource_path, :class => "delete btn", :confirm => 'Are you sure?', :method => :delete
10+
11+
12+
= render :partial => "shared/ask"
13+
= render :partial => "shared/support"
1114

1215
.meta
1316
Asked

app/views/shared/_ask.html.haml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
%section.ask
2+
%h2 Have A Question?
3+
%p Ask away! No question is too big or too small.
4+
- if current_user
5+
= link_to "Ask a Question", new_question_path, :class => "btn success"
6+
- else
7+
%p Log in to ask a question
8+
= link_to "Log In", login_path, :class => "btn success"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
%section.support
2+
%h2 Support
3+
%p Having a problem running Hackety Hack? Found a bug? Check out the #{link_to "support section", support_questions_path}

app/views/static/faq.html.haml

Lines changed: 52 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +1,83 @@
1-
:markdown
2-
#Frequently Asked Questions about Hackety Hack
1+
- content_for :sidebar do
2+
= render :partial => "shared/ask"
3+
= render :partial => "shared/support"
34

4-
(or FAQ re: HH)
5+
- content_for :title do
6+
Frequently Asked Questions
57

6-
##My install of Hackety-Hack crashes?
8+
#faq
9+
:markdown
10+
(or FAQ re: HH)
711

8-
Yes, we noticed that. Sorry. Multi-platform weirdness and all that. There are some known problems with HH on Windows Vista and XP, and they are being worked on.
12+
##My install of Hackety-Hack crashes?
913

10-
Always check you have the latest updates at hackety-hack.com/downloads just in case something has been fixed.
14+
Yes, we noticed that. Sorry. Multi-platform weirdness and all that. There are some known problems with HH on Windows Vista and XP, and they are being worked on.
1115

12-
Also, some Windows users have found that moving HH to C:\apps instead of C:\Programs.... makes HH a little happier.
16+
Always check you have the latest updates at hackety-hack.com/downloads just in case something has been fixed.
1317

14-
##What tutorials are available after I finish 'Beyond Shoes'?
18+
Also, some Windows users have found that moving HH to C:\apps instead of C:\Programs.... makes HH a little happier.
1519

16-
There will be more Tutorials added in the future. Meanwhile may I direct your curious minds to the following excellent resources on learning more about Shoes, Ruby and programming:
20+
##What tutorials are available after I finish 'Beyond Shoes'?
1721

18-
+ [Shoes website](http://shoesrb.com "Shoooooes!") : links to several things Shoes-y, some repeated below.
19-
+ [Shoes Manual](http://shoesrb.com/manual/Hello.html "Shoes Manual!") : a light waltz through Shoes. This is available through Hackety Hack's 'Help' menu;
20-
+ [Nobody Knows Shoes](http://cloud.github.com/downloads/shoes/shoes/nks.pdf "Nobody Knows Shoes, with Midas") : _why's tutorial on Shoes and all the useful bits in it. Many, many, bits.
21-
+ Chris Pine's [Learn to program](http://pine.fm/LearnToProgram "Learn to program 1st Ed") : 1st Edition is online for free. 2nd Edition Book it as [Pragmatic Programmers](pragprog.com/LearnToProgram "Pragprog - Learn to Program 2nd Ed") is bigger, better and has many more examples)
22-
+ Poignant Guide to Ruby : the delightful exploration of ruby with some foxes, chunky bacon, and more of _why's stylish examples. [get it here](http://cloud.github.com/downloads/devyn/shoes-web/whys-poignant-guide-to-ruby.pdf "Poignant guide to Ruby")
23-
+ [Learn Ruby the Hard Way](http://ruby.learncodethehardway.org/book/) : Don't let the title scare you. This book does not assume any programming skills and yet it's great for novices and experts
22+
There will be more Tutorials added in the future. Meanwhile may I direct your curious minds to the following excellent resources on learning more about Shoes, Ruby and programming:
2423

25-
##Why can't I see the Turtle?
24+
+ [Shoes website](http://shoesrb.com "Shoooooes!") : links to several things Shoes-y, some repeated below.
25+
+ [Shoes Manual](http://shoesrb.com/manual/Hello.html "Shoes Manual!") : a light waltz through Shoes. This is available through Hackety Hack's 'Help' menu;
26+
+ [Nobody Knows Shoes](http://cloud.github.com/downloads/shoes/shoes/nks.pdf "Nobody Knows Shoes, with Midas") : _why's tutorial on Shoes and all the useful bits in it. Many, many, bits.
27+
+ Chris Pine's [Learn to program](http://pine.fm/LearnToProgram "Learn to program 1st Ed") : 1st Edition is online for free. 2nd Edition Book it as [Pragmatic Programmers](pragprog.com/LearnToProgram "Pragprog - Learn to Program 2nd Ed") is bigger, better and has many more examples)
28+
+ Poignant Guide to Ruby : the delightful exploration of ruby with some foxes, chunky bacon, and more of _why's stylish examples. [get it here](http://cloud.github.com/downloads/devyn/shoes-web/whys-poignant-guide-to-ruby.pdf "Poignant guide to Ruby")
29+
+ [Learn Ruby the Hard Way](http://ruby.learncodethehardway.org/book/) : Don't let the title scare you. This book does not assume any programming skills and yet it's great for novices and experts
2630

27-
The tutorial on Turtle graphics uses `Turtle.draw` which gives the Turtle super-speed: it does the job and hides the turtle before you even see it. Turtles can be surprisingly fast.
31+
##Why can't I see the Turtle?
2832

29-
Change `Turtle.draw` to `Turtle.start` to see the turtle (whom I have nicknamed 'Chell') perform each of your commands. You can also do things like saying 'Chell! I command thee!' before each step, although it will not change the program outcome. But you might enjoy it.
33+
The tutorial on Turtle graphics uses `Turtle.draw` which gives the Turtle super-speed: it does the job and hides the turtle before you even see it. Turtles can be surprisingly fast.
3034

31-
##Where are my programs and samples stored?
35+
Change `Turtle.draw` to `Turtle.start` to see the turtle (whom I have nicknamed 'Chell') perform each of your commands. You can also do things like saying 'Chell! I command thee!' before each step, although it will not change the program outcome. But you might enjoy it.
3236

33-
*Linux*
37+
##Where are my programs and samples stored?
3438

35-
+ My Programs: your home directory, in the hidden folder '.hacketyhack' (eg: \users\jsmith\\.hacketyhack).
36-
+ Samples are in the 'samples' directory in the My Programs directory.
39+
*Linux*
3740

38-
*Mac OS X*
41+
+ My Programs: your home directory, in the hidden folder '.hacketyhack' (eg: \users\jsmith\\.hacketyhack).
42+
+ Samples are in the 'samples' directory in the My Programs directory.
3943

40-
+ My Programs: your home directory, in the hidden folder '.hacketyhack' (eg: \Users\jsmith\\.hacketyhack). Quickest way to get there using the Finder menus > Go > Go to Folder > type `~/.hacketyhack/` then click 'Go'. The files are plain text and can be opened in any text editor.
41-
+ Samples are in the Hackety Hack Package (/Applications then right-click on Hackety Hack > Show Package Contents > Contents > MacOS > app > samples)
44+
*Mac OS X*
4245

43-
*Windows Vista / XP*
46+
+ My Programs: your home directory, in the hidden folder '.hacketyhack' (eg: \Users\jsmith\\.hacketyhack). Quickest way to get there using the Finder menus > Go > Go to Folder > type `~/.hacketyhack/` then click 'Go'. The files are plain text and can be opened in any text editor.
47+
+ Samples are in the Hackety Hack Package (/Applications then right-click on Hackety Hack > Show Package Contents > Contents > MacOS > app > samples)
4448

45-
+ My Programs: In your _username_ 'Documents and Settings' folder (eg: C:\Documents and Settings\jsmith\\.hacketyhack). For the interested, the '.' at the start is left over from Linux and Mac and would otherwise make this folder hidden. But it's not on Windows.
46-
+ Samples are under the Shoes folder in 'Program Files' (eg: C:\Program Files\Common Files\Shoes\0.r1514\samples)
49+
*Windows Vista / XP*
4750

48-
##How do I upload my programs to hackety-hack.com
51+
+ My Programs: In your _username_ 'Documents and Settings' folder (eg: C:\Documents and Settings\jsmith\\.hacketyhack). For the interested, the '.' at the start is left over from Linux and Mac and would otherwise make this folder hidden. But it's not on Windows.
52+
+ Samples are under the Shoes folder in 'Program Files' (eg: C:\Program Files\Common Files\Shoes\0.r1514\samples)
4953

50-
1. Create an account on hackety-hack.com. Start by clicking #{link_to 'here', new_user_registration_path}
51-
2. In the HH application look for the 'Preferences' icon on the lower left side of the window
52-
3. Enter your hackety-hack.com account name and password then click 'Save'
53-
4. Now, when you create or edit a program, the 'Upload' button will be available to automatically upload the program to your page (hackety-hack.com/hackers/<youraccountname>
54+
##How do I upload my programs to hackety-hack.com
5455

55-
##What is the 'Preferences' page and the 2 text boxes?
56+
1. Create an account on hackety-hack.com. Start by clicking #{link_to 'here', new_user_registration_path}
57+
2. In the HH application look for the 'Preferences' icon on the lower left side of the window
58+
3. Enter your hackety-hack.com account name and password then click 'Save'
59+
4. Now, when you create or edit a program, the 'Upload' button will be available to automatically upload the program to your page (hackety-hack.com/hackers/<youraccountname>
5660

57-
The 'Preferences' are for you to type your Hackety-hack.com account details, for uploading files to your hackety-hack.com profile page.
58-
This is a way for you to show others what you are doing, and a way of sharing code if you are having problems.
59-
When you enter any programs there will be an 'Upload' button in the editor (next to Run) which you can use to, well, *upload* the program to your Hackety-Hack.com profile page (on the hackety-hack.com site, click 'My Page' at top-right)
61+
##What is the 'Preferences' page and the 2 text boxes?
6062

61-
##Where is my page on hackety-hack.com
63+
The 'Preferences' are for you to type your Hackety-hack.com account details, for uploading files to your hackety-hack.com profile page.
64+
This is a way for you to show others what you are doing, and a way of sharing code if you are having problems.
65+
When you enter any programs there will be an 'Upload' button in the editor (next to Run) which you can use to, well, *upload* the program to your Hackety-Hack.com profile page (on the hackety-hack.com site, click 'My Page' at top-right)
6266

63-
When you are logged in to hackety-hack.com, look for the 'My Page' link at top-right of page. Profile page Links look like this: hackety-hack.com/hackers/<youraccountname>
67+
##Where is my page on hackety-hack.com
6468

65-
You can usually click on another user's name to get to their page.
69+
When you are logged in to hackety-hack.com, look for the 'My Page' link at top-right of page. Profile page Links look like this: hackety-hack.com/hackers/<youraccountname>
6670

67-
##If I change a sample, does it change the original?
71+
You can usually click on another user's name to get to their page.
6872

69-
No. When you click on a Sample program, it is loaded into the Editor and you can change as much of it as you like. When you exit, the sample is not changed.
73+
##If I change a sample, does it change the original?
7074

71-
You can also click the 'Copy' button in the Editor (next to 'Run') then give it a new name and it will become one of your programs. You can then edit your version as much as you wish.
75+
No. When you click on a Sample program, it is loaded into the Editor and you can change as much of it as you like. When you exit, the sample is not changed.
7276

73-
(**NOTE**: _There is a small bug you might experience - after the 'Copy', Hackety Hack temporarily renames the sample program as well. The sample reverts to it's correct name after HH is closed/reopened_)
77+
You can also click the 'Copy' button in the Editor (next to 'Run') then give it a new name and it will become one of your programs. You can then edit your version as much as you wish.
7478

75-
# Thanks!
79+
(**NOTE**: _There is a small bug you might experience - after the 'Copy', Hackety Hack temporarily renames the sample program as well. The sample reverts to it's correct name after HH is closed/reopened_)
7680

77-
Special thanks goes out to Eric Affleck for writing this FAQ.
81+
# Thanks!
82+
83+
Special thanks goes out to Eric Affleck for writing this FAQ.

0 commit comments

Comments
 (0)