team4909 / 2018-Core

2018 Scouting Platform
MIT License
10 stars 3 forks source link

Finish Event Schedule Display #21

Closed roshanr10 closed 6 years ago

roshanr10 commented 6 years ago

Need to implement a way to input event key, add info-box with event handler to the template like the dashboard page.

Once the event key is being passed, it's a matter of simply copying the table design from the dashboard template and revising it slightly to work with the outputted data.

API call are currently fully functional.

roshanr10 commented 6 years ago

Editable Event Key

This event key was hardcoded for testing purposes.

https://github.com/FRCteam4909/The-Green-Alliance/blob/de9fb6e89fbf0a86ef3a926408340bdf683aed50/app/www/js/main.js#L58

I'd like to be able to edit it via an info-box like the one on the dashboard, while keeping it amber for consistency. This can be added directly to the template. Just make sure to use the match key as part of the config so it doesn't disappear when loading new data.

https://github.com/FRCteam4909/The-Green-Alliance/blob/de9fb6e89fbf0a86ef3a926408340bdf683aed50/app/www/index.html#L50

Just add a blur event to the <div ... contenteditable="true"></div> :

https://github.com/FRCteam4909/The-Green-Alliance/blob/de9fb6e89fbf0a86ef3a926408340bdf683aed50/app/www/js/main.js#L30

This was created for testing.. shouldn't be creating a config object there. Should just be editing templates.schedule.config to add whatever properties the template needs. Also, recommend using an {{if}} statement to verify the config is populated (event matches found) before you try to use the config, as to avoid fatal errors while generating the template.

https://github.com/FRCteam4909/The-Green-Alliance/blob/de9fb6e89fbf0a86ef3a926408340bdf683aed50/app/www/js/main.js#L76


Schedule Table Interface

All of the app is written based around the Handlebars templating engine.

The hook for the schedule template is here. https://github.com/FRCteam4909/The-Green-Alliance/blob/de9fb6e89fbf0a86ef3a926408340bdf683aed50/app/www/index.html#L134

Please copy the style of the dashboard table as found here. https://github.com/FRCteam4909/The-Green-Alliance/blob/de9fb6e89fbf0a86ef3a926408340bdf683aed50/app/www/index.html#L107

Header Row: Blank, Red 1-Y, Blue 1-Y (color coded) Match Row: Time, Red 1-Y, Blue 1-Y (white background)

where Y is equal to matches[0].alliances.red.length (pass that thru somehow from the api call)... just for the matches with backup bots at higher levels of play and stuff. it'll be either 3 or 4. you can implement the {{each}} like how the team numbers are in the dashboard currently.

roshanr10 commented 6 years ago

Closing due to unneeded complexity; can just as easily use TBA event data, maybe in future...