Giter VIP home page Giter VIP logo

soccerlite's Introduction

Greetings! My name is Mario Munoz

I code Python by night, which is what happens when there's not enough time during the day.

Python Developer (by night)

Working on

Figuring out what 2024 is all about

Currently Learning

soccerlite's People

Contributors

tataraba avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

cofin

soccerlite's Issues

Redesign Team index view

Once a lot of teams are added and attached to their respective leagues, this page will need to be a lot more compact and present the needed information. I'm thinking of three separate toggles, maybe more.

  1. sort all teams alphabetically
  2. group teams by leagues they are attached to
  3. view only teams not attached to a league

Validate end date for Seasons - don't allow date prior to start date

Currently, when editing the Season end date, the application allows user to enter a date prior to start date and save.
image

Validation should happen to prevent this.

This can likely be done with the flatpickr javascript library, but I'd prefer to do server side validation using htmx.

Adding score to just one team in schedule and saving causes error

If one of the scores is empty and you hit save, it causes an error:
image

msgspec.ValidationError: Expected `int | null`, got `str` - at `$.team_away_goals`

Having an empty value to begin with is desirable, as that can be used to assess that a game has not been played yet. But when one score is filled in, maybe it can default the other score to zero, or if you try to save with an empty value, it defaults to zero. Second option not the best, because wouldn't want to default to zero if both are left empty (on purpose) if the intent is to edit something else (like teams or start times).

Editing team should preselect league

This should be consistent with editing leagues/schedules...

The jinja template should look for what is the current selected league for team, and have that option preselected. Following this pattern:

league-edit.html does this to preselect the league's current category:

<select name="category" id="category" class="bg-gray-50 border border-gray-300 text-gray-900 rounded-lg focus:ring-cyan-600 focus:border-cyan-600 block w-full p-2.5">
    {% for category in categories %}
    {% if category.value == league.category %}
        <option value="{{ category.value }}" selected>Current: {{ category.value }}</option>
    {% else %}
        <option value="{{ category.value }}">{{ category.value }}</option>
     {% endif %}
    {% endfor %}
</select>

Dates on the schedule update behavior is wrong

When saving a field in the schedule edit view, the save changes the date field. I believe it is because it is sending a UTC time to the server, and then converting the time when sending the request back. Or vice versa, not sure which ...

Here is a schedule view before the change:
image

Then I add a score. Notice the date change:
image

This is the payload from the post request:
image

I'll have to check what date is being sent from the flatpickr library.

I haven't fiddled with dates all that much yet, so I suspect it's an issue of UTC and locale.

Removing "end date" from season-edit creates an error

Ideally, a user can end date a season to inactivate it. However, if this is done by accident, or the season needs to be extended, there's no intuitive way to extend the season. One way would be to simply remove the end date when editing the season.

However, that currently throws an error.

It appears that the DTO is expecting a value here (instead of None) and therefore throws an error. Maybe there's a better way to approach this.

Revamp the League edit view

Right now, the league-edit.html template seems a little cluttered and not totally intuitive. Could add instructions at the top (like for the Season section), and enhance the selections to preselect the current values.

I'm already getting current value, but it is not always preselected in the options.
image

Or, the preselection as the 1st option looks a little odd:
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.