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 the registracija_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:
Fetching and displaying the list of countries that a user can support (pridobi_razpolozljive_drzave and pridobi_ze_izbrane_drzave).
Adding or removing a single country to/from a user's supported countries list (dodaj_drzavo and odstrani_drzavo).
Adding all available countries or removing all selected countries from a user's supported countries list (uporabnik_post_dodaj_vse_drzave and uporabnik_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, and registracija.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.
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.