kalamuna / playbox

A playground for ambitious would-be code artists.
http://live-playbox.at.kalamuna.com/
GNU General Public License v2.0
5 stars 29 forks source link

Complete scores page #41

Open pirog opened 9 years ago

pirog commented 9 years ago

Since we only completed an MVP the scores page was never completed. It would be great to have two reports on this page.

  1. The first would contain the total amount of robots wins vs the total president wins.
  2. The second would contain a list of the top vote getters ordered by top vote getter to lowest vote getter.

There is already a stub feature at playbox_scores for some of this stuff. Bonus things you can do:

  1. Style the reports so they look awesome.
  2. Add some interactivity to the reports.
  3. Add something fun and unexpected not in this issue.

Feel free to do any of the parts here.

soniktrooth commented 9 years ago

I'm working on this one—should finish it up tonight.

One thing I wanted to note was how difficult this is to achieve with views. Whilst I was able to fairly easily generate a table with each competitors name and votes using a relationship, sorting was an issue.

Votes are stored in a different field depending on if the competitor is a robot or a president therefore sorting is problematic with out some pretty mind bending query_altering. Whilst I'm sure it would be completely possible given a little extra effort (and the advice of someone with better mysql fu than myself) I've decided to push forward building the table in code which should be a good way to display my render array samurai skillz. I hope this is ok.

pirog commented 9 years ago

DAMNNNN!!!! Re: whether this is OK i quote Terrance Mann from Field of Dreams: "Rules? There are no rules here!".

AKA there was no requirement on views. When i was thinking about the issue myself i figured the easiest implementation would be some sort of custom page via hook_menu() with some sql magic and then theme_table or some such.

Hope that helps and very excited to see the results!

soniktrooth commented 9 years ago

Cool, that's what I've gone for. With situations like this I usually would try and find out how likely it is for a client or site admin to need to configure the page in the future. If it is then I would probably push harder on the Views angle, otherwise the shortest line to a result is code.

pirog commented 9 years ago

Yeah definitely. That is a very good rule of thumb and very glad to hear the thought process there. That said, in this case the client is me so i am relatively well versed in the Drupals :) I also appreciate everyone's time working on the Playbox so the shortest/fastest solution that isn't COMPLETELY janksauce is 100% cool!

On Mon, Oct 20, 2014 at 12:07 PM, soniktrooth notifications@github.com wrote:

Cool, that's what I've gone for. With situations like this I usually would try and find out how likely it is for a client or site admin to need to configure the page in the future. If it is then I would probably push harder on the Views angle, otherwise the shortest line to a result is code.

— Reply to this email directly or view it on GitHub https://github.com/kalamuna/playbox/issues/41#issuecomment-59822324.

Cheers,

Mike Pirog Kalamuna www.kalamuna.com

soniktrooth commented 9 years ago

I do my best to avoid janksauce at all costs.

pirog commented 9 years ago

its not the kind of tonic you want to be drinking ;)

On Mon, Oct 20, 2014 at 12:15 PM, soniktrooth notifications@github.com wrote:

I do my best to avoid janksauce at all costs.

— Reply to this email directly or view it on GitHub https://github.com/kalamuna/playbox/issues/41#issuecomment-59823469.

Cheers,

Mike Pirog Kalamuna www.kalamuna.com