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
redesign, refactor, rebuild
- Loading branch information
1 parent
de65856
commit a6ff04a
Showing
34 changed files
with
434 additions
and
263 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 |
---|---|---|
|
@@ -4,4 +4,4 @@ | |
|
||
@import "rails_bootstrap_forms.css"; | ||
|
||
@import "income"; | ||
@import "mybudget"; |
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,80 +0,0 @@ | ||
.application { | ||
background-color: #D6EAFF; | ||
padding-top: 15px; | ||
h1 { | ||
font-size: 60px; | ||
font-weight: bolder; | ||
font-family: monospace; | ||
color: black; | ||
} | ||
} | ||
|
||
.navbar-default { | ||
margin-bottom: 0px; | ||
background-color: #D6EAFF; | ||
border: none; | ||
.dropdown-toggle { | ||
padding: inherit; | ||
padding-top: 20px; | ||
padding-right: 20px; | ||
} | ||
|
||
} | ||
|
||
.col-md-12 { | ||
padding-left: 80px; | ||
padding-right: 80px; | ||
} | ||
|
||
.col-md-8 { | ||
margin: 15px; | ||
} | ||
|
||
.bordered-form { | ||
margin-left: 50; | ||
padding: 20px; | ||
padding-left: 40px; | ||
padding-right: 40px; | ||
background-color: #ADD6FF; | ||
border-radius: 15px; | ||
width: 750px; | ||
|
||
.field-name { | ||
padding-left: 40px; | ||
} | ||
|
||
.field { | ||
padding: 10px; | ||
padding-left: 250px; | ||
|
||
#income_other_income { | ||
text-align: right; | ||
} | ||
#income_wages { | ||
text-align: right; | ||
} | ||
} | ||
|
||
.total-output { | ||
text-align: right; | ||
padding-right: 20px; | ||
font-style: bold; | ||
font-size: 40px | ||
} | ||
|
||
.actions { | ||
padding-left: 472px; | ||
font-size: 18px; | ||
} | ||
|
||
h1 { | ||
font-size: 40px; | ||
font-weight: inherit; | ||
border-bottom: solid black 1px; | ||
} | ||
} | ||
|
||
#total-field-name { | ||
font-size: 25px; | ||
color: #1F3D99; | ||
} | ||
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,99 @@ | ||
// Place all the styles related to the mybudget controller here. | ||
// They will automatically be included in application.css. | ||
// You can use Sass (SCSS) here: http://sass-lang.com/ | ||
.application { | ||
background-color: #D6EAFF; | ||
padding-top: 15px; | ||
h1 { | ||
font-size: 60px; | ||
font-weight: bolder; | ||
font-family: monospace; | ||
color: black; | ||
} | ||
|
||
.summary-row { | ||
margin-left: 50px; | ||
margin-top: 20px; | ||
margin-bottom: 20px; | ||
|
||
.total-field { | ||
text-align: right; | ||
margin-right: 20px; | ||
padding-left: 200px; | ||
font-style: bold; | ||
font-size: 40px | ||
} | ||
|
||
#total-field-name { | ||
font-size: 25px; | ||
color: #1F3D99; | ||
} | ||
} | ||
} | ||
|
||
.navbar-default { | ||
margin-bottom: 0px; | ||
background-color: #D6EAFF; | ||
border: none; | ||
.dropdown-toggle { | ||
padding: inherit; | ||
padding-top: 20px; | ||
padding-right: 20px; | ||
} | ||
|
||
} | ||
|
||
.col-md-12 { | ||
padding-left: 80px; | ||
padding-right: 80px; | ||
} | ||
|
||
.col-md-8 { | ||
margin: 15px; | ||
} | ||
|
||
.bordered-form { | ||
margin-left: 50px; | ||
margin-top: 20px; | ||
margin-bottom: 20px; | ||
padding: 20px; | ||
padding-left: 40px; | ||
padding-right: 40px; | ||
background-color: #ADD6FF; | ||
border-radius: 15px; | ||
width: 750px; | ||
|
||
.field-name { | ||
padding-left: 40px; | ||
} | ||
|
||
.table { | ||
padding: 10px; | ||
padding-left: 250px; | ||
} | ||
|
||
.amount { | ||
text-align: right; | ||
} | ||
|
||
.table-items { | ||
text-align: right; | ||
} | ||
|
||
.total-output { | ||
text-align: right; | ||
padding-right: 20px; | ||
font-style: bold; | ||
font-size: 40px | ||
} | ||
|
||
.actions { | ||
padding-left: 472px; | ||
font-size: 18px; | ||
} | ||
|
||
h2 { | ||
font-size: 40px; | ||
font-weight: inherit; | ||
border-bottom: solid black 1px; | ||
text-align: left; | ||
} | ||
|
||
} |
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 was deleted.
Oops, something went wrong.
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,51 @@ | ||
class MybudgetsController < ApplicationController | ||
before_action :set_mybudget, only: [:show, :edit, :update, :destroy] | ||
|
||
def index | ||
@mybudget = Mybudget.all | ||
end | ||
|
||
def new | ||
@mybudget = Mybudget.new | ||
end | ||
|
||
def show | ||
end | ||
|
||
def edit | ||
end | ||
|
||
def create | ||
@mybudget = Mybudget.new(mybudget_params) | ||
|
||
respond_to do |format| | ||
if @mybudget.save | ||
format.html { redirect_to mybudget_path(@mybudget), notice: 'mybudget was successfully created.' } | ||
format.json { render :show, status: :created, location: @mybudget } | ||
else | ||
format.html { render :new } | ||
format.json { render json: @mybudget.errors, status: :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
def update | ||
end | ||
|
||
def destroy | ||
@mybudget.destroy | ||
respond_to do |format| | ||
format.html { redirect_to mybudgets_home_path(@mybudget), notice: 'mybudget was successfully destroyed.' } | ||
format.json { head :no_content } | ||
end | ||
end | ||
|
||
private | ||
def set_mybudget | ||
@mybudget = Mybudget.find(params[:id]) | ||
end | ||
|
||
def mybudget_params | ||
params.require(:mybudget).permit(:name, :open_bal) | ||
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,5 +1,3 @@ | ||
class Expense < ActiveRecord::Base | ||
def total_expense | ||
outgoing.to_d + oneoff.to_d | ||
end | ||
belongs_to :mybudget | ||
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,7 +1,3 @@ | ||
class Income < ActiveRecord::Base | ||
belongs_to :mybudget | ||
|
||
def total_income | ||
wages.to_d + other_income.to_d | ||
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,4 @@ | ||
class Mybudget < ActiveRecord::Base | ||
has_many :incomes | ||
has_many :expenses | ||
end |
Oops, something went wrong.