-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from codeunion/better-markup
Improvements to styles and markup
- Loading branch information
Showing
12 changed files
with
244 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
source 'https://rubygems.org' | ||
|
||
gem 'sinatra' | ||
gem 'sinatra-partial' | ||
gem 'data_mapper' | ||
|
||
gem 'rake' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,125 @@ | ||
/* | ||
* HEADER | ||
*/ | ||
header { | ||
min-width: 100%; | ||
text-align: center; | ||
background-color: #555; | ||
color: #fff; | ||
padding: 0.5em; | ||
} | ||
|
||
.resume { | ||
header h1 { | ||
margin: 0; | ||
font-size: 1.5em; | ||
} | ||
|
||
|
||
/* | ||
* PAGE | ||
*/ | ||
.page { | ||
margin: 0 auto; | ||
width: 720px; | ||
} | ||
|
||
/* Separate page nav area from the main content with a border */ | ||
.page nav { | ||
padding-bottom: 0.25em; | ||
border-bottom: 1px solid; | ||
margin-bottom: 0.5em; | ||
} | ||
|
||
.page nav a { | ||
float: right; | ||
} | ||
|
||
/* Highlight section for featured content */ | ||
.highlight { | ||
width: 100%; | ||
margin-bottom: 3em; | ||
} | ||
|
||
.highlight p { font-size: 1.5em; } | ||
|
||
|
||
/* | ||
* GRID | ||
*/ | ||
.row { | ||
display: block; | ||
clear: both; | ||
} | ||
|
||
.row:after { | ||
display: block; | ||
content: ""; | ||
line-height: 0; | ||
clear: both; | ||
} | ||
|
||
/* 1/3 column (720 * 1/3) */ | ||
.one_third { | ||
float: left; | ||
width: 240px; | ||
} | ||
|
||
/* 2/3 column (720 * 2/3 - margin) */ | ||
.two_thirds { | ||
float: left; | ||
width: 460px; | ||
margin-right: 20px; | ||
} | ||
|
||
|
||
/* | ||
* FORMS | ||
*/ | ||
textarea { | ||
width: 360px; | ||
height: 3em; | ||
} | ||
|
||
form.vertical label { | ||
display: inline-block; | ||
min-width: 120px; | ||
vertical-align: top; | ||
} | ||
|
||
form.vertical input { margin-bottom: 0.25em; } | ||
|
||
form.vertical input[type="submit"] { | ||
margin-left: 124px; | ||
padding: 0.25em; | ||
} | ||
|
||
form.mini input[type="text"] { max-width: 160px; } | ||
form.mini input[type="submit"] { float: right; } | ||
|
||
|
||
/* | ||
* UTILITY CLASSES | ||
*/ | ||
.no_bullets { | ||
list-style-type: none; | ||
} | ||
|
||
.no_padding { | ||
padding: 0; | ||
} | ||
|
||
|
||
/* | ||
* SECTION STYLING | ||
*/ | ||
|
||
/* Jobs section */ | ||
.jobs li { margin-bottom: 2.5em; } | ||
.jobs li h4 { margin-bottom: 0; } | ||
|
||
/* Skills section */ | ||
.skills li { | ||
padding: 0.25em; | ||
margin-bottom: 1em; | ||
background-color: #ccc; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<li> | ||
<h4><%= job.job_title %> at <%= job.company_name %></h4> | ||
<p><%= job.job_description %></p> | ||
</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<% | ||
# When rendering a partial, the collection item takes the name | ||
# of the file for the item, so the job object is assigned to | ||
# the local variable `job_form` | ||
job = job_form | ||
%> | ||
<li> | ||
<form name="edit_job" action="/jobs/edit" method="post" accept-charset="utf-8"> | ||
<input type="hidden" name="_method" value="put"> | ||
|
||
<input type="hidden" name="job[id]" value="<%= job.id %>"> | ||
|
||
<input type="text" name="job[job_title]" value="<%= job.job_title %>"> at | ||
<input type="text" name="job[company_name]" value="<%= job.company_name %>"> | ||
<br> | ||
|
||
<label for="job[job_description]">Job Description</label><br> | ||
<textarea name="job[job_description]"><%= job.job_description %></textarea> | ||
<br> | ||
|
||
<input type="submit" value="Save"> | ||
</form> | ||
</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<section class="profile highlight"> | ||
<h1><%= user.name %></h1> | ||
<div class="contact-info"> | ||
<%= user.email %> | ||
| <%= user.phone %> | ||
| <a href="<%= user.website %>"><%= user.website %></a> | ||
</div> | ||
|
||
<p><%= user.bio %></p> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<section class="profile"> | ||
<form name="edit_user" action="/users/edit" method="post" accept-charset="utf-8" class="vertical"> | ||
<input type="hidden" name="_method" value="put"> | ||
|
||
<label for="user[name]">Name</label> | ||
<input type="text" name="user[name]" value="<%= user.name %>"> | ||
<br> | ||
|
||
<label for="user[email]">Email</label> | ||
<input type="email" name="user[email]" value="<%= user.email %>"> | ||
<br> | ||
|
||
<label for="user[phone]">Phone</label> | ||
<input type="phone" name="user[phone]" value="<%= user.phone %>"> | ||
<br> | ||
|
||
<label for="user[website]">Website</label> | ||
<input type="url" name="user[website]" value="<%= user.website %>"> | ||
<br> | ||
|
||
<label for="user[bio]">Bio</label> | ||
<textarea name="user[bio]"><%= user.bio %></textarea> | ||
<br> | ||
|
||
<input type="submit" value="Update profile"> | ||
</form> | ||
</section> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<li><%= skill.name %></li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<% skill = skill_form %> | ||
<li> | ||
<form name="edit_skill" action="/skills/edit" method="post" accept-charset="utf-8" class="mini"> | ||
<input type="hidden" name="_method" value="put"> | ||
|
||
<input type="hidden" name="skill[id]" value="<%= skill.id %>"> | ||
|
||
<input type="text" name="skill[name]" value="<%= skill.name %>"> | ||
|
||
<input type="submit" value="Save"> | ||
</form> | ||
</li> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,76 +1,24 @@ | ||
<div class="resume"> | ||
<h3>Edit My Résumé</h3> | ||
|
||
<section class="profile"> | ||
<form name="edit_user" action="/users/edit" method="post" accept-charset="utf-8"> | ||
<input type="hidden" name="_method" value="put"> | ||
|
||
<label for="user[name]">Name</label> | ||
<input type="text" name="user[name]" value="<%= default_user.name %>"> | ||
<br> | ||
|
||
<label for="user[email]">Email</label> | ||
<input type="email" name="user[email]" value="<%= default_user.email %>"> | ||
<br> | ||
|
||
<label for="user[phone]">Phone</label> | ||
<input type="phone" name="user[phone]" value="<%= default_user.phone %>"> | ||
<br> | ||
|
||
<label for="user[website]">Website</label> | ||
<input type="url" name="user[website]" value="<%= default_user.website %>"> | ||
<br> | ||
|
||
<label for="user[bio]">Bio</label> | ||
<textarea name="user[bio]"><%= default_user.bio %></textarea> | ||
<br> | ||
|
||
<input type="submit" value="Update user"> | ||
</form> | ||
</section> | ||
|
||
<section class="jobs"> | ||
<h2>Jobs</h2> | ||
<ul> | ||
<% @jobs.each do |job| %> | ||
<li> | ||
<form name="edit_job" action="/jobs/edit" method="post" accept-charset="utf-8"> | ||
<input type="hidden" name="_method" value="put"> | ||
|
||
<input type="hidden" name="job[id]" value="<%= job.id %>"> | ||
|
||
<input type="text" name="job[job_title]" value="<%= job.job_title %>"> at | ||
<input type="text" name="job[company_name]" value="<%= job.company_name %>"> | ||
<br> | ||
|
||
<label for="job[job_description]">Job Description</label> | ||
<textarea name="job[job_description]"><%= job.job_description %></textarea> | ||
<br> | ||
|
||
<input type="submit" value="Update job"> | ||
</form> | ||
</li> | ||
<% end %> | ||
</ul> | ||
</section> | ||
|
||
<section class="skills"> | ||
<h2>Skills</h2> | ||
<ul> | ||
<% @skills.each do |skill| %> | ||
<li> | ||
<form name="edit_skill" action="/skills/edit" method="post" accept-charset="utf-8"> | ||
<input type="hidden" name="_method" value="put"> | ||
|
||
<input type="hidden" name="skill[id]" value="<%= skill.id %>"> | ||
|
||
<input type="text" name="skill[name]" value="<%= skill.name %>"> | ||
<br> | ||
|
||
<input type="submit" value="Update skill"> | ||
</form> | ||
</li> | ||
<% end %> | ||
</ul> | ||
</section> | ||
<div class="page"> | ||
<nav> | ||
<a href="/" title="View resume">View</a> | ||
<h3>Edit My Résumé</h3> | ||
</nav> | ||
|
||
<%= partial :'partials/profile_form', :locals => { :user => default_user } %> | ||
|
||
<div class="row"> | ||
<section class="jobs two_thirds"> | ||
<h2>Jobs</h2> | ||
<ul class="no_bullets no_padding"> | ||
<%= partial :'partials/job_form', collection: @jobs %> | ||
</ul> | ||
</section> | ||
|
||
<section class="skills one_third"> | ||
<h2>Skills</h2> | ||
<ul class="no_bullets no_padding"> | ||
<%= partial :'partials/skill_form', collection: @skills %> | ||
</ul> | ||
</section> | ||
</div> | ||
</div> |
Oops, something went wrong.