Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
Merge pull request #46 from snap-cloud/page-layouts
Browse files Browse the repository at this point in the history
We need a designer.
  • Loading branch information
cycomachead committed Apr 27, 2015
2 parents 3cd3538 + f2792c1 commit d371423
Show file tree
Hide file tree
Showing 8 changed files with 158 additions and 129 deletions.
81 changes: 42 additions & 39 deletions app/views/devise/registrations/new.html.haml
Original file line number Diff line number Diff line change
@@ -1,41 +1,44 @@
.pure.content
.pure-g
.pure-u-1.pure-md-1-3
%h2 Sign Up
= form_for(resource, as: resource_name, url: registration_path(resource_name), :html => {:class => "pure-form pure-form-stacked"} ) do |f|
%fieldset
= devise_error_messages!
%legend
Welcome, to
%span.snap
snap
= f.label :username
= f.text_field :username, autofocus: true, class: 'pure-u-1-2'
= f.label :email
= f.email_field :email, autofocus: true, class: 'pure-u-1-2'
= f.label :password
- if @validatable
%em
(#{@minimum_password_length} characters minimum)
%br/
= f.password_field :password, autocomplete: "off", class: 'pure-u-1-2'
= f.label :password_confirmation
= f.password_field :password_confirmation, autocomplete: "off", class: 'pure-u-1-2'
%br/
%label
When were you born?
= date_select :user, :birthdate
.content.page-content
.pure-u-1.pure-u-md-1-3
%div
.pure-u-1.pure-u-md-1-3.center
%h2 Sign Up
= form_for(resource, as: resource_name, url: registration_path(resource_name), :html => {:class => "pure-form pure-form-stacked"} ) do |f|
%fieldset
= devise_error_messages!
%legend
Welcome, to
%span.snap
snap
= f.label :username
= f.text_field :username, autofocus: true, class: 'pure-u-1-2'
= f.label :email
= f.email_field :email, autofocus: true, class: 'pure-u-1-2'
= f.label :password
- if @validatable
%em
If you are less than 13 years old, you must have you parent's permission, and use your parent's email address.

%label
Do you agree to our Terms of Service?
= label_tag(:tos_agree, "Agree")
= check_box_tag(:tos_agree)
(#{@minimum_password_length} characters minimum)
%br/
= f.password_field :password, autocomplete: "off", class: 'pure-u-1-2'
= f.label :password_confirmation
= f.password_field :password_confirmation, autocomplete: "off", class: 'pure-u-1-2'
%br/
%label
When were you born?
= date_select :user, :birthdate
%em
If you are less than 13 years old, you must have you parent's permission, and use your parent's email address.

%label
Do you agree to our Terms of Service?
= label_tag(:tos_agree, "Agree")
= check_box_tag(:tos_agree)


.actions
%br/
= f.submit "Sign up", :class => 'pure-button pure-input-1-2 pure-button-primary'
%br
= render "devise/shared/links"

.actions
%br/
= f.submit "Sign up", :class => 'pure-button pure-input-1-2 pure-button-primary'
%br
= render "devise/shared/links"
.pure-u-1.pure-u-md-1-3
%div
30 changes: 0 additions & 30 deletions app/views/devise/sessions/new.html.erb

This file was deleted.

38 changes: 38 additions & 0 deletions app/views/devise/sessions/new.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
.content.page-content
.pure-u-1.pure-u-md-1-3
%div
.pure-u-1.pure-u-md-1-3.center
%h2 Log In
- if flash[:notice]
#login-error{ style: "color:rgb(202,60,60)" }
= flash[:notice]

= form_for(resource, as: resource_name, url: session_path(resource_name),
html: {class: "pure-form pure-form-stacked"}) do |f|
%fieldset
= devise_error_messages!
%legend
Sign in to your
%span.snap
snap
account.
= f.label :login
%em
You may use your username or email address.
= f.text_field :login, autofocus: true, class: 'pure-u-1-2'
= f.label :password
= f.password_field :password, autocomplete: "off", class: 'pure-u-1-2'

- if devise_mapping.rememberable?
.field
= f.check_box :remember_me
= f.label :remember_me

.actions
%br/
= f.submit "Log in", class: 'pure-button pure-input-1-2 pure-button-primary'
%br
= render "devise/shared/links"
.pure-u-1.pure-u-md-1-3
%div

44 changes: 30 additions & 14 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<!-- FIXME: each page needs title... -->
<title>Snap! Build Your Own Blocks</title>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
<%= yield :head %>
Expand All @@ -11,29 +12,44 @@

<div class="home-menu pure-menu pure-menu-horizontal pure-menu-fixed">
<ul class="pure-menu-list" id="splash-menu">
<li class="pure-menu-item"><a href=<%= home_path %> class="pure-menu-heading"><%= image_tag "snap-logo.png", alt: "Snap! logo", class: "run-snap-logo" %></a></li>
<li class="pure-menu-item"><%= link_to "Create", "/snap/", :class => "pure-menu-link" %></li>
<li class="pure-menu-item"><%= link_to "Get Started", help_path, :class => "pure-menu-link" %></li>
<li class="pure-menu-item"><%= link_to "About", about_path, :class => "pure-menu-link" %></li>
<li class="pure-menu-item">
<a href=<%= home_path %> class="pure-menu-heading"><%= image_tag "snap-logo.png", alt: "Snap! logo", class: "run-snap-logo" %></a>
</li>
<li class="pure-menu-item">
<%= link_to "Create", "/snap/", :class => "pure-menu-link" %>
</li>
<li class="pure-menu-item">
<%= link_to "Get Started", help_path, :class => "pure-menu-link" %>
</li>
<li class="pure-menu-item">
<%= link_to "About", about_path, :class => "pure-menu-link" %>
</li>
</ul>

<ul class="pure-menu-list">
<% if current_user %>
<li class="pure-menu-item"><%= link_to "Profile", user_profile_path(current_user.id), :class => "pure-menu-link" %></li>
<li class="pure-menu-item"><%= link_to "Logout", logout_path, :class => "pure-menu-link" %></li>
<li class="pure-menu-item">
<%= link_to "Profile", user_profile_path(current_user.id), :class => "pure-menu-link" %>
</li>
<li class="pure-menu-item">

<%= link_to "Logout", logout_path, :class => "pure-menu-link" %>
</li>
<% else %>
<li class="pure-menu-item"><%= link_to "Sign Up", signup_path, :class => "pure-menu-link" %></li>
<li class="pure-menu-item"><%= link_to "Sign In", login_path, :class => "pure-menu-link" %></li>
<li class="pure-menu-item">
<%= link_to "Sign Up", signup_path, :class => "pure-menu-link" %>
</li>
<li class="pure-menu-item">
<%= link_to "Sign In", login_path, :class => "pure-menu-link" %>
</li>
<% end %>
</ul>
</div>

<div class="content">
<% if current_user %>
<% render partial: 'pages/navigation' %>
<% end %>
<%= yield %>
<div class="content">
<div class="pure-g">
<%= yield %>
</div>

</div>
</body>
</html>
12 changes: 5 additions & 7 deletions app/views/pages/about.html.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
<% content_for :head do %>
<%= stylesheet_link_tag "about", "marketing" %>
<%= stylesheet_link_tag "about", "marketing" %>
<% end %>

<div class="pure-g">
<div class="content pages-content">
<div class="content pages-content">
<h2 class="pages-header">About</h2>
<p>Snap! (formerly BYOB) is a visual, drag-and-drop programming language. It is an extended reimplementation of Scratch (a project of the <a href="https://llk.media.mit.edu/">Lifelong Kindergarten Group</a> at the <a href="https://media.mit.edu/">MIT Media Lab</a>) that allows you to Build Your Own Blocks. It also features first class lists, first class procedures, and continuations. These added capabilities make it suitable for a serious introduction to computer science for high school or college students.

Snap! runs in your browser. It is implemented using Javascript, which is designed to limit the ability of browser-based software to affect your computer, so it's safe to run even other people's projects, even if you don't trust our competence or good intentions.
Snap! runs in your browser. It is implemented using Javascript, which is designed to limit the ability of browser-based software to affect your computer, so it's safe to run even other people's projects, even if you don't trust our competence or good intentions.

Snap! is presented by the University of California at Berkeley. It was developed by Jens Mönig at MioSoft Corporation (now at SAP), with design input and documentation by Brian Harvey at Berkeley, and contributions by students at Berkeley and elsewhere.
Snap! is presented by the University of California at Berkeley. It was developed by Jens Mönig at MioSoft Corporation (now at SAP), with design input and documentation by Brian Harvey at Berkeley, and contributions by students at Berkeley and elsewhere.

This material is based partly upon work supported by the National Science Foundation under Grant No. 1138596. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.</p>
</div>
This material is based partly upon work supported by the National Science Foundation under Grant No. 1138596. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation.</p>
</div>
76 changes: 41 additions & 35 deletions app/views/pages/dashboard.html.erb
Original file line number Diff line number Diff line change
@@ -1,41 +1,47 @@
<div class="pure-g">

<!-- blank div for spacing -->
<div class="pure-u-1-24">
</div>

<!-- navigation -->
<div class="pure-u-1-12">
<br><br><br><br>
<%= render 'navigation' %>
</div>

<!-- blank div for spacing -->
<div class="pure-u-1-24">
</div>

<div class="pure-u-5-6" text-align = center>
<br><br><br><br>
<font size="10"> <%= @user.username%>'s Dashboard </font> &nbsp;&nbsp;&nbsp;&nbsp;
<a id = 'RunSnap' class="pure-button" href="/snap/">Run <%= image_tag "snap-logo.png", alt: "Snap!", class: "run-snap-logo" %></a>
<br><br>

<!-- blank div for spacing -->
<div class="pure-u-1-24">
</div>

<!-- navigation -->
<div class="pure-u-1-12">
<br><br><br><br>
<%= render 'navigation' %>
</div>

<!-- blank div for spacing -->
<div class="pure-u-1-24">
</div>

<div class="pure-u-5-6" text-align="center">
<br>
<br>
<br>
<br>
<!-- FIXME this needs some CSS-->
<font size="10"><%= @user.username%>'s Dashboard</font>
&nbsp;&nbsp;&nbsp;&nbsp;
<a id="RunSnap" class="pure-button" href="/snap/">
Run <%= image_tag "snap-logo.png", alt: "Snap!", class: "run-snap-logo" %>
</a>
<br>
<br>
<!-- a user's news feed -->
<%= render 'newsfeed', :locals => {:announcements => @announcements} %>
<br><br>

<!-- a user's list of assignments-->
<%= render 'users/assignments', :locals => {:assignments => @assignments} %>
<br><br>

<!-- a user's list of courses-->
<%= render 'users/enrolled_classes', :locals => {:courses => @courses} %>
<br><br>

<!-- user's list of projects -->
<br>
<br>
<!-- a user's list of assignments -->
<%= render 'users/assignments', :locals => {:assignments => @assignments} %>
<br>
<br>
<!-- a user's list of courses -->
<%= render 'users/enrolled_classes', :locals => {:courses => @courses} %>
<br>
<br>
<!-- user's list of projects -->
<%= render 'projects/projectlist', :locals => {:projects => @projects} %>
<br><br>

</div>

<br>
<br>
</div>
</div>
4 changes: 1 addition & 3 deletions app/views/pages/help.html.erb
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<% content_for :head do %>
<%= stylesheet_link_tag "about", "marketing" %>
<%= stylesheet_link_tag "about", "marketing" %>
<% end %>

<div class="pure-g">
<div class="content pages-content">
<h2 class="pages-header">Get Started</h2>
<h3>Need help?</h3>
Expand Down Expand Up @@ -50,4 +49,3 @@
</ul>
<p style="float: center; margin-top: 50px;">Teachers, check out the <a href="http://bjc.berkeley.edu/">Beauty and Joy of Computing</a>, an AP CS: Principles course using Snap<em>!</em>.</p>
</div>
</div>
2 changes: 1 addition & 1 deletion features/step_definitions/course_steps.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
end

Then(/^I should see that I need to log in$/) do
text = "Log in"
text = "Log In"
if page.respond_to? :should
page.should have_content(text)
else
Expand Down

0 comments on commit d371423

Please sign in to comment.