Giter Site home page Giter Site logo

chtjonas / roombooking Goto Github PK

View Code? Open in Web Editor NEW
12.0 2.0 4.0 7.98 MB

The ADC Theatre's room booking system

Home Page: https://roombooking.adctheatre.com

License: GNU General Public License v3.0

Ruby 72.51% JavaScript 4.10% CSS 0.34% HTML 18.27% Dockerfile 0.29% SCSS 1.88% Haml 2.60%
ruby ruby-on-rails room-booking adc-theatre cambridge-university

roombooking's Introduction

ADC Room Booking System

Ruby Version Rails Version Build Status Test Coverage

This repository hosts the code for the ADC Theatre's new Room Booking System. The site runs as a Ruby on Rails application with background job processing handled by Sidekiq. Postgres is used as the backend database of choice and Redis to store in-memory data.

Installation

There are two officially supported methods of installation:

  1. Docker is the preferred choice for those running Windows, or for people who want to get hands on and coding as soon as possible.
  2. A native installation is more useful for developing advanced features, testing & instrumenting or for those that have trouble with the Docker process. It does, however, require you to be running a UNIX-like operating system.

During the setup you'll be prompted for your Camdram API credentials which you can obtain by registering here.

Docker Install

Docker is a lightning-fast way to get a development environment setup with minimal fuss by running virtualised containers on your machine. This cross-platform process should work on Windows, macOS and Linux, although there will be something of a performance degradation on macOS when compared to a native installation.

  1. git clone https://github.com/CHTJonas/roombooking.git
  2. cd roombooking
  3. docker-compose build
  4. docker-compose run --rm web "bin/setup"
  5. docker-compose up

This will spin up several Docker containers and the logs will appear in the foreground of your terminal window. Press Ctrl+C once to gracefully stop and bring down all containers. If you need to rebuild the Docker container for any reason (eg. after installing new Gems) then type docker-compose down --volumes --remove-orphans at the terminal prompt and repeat from step 3 above. If you're developing on top of Microsoft Windows then you need to ensure that you checkout and checkin source code with UNIX-style line endings (LF). This can usually be achieved by running git clone https://github.com/CHTJonas/roombooking.git --config core.autocrlf=input and/or by working with a modern text editor or IDE that preserves line endings.

Native Install

Installing from source is relatively easy and should work on anything UNIX-like including the Windows Subsystem for Linux. You'll need both Postgres and Redis setup locally which, if you're running Debian or Ubuntu, can be achieved by typing sudo apt install postgresql redis at a terminal. Note that your user account will need CREATE/DROP DATABASE privileges for the initial setup but not thereafter.

  1. git clone https://github.com/CHTJonas/roombooking.git
  2. cd roombooking
  3. bundle install -j4
  4. bin/setup
  5. rails server

This will start the Rails application (web) server in the foreground of the current terminal. To optionally start Sidekiq to process background jobs you can run bundle exec sidekiq in a separate terminal. Pressing Ctrl+C will interrupt and shutdown either one of these.

Contributing

Anyone may contribute to the project and bug reports or feature requests are warmly welcomed! Please familiarise yourself with the contributing guidelines before you get started. If you decide you want to write some code yourself:

  1. Fork the repo (https://github.com/CHTJonas/roombooking/fork).
  2. Create a feature branch (git checkout -b my-new-feature).
  3. Commit your changes (git commit -am 'Add some feature').
  4. Push to the branch (git push -u origin my-new-feature).
  5. Create a new Pull Request.

When coding, please try to update any tests your code affects or, even better, add new tests where none currently exist! Don't worry if you're not too sure about this - if you open a Pull Request we can provide some assistance. To run the full test suite, type the following into your terminal (or append to docker-compose run --rm web):

  1. rails test
  2. rails test:system

Please ensure your code adheres to the following basic style rules. You should be able to do this automatically by installing an EditorConfig compatible text editor/IDE, or a plugin.

  • Use UNIX-style (LF) line endings.
  • Terminate every file with a single blank line at the end.
  • Remove any whitespace characters preceding new lines.
  • Use the UTF-8 character set.
  • Indent code blocks using two spaces (please don't use tabs).

Management of the project is meritocratic; those who have a reasonable number of accepted contributions will be granted access to commit straight to the master branch of this repository.

Copyright

Copyright (c) 2018โ€“2022 Charlie Jonas and contributors. The ADC Room Booking System software is released under Version 3 of the GNU General Public License. See the LICENSE file for full details.

roombooking's People

Contributors

chtjonas avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar gkfx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

roombooking's Issues

Minor pedantic typos :)

  • /cookies
    Link to aboutcookies site is broken

  • /faq
    "First things first..." should have no apostrophe
    "...having any issues the please get..." should be then not the

  • /privacy
    "What safeguard are in place..." missing s on the safeguards

Non-admin users unable to make bookings

Students are currently unable to make bookings as the list of authorised shows and societies is incorrectly determined for non-admin users.

This was a regression introduced in 8337ada. The iterative operator needs to be replaced with the mapping operator in the following lines of code:

CamdramShow.where(camdram_id: shows.each(&:id), dormant: false, active: true)

CamdramSociety.where(camdram_id: societies.each(&:id), active: true)

Warn for bookings made outside office hours

Bookings made outside Management office hours (11am to 6pm) should attract a warning together with a reminder that a keyholder will need to be present. This is something that the old system apparently did, but which I didn't realise and which also wasn't in the initial 'spec'.

Dependabot can't resolve your Ruby dependency files

Dependabot can't resolve your Ruby dependency files.

As a result, Dependabot couldn't update your dependencies.

The error Dependabot encountered was:

Bundler::VersionConflict with message: Bundler could not find compatible versions for gem "mimemagic":
  In Gemfile:
    rails (~> 6.1.3) was resolved to 6.1.3, which depends on
      activestorage (= 6.1.3) was resolved to 6.1.3, which depends on
        mimemagic (~> 0.3.2)

Could not find gem 'mimemagic (~> 0.3.2)', which is required by gem 'activestorage (= 6.1.3)', in any of the sources.

If you think the above is an error on Dependabot's side please don't hesitate to get in touch - we'll do whatever we can to fix it.

View the update logs.

Room not listed as booked on home page

The Room#.currently_booked? method is currently (22:30 on Sunday 13th October 2019) returning false despite there being a booking for the Get In.

Kindly reported by Jacob Baldwin.

Alert when a show/society is deleted from Camdram

Currently shows and societies that are deleted from Camdram but remain referenced by a model in Room Booking cause 404 client errors which are either silently ignored or converted to nil, with the exception of the show controller action. We should detect these events and notify the relevant admins/sysadmins about the situation.

Error viewing rooms in limited circumstances

The RoomsController#Index method contains an if/elsif block used to set the @rooms instance variable:

if request.format == :html
  # blah
elsif request.format == :ics
  # blah
end

It seems that in certain circumstances request.format is equal to neither :html nor :ics. In these situation, @rooms is equal to nil and so rendering the app/views/rooms/index.html.erb template fails at line 8:

<% @rooms.each do |room| %>

Sentry issue: ROOMBOOKING-M

Exception when rendering any page

The site currently throws a NameError exception when rendering any page.

This is due to the ApplicationController#sentry_tags_context method (which is called during the set_sentry! before action) referencing the uninitialised constant Camdram::Version.

Book multiple rooms simultaneously

Enhancement to add the ability to book multiple rooms with the same booking, for example to simultaneously book the stage and dressing rooms during a Get In. This could be implemented as follows:

  1. Feature to clone a booking from one room to another, thereby creating a new booking model identical to the previous except in that it references a different room model.
  2. Feature to book multiple rooms at once from a single booking, thereby creating a many-to-many relationship between the booking and room models.

Daily calendar view

Create a calendar view that shows a single day's bookings across all rooms, with time on the vertical axis and each room occupying a new column on the horizontal axis. This would complement the existing per-room weekly calendar overview that already exists.

Venues no longer returned in JSON

As of v2.71, Camdram no longer returns a top level venue object in the show endpoint JSON, instead returning a venue with each performance. This is likely to cause a myriad of issues.

Subscription-based notifications

Implement an email notification service so that users can subscribe for bookings alerts made for shows and societies that they are interested in.

Error when trying to cast date

The RoomsController#show transaction can raise an ArgumentError: invalid date exception if the query string given for the start_date parameter cannot be cast to a date.

Sentry Issue: ROOMBOOKING-9

Overlap validator fails to detect some weekly repeating booking

Detection of weekly repeating bookings between a given pair of dates seems broken. This is affecting the validation that prevents overlapping bookings, for example: https://roombooking.adctheatre.com/rooms/1?start_date=2019-12-15.

I believe the problem is likely somewhere in the several lines of complicated SQL that start on line 103 of booking.rb:

EXTRACT(dow FROM timestamp :start) <= EXTRACT(dow FROM start_time)

"Soft" bookings for the workshop

Discuss this with Nat and Ellie first by all means, but last term for panto I had a spreadsheet where I kept track of who was in the workshop when and Nat seemed to be a fan. Features:

  • Ability for multiple shows to be present at once (this is what I mean by the bookings being "soft")
  • Ability for shows to make detailed notes on what they plan to do in the time - this makes it easier to work around others
  • Some sort of disclaimer to the effect that booking the workshop isn't actually binding on anyone
  • Marking out where shows are happening (based on Camdram) as unbookable time, and the ~30 mins before.
    This obviously isn't as essential as the booking of rehearsal spaces etc. but it's nice to know who's going to be present in the workshop

Can't make bookings for certain shows I have admin control over?

I can currently only make bookings for rehearsals/meetings/auditions of panto or meetings of cuadc - I am also the only show admin for the three freshers plays this year (Nell Gwynn, Bloody Chamber, and Beautiful Thing), and am trying to book auditions using the shows so I don't use up all of CUADC's booking time, but there's no option for me to book through them on the bookings page?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.