Skip to content

changes in new-allocation-card#654

Open
conwelld wants to merge 7 commits into
department-portal-basefrom
new-allocation-card
Open

changes in new-allocation-card#654
conwelld wants to merge 7 commits into
department-portal-basefrom
new-allocation-card

Conversation

@conwelld

Copy link
Copy Markdown

Allocation card revert merge

  • There was no way to access an allocation card from the department portals page, where one could view a summary of their allocations and click a view allocation button.

Changes

  • Added summary to the view allocation card that changes based on demo data
  • Added CSS styling to the HTML file
  • added allocation logic to the main routed file that iterates through labor status forms
  • Changed HTML to have card space for all three cards to be added
  • added demo data to students and forms so data looked more presentable
  • added information icon to AY as well as the break hours to give more context to what users are seeing.
  • added CSS styling to make the information icon
  • added JavaScript to allow for Bootstrap tooltips
  • added css styling that changes based on window size
image image image

Testing

  • Used 'flask run' to load the page, and everything shows up as it should
  • Reset the database, and no errors arose

@conwelld conwelld self-assigned this Jul 21, 2026
@conwelld
conwelld requested review from BetterRocket and fritzj2 July 21, 2026 14:59
Comment thread app/controllers/main_routes/main_routes.py Outdated
Comment thread app/controllers/main_routes/main_routes.py
Comment thread app/controllers/main_routes/main_routes.py Outdated
@conwelld conwelld changed the title added changes from previous branch to avoid all files being commited new-allocation-card changes in new-allocation-card Jul 21, 2026
Comment thread app/static/css/departmentPortal.css Outdated
@conwelld

Copy link
Copy Markdown
Author

Thanks for looking into this. I have fixed the comments you have made (removed code from other branches and added comments to logic)

Comment thread app/static/css/departmentPortal.css Outdated
fritzj2

This comment was marked as outdated.

Comment thread app/controllers/main_routes/main_routes.py Outdated
Comment thread app/controllers/main_routes/main_routes.py Outdated
Comment thread app/controllers/main_routes/main_routes.py
break_hours = sumBreak,
)
@main_bp.route('/department/<org>/<account>/managepositions', methods=['GET'])
def managePositions(org, account):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The manage positions page is not under the scope of this issue. Remove.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We just remove the duplicated logic (if statement because it is suing the try and exception)

Comment thread database/demo_data.py
"endDate": "2025-09-01"
}
]
LaborStatusForm.insert_many(dummy_lsf).on_conflict_replace().execute() No newline at end of file

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good otherwise

Image

@BetterRocket

Copy link
Copy Markdown
Contributor

No logic file and tests needed yet because the logic related to pulling allocations and allocation utilization will be standardized by another team, whereupon this will have to be modified to use those functions.

…rvice.

  See #657 but beyond that we created allo files
@@ -1,5 +1,6 @@
from flask import render_template, request, json, redirect, url_for, send_file, g, flash, jsonify
from peewee import JOIN, DoesNotExist
from flask_bootstrap import forms

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove extra import line

from app.login_manager import require_login, logout
from app.logic.getTableData import getDatatableData
from app.logic.banner import Banner
from app.logic.allocation_utilization import get_department_allocation_summary

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

getDepartmentAllocationSummary other logic files uses camel casing

from app.logic.banner import Banner
from app.logic.allocation_utilization import get_department_allocation_summary
from app.models.allocation import Allocation
from app.logic.tracy import Tracy

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove tracy

try:
dept = Department.get(Department.ORG == org, Department.ACCOUNT == account)
except (NameError, DoesNotExist):
open_term = g.openTerm

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

camelcase and Dayton has talked to scott on not using term but we grab allocation but whenever we grab them we should sort them by most recent year so current term.

open_term = g.openTerm
term_code = open_term.termCode

if org and account:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if org and account can be removed as it is working regardless

mysql -u root -proot --execute="CREATE DATABASE IF NOT EXISTS \`lsf\`; CREATE USER IF NOT EXISTS 'lsf_user'@'%' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON *.* TO 'lsf_user'@'%';"
mysql -u root -proot --execute="CREATE DATABASE IF NOT EXISTS \`UTE\`; CREATE USER IF NOT EXISTS 'tracy_user'@'%' IDENTIFIED BY 'password'; GRANT ALL PRIVILEGES ON *.* TO 'tracy_user'@'%';"

cd database

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we don't touch those files unless there is a separate PR on these

<h1>Allocations</h1>
</div>
<div class="header-container">
<h3>{{ term.termName }} <i class="bi bi-info-circle" data-toggle="tooltip" data-placement="top" title="All values are shown as Used/Given"></i></h3> <h3>{{used_allocation}}/{{total_allocation or 0}} Positions</h3>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

used/allocated

</span>
</div>
<div class="media-body media-middle">
<h1>Allocations</h1>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<h3> not <h1>

<h1>Allocations</h1>
</div>
<div class="header-container">
<h3>{{ term.termName }} <i class="bi bi-info-circle" data-toggle="tooltip" data-placement="top" title="All values are shown as Used/Given"></i></h3> <h3>{{used_allocation}}/{{total_allocation or 0}} Positions</h3>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we are planning to use the most recent as a way in peewee we should find a way to get the term name for this summary card too

<h1>Allocations</h1>
</div>
<div class="header-container">
<h3>{{ term.termName }} <i class="bi bi-info-circle" data-toggle="tooltip" data-placement="top" title="All values are shown as Used/Given"></i></h3> <h3>{{used_allocation}}/{{total_allocation or 0}} Positions</h3>

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<h4> o

with something that has style changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants