-
Notifications
You must be signed in to change notification settings - Fork 24
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
Changes from all commits
Commits
Show all changes
66 commits
Select commit
Hold shift + click to select a range
8ccbb2f
build(deps): Upgrade yarn
cbaudouinjr 38a605c
build(deps): Upgrade gems
cbaudouinjr b19aa4f
build(deps): Remove obsolete gems
cbaudouinjr 87f4245
v0.0.0
cbaudouinjr 3543164
build(deps): Update semantic-release
cbaudouinjr dfc116f
feat(events): add upcoming events page
JeremyRudman f3e659d
feat(events): added page to make new events
JeremyRudman e3f9c4f
added gem.lock
JeremyRudman 6539671
Merge branch '2.0' into issue-226
JeremyRudman c7de97f
functionally complete calendar
JeremyRudman ca0248b
feat(events):page to view and make upcoming events
JeremyRudman fc7f106
Merge branch '2.0' into issue-226
cbaudouinjr 6706ee2
Merge branch '2.0' into issue-226
JeremyRudman 6cf5144
fix: corrected formating errors and removed all day option
JeremyRudman 1520b42
fix: removed left over allDay refernce
JeremyRudman 122c209
fix: corrected houndci format suggestion
JeremyRudman ac9e1db
Merge branch '2.0' into issue-226
JeremyRudman c6caf7a
feat(event): added owners as a list of admins only
JeremyRudman 826540f
Merge branch 'issue-226' of https://github.com/codeRIT/hackathon-mana…
JeremyRudman 3618cdd
Merge branch '2.0' into issue-226
cbaudouinjr a97075a
Merge branch '2.0' into issue-226
JeremyRudman 8b47528
fix(events): refactored to work with latest 2.0
JeremyRudman 8bb09bc
Merge pull request #398 from codeRIT/master
cbaudouinjr d395543
Fixed issue on desktop
peterkos b5ab15a
feat(event): removed unneeded form options
JeremyRudman 8ce39f1
Map overflow scroll
peterkos 425f403
Fix scroll issue
peterkos 85cad64
Fixed toggle button; fits screen, sidebar width
peterkos 57098dc
Merge pull request #399 from codeRIT/hm-380
cbaudouinjr 59bc706
fix: Allows optional assets to be unset
cbaudouinjr 0b0adbc
fix(events):added basic testing
JeremyRudman e0ebdc5
Merge branch '2.1' into issue-226
JeremyRudman 21e1c01
Fixes test
cbaudouinjr d6b8af3
fix(event): tweak test in attempt to get working
JeremyRudman b896471
fix(event): got testing to work
JeremyRudman 43cdc53
fix(event): fix hound errors and db password error
JeremyRudman 971906c
fix(event): fix houndci error i missed
JeremyRudman b6963e6
Merge pull request #406 from codeRIT/hm-405
cbaudouinjr f95f2ff
feat: Redesigns OAuth2 portal (#404)
cbaudouinjr 0fd6e91
Adds Redis dump files to .gitignore
cbaudouinjr 47f1eda
Merge branch '2.1' into issue-226
cbaudouinjr baac803
fix(event): fixed some of the pull request suggestions
JeremyRudman ac139a6
Shorten form :)
peterkos 889a046
fix(forms): change size of all forms without textbox
JeremyRudman 560f026
fix(event): implemented pull request changes
JeremyRudman e43618f
fix: Fixes MyMLH branding in config (#412)
cbaudouinjr 5591a92
feat(settings): Simplifies Config (#409)
cbaudouinjr 20f0a2d
feat: Adds support for digital-only hackathons (#395)
cbaudouinjr 3b23092
event(fix): renamed events to schedule and reverted forms
JeremyRudman 704432a
feat: Adds GitHub Action for releases (#426)
cbaudouinjr 6386ccc
feat: Adds GitHub Action CI testing (#423)
cbaudouinjr 383234f
Merge branch '2.1' into issue-226
cbaudouinjr 4e36b05
fix(event): schedule now shows end time
JeremyRudman 387333d
Merge branch 'issue-226' of https://github.com/codeRIT/hackathon-mana…
JeremyRudman 9bf3f45
fix(event): fix houndci complaints
JeremyRudman 6c37465
Merge branch '2.1.2' into issue-226
JeremyRudman 1844eae
Merge branch '2.2' into issue-226
peterkos bd88847
bundle install
peterkos a12dc7d
Merge branch '2.2' into issue-226
cbaudouinjr b57fc75
Merge branch '2.2' into issue-226
JeremyRudman 6abb189
fixed styling errors and added check for finish and start time
JeremyRudman f8c3141
Merge branch 'issue-226' of https://github.com/codeRIT/hackathon-mana…
JeremyRudman 690d60c
made finish time optional and made css fixes
JeremyRudman d61c80f
fix houndci complaint
JeremyRudman 8f90285
fix houndci complaint part 2
JeremyRudman 8b75e16
removed finish time requirement in test
JeremyRudman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,38 @@ | ||
function eventCalendar() { | ||
return $('#calendar').fullCalendar({ | ||
defaultView: 'listYear', | ||
buttonText: { | ||
today: 'Today' | ||
}, | ||
eventRender: function (event, element, view) { | ||
var description = event.description ? event.description : ''; | ||
var location = event.location ? event.location : ''; | ||
element.find('.fc-event-dot').css('display','none'); | ||
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>'); | ||
}, | ||
events: { | ||
url: '/manage/events.json', | ||
success: function(response) { | ||
// due to "end" being a keyword in ruby and what fullcalender uses it is stored as finish and than it is | ||
// converted to "end" when sending it to fullcalendar | ||
response = JSON.parse(JSON.stringify(response).split('"finish":').join('"end":')); | ||
return response; | ||
} | ||
}, | ||
eventClick: function (info) { | ||
window.location = 'events/' + info.id; | ||
}, | ||
height: 'auto', | ||
}); | ||
} | ||
|
||
function clearCalendar() { | ||
$('#calendar').fullCalendar('delete'); | ||
$('#calendar').html(''); | ||
} | ||
|
||
document.addEventListener('turbolinks:load', function () { | ||
eventCalendar(); | ||
}); | ||
document.addEventListener('turbolinks:before-cache', clearCalendar); | ||
This file contains hidden or 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 hidden or 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,9 @@ | ||
.fc-list-item | ||
cursor: pointer !important | ||
|
||
.event_start select:first-child, .event_finish select:first-child | ||
margin-left: 0 !important | ||
|
||
.event_start select:last-child, .event_finish select:last-child | ||
margin-right: 0 !important | ||
|
This file contains hidden or 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,54 @@ | ||
class Manage::EventsController < Manage::ApplicationController | ||
before_action :require_director | ||
respond_to :html, :json | ||
|
||
def index | ||
@start_date = HackathonConfig['event_start_date'] | ||
respond_to do |format| | ||
format.html | ||
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, :public, :start, :finish, owner: [] | ||
) | ||
end | ||
end |
This file contains hidden or 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,12 @@ | ||
class Event < ApplicationRecord | ||
validates_presence_of :title, :start | ||
|
||
JeremyRudman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
validate :finish_before_start | ||
|
||
def finish_before_start | ||
return if finish.nil? | ||
unless finish > start | ||
errors.add(:finish, 'time must be after start time') | ||
end | ||
end | ||
end |
This file contains hidden or 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 hidden or 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,11 +1,9 @@ | ||
.form-container | ||
= bs_horizontal_simple_form_for @data_export, url: url_for(action: @data_export.new_record? ? "create" : "update", controller: "data_exports") do |f| | ||
= f.error_notification | ||
|
||
.form-inputs | ||
= f.input :export_type, as: :select, collection: DataExport::POSSIBLE_TYPES.map { |x| [x.titleize, x] }, include_blank: false | ||
|
||
.form-actions.mb-3.mt-3 | ||
= f.button :submit, class: 'btn-primary' | ||
.form-inputs | ||
= f.input :export_type, as: :select, collection: DataExport::POSSIBLE_TYPES.map { |x| [x.titleize, x] }, include_blank: false | ||
.form-actions.mb-3.mt-3 | ||
= f.button :submit, class: 'btn-primary' | ||
|
||
.mb-4 |
This file contains hidden or 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,11 @@ | ||
= bs_horizontal_simple_form_for @event, url: url_for(action: @event.new_record? ? "create" : "update", controller: "events") do |f| | ||
= f.error_notification | ||
.form-inputs | ||
= f.input :title | ||
= f.input :description | ||
= f.input :location | ||
= f.input :start | ||
= f.input :finish, include_blank: true | ||
.center | ||
//TODO figure out why you need to add save and it doesn't work automatically like other forms | ||
= f.button :submit, 'Save', value: ( @event.new_record? ? 'Create' : 'Save' ), class: 'btn-primary' |
This file contains hidden or 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 @@ | ||
= render "layouts/manage/page_title", title: t(:title, scope: 'pages.manage.events') do | ||
JeremyRudman marked this conversation as resolved.
Show resolved
Hide resolved
|
||
= link_to "Add Event", new_manage_event_path, class: "btn btn-sm btn-outline-secondary" | ||
|
||
.calendar-list#calendar |
This file contains hidden or 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 @@ | ||
= render "layouts/manage/page_title", title: "New Event" | ||
|
||
.form-container | ||
= render "form" |
This file contains hidden or 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,6 @@ | ||
= render "layouts/manage/page_title", title: "Edit Event", subtitle: @event.title do | ||
.btn-group | ||
= link_to 'Cancel', manage_events_path, class: 'btn btn-sm btn-outline-secondary' | ||
= link_to 'Delete', manage_event_path(@event), method: :delete, data: { confirm: 'Are you sure? This action is irreversible.' }, class: 'btn btn-sm btn-outline-secondary' | ||
|
||
= render "form" |
This file contains hidden or 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 hidden or 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 hidden or 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,13 @@ | ||
class CreateEvents < ActiveRecord::Migration[5.2] | ||
def change | ||
create_table :events do |t| | ||
t.string :title | ||
t.string :description | ||
t.string :location | ||
t.datetime :start | ||
t.datetime :finish | ||
|
||
t.timestamps | ||
end | ||
end | ||
end |
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.