Git Product home page Git Product logo

reservator's People

Contributors

alexkahn avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

reservator's Issues

Patron Dashboard

Should display:

  • List of their starred restaurants
  • Upcoming reservations

Should be able to

  • Modify reservations

New Home controller

Since the restaurant index isn't the best place to send users anymore, it may be intelligent to generate a contoller whose sole responsibility is grabbing data from various models that produces a landing page and the two dash boards.

It could look something like:

class HomeController < ApplicationController
  before_action :authenticated?, on: [:owner_dashboard, :patron_dashboard]

  def index
  end

  def owner_dashboard
    redirect_to action: "index" unless current_user.owner?
  end

  def patron_dashboard
    redirect_to action: "index" unless current_user.patron?
  end

end

It would be smart to generalize the logic for checking authorization alongside authentication. It may be necessary to check the calling method to see what to check for and just send back a boolean - probably a job for controller concerns or the like.

Stars should be created/destroyed via AJAX

In app/assets/javascripts/star.js.coffee, something like:

function toggleStar ->
var url;
if $('#star').hasClass('starred') 
   url = '/stars/delete'
else 
  url = 'stars/create'

$.post({
  url: url,
  method: "post",
  success: ->
    $('#star').toggle( '.starred')
})

If erb can be used to pass in the url or other fun stuff then a more complicated method may not be needed.

There should of course be routes that responds_to json and render json response objects that confirm or deny the creation of the star.

Owners Dashboard

Should display:

  • Restaurant list with count of stars
  • Reservations (pending, confirmed, ordered)

Should be able to:

  • Confirm or deny reservations by restaurant
  • Add a new restaurant

Maps

There should be maps on restaurant show pages.

This means that some sort of geocoding needs to be done (it can be outsourced to the Goog), it would be good to have it persist (buildings don't move much) and it can be easily recalculated if the address field changes via a model callback that calls a geocoder object.

Tools:

  • Leaflet.js
  • HTML Location grabber for users

Reservation validation and scoping

Should validate that reservation can only be made in future
Should have a scope available for upcoming reservations like:

scope :visible, -> { where("date_time > ?", Time.now) }

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.