Skip to content

feat: Adds event calendar support #259

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

Merged
merged 66 commits into from
Jan 23, 2021
Merged
Show file tree
Hide file tree
Changes from 14 commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
8ccbb2f
build(deps): Upgrade yarn
cbaudouinjr May 6, 2020
38a605c
build(deps): Upgrade gems
cbaudouinjr May 6, 2020
b19aa4f
build(deps): Remove obsolete gems
cbaudouinjr May 6, 2020
87f4245
v0.0.0
cbaudouinjr May 6, 2020
3543164
build(deps): Update semantic-release
cbaudouinjr May 6, 2020
dfc116f
feat(events): add upcoming events page
JeremyRudman May 24, 2020
f3e659d
feat(events): added page to make new events
JeremyRudman May 30, 2020
e3f9c4f
added gem.lock
JeremyRudman May 30, 2020
6539671
Merge branch '2.0' into issue-226
JeremyRudman May 30, 2020
c7de97f
functionally complete calendar
JeremyRudman Jun 6, 2020
ca0248b
feat(events):page to view and make upcoming events
JeremyRudman Jun 12, 2020
fc7f106
Merge branch '2.0' into issue-226
cbaudouinjr Jun 13, 2020
6706ee2
Merge branch '2.0' into issue-226
JeremyRudman Jul 3, 2020
6cf5144
fix: corrected formating errors and removed all day option
JeremyRudman Jul 4, 2020
1520b42
fix: removed left over allDay refernce
JeremyRudman Jul 4, 2020
122c209
fix: corrected houndci format suggestion
JeremyRudman Jul 4, 2020
ac9e1db
Merge branch '2.0' into issue-226
JeremyRudman Jul 18, 2020
c6caf7a
feat(event): added owners as a list of admins only
JeremyRudman Aug 8, 2020
826540f
Merge branch 'issue-226' of https://github.com/codeRIT/hackathon-mana…
JeremyRudman Aug 10, 2020
3618cdd
Merge branch '2.0' into issue-226
cbaudouinjr Aug 26, 2020
a97075a
Merge branch '2.0' into issue-226
JeremyRudman Sep 5, 2020
8b47528
fix(events): refactored to work with latest 2.0
JeremyRudman Sep 5, 2020
8bb09bc
Merge pull request #398 from codeRIT/master
cbaudouinjr Nov 9, 2020
d395543
Fixed issue on desktop
peterkos Nov 14, 2020
b5ab15a
feat(event): removed unneeded form options
JeremyRudman Nov 14, 2020
8ce39f1
Map overflow scroll
peterkos Nov 15, 2020
425f403
Fix scroll issue
peterkos Nov 15, 2020
85cad64
Fixed toggle button; fits screen, sidebar width
peterkos Nov 15, 2020
57098dc
Merge pull request #399 from codeRIT/hm-380
cbaudouinjr Nov 15, 2020
59bc706
fix: Allows optional assets to be unset
cbaudouinjr Nov 29, 2020
0b0adbc
fix(events):added basic testing
JeremyRudman Nov 29, 2020
e0ebdc5
Merge branch '2.1' into issue-226
JeremyRudman Nov 29, 2020
21e1c01
Fixes test
cbaudouinjr Nov 29, 2020
d6b8af3
fix(event): tweak test in attempt to get working
JeremyRudman Nov 29, 2020
b896471
fix(event): got testing to work
JeremyRudman Nov 29, 2020
43cdc53
fix(event): fix hound errors and db password error
JeremyRudman Nov 29, 2020
971906c
fix(event): fix houndci error i missed
JeremyRudman Nov 29, 2020
b6963e6
Merge pull request #406 from codeRIT/hm-405
cbaudouinjr Nov 29, 2020
f95f2ff
feat: Redesigns OAuth2 portal (#404)
cbaudouinjr Nov 29, 2020
0fd6e91
Adds Redis dump files to .gitignore
cbaudouinjr Nov 29, 2020
47f1eda
Merge branch '2.1' into issue-226
cbaudouinjr Nov 29, 2020
baac803
fix(event): fixed some of the pull request suggestions
JeremyRudman Nov 29, 2020
ac139a6
Shorten form :)
peterkos Nov 30, 2020
889a046
fix(forms): change size of all forms without textbox
JeremyRudman Nov 30, 2020
560f026
fix(event): implemented pull request changes
JeremyRudman Nov 30, 2020
e43618f
fix: Fixes MyMLH branding in config (#412)
cbaudouinjr Dec 1, 2020
5591a92
feat(settings): Simplifies Config (#409)
cbaudouinjr Dec 2, 2020
20f0a2d
feat: Adds support for digital-only hackathons (#395)
cbaudouinjr Dec 2, 2020
3b23092
event(fix): renamed events to schedule and reverted forms
JeremyRudman Dec 5, 2020
704432a
feat: Adds GitHub Action for releases (#426)
cbaudouinjr Dec 10, 2020
6386ccc
feat: Adds GitHub Action CI testing (#423)
cbaudouinjr Dec 10, 2020
383234f
Merge branch '2.1' into issue-226
cbaudouinjr Dec 10, 2020
4e36b05
fix(event): schedule now shows end time
JeremyRudman Dec 10, 2020
387333d
Merge branch 'issue-226' of https://github.com/codeRIT/hackathon-mana…
JeremyRudman Dec 10, 2020
9bf3f45
fix(event): fix houndci complaints
JeremyRudman Dec 10, 2020
6c37465
Merge branch '2.1.2' into issue-226
JeremyRudman Dec 17, 2020
1844eae
Merge branch '2.2' into issue-226
peterkos Jan 3, 2021
bd88847
bundle install
peterkos Jan 3, 2021
a12dc7d
Merge branch '2.2' into issue-226
cbaudouinjr Jan 3, 2021
b57fc75
Merge branch '2.2' into issue-226
JeremyRudman Jan 22, 2021
6abb189
fixed styling errors and added check for finish and start time
JeremyRudman Jan 23, 2021
f8c3141
Merge branch 'issue-226' of https://github.com/codeRIT/hackathon-mana…
JeremyRudman Jan 23, 2021
690d60c
made finish time optional and made css fixes
JeremyRudman Jan 23, 2021
d61c80f
fix houndci complaint
JeremyRudman Jan 23, 2021
8f90285
fix houndci complaint part 2
JeremyRudman Jan 23, 2021
8b75e16
removed finish time requirement in test
JeremyRudman Jan 23, 2021
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
4 changes: 3 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ gem 'jquery-ui-rails'
gem 'selectize-rails'
gem 'highcharts-rails', '~> 6.0'
gem 'bootstrap', '~> 4.3.1'
gem 'fullcalendar-rails'
gem 'momentjs-rails'

# Markdown parsing
gem 'redcarpet'
Expand Down Expand Up @@ -129,4 +131,4 @@ group :test do
end

# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
# gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]
25 changes: 18 additions & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ GEM
railties (>= 5.0.0)
faraday (1.0.1)
multipart-post (>= 1.2, < 3)
ffi (1.13.1)
ffi (1.13.1-x64-mingw32)
file_validators (2.3.0)
activemodel (>= 3.2)
mime-types (>= 1.0)
Expand All @@ -157,6 +157,10 @@ GEM
fugit (1.3.6)
et-orbi (~> 1.1, >= 1.1.8)
raabro (~> 1.3)
fullcalendar-rails (3.9.0.0)
jquery-rails (>= 4.0.5, < 5.0.0)
jquery-ui-rails (>= 5.0.2)
momentjs-rails (>= 2.9.0)
globalid (0.4.2)
activesupport (>= 4.2.0)
groupdate (5.0.0)
Expand Down Expand Up @@ -232,15 +236,17 @@ GEM
builder
minitest (>= 5.0)
ruby-progressbar
msgpack (1.3.3)
momentjs-rails (2.20.1)
railties (>= 3.1)
msgpack (1.3.3-x64-mingw32)
multi_json (1.14.1)
multi_xml (0.6.0)
multipart-post (2.1.1)
mustache (1.1.1)
mysql2 (0.5.3)
mysql2 (0.5.3-x64-mingw32)
nenv (0.3.0)
nio4r (2.5.2)
nokogiri (1.10.9)
nokogiri (1.10.9-x64-mingw32)
mini_portile2 (~> 2.4.0)
notiffany (0.1.3)
nenv (~> 0.1)
Expand Down Expand Up @@ -341,7 +347,7 @@ GEM
errbase (>= 0.1.1)
sass-rails (6.0.0)
sassc-rails (~> 2.1, >= 2.1.1)
sassc (2.4.0)
sassc (2.4.0-x64-mingw32)
ffi (~> 1.9)
sassc-rails (2.1.2)
railties (>= 4.0.0)
Expand Down Expand Up @@ -406,6 +412,8 @@ GEM
turbolinks-source (5.2.0)
tzinfo (1.2.7)
thread_safe (~> 0.1)
tzinfo-data (1.2020.1)
tzinfo (>= 1.0.0)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
valid_attribute (2.0.0)
Expand All @@ -431,7 +439,7 @@ GEM
zeitwerk (2.3.0)

PLATFORMS
ruby
x64-mingw32

DEPENDENCIES
ajax-datatables-rails (~> 1.0)
Expand All @@ -454,6 +462,7 @@ DEPENDENCIES
factory_bot_rails
file_validators
font-awesome-rails (~> 4.0)
fullcalendar-rails
groupdate
guard
guard-minitest
Expand All @@ -464,6 +473,7 @@ DEPENDENCIES
jquery-ui-rails
listen (>= 3.0.5, < 3.2)
minitest-reporters
momentjs-rails
mustache (~> 1.0)
mysql2 (>= 0.4.4, < 0.6.0)
omniauth-mlh (~> 0.1)
Expand Down Expand Up @@ -496,14 +506,15 @@ DEPENDENCIES
test-unit (~> 3.0)
timecop
turbolinks (~> 5)
tzinfo-data
uglifier (>= 1.3.0)
valid_attribute
validate_url
web-console (>= 3.3.0)
webmock (~> 3.4)

RUBY VERSION
ruby 2.6.1p33
ruby 2.6.6p146

BUNDLED WITH
1.17.2
3 changes: 3 additions & 0 deletions app/assets/javascripts/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@
//= require_directory .
//= require_directory ./channels
//= require ./vendor/simplemde.min.js
//= require moment
//= require fullcalendar
//= require fullcalendar/locale-all
37 changes: 37 additions & 0 deletions app/assets/javascripts/events.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
function eventCalendar() {
return $('#calendar').fullCalendar({
defaultView: 'listYear',
eventRender: function (event, element, view) {
if (event.public) {
element.find('.fc-event-dot').css('background-color', 'red');
}
var publicText = "";
if (event.public)
publicText = "Public";
var description = event.description ? event.description : "";
var location = event.location ? event.location : "";
element.find('.fc-list-item-title').append('<div style="float: right"><span style="color: red">' + publicText + '</span></div>');
element.find('.fc-list-item-title').append('<div></div><span style="font-size: 12px">' + description + '</span>');
element.find('.fc-list-item-title').append('<div></div><span style="font-size: 12px">' + location + '</span>');
element.find('.fc-list-item-title').append('<div></div><span style="font-size: 12px">' + event.owner + '</span>');
},
events: '/manage/events.json',
eventClick: function (info) {
window.location = "events/" + info.id;
},
eventData: {
Color: 'red'
},
height: "auto",
});
}

function clearCalendar() {
$('#calendar').fullCalendar('delete');
$('#calendar').html('');
}

document.addEventListener('turbolinks:load', function () {
eventCalendar();
});
document.addEventListener('turbolinks:before-cache', clearCalendar);
7 changes: 7 additions & 0 deletions app/assets/stylesheets/manage.sass
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ $grey-med: #999
@import vendor/datatables.min
@import selectize
@import selectize.default
@import fullcalendar

.icon-space-r
margin-right: 0.5em
Expand Down Expand Up @@ -172,6 +173,12 @@ $grey-med: #999
.sidebar-mobile .sidebar-sticky
height: auto

.calendar-list
width: 70%
min-width: 500px
margin: auto


/*
* Datatable changes
*/
Expand Down
52 changes: 52 additions & 0 deletions app/controllers/manage/events_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
class Manage::EventsController < Manage::ApplicationController
respond_to :html, :json

def index
respond_to do |format|
format.html # index.html.erb
format.json { render json: Event.all }
end
end

def new
@event = ::Event.new
end

def create
@event = ::Event.new(event_params)
if @event.save
redirect_to(manage_events_path)
else
render('new')
end
end

def show
@event = Event.find_by_id(params[:id])
respond_with(:manage, @event)
end

def update
@event = Event.find_by_id(params[:id])
if @event.update(event_params)
redirect_to(manage_events_path)
else
render('show')
end
end

def destroy
@event = Event.find_by_id(params[:id])
if @event.destroy
redirect_to(manage_events_path)
else
render('show')
end
end

def event_params
params.require(:event).permit(
:title, :description, :location, :owner, :public, :start, :end,
)
end
end
3 changes: 3 additions & 0 deletions app/models/event.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class Event < ApplicationRecord
validates_presence_of :title, :owner, :start, :end
end
4 changes: 4 additions & 0 deletions app/views/layouts/manage/application.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@
= active_link_to manage_checkins_path, class: "nav-link" do
.fa.fa-drivers-license-o.fa-fw.icon-space-r-half
Check-in
%li.nav-item
= active_link_to manage_events_path, class: "nav-link" do
.fa.fa-calendar.fa-fw.icon-space-r-half
Events
- if current_user.admin?
%li.nav-item
= active_link_to manage_users_path, class: "nav-link" do
Expand Down
11 changes: 11 additions & 0 deletions app/views/manage/events/_form.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
= bs_horizontal_simple_form_for @event, url: url_for(action: @event.new_record? ? "create" : "update", controller: "events") do |f|
.form-inputs
= f.input :title
= f.input :description
= f.input :location
= f.input :owner, input_html: {value: @event.new_record? ? current_user.full_name: @event.owner }, required: true
= f.input :public
= f.input :start, minute_step: 5
= f.input :end, minute_step: 5
.center
= f.button :submit, value: ( @event.new_record? ? 'Create' : 'Save' ), class: 'btn-primary'
4 changes: 4 additions & 0 deletions app/views/manage/events/index.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
= render "layouts/manage/page_title", title: "Events" do
= link_to "Add Event", new_manage_event_path, class: "btn btn-sm btn-outline-secondary"

.calendar-list#calendar
6 changes: 6 additions & 0 deletions app/views/manage/events/new.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
= render "layouts/manage/page_title", title: "New Event"

.form-container
= render "form"
.center
= link_to 'Back', manage_events_path
7 changes: 7 additions & 0 deletions app/views/manage/events/show.html.haml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
= render "layouts/manage/page_title", title: "Edit Event"

= render "form"
.center
= link_to 'Delete', manage_event_path(@event), method: :delete, class: 'btn btn-danger' , data: { confirm: 'Are you sure? This action is irreversible.' }
.center
= link_to 'Back', manage_events_path
6 changes: 6 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,12 @@
resources :checkins do
post :datatable, on: :collection
end
resources :events do
# get :events, on: :collection
end
resources :admins do
post :datatable, on: :collection
end
resources :users do
post :user_datatable, on: :collection
post :admin_datatable, on: :collection
Expand Down
14 changes: 14 additions & 0 deletions db/migrate/20200529142141_create_events.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
class CreateEvents < ActiveRecord::Migration[5.2]
def change
create_table :events do |t|
t.string :title
t.string :description
t.string :owner
t.boolean :allDay
t.datetime :start
t.datetime :end

t.timestamps
end
end
end
5 changes: 5 additions & 0 deletions db/migrate/20200610004703_add_location_to_events.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddLocationToEvents < ActiveRecord::Migration[5.2]
def change
add_column :events, :location, :string
end
end
5 changes: 5 additions & 0 deletions db/migrate/20200703205939_add_public_to_events.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddPublicToEvents < ActiveRecord::Migration[5.2]
def change
add_column :events, :public, :boolean
end
end
5 changes: 5 additions & 0 deletions db/migrate/20200703220138_remove_all_day_from_events.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class RemoveAllDayFromEvents < ActiveRecord::Migration[5.2]
def change
remove_column :events, :allDay, :boolean
end
end
14 changes: 13 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2020_02_05_160318) do
ActiveRecord::Schema.define(version: 2020_07_03_220138) do

create_table "active_storage_attachments", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
t.string "name", null: false
Expand Down Expand Up @@ -119,6 +119,18 @@
t.datetime "updated_at", null: false
end

create_table "events", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
t.string "title"
t.string "description"
t.string "owner"
t.datetime "start"
t.datetime "end"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.string "location"
t.boolean "public"
end

create_table "fips", id: :integer, options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t|
t.string "fips_code"
t.string "city"
Expand Down
17 changes: 17 additions & 0 deletions test/fixtures/events.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html

one:
title: MyString
description: MyString
owner: MyString
allDay: false
start: 2020-05-29 10:21:41
end: 2020-05-29 10:21:41

two:
title: MyString
description: MyString
owner: MyString
allDay: false
start: 2020-05-29 10:21:41
end: 2020-05-29 10:21:41
8 changes: 8 additions & 0 deletions test/models/event_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require 'test_helper'

class EventTest < ActiveSupport::TestCase
should validate_presence_of :title
should validate_presence_of :owner
should validate_presence_of :start
should validate_presence_of :end
end
Binary file removed vendor/cache/aws-partitions-1.317.0.gem
Binary file not shown.
Binary file removed vendor/cache/aws-sdk-core-3.96.1.gem
Binary file not shown.
Binary file removed vendor/cache/aws-sdk-kms-1.31.0.gem
Binary file not shown.
Binary file removed vendor/cache/aws-sdk-s3-1.65.0.gem
Binary file not shown.
Binary file removed vendor/cache/capybara-3.32.2.gem
Binary file not shown.
Binary file added vendor/cache/ffi-1.13.1-x64-mingw32.gem
Binary file not shown.
Binary file removed vendor/cache/fugit-1.3.5.gem
Binary file not shown.
Binary file added vendor/cache/fullcalendar-rails-3.9.0.0.gem
Binary file not shown.
Binary file added vendor/cache/momentjs-rails-2.20.1.gem
Binary file not shown.
Binary file added vendor/cache/msgpack-1.3.3-x64-mingw32.gem
Binary file not shown.
Binary file added vendor/cache/mysql2-0.5.3-x64-mingw32.gem
Binary file not shown.
Binary file added vendor/cache/nokogiri-1.10.9-x64-mingw32.gem
Binary file not shown.
Binary file removed vendor/cache/redis-4.1.4.gem
Binary file not shown.
Binary file added vendor/cache/sassc-2.4.0-x64-mingw32.gem
Binary file not shown.
Binary file added vendor/cache/tzinfo-data-1.2020.1.gem
Binary file not shown.