camilosampedro / Aton

Open web computer laboratory administrator
http://camilosampedro.github.io/Aton
GNU General Public License v3.0
14 stars 12 forks source link

Add Block User Dialog #42

Closed minrwhite closed 8 years ago

minrwhite commented 8 years ago

Closes #14

  1. Why this change is necessary? A button is required on the room panel, to open a dialog that can then be used to block a user from the room
  2. How does it address the issue?
    • Two routes and related methods are added to RoomController:
      • To fetch the modal contents, including the form for a room via a request
      • To submit the user selection
    • A new template is added to scaffold the modal contents: blockUser.scala.html
    • index.scala.html is modified to add a modal target div
    • A new method is added to the UserService Trait, listAll (to list all users) for scaffolding the select form field to choose the user
    • Javascript is added to general.js that will handle the loading of the dialog content
    • The button is added to roomPanel.scala.html, including a data attribute giving the target url to ask for the modal content
  3. What side effects does this change have?

    This is a relatively small change, and I do not believe it will have any side-effects.

minrwhite commented 8 years ago

I'm glad you like my code! Jumping in on an issue like this has been really good to get an overview of how a play framework based app functions.

The blockUser method is a stub in place of performing the actual block, probably to be worked on as part of issue #15 as currently no blocking takes place (requires database schema changes etc.) Assuming that the change has taken place, the user is then redirected back to the page of the lab they were viewing. Does that make sense?

camilosampedro commented 8 years ago

On that action the BlockUserForm could be received? (Like a pending TODO)

But you really made a good job here, thank you!

minrwhite commented 8 years ago

Yes, exactly like that. In fact there's a TODO comment in the body of the function that I intended to say as much!

camilosampedro commented 8 years ago

Merged! :sunglasses: