Bergrebell / CyberCoach

1 stars 1 forks source link

UI: Filter for SportSessions #69

Closed wanze closed 9 years ago

svetakrasikova commented 9 years ago

@wanze Hi Stefan, I looked at your filter implementation for offers in CarTrading today. We want the same logic here, don't we? A method in the sessions model (along the lines of your method filter()) which can be used in the controller for initialising the instance variables. Sorry, you explained this to me already, but things looked pretty vague to me on Tuesday:)

wanze commented 9 years ago

@svetakrasikova Exactly. I was thinking of a method on the SportSession model that takes an array of parameters (e.g. the GET parameters coming from the form) and returns the correct objects, accoridng to the filter. I remember that building the query for the filter was driving me mad back then :)

svetakrasikova commented 9 years ago

Can you create new sport sessions? I get an error in first line of the create method (e.g. of the runnings controller).

wanze commented 9 years ago

It works for me, what kind of error do you get? The first line is parsing the date. Are you on an up-to-date dev branch?

lexruee commented 9 years ago

@wanze @svetakrasikova Should be fixed in commit: https://github.com/Bergrebell/CyberCoach/commit/bd751c09f5dbb795907a40bed388edb6242346bd

svetakrasikova commented 9 years ago

Thanks for your quick replies, guys! Will get back to this first thing tomorrow morning - need some sleep now - and there's a high chance I'll have a couple of questions. Good night :)

svetakrasikova commented 9 years ago

@wanze @lexruee Hi, I just pushed what I've done so far to the branch filter_sport_sessions. I copied most of the things from what you've done for CarTrading, Stefan. Could you have a look (time permitting) and let me know what needs to be added/improved/altered :) Really hope it's not totally useless. So far one can pick one participant at a time, this is not so great, I'll see if I can do better.

wanze commented 9 years ago

@svetakrasikova Looks good ;) A couple of thoughts:

Ideally we can reuse the filter for each sport, e.g. running and boxing. Today I was working directly on the dev branch and I modified several files (Sorry, i know it's bad :( ). Drop me a line if the feature is finished, I will merge it manually into dev.

svetakrasikova commented 9 years ago

Thanks, Stefan. I'll be working on these points tonight.

Îòïðàâëåíî ñ iPhone

22 íîÿá. 2014 ã., â 2:32, Stefan Wanzenried notifications@github.com íàïèñàë(à):

@svetakrasikova Looks good ;) A couple of thoughts:

Filter by sport is already handled with the subnav under "Sport Sessions" Date range would be nice Location: Would it make more sense to just add a text-field and filter with a LIKE query? This would also be easier for you as you don't need to get all the locations out of the DB. I get the same values multiple times. Ideally we can reuse the filter for each sport, e.g. running and boxing. Today I was working directly on the dev branch and I modified several files (Sorry, i know it's bad :( ). If there are merging conflicts after your feature is finished, I will merge it manually into dev

— Reply to this email directly or view it on GitHub.

svetakrasikova commented 9 years ago

@wanze I made some changes:

  1. replaced a single date by a date range. I don't know how to make it pretty, though. There exist range date pickers, but not for the UIkit picker, so the result so far leaves much to be desired.
  2. filtered locations, so that no duplicates are displayed. But I can replace this by a text field, maybe it's better.

I'll do some more work tomorrow to finalise this. Should I try to merge this branch manually into dev? You have more than enough to do.

wanze commented 9 years ago

Fine for me :) Text-Field for loaction would be nice, so we could find the same location that was maybe written differently, e.g. "Bern", "Bern, Switzerland" or "Bern, Länggasse 12"

svetakrasikova commented 9 years ago

OK, I'll do that if I am still alive tomorrow :) sick, sick, sick and only sick people around.

svetakrasikova commented 9 years ago

@wanze I changed the location filter: it is now text based and with a like query behind. let me know what else I can do

svetakrasikova commented 9 years ago

I finally merged this into the dev branch. Still need to recycle the sport kinds other than running.