-
Notifications
You must be signed in to change notification settings - Fork 0
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 #62 from camsys/quarter1
Develop
- Loading branch information
Showing
123 changed files
with
5,662 additions
and
2,718 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,6 @@ | ||
language: ruby | ||
rvm: | ||
- 2.2.2 | ||
- 2.5.3 | ||
branches: | ||
only: | ||
- master | ||
|
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,2 @@ | ||
// Place all the behaviors and hooks related to the matching controller here. | ||
// All this logic will automatically be available in application.js. |
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 @@ | ||
/* | ||
Place all the styles related to the matching controller here. | ||
They will automatically be included in application.css. | ||
*/ |
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,76 @@ | ||
class GrantAmendmentsController < OrganizationAwareController | ||
add_breadcrumb "Home", :root_path | ||
add_breadcrumb "Grants", :grants_path | ||
|
||
before_action :set_grant | ||
|
||
before_action :set_grant_amendment, only: [:show, :edit, :update, :destroy] | ||
|
||
before_action :set_paper_trail_whodunnit | ||
|
||
# GET /grant_amendments | ||
def index | ||
@grant_amendments = @grant.grant_amendments | ||
end | ||
|
||
# GET /grant_amendments/1 | ||
def show | ||
end | ||
|
||
# GET /grant_amendments/new | ||
def new | ||
add_breadcrumb @grant.to_s, grant_path(@grant) | ||
add_breadcrumb "New Amendment" | ||
|
||
@grant_amendment = @grant.grant_amendments.build | ||
end | ||
|
||
# GET /grant_amendments/1/edit | ||
def edit | ||
add_breadcrumb @grant.to_s, grant_path(@grant) | ||
add_breadcrumb "Update Amendment" | ||
end | ||
|
||
# POST /grant_amendments | ||
def create | ||
@grant_amendment = @grant.grant_amendments.build(grant_amendment_params) | ||
@grant_amendment.creator = current_user | ||
|
||
if @grant_amendment.save | ||
redirect_to @grant, notice: 'Grant amendment was successfully created.' | ||
else | ||
render :new | ||
end | ||
end | ||
|
||
# PATCH/PUT /grant_amendments/1 | ||
def update | ||
if @grant_amendment.update(grant_amendment_params) | ||
|
||
redirect_to @grant, notice: 'Grant amendment was successfully updated.' | ||
else | ||
render :edit | ||
end | ||
end | ||
|
||
# DELETE /grant_amendments/1 | ||
def destroy | ||
@grant_amendment.destroy | ||
redirect_to @grant, notice: 'Grant amendment was successfully destroyed.' | ||
end | ||
|
||
private | ||
def set_grant | ||
@grant = Grant.find_by(object_key: params[:grant_id]) | ||
end | ||
|
||
# Use callbacks to share common setup or constraints between actions. | ||
def set_grant_amendment | ||
@grant_amendment = GrantAmendment.find_by(object_key: params[:id]) | ||
end | ||
|
||
# Only allow a trusted parameter "white list" through. | ||
def grant_amendment_params | ||
params.require(:grant_amendment).permit(GrantAmendment.allowable_params) | ||
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,74 @@ | ||
class GrantApportionmentsController < OrganizationAwareController | ||
|
||
before_action :set_grant | ||
before_action :set_grant_apportionment, only: [:show, :edit, :update, :destroy] | ||
|
||
# GET /grant_apportionments | ||
def index | ||
@grant_apportionments = @grant.grant_apportionments | ||
end | ||
|
||
# GET /grant_apportionments/1 | ||
def show | ||
end | ||
|
||
# GET /grant_apportionments/new | ||
def new | ||
@grant_apportionment = GrantApportionment.new | ||
end | ||
|
||
# GET /grant_apportionments/1/edit | ||
def edit | ||
end | ||
|
||
# POST /grant_apportionments | ||
def create | ||
@grant_apportionment.creator = current_user | ||
|
||
@grant_apportionment = GrantApportionment.new(grant_apportionment_params) | ||
|
||
if @grant_apportionment.save | ||
redirect_to @grant, notice: 'Grant apportionment was successfully created.' | ||
else | ||
render :new | ||
end | ||
end | ||
|
||
# PATCH/PUT /grant_apportionments/1 | ||
def update | ||
|
||
@grant_apportionment.updater = current_user | ||
|
||
respond_to do |format| | ||
if @grant_apportionment.update(grant_apportionment_params) | ||
notify_user(:notice, "Grant apportionment was successfully updated.") | ||
format.html { redirect_to @grant } | ||
format.json { head :no_content } | ||
else | ||
format.html { render action: 'edit' } | ||
format.json { render json: @grant.errors, status: :unprocessable_entity } | ||
end | ||
end | ||
end | ||
|
||
# DELETE /grant_apportionments/1 | ||
def destroy | ||
@grant_apportionment.destroy | ||
redirect_to @grant, notice: 'Grant apportionment was successfully destroyed.' | ||
end | ||
|
||
private | ||
def set_grant | ||
@grant = Grant.find_by(object_key: params[:grant_id]) | ||
end | ||
|
||
# Use callbacks to share common setup or constraints between actions. | ||
def set_grant_apportionment | ||
@grant_apportionment = GrantApportionment.find_by(object_key: params[:id]) | ||
end | ||
|
||
# Only allow a trusted parameter "white list" through. | ||
def grant_apportionment_params | ||
params.require(:grant_apportionment).permit(GrantApportionment.allowable_params) | ||
end | ||
end |
Oops, something went wrong.