Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
WIP - things looking good now
- Loading branch information
Abhishek Yadav
committed
Dec 22, 2010
1 parent
ac09faa
commit e81d56f
Showing
65 changed files
with
11,256 additions
and
45 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,14 +1,14 @@ | ||
#ignore the log files | ||
rc3/log/* | ||
log/* | ||
|
||
#ignore the tmp files | ||
rc3/tmp/**/* | ||
|
||
#ignore the user_data files | ||
data/* | ||
tmp/**/* | ||
|
||
#ignore the database.yml file so that passwords are not exposed on github | ||
rc3/config/database.yml | ||
config/database.yml | ||
|
||
# ignore the sqlite databases - | ||
rc3/rc/db/*.sqlite3 | ||
db/*.sqlite3 | ||
|
||
# ignore the data folder - contains random data | ||
data/* |
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,3 +1,19 @@ | ||
class ApplicationController < ActionController::Base | ||
protect_from_forgery | ||
|
||
def admin | ||
User.find_by_email "admin@rc.com" | ||
end | ||
|
||
# Returns the default style object | ||
# Currently set to the first style object | ||
def default_style | ||
Style.find 1 | ||
end | ||
|
||
# Returns true if the request is a part of a demo - user is unauthenticated | ||
def demo? | ||
true unless user_signed_in? | ||
end | ||
helper_method :demo? | ||
end |
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,5 +1,22 @@ | ||
class HomeController < ApplicationController | ||
|
||
layout "demo" | ||
# show the welcome page if user isn't logged in, | ||
# redirect the user to resume index if she is logged in | ||
def index | ||
redirect_to resumes_path if user_signed_in? | ||
# show welcome page - Render home/index.html.erb | ||
end | ||
|
||
# create a demo resume for the (existing) admin user, | ||
# and direct him to the resume edit page | ||
def demo | ||
if params[:r].blank? | ||
r = admin.resumes.create(:content => "Copy-paste your resume here", :is_demo => true) | ||
else | ||
r = admin.resumes.find(params[:r]) | ||
end | ||
redirect_to edit_resume_path(r) | ||
end | ||
|
||
end |
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 |
---|---|---|
@@ -0,0 +1,86 @@ | ||
class StylesController < ApplicationController | ||
|
||
before_filter :authenticate_user! | ||
|
||
# GET /styles | ||
# GET /styles.xml | ||
def index | ||
@styles = Style.all | ||
|
||
respond_to do |format| | ||
format.html # index.html.erb | ||
format.xml { render :xml => @styles } | ||
end | ||
end | ||
|
||
# GET /styles/1 | ||
# GET /styles/1.xml | ||
def show | ||
@style = Style.find(params[:id]) | ||
|
||
respond_to do |format| | ||
format.html # show.html.erb | ||
format.xml { render :xml => @style } | ||
end | ||
end | ||
|
||
# GET /styles/new | ||
# GET /styles/new.xml | ||
def new | ||
@style = Style.new | ||
|
||
respond_to do |format| | ||
format.html # new.html.erb | ||
format.xml { render :xml => @style } | ||
end | ||
end | ||
|
||
# GET /styles/1/edit | ||
def edit | ||
@style = Style.find(params[:id]) | ||
end | ||
|
||
# POST /styles | ||
# POST /styles.xml | ||
def create | ||
@style = Style.new(params[:style]) | ||
|
||
respond_to do |format| | ||
if @style.save | ||
format.html { redirect_to(@style, :notice => 'Style was successfully created.') } | ||
format.xml { render :xml => @style, :status => :created, :location => @style } | ||
else | ||
format.html { render :action => "new" } | ||
format.xml { render :xml => @style.errors, :status => :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# PUT /styles/1 | ||
# PUT /styles/1.xml | ||
def update | ||
@style = Style.find(params[:id]) | ||
|
||
respond_to do |format| | ||
if @style.update_attributes(params[:style]) | ||
format.html { redirect_to(@style, :notice => 'Style was successfully updated.') } | ||
format.xml { head :ok } | ||
else | ||
format.html { render :action => "edit" } | ||
format.xml { render :xml => @style.errors, :status => :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# DELETE /styles/1 | ||
# DELETE /styles/1.xml | ||
def destroy | ||
@style = Style.find(params[:id]) | ||
@style.destroy | ||
|
||
respond_to do |format| | ||
format.html { redirect_to(styles_url) } | ||
format.xml { head :ok } | ||
end | ||
end | ||
end |
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,2 +1,3 @@ | ||
module ApplicationHelper | ||
|
||
end |
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,2 @@ | ||
module StylesHelper | ||
end |
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,2 +1,13 @@ | ||
class Resume < ActiveRecord::Base | ||
belongs_to :user | ||
has_one :style_attachment, :dependent => :destroy | ||
has_one :style, :through => :style_attachment | ||
|
||
after_create :add_style | ||
|
||
def add_style | ||
default_style = Style.find_by_title "default" | ||
#StyleAttachment.create!(:resume => self, :style => default_style) | ||
build_style_attachment(:style => default_style) | ||
end | ||
end |
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,14 @@ | ||
class Style < ActiveRecord::Base | ||
# Styles are the templates associated with the resume. | ||
# Style associate to a resume through a style_attachment table, so - | ||
# - a resume can have one style_attachment, that is one style | ||
# - a style can have many style_attachments, that is, can be applied to many resumes | ||
# They contain the css and some meta data | ||
# Every user can create/edit/destroy her styles | ||
# User can also read/copy/use another user's styles | ||
# Styles are marked default, featured | ||
# Styles have to be rated/rated - based on usage, editorial | ||
belongs_to :user | ||
has_many :style_attachments, :dependent => :destroy | ||
has_many :resumes, :through => :style_attachments | ||
end |
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 @@ | ||
class StyleAttachment < ActiveRecord::Base | ||
belongs_to :resume | ||
belongs_to :style | ||
end |
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,16 @@ | ||
class User < ActiveRecord::Base | ||
# Include default devise modules. Others available are: | ||
# :token_authenticatable, :confirmable, :lockable and :timeoutable | ||
devise :database_authenticatable, # encrypts and stores a password in the database to validate the authenticity of an user while signing in. | ||
:registerable, # handles signing up users through a registration process, also allowing them to edit and destroy their account. | ||
:recoverable, # resets the user password and sends reset instructions. | ||
:rememberable, # manages generating and clearing a token for remembering the user from a saved cookie. | ||
:trackable, # tracks sign in count, timestamps and IP address. | ||
:validatable # provides validations of email and password | ||
|
||
# Setup accessible (or protected) attributes for your model | ||
attr_accessible :email, :password, :password_confirmation, :remember_me | ||
|
||
has_many :resumes, :foreign_key => "user_id" | ||
has_many :styles, :foreign_key => "user_id" | ||
end |
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,2 +1,7 @@ | ||
<h1>Home#index</h1> | ||
<p>Find me in app/views/home/index.html.erb</p> | ||
<h1>rC</h1> | ||
<h2>resumeCreator helps you create nice looking resumes online. Fast</h2> | ||
|
||
<%= link_to "sign_in", new_user_session_path %> / | ||
<%= link_to "sign up", new_user_registration_path %> | ||
<br/>or<br/> | ||
<%= link_to "get started ...", demo_path %> |
Oops, something went wrong.