Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Carnival Creation #294

Open
wants to merge 44 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
df1af4f
creates CsvUpdater as Ruby Object with controller
Mar 27, 2019
708e214
implements carnival creation for Organizations
Mar 28, 2019
2bba99d
implements seeding for participants + memberships
Mar 29, 2019
75d67b6
adds tool upload func. and fixes other uploads
Mar 29, 2019
d091159
adds shift seeding
Mar 29, 2019
4b8a0c5
finishes mandatory seeding
Mar 29, 2019
f25f648
makes initial frontend changes
Mar 29, 2019
29902c8
clears cache after commiting db changes
Mar 29, 2019
584dedb
Changed creation and editing wizard pages
Mar 29, 2019
2e182cf
updates carnival_creation_controller_test
Mar 29, 2019
512715e
Merge branch 'carnival-creation' of https://github.com/sc0v/binder-ap…
Mar 29, 2019
72c564e
Added required tag to fields
Mar 29, 2019
b561853
Minor frontend change
Mar 29, 2019
9ccd812
Changed participants to just numbers on diff page
Mar 29, 2019
2d53e68
Added active filtering
Mar 29, 2019
a157e6c
moves csv_updater.rb to helpers
Mar 31, 2019
ebf5037
adds authorization to CarnivalCreationController
Mar 31, 2019
82db41a
comments carnival creation controller tests
Apr 2, 2019
a5aed40
implements task and certification seeding
Apr 2, 2019
65859a9
adds active filtering to search
Apr 2, 2019
05575eb
Fixed application controller
Apr 3, 2019
f38ebae
further active filtering
Apr 3, 2019
960d9ce
Revert "Revert "Dashboards (#293)""
Apr 17, 2019
b663487
removes materialize gem
Apr 17, 2019
f6340a3
nils out waiver signatures on carnival creation
Apr 19, 2019
b2ba102
redirects to root after carnival creation
Apr 19, 2019
15056e1
adds ability to upload additional csv's from Edit Carnival page
Apr 19, 2019
d1fc67c
Changing nav bar
Apr 21, 2019
5c95ce4
reactivates inactive tools upon scanning
Apr 26, 2019
7295c3d
removes active filtering for tools
Apr 26, 2019
58d1965
Merge branch 'active-filtering' into carnival-creation
Apr 26, 2019
d28edcc
adds confirmation popups to create/edit carnival actions
Apr 26, 2019
bfcf942
adds active status to show pages
Apr 26, 2019
b4958b4
adds active fields to all forms
Apr 26, 2019
6f35858
reverts 65859a9b
Apr 26, 2019
72df810
Navbar stuff done
Apr 26, 2019
af385ef
requires active certification for tool checkout
Apr 26, 2019
2ea9a8d
Shifts changes
Apr 26, 2019
2e0fca0
Waiver stuff
Apr 26, 2019
a606160
Made search bar wider
May 3, 2019
98d2ffe
Store cart widget changed
May 3, 2019
56fce17
Got rid of sorting in tasks bar
May 3, 2019
dce2648
Merge branch 'dashboards2' into carnival-creation
May 3, 2019
db795a7
resolves merge conflicts with navbar
May 3, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions app/assets/javascripts/carnival_creation.coffee
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Place all the behaviors and hooks related to the matching controller here.
# All this logic will automatically be available in application.js.
# You can use CoffeeScript in this file: http://coffeescript.org/
31 changes: 31 additions & 0 deletions app/assets/stylesheets/carnival_creation.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
// Place all the styles related to the CarnivalCreation controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/

.card {
margin: auto;
width: 70%;
border: 2px solid #eeeeee;
border-radius: 7px;
padding: 10px 10px 50px;
background-color: #eeeeee;
text-align: center;
}

input[type='file'] {
margin: auto 35%;
}

.table-success {
background-color: #b5e2b9;
}

.table-danger {
background-color: #edb8b4;
}

.required:after {
content:"*";
color: red;
}

41 changes: 41 additions & 0 deletions app/controllers/carnival_creation_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
class CarnivalCreationController < ApplicationController
def show_uploader
end

def show_diff
@organization_adds = Rails.cache.read('organization_insertions') | Rails.cache.read('organization_reactivations')
@participant_adds = Rails.cache.read('participant_insertions') | Rails.cache.read('participant_reactivations')
@membership_adds = Rails.cache.read('membership_insertions') | Rails.cache.read('membership_reactivations')
@tool_adds = Rails.cache.read('tool_insertions') | Rails.cache.read('tool_reactivations')
@shift_adds = Rails.cache.read('shift_insertions')

@organization_deactivations = Rails.cache.read('organization_deactivations')
@participant_deactivations = Rails.cache.read('participant_deactivations')
@membership_deactivations = Rails.cache.read('membership_deactivations')
@tool_deactivations = Rails.cache.read('tool_deactivations')
end

def upload_csvs
c = CsvUpdater.new()
c.add_from_csv(params[:organization_csv].tempfile, 'organization')
c.add_from_csv(params[:participant_csv].tempfile, 'participant')
c.add_from_csv(params[:participant_csv].tempfile, 'membership')
c.add_from_csv(params[:tool_csv].tempfile, 'tool')
c.add_from_csv(params[:shift_csv].tempfile, 'shift')
redirect_to :show_diff
end

def commit_changes
# TODO: dump current DB state
c = CsvUpdater.new()
c.run_mandatory_seeds()

# clear the cache, where all info about insertions/deletions was stored
Rails.cache.clear

redirect_to :show_end_index
end

def show_end_index
end
end
2 changes: 2 additions & 0 deletions app/helpers/carnival_creation_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
module CarnivalCreationHelper
end
Loading