This is a group coding project for the Nashville Software School. Our assignment is to create a one-page app that stores and displays information for a baseball league.
Our app can be viewed live at:
https://baseballchallenge-e5qs2.backliftapp.com/
Our app has met the following project requirements:
Phase 1:
- use the Bootstrap framework
- set a minimum of 4 teams
- set a maximum of 8 teams
- allow users to create teams
- collect the following team contact information:
- team name
- manager's first name
- manager's last name
- phone number
- sponsor
- zip code
- save team information to the server using Ajax and JSON
- display team details when users hover over team names in the standings table
Phase 2:
- use pre-defined schedules for varying league sizes
- allow users to submit scores
- store scores on the server and display them in the schedule table
- update team wins and losses on the server and display them in the standings table
- sort the league standings by win percentage
Additional technical information:
- the bulk of our HTML is a series of form modals that are not displayed on page load; the rest is made up of empty elements that are dynamically injected with content as users create teams
- our JavaScript is divided into two major sections:
- the first half is script that runs on page load, affecting elements that already exist in the DOM; there are instances, though, where we use the jQuery .on() method to assign events to elements not yet present in the DOM
- the second half is comprised of functions, which are referenced in either the first half of the script or in other functions; these functions perform various actions, such as adding or removing objects from the server and updating page content
- we tried to maintain an intuitive naming convention where variables are nouns, functions contain verbs, etc.
- we have dedicated functions that refresh our standings and schedule tables, respectively
- we attempted to structure our script by the order in which elements are loaded into the DOM; when no logical ordering was apparent, we prioritized the sections by which elements users would interact with first