-
Notifications
You must be signed in to change notification settings - Fork 0
Create a page for departments to view their allocations #667
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
fritzj2
wants to merge
58
commits into
department-portal-base
Choose a base branch
from
allocation_table
base: department-portal-base
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
58 commits
Select commit
Hold shift + click to select a range
0eb3bb1
Added necessary files for the allocationTable
fritzj2 5ab2dca
added the individual term for each row in the table
fritzj2 ce23c09
Bootstrap datatable was implemented
fritzj2 05216d0
added a download button to the page
fritzj2 c8f12b1
Added accordians instead of a giant table
fritzj2 beaba49
structured primaries table
fritzj2 e981118
Formatted the break table
fritzj2 fd7c2c6
removed an unecessary card from the HTML
fritzj2 ddad2d2
added logic using the allocationManager
fritzj2 eb4e0af
Added break contracts to the table
fritzj2 9eaf061
fixed function calls, added more data for breaks
fritzj2 64f4dc4
got the contracts to count in page
fritzj2 c3e9cc1
Request allocation modification button
fritzj2 5350883
Created the secondaries table
fritzj2 f9670d3
table now calls allocations
fritzj2 23e84d1
fixed table sizing
fritzj2 54a3f13
added arrows to the accordions in th tables
fritzj2 cc374dc
fixed formatting of html
fritzj2 827f390
changed allocation req wording
fritzj2 5978774
fixed the contract index, the total returns correctly now
fritzj2 32f8f6b
fixed the sum of break hours
fritzj2 5110359
added the fall break row
fritzj2 071232b
moved the header to be centered
fritzj2 0760c5d
Merge branch 'department-portal-base' into allocation_table
fritzj2 fa4a35c
fixed format of accordions
fritzj2 5f44de5
Merge branch 'department-portal-base' of https://github.com/BCStudent…
fritzj2 764db13
fixed the button layout
fritzj2 b67164b
Added tests for getBreakContracts
fritzj2 cdfbae5
made getStudents() less brittle
fritzj2 2736b90
added notes to getBreakContracts test
fritzj2 22a1856
added a test for changing terms
fritzj2 2005c87
created date check in allocationManager
fritzj2 b9f9cc4
fixed comments for date logic
fritzj2 96ffe5f
fixed current term logic
fritzj2 ea29109
shortened js significantly.
fritzj2 73af911
added a check if no break contracts are found
fritzj2 76a167b
checks if the user is in a department
fritzj2 f74fb7d
test_allocationManager accurately reflects changes to logic
fritzj2 e4b2bc0
fixed test_allocationManager.py name
fritzj2 8c417f7
contractHours != None -> .is_null(False)
fritzj2 6299820
removed AddUserToDept route again
fritzj2 4b2ece2
fixed allocationManager import functions
fritzj2 1e4d1d4
fixed termCode function calls
fritzj2 18f1abc
added 404 error to no dept allocation view
fritzj2 7b0cd5a
added more comments to date contContracts
fritzj2 8ef2325
break table: spring -> spring break
fritzj2 a38dc46
test_GestSTudents now works correctly, still brittle
fritzj2 9c7b727
switched the position of total in the tables.
fritzj2 47f4f57
added case for no allocation being found
fritzj2 26be0a4
fixed order of table elements
fritzj2 b3ec72e
removed print statements from tests
fritzj2 d374990
fixed table resizing issue
fritzj2 4cc64c9
added tooltips to the Total Contracts Table
fritzj2 da32680
centered the text for the accordions
fritzj2 8d32fe2
added a tooltip for the break allocations
fritzj2 187a5b6
added a logic file to get all Current Terms
fritzj2 8747fda
removed unecessary import
fritzj2 dd2516f
began writing test getCurrentTerms.py
fritzj2 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
Some comments aren't visible on the classic Files Changed page.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| from app.models.term import Term | ||
| from datetime import datetime, date | ||
|
|
||
| def getCurrentTerms(): | ||
| ''' | ||
| Gets 3 primary terms for the current Academic Year (AY) | ||
| This means it attempt to get an AY, fall term, and spring term | ||
| This returns all three objects individually for each of the terms. | ||
| ''' | ||
| currentDate = date.today() | ||
| if currentDate.month <= 6: | ||
| # If it is the spring semester, then the term code is 1 year behind. e.g. 2025-2026 term code is 202500. Thus the - 100 in the spring term. | ||
| # The (year * 100) turns the year into an AY term code, 2025 -> 202500. The + 12/11 turns it into a fall or spring term. | ||
| springTerm = Term.select().where(Term.termCode == currentDate.year * 100 + 12 - 100).get() | ||
| currentAY = Term.select().where(Term.termCode == currentDate.year * 100 - 100).get() | ||
| fallTerm = Term.select().where(Term.termCode == currentDate.year * 100 + 11 - 100).get() | ||
| return currentAY, fallTerm, springTerm | ||
|
|
||
| else: | ||
| fallTerm = Term.select().where(Term.termCode == currentDate.year * 100 + 11).get() | ||
| currentAY = Term.select().where(Term.termCode == currentDate.year * 100).get() | ||
| springTerm = Term.select().where(Term.termCode == currentDate.year * 100 + 12).get() | ||
| return currentAY, fallTerm, springTerm | ||
|
|
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 |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| .grid-container { | ||
| display: grid; | ||
| grid-template-columns: 1fr 1fr; | ||
| } | ||
| .btn-success{ | ||
| align-self: center; | ||
| justify-self: end; | ||
| } | ||
| .card-header { | ||
| background-color: #efebeb; | ||
| margin-bottom: 7px; | ||
| height: 6rem; | ||
| } | ||
| .mb-0, .collapsed { | ||
| outline-color: none; | ||
| color: black; | ||
| font-size: 18px; | ||
| font-weight: 525; | ||
| } | ||
| .accordion{ | ||
| padding-left: 5%; | ||
| padding-right: 5%; | ||
| } | ||
| .table-striped { | ||
| table-layout:fixed; | ||
| width:100%; | ||
| } | ||
| .table-striped tbody tr:nth-of-type(odd) { | ||
| background-color: #f2f2f2; | ||
| } | ||
| .btn-info{ | ||
| justify-self:flex-end; | ||
| align-self: center; | ||
| margin-left: 4px | ||
| } | ||
| .accordion-arrow { | ||
| display: inline-block; | ||
| transition: transform 0.2s ease-in-out; | ||
| } | ||
| .btn.collapsed .accordion-arrow { | ||
| transform: rotate(-90deg); | ||
| } | ||
| .btn:not(.collapsed) .accordion-arrow { | ||
| transform: rotate(0deg); | ||
| } | ||
| .button-container { | ||
| display:flex; | ||
| justify-content:end; | ||
| } | ||
| .btn-block{ | ||
| align-items: center; | ||
| align-self: center; | ||
| text-align: left; | ||
| justify-content: center; | ||
| height: 100% | ||
| } | ||
| .termDisplay{ | ||
| margin-right:auto; | ||
| } | ||
| .bi-info-circle { | ||
| padding: 3px 3.5px 1.5px 3.5px; | ||
| font-size: 1.5rem; | ||
| vertical-align: middle; | ||
| color:#6e6e6e; | ||
| } |
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 |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| $(document).ready( function(){ | ||
| function initTable(selector) { | ||
| return $(selector).DataTable({ | ||
| pageLength: 25, | ||
| info: false, | ||
| lengthChange: false, | ||
| searching: false, | ||
| paging: false, | ||
| order: [] | ||
| }); | ||
| } | ||
|
|
||
| const fallTermPrimaries = initTable('#fallTermPrimaries'); | ||
| const fallTermSecondaries = initTable('#fallTermSecondaries'); | ||
| const springTermPrimaries = initTable('#springTermPrimaries'); | ||
| const springTermSecondaries = initTable('#springTermSecondaries'); | ||
| const breakTable = initTable('#breakTable'); | ||
| }); | ||
|
|
||
| $(function () { | ||
| $('[data-toggle="tooltip"]').tooltip() | ||
| }) |
Oops, something went wrong.
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.
have your accordion words to the left