From e4bbd5f0eb56993ba9672f0313785c47bf249250 Mon Sep 17 00:00:00 2001 From: Rafael Cenzano Date: Tue, 31 Oct 2023 17:38:23 -0400 Subject: [PATCH 1/4] Use https://prettier.io/ Prettier on all templates --- labconnect/templates/404.html | 3 +- labconnect/templates/500.html | 3 +- .../templates/URP_Basic_Information_Page.html | 579 +++++++++--------- labconnect/templates/base.html | 13 +- labconnect/templates/discover.html | 2 +- labconnect/templates/flash.html | 44 +- labconnect/templates/footer.html | 70 +-- labconnect/templates/messages.html | 494 +++++++-------- labconnect/templates/opportunity_details.html | 391 ++++++------ labconnect/templates/opportunitys.html | 2 +- labconnect/templates/posting.html | 2 +- labconnect/templates/professor.html | 2 +- labconnect/templates/profile.html | 2 +- labconnect/templates/sign_in.html | 3 +- labconnect/templates/tips_and_tricks.html | 33 +- 15 files changed, 870 insertions(+), 773 deletions(-) diff --git a/labconnect/templates/404.html b/labconnect/templates/404.html index df41793..2da45fa 100644 --- a/labconnect/templates/404.html +++ b/labconnect/templates/404.html @@ -6,5 +6,6 @@

404 Not Found

This page was not found

Return Home

-

If you believe this is a bug or error please create an Issue

+

If you believe this is a bug or error please create an Issue

{% endblock %} \ No newline at end of file diff --git a/labconnect/templates/500.html b/labconnect/templates/500.html index 046c89f..538739f 100644 --- a/labconnect/templates/500.html +++ b/labconnect/templates/500.html @@ -6,5 +6,6 @@

500 Server Error

The server had an error

Return Home

-

If you believe this is a bug or error please create an Issue

+

If you believe this is a bug or error please create an Issue

{% endblock %} \ No newline at end of file diff --git a/labconnect/templates/URP_Basic_Information_Page.html b/labconnect/templates/URP_Basic_Information_Page.html index 7d27112..6a5b36a 100644 --- a/labconnect/templates/URP_Basic_Information_Page.html +++ b/labconnect/templates/URP_Basic_Information_Page.html @@ -1,332 +1,363 @@ - - - - - - - Pricing test · Bootstrap v5.3 + + - + + + + + + Pricing test · Bootstrap v5.3 - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Check + + + + +
+
+
+ + + + Labconnect + - .bi { - vertical-align: -.125em; - fill: currentColor; - } + +
+
- .bd-mode-toggle { - z-index: 1500; - } +
- .bd-mode-toggle .dropdown-menu .active .bi { - display: block !important; - } - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Check - - - - -
-
- -
- -
- - + - Basic URP Information + Basic URP Information -

URP for Credit

+

URP for Credit

-

Earn 1 — 4 Credits

+

Earn 1 — 4 Credits

-

The number of credit hours you earn is negotiable between you and your faculty sponsor. If you choose this option, you and your sponsor will need to:

+

The number of credit hours you earn is negotiable between you and your faculty sponsor. If you choose this + option, you and your sponsor will need to:

-
    +
    • Determine how many credit hours you will earn (1 — 4).
    • -
    • Decide exactly what is expected of you, such as your time commitment (no more than 12 hours per week) and the type of work to be submitted.
    • +
    • Decide exactly what is expected of you, such as your time commitment (no more than 12 hours per week) and + the type of work to be submitted.
    • Agree on how your grade will be determined.
    • -
    +
-

Please refer to this link for additional information regarding credit hours. During the summer term, you will be billed for each URP credit hour for which you register.

+

Please refer to this link for additional + information regarding credit hours. During the summer term, you will be billed for each URP credit hour for + which you register.

-

Applying for Credit

+

Applying for Credit

-

With your sponsor, complete the 4UR Form and submit via the Registrar’s website under Registrar Requests. Be sure to CC your department's URP Coordinator.

+

With your sponsor, complete the 4UR Form and submit via the Registrar’s website under + Registrar Requests. Be sure to CC your department's URP Coordinator.

-

How to Submit a 4UR Form

+

How to Submit a 4UR Form

-

Fall 2023 applications are due Monday September 11th, 2023.

+

Fall 2023 applications are due Monday September 11th, 2023.

-

(The Registrar's "Add Course" deadline.)

+

(The Registrar's "Add Course" deadline.)

-
+
-

URP for Funding

+

URP for Funding

-

FUNDING SOURCE: Sponsoring Faculty Member or Department

+

FUNDING SOURCE: Sponsoring Faculty Member or Department

-

The faculty sponsor or department is responsible for the financial support of your research. The URP application should be submitted to the URP Coordinator for the department in which you are working.

+

The faculty sponsor or department is responsible for the financial support of your research. The URP + application should be submitted to the URP Coordinator for the department in which you are working.

-

The URP Coordinator:

+

The URP Coordinator:

-
    +
    • Reviews the URP application for completeness.
    • Processes your payroll request.
    • Forwards the URP application to the Office of Undergraduate Education for approval.
    • Will set up a schedule for reporting your hours via web-time entry.
    • -
    +
-

FUNDING MATCH: The Office of Undergraduate Education

+

FUNDING MATCH: The Office of Undergraduate Education

-

The Office of Undergraduate Education pays URP participants up to a maximum of $500 per semester in the form of matching funds. Applications that are submitted to the Office of Undergraduate Education that do not contain funding from the sponsoring department will not be approved for matching funds. Applications requesting funding from the Office of Undergraduate Education that are received after the application deadline will not be approved for matching funds. However, the sponsoring department's funding will be approved.

+

The Office of Undergraduate Education pays URP participants up to a maximum of $500 per semester in the form of + matching funds. Applications that are submitted to the Office of Undergraduate Education that do not contain + funding from the sponsoring department will not be approved for matching funds. Applications requesting funding + from the Office of Undergraduate Education that are received after the application deadline will not be approved + for matching funds. However, the sponsoring department's funding will be approved.

-

Applying for Funding

+

Applying for Funding

-

Complete the URP Application for Funding and obtain the required signatures. Completed applications should be emailed to the appropriate URP Coordinator. Email confirmation from the faculty research supervisor in lieu of a signature on the form will be accepted.

+

Complete the URP Application for Funding and obtain the required signatures. Completed + applications should be emailed to the appropriate URP Coordinator. Email confirmation from the faculty research + supervisor in lieu of a signature on the form will be accepted.

-

Fall 2023 applications are due Monday September 11th, 2023.

+

Fall 2023 applications are due Monday September 11th, 2023.

-

(The Registrar's "Add Course" deadline.)

+

(The Registrar's "Add Course" deadline.)

-

Getting Paid

+

Getting Paid

-

You and your sponsor determine the total amount you will earn and rate of pay. The minimum hourly rate for the URP is $14.20, however the rate that the sponsoring faculty member pays to you from their funds is negotiable. Decide how much time you will work; most projects expect eight hours per week not to exceed twelve hours of research per week. Pay checks are issued every other Friday.

+

You and your sponsor determine the total amount you will earn and rate of pay. The minimum hourly rate for the + URP is $14.20, however the rate that the sponsoring faculty member pays to you from their funds is negotiable. + Decide how much time you will work; most projects expect eight hours per week not to exceed twelve hours of + research per week. Pay checks are issued every other Friday.

-

More information on Undergraduate Research Information can be found here: https://info.rpi.edu/undergraduate-research/undergraduate-research-program-academic-year/

+

More information on Undergraduate Research Information can be found here: https://info.rpi.edu/undergraduate-research/undergraduate-research-program-academic-year/ +

- - - - -
- -
+ +
- - - + + + + + - \ No newline at end of file diff --git a/labconnect/templates/base.html b/labconnect/templates/base.html index 0a0e123..e31dc35 100644 --- a/labconnect/templates/base.html +++ b/labconnect/templates/base.html @@ -1,5 +1,6 @@ + {% block title %}{% endblock %} - LabConnect @@ -29,15 +30,16 @@ {% block head_js %} {% endblock %} - + + {% include "flash.html" %}
- {% include "navbar.html" %} - {% block content %} - {% endblock %} - {% include "footer.html" %} + {% include "navbar.html" %} + {% block content %} + {% endblock %} + {% include "footer.html" %}
{% block trailing_js %} {% endblock %} @@ -45,4 +47,5 @@ integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"> + \ No newline at end of file diff --git a/labconnect/templates/discover.html b/labconnect/templates/discover.html index 763356c..510213b 100644 --- a/labconnect/templates/discover.html +++ b/labconnect/templates/discover.html @@ -33,4 +33,4 @@ {% endfor %} - {% endblock %} +{% endblock %} \ No newline at end of file diff --git a/labconnect/templates/flash.html b/labconnect/templates/flash.html index 80e1984..b1a2c1c 100644 --- a/labconnect/templates/flash.html +++ b/labconnect/templates/flash.html @@ -1,10 +1,36 @@ -{% with errors = get_flashed_messages(category_filter=["error"]) %}{% if errors %}{% for msg in errors %}
- ×{{ msg }} -
{% endfor %}{% endif %}{% endwith %}{% with errors = get_flashed_messages(category_filter=["success"]) %}{% if errors %}{% for msg in errors %}
- ×{{ msg }} -
{% endfor %}{% endif %}{% endwith %}{% with errors = get_flashed_messages(category_filter=["info"]) %}{% if errors %}{% for msg in errors %}
- ×{{ msg }} -
{% endfor %}{% endif %}{% endwith %}{% with errors = get_flashed_messages(category_filter=["warning"]) %}{% if errors %}{% for msg in errors %}
- ×{{ msg }} -
{% endfor %}{% endif %} +{% with errors = get_flashed_messages(category_filter=["error"]) %} + {% if errors %} + {% for msg in errors %} +
+ ×{{ msg }} +
+ {% endfor %} + {% endif %} +{% endwith %} +{% with errors = get_flashed_messages(category_filter=["success"]) %} + {% if errors %} + {% for msg in errors %} +
+ ×{{ msg }} +
+ {% endfor %} + {% endif %} +{% endwith %} +{% with errors = get_flashed_messages(category_filter=["info"]) %} + {% if errors %} + {% for msg in errors %} +
+ ×{{ msg }} +
+ {% endfor %} + {% endif %} +{% endwith %} +{% with errors = get_flashed_messages(category_filter=["warning"]) %} + {% if errors %} + {% for msg in errors %} +
+ ×{{ msg }} +
+ {% endfor %} + {% endif %} {% endwith %} \ No newline at end of file diff --git a/labconnect/templates/footer.html b/labconnect/templates/footer.html index 071084d..ffdbdd2 100644 --- a/labconnect/templates/footer.html +++ b/labconnect/templates/footer.html @@ -1,37 +1,37 @@ \ No newline at end of file +
+
Features
+ +
+
+
Resources
+ +
+
+
About
+ +
+ + \ No newline at end of file diff --git a/labconnect/templates/messages.html b/labconnect/templates/messages.html index 6b17a94..f5e50f6 100644 --- a/labconnect/templates/messages.html +++ b/labconnect/templates/messages.html @@ -1,273 +1,289 @@ - - - - - - - - Messages + + - + + + + + + Messages - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Check - - - - -
-
-
+ + Messaging - -
-
-
- -
+ +
+
+
+
+
- - - - + + + - - - - -
- + +
+ - - + + + \ No newline at end of file diff --git a/labconnect/templates/opportunity_details.html b/labconnect/templates/opportunity_details.html index c7e13cb..8acd8bf 100644 --- a/labconnect/templates/opportunity_details.html +++ b/labconnect/templates/opportunity_details.html @@ -1,209 +1,212 @@ - - - Position Details - - - - - - - - - - - - -
-
- Professor Turner - Full Time Internship -
- -

Quantum Computing to solve NP-Complete Problems

- - - -

- About This Role -

- -
-
-
-
    -
  • Deadline
  • -
  • October 6th, 2023
  • -
-
- -
-
    -
  • Posted Date
  • -
  • October 6th, 2023
  • -
-
- -
-
    -
  • Seasonal Role
  • -
  • Summer 2024
  • -
-
-
- - - -
-
-
    -
  • Location
  • -
  • Russel Sage
  • -
-
- -
-
    -
  • Location
  • -
  • Russel Sage
  • -
-
- -
-
    -
  • Location
  • -
  • Russel Sage
  • -
-
-
+ + + + Position Details + + + + + + + + + + + + + +
+
+ Professor Turner + Full Time Internship +
+ +

Quantum Computing to solve NP-Complete Problems

+ + + +

+ About This Role +

+ +
+
+
+
    +
  • Deadline
  • +
  • October 6th, 2023
  • +
-

- Description -

+
+
    +
  • Posted Date
  • +
  • October 6th, 2023
  • +
+
-

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do - eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad - minim veniam, quis nostrud exercitation ullamco laboris nisi ut - aliquip ex ea commodo consequat. Duis aute irure dolor in - reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla - pariatur. Excepteur sint occaecat cupidatat non proident, sunt in - culpa qui officia deserunt mollit anim id est laborum. -

+
+
    +
  • Seasonal Role
  • +
  • Summer 2024
  • +
+
+
- + - +
+
+
    +
  • Location
  • +
  • Russel Sage
  • +
+
-
+
+
    +
  • Location
  • +
  • Russel Sage
  • +
+
-

- About Quantum Computing Center -

+
+
    +
  • Location
  • +
  • Russel Sage
  • +
+
+
+
-
-
-

Subject

+

+ Description +

-

Computer Science

-
+

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad + minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. Duis aute irure dolor in + reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in + culpa qui officia deserunt mollit anim id est laborum. +

-
-

Location

+ -

Vorhees Computing Center

-
-
+ -

- Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do - eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad - minim veniam, quis nostrud exercitation ullamco laboris nisi ut - aliquip ex ea commodo consequat. Duis aute irure dolor in - reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla - pariatur. Excepteur sint occaecat cupidatat non proident, sunt in - culpa qui officia deserunt mollit anim id est laborum. -

- +
+ +

+ About Quantum Computing Center +

+ +
+
+

Subject

+ +

Computer Science

+
+ +
+

Location

+ +

Vorhees Computing Center

+
- - + +

+ Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do + eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad + minim veniam, quis nostrud exercitation ullamco laboris nisi ut + aliquip ex ea commodo consequat. Duis aute irure dolor in + reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla + pariatur. Excepteur sint occaecat cupidatat non proident, sunt in + culpa qui officia deserunt mollit anim id est laborum. +

+ +
+ + + \ No newline at end of file diff --git a/labconnect/templates/opportunitys.html b/labconnect/templates/opportunitys.html index 8b6d3ab..202ae28 100644 --- a/labconnect/templates/opportunitys.html +++ b/labconnect/templates/opportunitys.html @@ -89,4 +89,4 @@
Computer Science
-{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/labconnect/templates/posting.html b/labconnect/templates/posting.html index 3bde821..8102da7 100644 --- a/labconnect/templates/posting.html +++ b/labconnect/templates/posting.html @@ -69,4 +69,4 @@

Posting

-{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/labconnect/templates/professor.html b/labconnect/templates/professor.html index c2f1f6c..f9aad09 100644 --- a/labconnect/templates/professor.html +++ b/labconnect/templates/professor.html @@ -142,4 +142,4 @@

-{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/labconnect/templates/profile.html b/labconnect/templates/profile.html index 9e37a73..7bd6a60 100644 --- a/labconnect/templates/profile.html +++ b/labconnect/templates/profile.html @@ -51,4 +51,4 @@
Add any relevant documents
-{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/labconnect/templates/sign_in.html b/labconnect/templates/sign_in.html index 9e1c2b8..cb6b0df 100644 --- a/labconnect/templates/sign_in.html +++ b/labconnect/templates/sign_in.html @@ -9,7 +9,8 @@ {% block content %}
- +

Please sign in

diff --git a/labconnect/templates/tips_and_tricks.html b/labconnect/templates/tips_and_tricks.html index ab5cc84..a1de2d0 100644 --- a/labconnect/templates/tips_and_tricks.html +++ b/labconnect/templates/tips_and_tricks.html @@ -1,5 +1,6 @@ + @@ -19,7 +20,9 @@ padding: 20px 0; } - h1, h2, h3 { + h1, + h2, + h3 { margin: 0; padding: 0; } @@ -63,37 +66,49 @@ } +

Tips and Tricks for LabConnect

Welcome to LabConnect Tips and Tricks!

-

This page is designed to help you navigate through LabConnect and make the most out of your experience. Whether you're reaching out to professors, trying to join projects, or navigating deadlines, we've got some helpful advice for you!

+

This page is designed to help you navigate through LabConnect and make the most out of your experience. + Whether you're reaching out to professors, trying to join projects, or navigating deadlines, we've got some + helpful advice for you!

1. Communication is Key: Emailing Professors

    -
  • Be Proactive: Don’t hesitate to reach out to professors via email. Professors appreciate students who take the initiative to communicate.
  • -
  • Be Clear and Concise: Clearly state your purpose, ask your questions, and express your interest in the project.
  • +
  • Be Proactive: Don’t hesitate to reach out to professors via email. Professors + appreciate students who take the initiative to communicate.
  • +
  • Be Clear and Concise: Clearly state your purpose, ask your questions, and express your + interest in the project.

2. Don’t Get Discouraged: Follow up In-Person

    -
  • Office Visits: If you don’t receive a response via email, try finding the professors in their office spaces. It demonstrates your commitment and can sometimes lead to more fruitful conversations.
  • -
  • Be Respectful: Respect their time and be prepared to introduce yourself and explain why you are interested in their project.
  • +
  • Office Visits: If you don’t receive a response via email, try finding the professors in + their office spaces. It demonstrates your commitment and can sometimes lead to more fruitful + conversations.
  • +
  • Be Respectful: Respect their time and be prepared to introduce yourself and explain why + you are interested in their project.

3. Missed the Deadline? It’s Not Always Over!

    -
  • Ask Politely: If you’ve missed a deadline, it’s worth reaching out to ask if you can still participate. Some professors can be quite lenient and understanding.
  • -
  • Unofficial Participation: Even if it's past the deadline, some students can still work on a project they are interested in, albeit unofficially. It’s about the learning experience!
  • +
  • Ask Politely: If you’ve missed a deadline, it’s worth reaching out to ask if you can + still participate. Some professors can be quite lenient and understanding.
  • +
  • Unofficial Participation: Even if it's past the deadline, some students can still work + on a project they are interested in, albeit unofficially. It’s about the learning experience!

4. Conclusion: Good Luck!

-

We hope these tips help you in making the most out of LabConnect. Remember, the initiative you take today can open doors for you tomorrow. Wishing you all the best in your endeavors!

+

We hope these tips help you in making the most out of LabConnect. Remember, the initiative you take today can + open doors for you tomorrow. Wishing you all the best in your endeavors!

Good luck, and happy connecting!

+ \ No newline at end of file From 893b443118a45287cf04f29f03af14ff40bb5631 Mon Sep 17 00:00:00 2001 From: Rafael Cenzano Date: Tue, 31 Oct 2023 17:40:23 -0400 Subject: [PATCH 2/4] update error page tests to accomodate formatting changes --- tests/test_errors.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_errors.py b/tests/test_errors.py index 57f3fa4..e966e92 100644 --- a/tests/test_errors.py +++ b/tests/test_errors.py @@ -14,8 +14,9 @@ def test_404_page(test_client) -> None: assert b"404 Not Found" in response.data assert b"This page was not found" in response.data assert b"Return Home" in response.data + assert b"If you believe this is a bug or error please create an" in response.data assert ( - b'If you believe this is a bug or error please create an Issue' + b'href="https://github.com/RafaelCenzano/LabConnect/issues">Issue' in response.data ) @@ -31,7 +32,8 @@ def test_500_page(test_client) -> None: assert b"500 Server Error" in response.data assert b"The server had an error" in response.data assert b"Return Home" in response.data + assert b"If you believe this is a bug or error please create an" in response.data assert ( - b'If you believe this is a bug or error please create an Issue' + b'href="https://github.com/RafaelCenzano/LabConnect/issues">Issue' in response.data ) From 80274404b3b95a5a8bf018a4cf6abe14f0b793aa Mon Sep 17 00:00:00 2001 From: Rafael Cenzano Date: Tue, 31 Oct 2023 20:06:13 -0400 Subject: [PATCH 3/4] format css --- labconnect/static/css/base.css | 292 ++++++++++++++++----------------- 1 file changed, 146 insertions(+), 146 deletions(-) diff --git a/labconnect/static/css/base.css b/labconnect/static/css/base.css index 8c2f5b0..50019fd 100644 --- a/labconnect/static/css/base.css +++ b/labconnect/static/css/base.css @@ -1,273 +1,273 @@ .bd-placeholder-img { - font-size: 1.125rem; - text-anchor: middle; - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; + font-size: 1.125rem; + text-anchor: middle; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; } @media (min-width: 768px) { - .bd-placeholder-img-lg { - font-size: 3.5rem; - } + .bd-placeholder-img-lg { + font-size: 3.5rem; + } } .b-example-divider { - width: 100%; - height: 3rem; - background-color: rgba(0, 0, 0, 0.1); - border: solid rgba(0, 0, 0, 0.15); - border-width: 1px 0; - box-shadow: inset 0 0.5em 1.5em rgba(0, 0, 0, 0.1), - inset 0 0.125em 0.5em rgba(0, 0, 0, 0.15); + width: 100%; + height: 3rem; + background-color: rgba(0, 0, 0, 0.1); + border: solid rgba(0, 0, 0, 0.15); + border-width: 1px 0; + box-shadow: inset 0 0.5em 1.5em rgba(0, 0, 0, 0.1), + inset 0 0.125em 0.5em rgba(0, 0, 0, 0.15); } .b-example-vr { - flex-shrink: 0; - width: 1.5rem; - height: 100vh; + flex-shrink: 0; + width: 1.5rem; + height: 100vh; } .bi { - vertical-align: -0.125em; - fill: currentColor; + vertical-align: -0.125em; + fill: currentColor; } .nav-scroller { - position: relative; - z-index: 2; - height: 2.75rem; - overflow-y: hidden; + position: relative; + z-index: 2; + height: 2.75rem; + overflow-y: hidden; } .nav-scroller .nav { - display: flex; - flex-wrap: nowrap; - padding-bottom: 1rem; - margin-top: -1px; - overflow-x: auto; - text-align: center; - white-space: nowrap; - -webkit-overflow-scrolling: touch; + display: flex; + flex-wrap: nowrap; + padding-bottom: 1rem; + margin-top: -1px; + overflow-x: auto; + text-align: center; + white-space: nowrap; + -webkit-overflow-scrolling: touch; } .btn-bd-primary { - --bd-violet-bg: #712cf9; - --bd-violet-rgb: 112.520718, 44.062154, 249.437846; - - --bs-btn-font-weight: 600; - --bs-btn-color: var(--bs-white); - --bs-btn-bg: var(--bd-violet-bg); - --bs-btn-border-color: var(--bd-violet-bg); - --bs-btn-hover-color: var(--bs-white); - --bs-btn-hover-bg: #6528e0; - --bs-btn-hover-border-color: #6528e0; - --bs-btn-focus-shadow-rgb: var(--bd-violet-rgb); - --bs-btn-active-color: var(--bs-btn-hover-color); - --bs-btn-active-bg: #5a23c8; - --bs-btn-active-border-color: #5a23c8; + --bd-violet-bg: #712cf9; + --bd-violet-rgb: 112.520718, 44.062154, 249.437846; + + --bs-btn-font-weight: 600; + --bs-btn-color: var(--bs-white); + --bs-btn-bg: var(--bd-violet-bg); + --bs-btn-border-color: var(--bd-violet-bg); + --bs-btn-hover-color: var(--bs-white); + --bs-btn-hover-bg: #6528e0; + --bs-btn-hover-border-color: #6528e0; + --bs-btn-focus-shadow-rgb: var(--bd-violet-rgb); + --bs-btn-active-color: var(--bs-btn-hover-color); + --bs-btn-active-bg: #5a23c8; + --bs-btn-active-border-color: #5a23c8; } .bd-mode-toggle { - z-index: 1500; + z-index: 1500; } .bd-mode-toggle .dropdown-menu .active .bi { - display: block !important; + display: block !important; } .bd-placeholder-img { - font-size: 1.125rem; - text-anchor: middle; - -webkit-user-select: none; - -moz-user-select: none; - user-select: none; + font-size: 1.125rem; + text-anchor: middle; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; } @media (min-width: 768px) { - .bd-placeholder-img-lg { - font-size: 3.5rem; - } + .bd-placeholder-img-lg { + font-size: 3.5rem; + } } .b-example-divider { - width: 100%; - height: 3rem; - background-color: rgba(0, 0, 0, 0.1); - border: solid rgba(0, 0, 0, 0.15); - border-width: 1px 0; - box-shadow: inset 0 0.5em 1.5em rgba(0, 0, 0, 0.1), - inset 0 0.125em 0.5em rgba(0, 0, 0, 0.15); + width: 100%; + height: 3rem; + background-color: rgba(0, 0, 0, 0.1); + border: solid rgba(0, 0, 0, 0.15); + border-width: 1px 0; + box-shadow: inset 0 0.5em 1.5em rgba(0, 0, 0, 0.1), + inset 0 0.125em 0.5em rgba(0, 0, 0, 0.15); } .b-example-vr { - flex-shrink: 0; - width: 1.5rem; - height: 100vh; + flex-shrink: 0; + width: 1.5rem; + height: 100vh; } .bi { - vertical-align: -0.125em; - fill: currentColor; + vertical-align: -0.125em; + fill: currentColor; } .nav-scroller { - position: relative; - z-index: 2; - height: 2.75rem; - overflow-y: hidden; + position: relative; + z-index: 2; + height: 2.75rem; + overflow-y: hidden; } .nav-scroller .nav { - display: flex; - flex-wrap: nowrap; - padding-bottom: 1rem; - margin-top: -1px; - overflow-x: auto; - text-align: center; - white-space: nowrap; - -webkit-overflow-scrolling: touch; + display: flex; + flex-wrap: nowrap; + padding-bottom: 1rem; + margin-top: -1px; + overflow-x: auto; + text-align: center; + white-space: nowrap; + -webkit-overflow-scrolling: touch; } .btn-bd-primary { - --bd-violet-bg: #712cf9; - --bd-violet-rgb: 112.520718, 44.062154, 249.437846; - - --bs-btn-font-weight: 600; - --bs-btn-color: var(--bs-white); - --bs-btn-bg: var(--bd-violet-bg); - --bs-btn-border-color: var(--bd-violet-bg); - --bs-btn-hover-color: var(--bs-white); - --bs-btn-hover-bg: #6528e0; - --bs-btn-hover-border-color: #6528e0; - --bs-btn-focus-shadow-rgb: var(--bd-violet-rgb); - --bs-btn-active-color: var(--bs-btn-hover-color); - --bs-btn-active-bg: #5a23c8; - --bs-btn-active-border-color: #5a23c8; + --bd-violet-bg: #712cf9; + --bd-violet-rgb: 112.520718, 44.062154, 249.437846; + + --bs-btn-font-weight: 600; + --bs-btn-color: var(--bs-white); + --bs-btn-bg: var(--bd-violet-bg); + --bs-btn-border-color: var(--bd-violet-bg); + --bs-btn-hover-color: var(--bs-white); + --bs-btn-hover-bg: #6528e0; + --bs-btn-hover-border-color: #6528e0; + --bs-btn-focus-shadow-rgb: var(--bd-violet-rgb); + --bs-btn-active-color: var(--bs-btn-hover-color); + --bs-btn-active-bg: #5a23c8; + --bs-btn-active-border-color: #5a23c8; } .bd-mode-toggle { - z-index: 1500; + z-index: 1500; } .bd-mode-toggle .dropdown-menu .active .bi { - display: block !important; + display: block !important; } body { - background-color: white; + background-color: white; } .sign-in { - margin-left: 1rem; - margin-right: 1rem; + margin-left: 1rem; + margin-right: 1rem; } .position-card-row { - display: grid; - columns: 8; + display: grid; + columns: 8; } .position-card { - margin-top: 1rem; - margin-bottom: 1rem; - width: 40rem; + margin-top: 1rem; + margin-bottom: 1rem; + width: 40rem; } .bug-report { - margin-top: 5rem; + margin-top: 5rem; } .top-margin { - margin-top: 1rem; + margin-top: 1rem; } .logo { - margin-left: 1rem; - margin-right: 1rem; + margin-left: 1rem; + margin-right: 1rem; } body { - background-image: linear-gradient( - 180deg, - var(--bs-secondary-bg), - var(--bs-body-bg) 100px, - var(--bs-body-bg) - ); + background-image: linear-gradient( + 180deg, + var(--bs-secondary-bg), + var(--bs-body-bg) 100px, + var(--bs-body-bg) + ); } .container { - max-width: 960px; + max-width: 960px; } .pricing-header { - max-width: 700px; + max-width: 700px; } .search { - color: white; - grid-column: 1; + color: white; + grid-column: 1; } .search-grid { - display: grid; - columns: 2; + display: grid; + columns: 2; } .search-grid-buttons { - display: flex; - justify-content: flex-end; - gap: 0.5rem; + display: flex; + justify-content: flex-end; + gap: 0.5rem; } .no-border-radius { - border-radius: 0%; + border-radius: 0%; } .position-grid { - display: grid; - grid-template-columns: repeat(12, 1fr); + display: grid; + grid-template-columns: repeat(12, 1fr); } .position-card { - height: 100%; - grid-column: span 4; - overflow: scroll; + height: 100%; + grid-column: span 4; + overflow: scroll; } .profile-contacts { - display: flex; - gap: 1rem; - width: 100%; + display: flex; + gap: 1rem; + width: 100%; } .center-flex { - display: flex; - align-items: center; + display: flex; + align-items: center; } .profile-img { - width: 10rem; - height: 10rem; - border-radius: 100%; - background-color: white; + width: 10rem; + height: 10rem; + border-radius: 100%; + background-color: white; } .flex-gap { - display: flex; - gap: 3rem; + display: flex; + gap: 3rem; } .profile-card { - min-width: 500px; + min-width: 500px; } .left-float { - float: left; + float: left; } .documents { - display: flex; - gap: 1rem; - width: 100%; -} \ No newline at end of file + display: flex; + gap: 1rem; + width: 100%; +} From df8ab69a6be9bc58d020a63f38d324751c66a194 Mon Sep 17 00:00:00 2001 From: Rafael Cenzano Date: Tue, 31 Oct 2023 20:06:37 -0400 Subject: [PATCH 4/4] format main js --- labconnect/static/js/color-modes.js | 108 +++++++++++++++------------- 1 file changed, 59 insertions(+), 49 deletions(-) diff --git a/labconnect/static/js/color-modes.js b/labconnect/static/js/color-modes.js index 9f22daa..d87ba5a 100644 --- a/labconnect/static/js/color-modes.js +++ b/labconnect/static/js/color-modes.js @@ -5,76 +5,86 @@ */ (() => { - 'use strict' + "use strict"; - const getStoredTheme = () => localStorage.getItem('theme') - const setStoredTheme = theme => localStorage.setItem('theme', theme) + const getStoredTheme = () => localStorage.getItem("theme"); + const setStoredTheme = (theme) => localStorage.setItem("theme", theme); const getPreferredTheme = () => { - const storedTheme = getStoredTheme() + const storedTheme = getStoredTheme(); if (storedTheme) { - return storedTheme + return storedTheme; } - return window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light' - } + return window.matchMedia("(prefers-color-scheme: dark)").matches + ? "dark" + : "light"; + }; - const setTheme = theme => { - if (theme === 'auto' && window.matchMedia('(prefers-color-scheme: dark)').matches) { - document.documentElement.setAttribute('data-bs-theme', 'dark') + const setTheme = (theme) => { + if ( + theme === "auto" && + window.matchMedia("(prefers-color-scheme: dark)").matches + ) { + document.documentElement.setAttribute("data-bs-theme", "dark"); } else { - document.documentElement.setAttribute('data-bs-theme', theme) + document.documentElement.setAttribute("data-bs-theme", theme); } - } + }; - setTheme(getPreferredTheme()) + setTheme(getPreferredTheme()); const showActiveTheme = (theme, focus = false) => { - const themeSwitcher = document.querySelector('#bd-theme') + const themeSwitcher = document.querySelector("#bd-theme"); if (!themeSwitcher) { - return + return; } - const themeSwitcherText = document.querySelector('#bd-theme-text') - const activeThemeIcon = document.querySelector('.theme-icon-active use') - const btnToActive = document.querySelector(`[data-bs-theme-value="${theme}"]`) - const svgOfActiveBtn = btnToActive.querySelector('svg use').getAttribute('href') + const themeSwitcherText = document.querySelector("#bd-theme-text"); + const activeThemeIcon = document.querySelector(".theme-icon-active use"); + const btnToActive = document.querySelector( + `[data-bs-theme-value="${theme}"]` + ); + const svgOfActiveBtn = btnToActive + .querySelector("svg use") + .getAttribute("href"); - document.querySelectorAll('[data-bs-theme-value]').forEach(element => { - element.classList.remove('active') - element.setAttribute('aria-pressed', 'false') - }) + document.querySelectorAll("[data-bs-theme-value]").forEach((element) => { + element.classList.remove("active"); + element.setAttribute("aria-pressed", "false"); + }); - btnToActive.classList.add('active') - btnToActive.setAttribute('aria-pressed', 'true') - activeThemeIcon.setAttribute('href', svgOfActiveBtn) - const themeSwitcherLabel = `${themeSwitcherText.textContent} (${btnToActive.dataset.bsThemeValue})` - themeSwitcher.setAttribute('aria-label', themeSwitcherLabel) + btnToActive.classList.add("active"); + btnToActive.setAttribute("aria-pressed", "true"); + activeThemeIcon.setAttribute("href", svgOfActiveBtn); + const themeSwitcherLabel = `${themeSwitcherText.textContent} (${btnToActive.dataset.bsThemeValue})`; + themeSwitcher.setAttribute("aria-label", themeSwitcherLabel); if (focus) { - themeSwitcher.focus() + themeSwitcher.focus(); } - } + }; - window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', () => { - const storedTheme = getStoredTheme() - if (storedTheme !== 'light' && storedTheme !== 'dark') { - setTheme(getPreferredTheme()) - } - }) + window + .matchMedia("(prefers-color-scheme: dark)") + .addEventListener("change", () => { + const storedTheme = getStoredTheme(); + if (storedTheme !== "light" && storedTheme !== "dark") { + setTheme(getPreferredTheme()); + } + }); - window.addEventListener('DOMContentLoaded', () => { - showActiveTheme(getPreferredTheme()) + window.addEventListener("DOMContentLoaded", () => { + showActiveTheme(getPreferredTheme()); - document.querySelectorAll('[data-bs-theme-value]') - .forEach(toggle => { - toggle.addEventListener('click', () => { - const theme = toggle.getAttribute('data-bs-theme-value') - setStoredTheme(theme) - setTheme(theme) - showActiveTheme(theme, true) - }) - }) - }) -})() + document.querySelectorAll("[data-bs-theme-value]").forEach((toggle) => { + toggle.addEventListener("click", () => { + const theme = toggle.getAttribute("data-bs-theme-value"); + setStoredTheme(theme); + setTheme(theme); + showActiveTheme(theme, true); + }); + }); + }); +})();