codalab / chahub

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Management buttons

ckcollab opened this issue · comments

Add buttons allowing an admin to modify/remove/add listings.

When an admin is logged in listings should show a pencil (edit) and x (delete) button. The buttons should only show when hovered. Clicking edit brings up a modal form for listings. When the form is successfully submitted it should be cleared. Errors for the form should be shown inline, if possible

The modal form can also be used for creation. The creation button should be fixed to the bottom right of the viewport.

Todo:

  • (+) button on bottom right, fixed
  • (+) button click opens modal
  • modal created with fields: title, description, logo url (eep, we need to make this download and process image still... TODO!) (producer dropdown... if we create a new competition it has to belong to a producer)
  • Clicking edit on competition loads details in modal (you can do CHAHUB.events.trigger('competition_selected', event.item.competition_or_whatever_it_is) and listen for it with example below)
  • (ERIC/CHRIS/TYLER/JIMMY) Clicking save in the modal POSTS the competition -- this POST should only be allowed from admins and should keep the producer that is already set on the competition.................
  • Successful submission of competition edit should clear competition
  • Failed submission of competition should show inline errors or some-such
<div class="modal" ref="modal">
    <input ref="competition_title" name="title">
</div>

CHAHUB.events.on('competition_selected', function(competition) {
    self.selected_competition = competition
    self.refs.competition_title.value = self.selected_competition.title
    self.update()
    self.refs.modal.show()
})