Closed tjazerzen closed 1 year ago
Po novem sem dodal še prijavo, ki s podatkovno bazo uspešno komunicira z GET requesti (https://github.com/valg01/Svetovna-prvenstva-v-nogometu/pull/4/commits/bed39043b7d3e8976ecf63660cabb3e6c79caa30). Čudno mi je, da get requesti gredo skozi, medtem ko pa se INSERT stavki nevem zakaj sesujejo.
Se je že res veliko sprememb nabralo na tem PR-ju.
@valg01, pojdi čez vse ter jih dobro razumi. Vsi fajli, kjer piše "TODO (Val): ..." je še delo za narediti
Summary
In general, this PR includes most of the basic changes and scaffoldings that are going to be present in the final version of the app. Details follow below.
Refactoring
The code has been refactored for better readability and to adhere to best coding practices. This includes adopting the
snake_case
convention for function names and improving the organization of imported modules.Improved User Verification
The PR introduces a new function,
preveri_uporabnika()
, which retrieves the user ID from a cookie and verifies it against the database.Improved User Registration
An additional field
vse_mozne_drzave
has been added in theregistracija_get()
function that fetches all possible countries for a user to select during registration.User Login and Logout Enhancements
More detailed error messages have been introduced during the login process to inform the user if their email doesn't exist in the database, or if the password entered is incorrect. A new path for user redirection,
uporabnik_get
, has been introduced after successful login.User Profile Management
The PR introduces a range of new functionalities related to user profile management. These include:
pridobi_razpolozljive_drzave
andpridobi_ze_izbrane_drzave
).dodaj_drzavo
andodstrani_drzavo
).uporabnik_post_dodaj_vse_drzave
anduporabnik_post_odstrani_vse_drzave
).Additional User Pages
New routes have been defined for additional user pages like "About", "Hall of Fame", "Team Statistics", and "User Profile".
Logout
The
odjava
function has been introduced to delete the user ID cookie and redirect the user to the index page.User Profile Retrieval
In the
profil_get()
function, user data is retrieved from the database for display.DBUtils
The
dobi_prvi_rezultat(cur)
method has been modified to improve its functionality.RegistracijaUtils
A new static method
_email_ze_obstaja_q(email, cur)
has been added, which seems to check if a given email already exists in the database. The_gesli_enaki(geslo, ponovljeno_geslo)
method has been modified for better functionality.bottleext.py
The template function has been adjusted for simplification.
HTML Changes
The HTML changes involve additions to several pages including
about.html
,base.html
,hall_of_fame.html
,profil.html
,statistike_ekip.html
,uporabnik.html
, andregistracija.html
.about.html
A new HTML page about the platform was added. It includes basic information about the purpose of the platform.
base.html
This file underwent multiple changes to enhance the navigation bar and the site footer. The changes include conditional display of links based on user type (registered or guest), adding useful platform-related links, and styling improvements.
hall_of_fame.html, profil.html, statistike_ekip.html and uporabnik.html
These new HTML pages have been added to handle display and interaction with the user's profile, hall of fame information, team statistics, and user-selected countries respectively.
registracija.html
The registration page has been updated to dynamically populate a dropdown menu with available countries for a user to select during the registration process.
In summary, this pull request enhances the website's functionality and user interface by improving database utility methods, simplifying template rendering, and significantly enhancing the layout and content of various webpages.