Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
42 changed files
with
793 additions
and
0 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
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,83 @@ | ||
class ClockInsController < ApplicationController | ||
# GET /clock_ins | ||
# GET /clock_ins.xml | ||
def index | ||
@clock_ins = ClockIn.all | ||
|
||
respond_to do |format| | ||
format.html # index.html.erb | ||
format.xml { render :xml => @clock_ins } | ||
end | ||
end | ||
|
||
# GET /clock_ins/1 | ||
# GET /clock_ins/1.xml | ||
def show | ||
@clock_in = ClockIn.find(params[:id]) | ||
|
||
respond_to do |format| | ||
format.html # show.html.erb | ||
format.xml { render :xml => @clock_in } | ||
end | ||
end | ||
|
||
# GET /clock_ins/new | ||
# GET /clock_ins/new.xml | ||
def new | ||
@clock_in = ClockIn.new | ||
|
||
respond_to do |format| | ||
format.html # new.html.erb | ||
format.xml { render :xml => @clock_in } | ||
end | ||
end | ||
|
||
# GET /clock_ins/1/edit | ||
def edit | ||
@clock_in = ClockIn.find(params[:id]) | ||
end | ||
|
||
# POST /clock_ins | ||
# POST /clock_ins.xml | ||
def create | ||
@clock_in = ClockIn.new(params[:clock_in]) | ||
|
||
respond_to do |format| | ||
if @clock_in.save | ||
format.html { redirect_to(@clock_in, :notice => 'Clock in was successfully created.') } | ||
format.xml { render :xml => @clock_in, :status => :created, :location => @clock_in } | ||
else | ||
format.html { render :action => "new" } | ||
format.xml { render :xml => @clock_in.errors, :status => :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# PUT /clock_ins/1 | ||
# PUT /clock_ins/1.xml | ||
def update | ||
@clock_in = ClockIn.find(params[:id]) | ||
|
||
respond_to do |format| | ||
if @clock_in.update_attributes(params[:clock_in]) | ||
format.html { redirect_to(@clock_in, :notice => 'Clock in was successfully updated.') } | ||
format.xml { head :ok } | ||
else | ||
format.html { render :action => "edit" } | ||
format.xml { render :xml => @clock_in.errors, :status => :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# DELETE /clock_ins/1 | ||
# DELETE /clock_ins/1.xml | ||
def destroy | ||
@clock_in = ClockIn.find(params[:id]) | ||
@clock_in.destroy | ||
|
||
respond_to do |format| | ||
format.html { redirect_to(clock_ins_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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
class ClockOutsController < ApplicationController | ||
# GET /clock_outs | ||
# GET /clock_outs.xml | ||
def index | ||
@clock_outs = ClockOut.all | ||
|
||
respond_to do |format| | ||
format.html # index.html.erb | ||
format.xml { render :xml => @clock_outs } | ||
end | ||
end | ||
|
||
# GET /clock_outs/1 | ||
# GET /clock_outs/1.xml | ||
def show | ||
@clock_out = ClockOut.find(params[:id]) | ||
|
||
respond_to do |format| | ||
format.html # show.html.erb | ||
format.xml { render :xml => @clock_out } | ||
end | ||
end | ||
|
||
# GET /clock_outs/new | ||
# GET /clock_outs/new.xml | ||
def new | ||
@clock_out = ClockOut.new | ||
|
||
respond_to do |format| | ||
format.html # new.html.erb | ||
format.xml { render :xml => @clock_out } | ||
end | ||
end | ||
|
||
# GET /clock_outs/1/edit | ||
def edit | ||
@clock_out = ClockOut.find(params[:id]) | ||
end | ||
|
||
# POST /clock_outs | ||
# POST /clock_outs.xml | ||
def create | ||
@clock_out = ClockOut.new(params[:clock_out]) | ||
|
||
respond_to do |format| | ||
if @clock_out.save | ||
format.html { redirect_to(@clock_out, :notice => 'Clock out was successfully created.') } | ||
format.xml { render :xml => @clock_out, :status => :created, :location => @clock_out } | ||
else | ||
format.html { render :action => "new" } | ||
format.xml { render :xml => @clock_out.errors, :status => :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# PUT /clock_outs/1 | ||
# PUT /clock_outs/1.xml | ||
def update | ||
@clock_out = ClockOut.find(params[:id]) | ||
|
||
respond_to do |format| | ||
if @clock_out.update_attributes(params[:clock_out]) | ||
format.html { redirect_to(@clock_out, :notice => 'Clock out was successfully updated.') } | ||
format.xml { head :ok } | ||
else | ||
format.html { render :action => "edit" } | ||
format.xml { render :xml => @clock_out.errors, :status => :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# DELETE /clock_outs/1 | ||
# DELETE /clock_outs/1.xml | ||
def destroy | ||
@clock_out = ClockOut.find(params[:id]) | ||
@clock_out.destroy | ||
|
||
respond_to do |format| | ||
format.html { redirect_to(clock_outs_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 |
---|---|---|
@@ -0,0 +1,83 @@ | ||
class TasksController < ApplicationController | ||
# GET /tasks | ||
# GET /tasks.xml | ||
def index | ||
@tasks = Task.all | ||
|
||
respond_to do |format| | ||
format.html # index.html.erb | ||
format.xml { render :xml => @tasks } | ||
end | ||
end | ||
|
||
# GET /tasks/1 | ||
# GET /tasks/1.xml | ||
def show | ||
@task = Task.find(params[:id]) | ||
|
||
respond_to do |format| | ||
format.html # show.html.erb | ||
format.xml { render :xml => @task } | ||
end | ||
end | ||
|
||
# GET /tasks/new | ||
# GET /tasks/new.xml | ||
def new | ||
@task = Task.new | ||
|
||
respond_to do |format| | ||
format.html # new.html.erb | ||
format.xml { render :xml => @task } | ||
end | ||
end | ||
|
||
# GET /tasks/1/edit | ||
def edit | ||
@task = Task.find(params[:id]) | ||
end | ||
|
||
# POST /tasks | ||
# POST /tasks.xml | ||
def create | ||
@task = Task.new(params[:task]) | ||
|
||
respond_to do |format| | ||
if @task.save | ||
format.html { redirect_to(@task, :notice => 'Task was successfully created.') } | ||
format.xml { render :xml => @task, :status => :created, :location => @task } | ||
else | ||
format.html { render :action => "new" } | ||
format.xml { render :xml => @task.errors, :status => :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# PUT /tasks/1 | ||
# PUT /tasks/1.xml | ||
def update | ||
@task = Task.find(params[:id]) | ||
|
||
respond_to do |format| | ||
if @task.update_attributes(params[:task]) | ||
format.html { redirect_to(@task, :notice => 'Task was successfully updated.') } | ||
format.xml { head :ok } | ||
else | ||
format.html { render :action => "edit" } | ||
format.xml { render :xml => @task.errors, :status => :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# DELETE /tasks/1 | ||
# DELETE /tasks/1.xml | ||
def destroy | ||
@task = Task.find(params[:id]) | ||
@task.destroy | ||
|
||
respond_to do |format| | ||
format.html { redirect_to(tasks_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 |
---|---|---|
@@ -0,0 +1,2 @@ | ||
module ClockInsHelper | ||
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 ClockOutsHelper | ||
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 TasksHelper | ||
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 @@ | ||
class ClockIn < ActiveRecord::Base | ||
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 @@ | ||
class ClockOut < ActiveRecord::Base | ||
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 @@ | ||
class Task < ActiveRecord::Base | ||
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,25 @@ | ||
<%= form_for(@clock_in) do |f| %> | ||
<% if @clock_in.errors.any? %> | ||
<div id="error_explanation"> | ||
<h2><%= pluralize(@clock_in.errors.count, "error") %> prohibited this clock_in from being saved:</h2> | ||
|
||
<ul> | ||
<% @clock_in.errors.full_messages.each do |msg| %> | ||
<li><%= msg %></li> | ||
<% end %> | ||
</ul> | ||
</div> | ||
<% end %> | ||
|
||
<div class="field"> | ||
<%= f.label :in_time %><br /> | ||
<%= f.datetime_select :in_time %> | ||
</div> | ||
<div class="field"> | ||
<%= f.label :task_id %><br /> | ||
<%= f.text_field :task_id %> | ||
</div> | ||
<div class="actions"> | ||
<%= f.submit %> | ||
</div> | ||
<% 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,6 @@ | ||
<h1>Editing clock_in</h1> | ||
|
||
<%= render 'form' %> | ||
<%= link_to 'Show', @clock_in %> | | ||
<%= link_to 'Back', clock_ins_path %> |
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,25 @@ | ||
<h1>Listing clock_ins</h1> | ||
|
||
<table> | ||
<tr> | ||
<th>In time</th> | ||
<th>Task</th> | ||
<th></th> | ||
<th></th> | ||
<th></th> | ||
</tr> | ||
|
||
<% @clock_ins.each do |clock_in| %> | ||
<tr> | ||
<td><%= clock_in.in_time %></td> | ||
<td><%= clock_in.task_id %></td> | ||
<td><%= link_to 'Show', clock_in %></td> | ||
<td><%= link_to 'Edit', edit_clock_in_path(clock_in) %></td> | ||
<td><%= link_to 'Destroy', clock_in, :confirm => 'Are you sure?', :method => :delete %></td> | ||
</tr> | ||
<% end %> | ||
</table> | ||
|
||
<br /> | ||
|
||
<%= link_to 'New Clock in', new_clock_in_path %> |
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,5 @@ | ||
<h1>New clock_in</h1> | ||
|
||
<%= render 'form' %> | ||
<%= link_to 'Back', clock_ins_path %> |
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,15 @@ | ||
<p id="notice"><%= notice %></p> | ||
|
||
<p> | ||
<b>In time:</b> | ||
<%= @clock_in.in_time %> | ||
</p> | ||
|
||
<p> | ||
<b>Task:</b> | ||
<%= @clock_in.task_id %> | ||
</p> | ||
|
||
|
||
<%= link_to 'Edit', edit_clock_in_path(@clock_in) %> | | ||
<%= link_to 'Back', clock_ins_path %> |
Oops, something went wrong.