-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: fancy in-page transitions for forms (#201)
- Loading branch information
1 parent
427c36c
commit 500a354
Showing
60 changed files
with
2,356 additions
and
1,740 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
"""Controllers for experience.""" | ||
|
||
from valentina.models import Campaign, User | ||
|
||
|
||
async def total_campaign_experience(campaign: Campaign) -> tuple[int, int, int]: | ||
"""Return the total experience for the campaign.""" | ||
user_id_list = {character.user_owner for character in await campaign.fetch_player_characters()} | ||
available_xp = 0 | ||
total_xp = 0 | ||
cool_points = 0 | ||
|
||
for user_id in user_id_list: | ||
user = await User.get(int(user_id)) | ||
user_available_xp, user_total_xp, user_cool_points = user.fetch_campaign_xp(campaign) | ||
|
||
available_xp += user_available_xp | ||
total_xp += user_total_xp | ||
cool_points += user_cool_points | ||
|
||
return available_xp, total_xp, cool_points |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
"""Serve HTMX Partials.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"""Blueprints for serving HTMX Partials.""" | ||
|
||
from quart import Blueprint | ||
|
||
from valentina.webui.constants import TableType, TextType | ||
|
||
from .route import EditTableView, EditTextView | ||
|
||
blueprint = Blueprint("partials", __name__, url_prefix="/partials") | ||
|
||
|
||
for i in TableType: | ||
blueprint.add_url_rule( | ||
f"/table/{i.value.route_suffix}", | ||
view_func=EditTableView.as_view(i.value.route_suffix, table_type=i), | ||
methods=["GET", "POST", "DELETE", "PUT"], | ||
) | ||
|
||
for t in TextType: | ||
blueprint.add_url_rule( | ||
f"/text/{t.value.route_suffix}", | ||
view_func=EditTextView.as_view(t.value.route_suffix, text_type=t), | ||
methods=["GET", "POST", "PUT"], | ||
) |
Oops, something went wrong.