Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

Commit

Permalink
Merge pull request #246 from TechforgoodCAST/dev
Browse files Browse the repository at this point in the history
v0.3.18
  • Loading branch information
jdudley1123 authored Mar 19, 2020
2 parents 64babea + 1a0c6fe commit d5f1467
Show file tree
Hide file tree
Showing 71 changed files with 2,633 additions and 1,014 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]

# TODO: review dependencies

gem 'activeadmin', '~> 2.6.1'
gem 'ahoy_email', '~> 1.1.0'
gem 'ahoy_matey', '~> 3.0.0'
gem 'audited', '~> 4.7'
Expand Down
41 changes: 40 additions & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,17 @@ GEM
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3)
activeadmin (2.6.1)
arbre (~> 1.2, >= 1.2.1)
formtastic (~> 3.1)
formtastic_i18n (~> 0.4)
inherited_resources (~> 1.7)
jquery-rails (~> 4.2)
kaminari (~> 1.0, >= 1.0.1)
railties (>= 5.2, < 6.1)
ransack (~> 2.1, >= 2.1.1)
sassc-rails (~> 2.1)
sprockets (>= 3.0, < 4.1)
activejob (5.2.2.1)
activesupport (= 5.2.2.1)
globalid (>= 0.3.6)
Expand Down Expand Up @@ -62,6 +73,8 @@ GEM
device_detector
geocoder (>= 1.4.5)
safely_block (>= 0.2.1)
arbre (1.2.1)
activesupport (>= 3.0.0)
arel (9.0.0)
ast (2.4.0)
audited (4.9.0)
Expand Down Expand Up @@ -100,13 +113,25 @@ GEM
factory_bot (~> 4.11.1)
railties (>= 3.0.0)
ffi (1.12.2)
ffi (1.12.2-x64-mingw32)
formtastic (3.1.5)
actionpack (>= 3.2.13)
formtastic_i18n (0.6.0)
friendly_id (5.2.5)
activerecord (>= 4.0.0)
geocoder (1.6.1)
globalid (0.4.2)
activesupport (>= 4.2.0)
has_scope (0.7.2)
actionpack (>= 4.1)
activesupport (>= 4.1)
i18n (1.8.2)
concurrent-ruby (~> 1.0)
inherited_resources (1.11.0)
actionpack (>= 5.0, < 6.1)
has_scope (~> 0.6)
railties (>= 5.0, < 6.1)
responders (>= 2, < 4)
jaro_winkler (1.5.4)
jbuilder (2.10.0)
activesupport (>= 5.0.0)
Expand Down Expand Up @@ -143,17 +168,23 @@ GEM
mini_portile2 (2.4.0)
minitest (5.14.0)
msgpack (1.3.3)
msgpack (1.3.3-x64-mingw32)
multi_json (1.14.1)
nio4r (2.5.2)
nokogiri (1.10.9)
mini_portile2 (~> 2.4.0)
nokogiri (1.10.9-x64-mingw32)
mini_portile2 (~> 2.4.0)
orm_adapter (0.5.0)
parallel (1.19.1)
parser (2.7.0.4)
ast (~> 2.4.0)
pg (1.2.2)
pg (1.2.2-x64-mingw32)
polyamorous (2.3.2)
activerecord (>= 5.2.1)
psych (3.1.0)
public_suffix (4.0.1)
psych (3.1.0-x64-mingw32)
public_suffix (4.0.3)
puma (3.12.4)
pundit (2.0.1)
Expand Down Expand Up @@ -189,6 +220,11 @@ GEM
thor (>= 0.19.0, < 2.0)
rainbow (3.0.0)
rake (13.0.1)
ransack (2.3.2)
activerecord (>= 5.2.1)
activesupport (>= 5.2.1)
i18n
polyamorous (= 2.3.2)
rb-fsevent (0.10.3)
rb-inotify (0.10.1)
ffi (~> 1.0)
Expand All @@ -213,6 +249,8 @@ GEM
errbase (>= 0.1.1)
sassc (2.2.1)
ffi (~> 1.9)
sassc (2.2.1-x64-mingw32)
ffi (~> 1.9)
sassc-rails (2.1.2)
railties (>= 4.0.0)
sassc (>= 2.0)
Expand Down Expand Up @@ -275,6 +313,7 @@ PLATFORMS
x64-mingw32

DEPENDENCIES
activeadmin (~> 2.6.1)
ahoy_email (~> 1.1.0)
ahoy_matey (~> 3.0.0)
audited (~> 4.7)
Expand Down
29 changes: 29 additions & 0 deletions app/admin/admin_users.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# frozen_string_literal: true

ActiveAdmin.register AdminUser do
permit_params :email, :password, :password_confirmation

index do
selectable_column
id_column
column :email
column :current_sign_in_at
column :sign_in_count
column :created_at
actions
end

filter :email
filter :current_sign_in_at
filter :sign_in_count
filter :created_at

form do |f|
f.inputs do
f.input :email
f.input :password
f.input :password_confirmation
end
f.actions
end
end
30 changes: 30 additions & 0 deletions app/admin/cohorts.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# frozen_string_literal: true

ActiveAdmin.register Cohort do
permit_params :name, :description, project_ids: []

index do
selectable_column
column :name
column :description
column :projects
column :created_at
column :updated_at
actions
end

filter :name
filter :description
filter :projects
filter :created_at
filter :updated_at

form do |f|
f.inputs do
f.input :name
f.input :description
f.input :projects
end
f.actions
end
end
34 changes: 34 additions & 0 deletions app/admin/dashboard.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# frozen_string_literal: true

ActiveAdmin.register_page 'Dashboard' do
menu priority: 1, label: proc { I18n.t('active_admin.dashboard') }

content title: proc { I18n.t('active_admin.dashboard') } do
div class: 'blank_slate_container', id: 'dashboard_default_message' do
span class: 'blank_slate' do
span I18n.t('active_admin.dashboard_welcome.welcome')
small I18n.t('active_admin.dashboard_welcome.call_to_action')
end
end

# Here is an example of a simple dashboard with columns and panels.
#
# columns do
# column do
# panel 'Recent Posts' do
# ul do
# Post.recent(5).map do |post|
# li link_to(post.title, admin_post_path(post))
# end
# end
# end
# end

# column do
# panel 'Info' do
# para 'Welcome to ActiveAdmin.'
# end
# end
# end
end
end
41 changes: 41 additions & 0 deletions app/admin/offers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# frozen_string_literal: true

ActiveAdmin.register Offer do
permit_params :provider_id, :title, :short_description, :long_description,
:sign_up_link, :logo_link, :duration_category, :provider_email,
:duration_description, cohort_ids: [], topic_ids: []

index do
selectable_column
column :provider
column :title
column :cohorts
column :topics
column :updated_at
actions
end

filter :provider
filter :title
filter :cohorts
filter :topics
filter :created_at
filter :updated_at

form do |f|
f.inputs do
f.input :cohorts
f.input :topics
f.input :provider
f.input :provider_email
f.input :title
f.input :duration_category
f.input :duration_description
f.input :sign_up_link
f.input :logo_link
f.input :short_description, as: :trix_editor
f.input :long_description, as: :trix_editor
end
f.actions
end
end
27 changes: 27 additions & 0 deletions app/admin/providers.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# frozen_string_literal: true

ActiveAdmin.register Provider do
permit_params :name, :website

index do
selectable_column
column :name
column :website
column :created_at
column :updated_at
actions
end

filter :name
filter :website
filter :created_at
filter :updated_at

form do |f|
f.inputs do
f.input :name
f.input :website
end
f.actions
end
end
30 changes: 30 additions & 0 deletions app/admin/topics.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# frozen_string_literal: true

ActiveAdmin.register Topic do
permit_params :title, :short_desc, :long_desc

index do
selectable_column
column :title
column :short_desc
column :long_desc
column :created_at
column :updated_at
actions
end

filter :title
filter :short_desc
filter :long_desc
filter :created_at
filter :updated_at

form do |f|
f.inputs do
f.input :title
f.input :short_desc
f.input :long_desc
end
f.actions
end
end
2 changes: 2 additions & 0 deletions app/assets/javascripts/active_admin.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
//= require active_admin/base
//= require trix
2 changes: 2 additions & 0 deletions app/assets/javascripts/support_requests.js
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.
18 changes: 18 additions & 0 deletions app/assets/stylesheets/active_admin.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
// SASS variable overrides must be declared before loading up Active Admin's styles.
//
// To view the variables that Active Admin provides, take a look at
// `app/assets/stylesheets/active_admin/mixins/_variables.scss` in the
// Active Admin source.
//
// For example, to change the sidebar width:
// $sidebar-width: 242px;

// Active Admin's got SASS!
@import "active_admin/mixins";
@import "active_admin/base";
@import "trix";

// Overriding any non-variable SASS must be done after the fact.
// For example, to change the default status-tag color:
//
// .status_tag { background: #6090DB; }
3 changes: 3 additions & 0 deletions app/assets/stylesheets/support_requests.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// Place all the styles related to the SupportRequests controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: https://sass-lang.com/
6 changes: 3 additions & 3 deletions app/controllers/iterations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ def create
end

def show
@iteration = authorize @project.iterations.find_by(id: params[:id])
@iteration = authorize @project.iterations.find(params[:id])
end

def edit
@iteration = authorize @project.iterations.find_by(id: params[:id])
@iteration = authorize @project.iterations.find(params[:id])
end

def update
@iteration = authorize @project.iterations.find_by(id: params[:id])
@iteration = authorize @project.iterations.find(params[:id])

if @iteration.update(iteration_params)
redirect_to project_iteration_url(@project, @iteration), notice: msg(@iteration.draftable?)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/memberships_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def create
end

def destroy
@membership = Membership.find_by(id: params[:id])
@membership = Membership.find(params[:id])
notice = "#{@membership.role.titleize} removed"
removing_current_user = @membership.user == current_user
@membership.destroy
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/milestones_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class MilestonesController < ApplicationController
before_action :authenticate_user!, :load_project

def show
@milestone = authorize @project.milestones.find_by(id: params[:id])
@milestone = authorize @project.milestones.find(params[:id])
end

def new
Expand All @@ -23,11 +23,11 @@ def create
end

def edit
@milestone = authorize @project.milestones.find_by(id: params[:id])
@milestone = authorize @project.milestones.find(params[:id])
end

def update
@milestone = authorize @project.milestones.find_by(id: params[:id])
@milestone = authorize @project.milestones.find(params[:id])

if @milestone.update(milestone_params)
update_milestone_statues!(@project)
Expand Down
Loading

0 comments on commit d5f1467

Please sign in to comment.