Skip to content
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

Feature send email #49

Open
wants to merge 29 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
16bec2f
Resolving issues filtering with no organizations
SamuelVch98 Jul 27, 2024
585ace3
use toast to display errors
SamuelVch98 Jul 29, 2024
0da87f0
Merge branch 'UCL-INGI:main' into main
SamuelVch98 Jul 29, 2024
eada3ca
Fix small issues
SamuelVch98 Jul 30, 2024
7cae218
create unique file for toast and use it
SamuelVch98 Jul 30, 2024
4a633f6
Merge branch 'UCL-INGI:main' into main
SamuelVch98 Jul 30, 2024
99f16d6
Merge branch 'UCL-INGI:main' into main
SamuelVch98 Aug 20, 2024
cf3938d
Merge branch 'UCL-INGI:main' into main
SamuelVch98 Sep 12, 2024
ad8658c
Merge branch 'UCL-INGI:main' into main
SamuelVch98 Oct 1, 2024
1177b11
indicate the type of user to be displayed
SamuelVch98 Oct 9, 2024
9f8b4cc
Fix the bug that prevents you from changing organisation if none was …
SamuelVch98 Oct 9, 2024
ec2bdc1
Merge branch 'UCL-INGI:main' into main
SamuelVch98 Oct 13, 2024
97023c8
Merge branch 'UCL-INGI:main' into main
SamuelVch98 Oct 15, 2024
af8da85
Merge branch 'UCL-INGI:main' into main
SamuelVch98 Oct 15, 2024
4db087a
Merge branch 'UCL-INGI:main' into main
SamuelVch98 Oct 16, 2024
d40c27b
Merge branch 'UCL-INGI:main' into main
SamuelVch98 Oct 17, 2024
7d55991
Merge branch 'UCL-INGI:main' into main
SamuelVch98 Nov 28, 2024
cce7b20
Merge branch 'UCL-INGI:main' into main
SamuelVch98 Dec 3, 2024
8c94489
Add handsontable to the app
SamuelVch98 Jul 16, 2024
9698880
Finish integrating the handsontable panel
SamuelVch98 Jul 16, 2024
2af10b9
update README
SamuelVch98 Jul 16, 2024
a7f1f7d
Fix PR request
SamuelVch98 Jul 26, 2024
11ab5cb
rabse + modifying the code to display several promoters
SamuelVch98 Oct 21, 2024
e1cae5a
create a new table to store more easily whether a publication is for …
SamuelVch98 Oct 15, 2024
84b4903
continue to develop the publication just for teachers
SamuelVch98 Oct 15, 2024
5a446f2
display of courses assigned in the researcher and teacher view
SamuelVch98 Oct 16, 2024
a7a0e7e
send a mail to the users concerned after publication of the assignments
SamuelVch98 Oct 27, 2024
3345eae
add mail template
SamuelVch98 Oct 28, 2024
d0f4c6c
small fix
SamuelVch98 Dec 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Resolving issues filtering with no organizations
  • Loading branch information
SamuelVch98 committed Jul 27, 2024
commit 16bec2f5e1b5b69789435988c578d5c1f3651186
14 changes: 14 additions & 0 deletions course.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,11 @@ def assign_teachers_to_course(course_id, course_year, assigned_teachers):
raise e


def count_org(orgs):
if len(orgs) == 0:
return "Please select at least one organization", 400


@course_bp.route('/add_course', methods=['POST', 'GET'])
@login_required
@check_access_level(Role.ADMIN)
Expand All @@ -87,6 +92,9 @@ def add_course():
language = request.form['language']

organization_ids = request.form.getlist('organization_code[]')
check_orgs = count_org(organization_ids)
if check_orgs:
return make_response(*check_orgs)

try:
is_course = db.session.query(Course).filter(Course.code == code,
Expand Down Expand Up @@ -167,6 +175,9 @@ def update_course_info():
nbr_monitor_students = request.form['nbr_monitor_students']
assigned_teachers = request.form.getlist('assigned_teachers[]')
organisation_code = request.form.getlist('organization_code[]')
check_orgs = count_org(organisation_code)
if check_orgs:
return make_response(*check_orgs)

course = db.session.query(Course).filter(Course.id == course_id, Course.year == year).first()
if not course:
Expand Down Expand Up @@ -239,6 +250,9 @@ def add_duplicate_course():
course_id = request.form['course_id']
assigned_teachers = request.form.getlist('assigned_teachers[]')
organisation_code = request.form.getlist('organization_code[]')
check_orgs = count_org(organisation_code)
if check_orgs:
return make_response(*check_orgs)

try:
duplicate_course = Course(id=course_id, code=code, title=title, quadri=quadri, year=year,
Expand Down
14 changes: 3 additions & 11 deletions static/scripts/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,18 +75,10 @@ function filter(page) {

if (activeOrganizations.length > 0) {
items.each(function () {
let organizations;
let showItem;

if (page === "course") {
organizations = $(this).data('organizations').toString().split(',');
showItem = activeOrganizations.some(org => organizations.includes(org.toString()));
}
else if (page === "user") {
organizations = $(this).data('organizations');
showItem = activeOrganizations.includes(organizations);
}
let organizations = $(this).data('organizations').toString().split(',');
let showItem = activeOrganizations.some(org => organizations.includes(org.toString()));

// Show or hide the item based on whether it belongs to any active organization
if (showItem) {
$(this).show();
} else {
Expand Down