Skip to content
This repository has been archived by the owner on Jul 24, 2020. It is now read-only.

[1498] Replace availability calendar with FullCalendar [v5.5] #1505

Merged
merged 1 commit into from
Mar 1, 2016

Conversation

orenyk
Copy link
Contributor

@orenyk orenyk commented Feb 16, 2016

Resolves #1498 on release-v5.5

  • install FullCalendar v2.3.1 (blocked on Rails 4.1)
  • generate event hash in controller
  • generate event array in JS for speed
  • remove old JS calendar

This is a bit hack-y and probably could be better, looking forward to some good code review 😛. I'll work on a much cleaner version of this for master once we've merged in #1360.

@esoterik
Copy link
Collaborator

the days in the past should be greyed out

@esoterik
Copy link
Collaborator

Suggestion: color the box yellow when only one item is available for that day

@@ -184,4 +191,43 @@ def fix_content_type(filedata)
def type_from_file_command(file)
Paperclip::FileCommandContentTypeDetector.new(file).detect
end

def calculate_availability # rubocop:disable all
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use existing model methods for this? seems pretty similar

@esoterik
Copy link
Collaborator

disregard my inline comments!

@orenyk
Copy link
Contributor Author

orenyk commented Feb 23, 2016

Dammit I forgot to add / commit the JSON builder file for this branch and just deleted it locally. @esoterik did you actually test this locally? ignore me, I realized that I took out the JSON functionality, sorry! You should have caught the no-longer-relevant controller method and new route, though 😛.

@orenyk
Copy link
Contributor Author

orenyk commented Feb 23, 2016

Ok, I cleaned up a bit and made sure that past days would be colored grey. In terms of yellow coloring when there's only one, I implemented it but I'm not sure it makes sense given that if there's only one item to begin with then it's not really "low", just normal (it colors the cell yellow if there are less than 1/4 of the items available, which isn't great but is something). See what you think and I'll consider ways to make the coloring better.

@orenyk
Copy link
Contributor Author

orenyk commented Feb 23, 2016

Never mind, made the colors better 😄, you'll have to check it out on equipment with 3 or more items to see the range.

Resolves #1498
- install FullCalendar v2.3.1 (blocked on Rails 4.1)
- generate event hash in controller
- generate event array in JS for speed
- remove old JS calendar
@esoterik
Copy link
Collaborator

okay, this looks good!

@orenyk
Copy link
Contributor Author

orenyk commented Mar 1, 2016

Also reviewed by @AlanLiu96, merging!

orenyk added a commit that referenced this pull request Mar 1, 2016
[1498] Replace availability calendar with FullCalendar
@orenyk orenyk merged commit 71e1b2c into release-v5.5 Mar 1, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants