-
Notifications
You must be signed in to change notification settings - Fork 12
82 midify detail view #178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
bizmarcin
wants to merge
34
commits into
master
Choose a base branch
from
82_midify_detail_view
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
5908dff
initial commit branch 74/user_registration_bizmarcin
bizmarcin 883b0d7
add child and caregiver, add record to assign child to caregiver
bizmarcin db1a330
already done in master branch
bizmarcin 3f3ef08
add col is_active to table home_points
bizmarcin fb27a74
simple solution for showing only active tasks
bizmarcin 7666208
change query for include is_active in table home_points
bizmarcin d54f2d8
add buttons
bizmarcin 892ecdd
remove points indication
bizmarcin dc6c4be
add point number near button, coment 'block add_points'
bizmarcin 1d36092
sync with master
bizmarcin b8ae25a
chenge from GET to POST
bizmarcin 973cf2d
switch to master
bizmarcin 8952c8b
Merge branch 'master' into 79_add_buutons_to_add_points
bizmarcin 2852e51
pull froma master and starting work froma limits
bizmarcin 66923df
add points button ready to check
bizmarcin 631a628
sync with #79 and master, first few fix, not ready
bizmarcin baff351
max_day, still to fix history table
bizmarcin 2b8667e
pull from master
bizmarcin 010df89
almost done, not for PR yeat
bizmarcin 124b6b6
works but there no flash message, check time diff
bizmarcin 35279da
ready for PR
bizmarcin e812d3b
test
bizmarcin 97d73f3
test1
bizmarcin 0db2613
Merge branch 'master' into 81_max_week
bizmarcin ecbd4b5
modify max_day method to universal, add max_week check
bizmarcin fdd677c
Merge branch 'master' into 81_max_week
bizmarcin 6c014db
Merge branch 'master' into 81_max_week
bizmarcin 490f889
prepare init data after merge master
bizmarcin 7bb511f
fix data
bizmarcin 0133734
start work with Leszeks CR
bizmarcin 3a0712f
modify flash message day/week
bizmarcin 2c3befa
Merge branch 'master' into 81_max_week
tgbdc7 e687379
once again
bizmarcin 15876b9
Merge branch 'master' into 82_midify_detail_view
bizmarcin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 |
|---|---|---|
|
|
@@ -22,10 +22,11 @@ def is_limit_reached(child_id, exercise_id, days, max_column): | |
| return False | ||
| return True | ||
|
|
||
| @bp.route("/child/<child_id>/points/add/<points>/<exercise_id>", methods=['POST']) | ||
| @bp.route("/child/<child_id>/points/add/<points>/<exercise_id>/<is_detail>", methods=['POST']) | ||
| @auth.login_required | ||
| @auth.logged_child_or_caregiver_only | ||
| def add_points(child_id, points, exercise_id): | ||
|
|
||
| def add_points(child_id, points, exercise_id,is_detail): | ||
| if is_limit_reached(child_id, exercise_id, 1, 'max_day') and is_limit_reached(child_id, exercise_id, 7, 'max_week'): | ||
| logged_user_id = g.user_data['id'] | ||
| return_url = request.args.get('return_url', '/') | ||
|
|
@@ -46,15 +47,23 @@ def add_points(child_id, points, exercise_id): | |
| if role == 'child': | ||
| return redirect(return_url) | ||
| else: | ||
| return redirect(url_for('views.child', child_id=child_id)) | ||
| if is_detail == "0": | ||
| return redirect(url_for('views.child', child_id=child_id)) | ||
| else: | ||
| return redirect(url_for('views.task_detail', child_id=child_id)) | ||
|
Comment on lines
+50
to
+53
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. proponuję |
||
| else: | ||
| if not is_limit_reached(child_id, exercise_id, 1, 'max_day'): | ||
| flash(f'W ciągu ostatniej doby został przekroczony limit punktów') | ||
|
|
||
| if not is_limit_reached(child_id, exercise_id, 7, 'max_week'): | ||
| flash(f'W ciągu ostatnich 7 dni został przekroczony limit punktów') | ||
|
|
||
| return redirect(url_for('views.child', child_id=child_id)) | ||
|
|
||
|
|
||
| if is_detail == "0": | ||
| return redirect(url_for('views.child', child_id=child_id)) | ||
| else: | ||
| return redirect(url_for('views.task_detail', child_id=child_id)) | ||
|
|
||
|
|
||
|
|
||
| @bp.route("/child/<child_id>/points/use", methods=['POST']) | ||
|
|
||
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
proponuję bez
is_detail- można wykorzystaćrequest.referrer