Spaces:
Runtime error
Runtime error
Caitlin Blackmore commited on
Commit ·
0726b70
1
Parent(s): d61cc16
add custom messages
Browse files- main.py +7 -3
- templates/candidate_matcher.html +1 -1
- templates/find_hire.html +5 -2
- templates/find_match.html +5 -3
- templates/find_my_match.html +1 -1
main.py
CHANGED
|
@@ -10,7 +10,7 @@
|
|
| 10 |
from fastapi import FastAPI, Request, Form, File, UploadFile, BackgroundTasks
|
| 11 |
from fastapi.templating import Jinja2Templates
|
| 12 |
from fastapi.staticfiles import StaticFiles
|
| 13 |
-
from fastapi.responses import HTMLResponse
|
| 14 |
import pandas as pd
|
| 15 |
from scrape_onet import get_onet_code, get_onet_description, get_onet_tasks
|
| 16 |
from match_utils import neighborhoods, get_resume, skillNER, sim_result_loop, get_links
|
|
@@ -71,7 +71,9 @@ async def post_matches(request: Request, resume: UploadFile = File(...)):
|
|
| 71 |
|
| 72 |
@app.get("/find-match/", response_class=HTMLResponse)
|
| 73 |
def find_match(request: Request):
|
| 74 |
-
|
|
|
|
|
|
|
| 75 |
|
| 76 |
@app.get("/find-my-hire/", response_class=HTMLResponse)
|
| 77 |
def get_hires(request: Request):
|
|
@@ -90,4 +92,6 @@ async def post_matches(request: Request, jobdesc: UploadFile = File(...)):
|
|
| 90 |
|
| 91 |
@app.get("/find-hire/", response_class=HTMLResponse)
|
| 92 |
def find_hire(request: Request):
|
| 93 |
-
|
|
|
|
|
|
|
|
|
| 10 |
from fastapi import FastAPI, Request, Form, File, UploadFile, BackgroundTasks
|
| 11 |
from fastapi.templating import Jinja2Templates
|
| 12 |
from fastapi.staticfiles import StaticFiles
|
| 13 |
+
from fastapi.responses import HTMLResponse, Response
|
| 14 |
import pandas as pd
|
| 15 |
from scrape_onet import get_onet_code, get_onet_description, get_onet_tasks
|
| 16 |
from match_utils import neighborhoods, get_resume, skillNER, sim_result_loop, get_links
|
|
|
|
| 71 |
|
| 72 |
@app.get("/find-match/", response_class=HTMLResponse)
|
| 73 |
def find_match(request: Request):
|
| 74 |
+
jobselection = str(request.url).split("=")[1].replace('HTTP/1.1', '').replace("-", " ")
|
| 75 |
+
print(jobselection)
|
| 76 |
+
return templates.TemplateResponse('find_match.html', context={'request': request, 'jobselection': jobselection})
|
| 77 |
|
| 78 |
@app.get("/find-my-hire/", response_class=HTMLResponse)
|
| 79 |
def get_hires(request: Request):
|
|
|
|
| 92 |
|
| 93 |
@app.get("/find-hire/", response_class=HTMLResponse)
|
| 94 |
def find_hire(request: Request):
|
| 95 |
+
jobselection = str(request.url).split("=")[1].replace('HTTP/1.1', '').replace("-", " ")
|
| 96 |
+
print(jobselection)
|
| 97 |
+
return templates.TemplateResponse('find_hire.html', context={'request': request, 'jobselection': jobselection})
|
templates/candidate_matcher.html
CHANGED
|
@@ -57,7 +57,7 @@
|
|
| 57 |
{% for n in range(1,11) %}
|
| 58 |
<tr>
|
| 59 |
<th class="output__list-item" scope="row">
|
| 60 |
-
<input type="radio"
|
| 61 |
<a class="output__table-item" href={{ links[n] }}>{{ simResults.loc[n, 'JobTitle'] }}</a>
|
| 62 |
</th>
|
| 63 |
<td class="output__list-item" style="text-align: center">
|
|
|
|
| 57 |
{% for n in range(1,11) %}
|
| 58 |
<tr>
|
| 59 |
<th class="output__list-item" scope="row">
|
| 60 |
+
<input type="radio" name="jobselection" class="jobselection" value={{ simResults.loc[n, 'JobTitle'].replace(" ", "-") }} />
|
| 61 |
<a class="output__table-item" href={{ links[n] }}>{{ simResults.loc[n, 'JobTitle'] }}</a>
|
| 62 |
</th>
|
| 63 |
<td class="output__list-item" style="text-align: center">
|
templates/find_hire.html
CHANGED
|
@@ -20,8 +20,11 @@
|
|
| 20 |
</ul>
|
| 21 |
</header>
|
| 22 |
<main class="main">
|
| 23 |
-
<h1 class="pagetitle">
|
| 24 |
-
<h2 class="pagesubtitle">We're sorry! This page is currently under construction.
|
|
|
|
|
|
|
|
|
|
| 25 |
</main>
|
| 26 |
<footer class="footer">
|
| 27 |
<ul class="footer__text">
|
|
|
|
| 20 |
</ul>
|
| 21 |
</header>
|
| 22 |
<main class="main">
|
| 23 |
+
<h1 class="pagetitle">Matching Candidates</h1>
|
| 24 |
+
<h2 class="pagesubtitle">We're sorry! This page is currently under construction.</h2>
|
| 25 |
+
<h2 class="pagesubtitle">Please check back soon to get candidates who are a great match for your {{ jobselection }} role!</h2>
|
| 26 |
+
<br>
|
| 27 |
+
<br>
|
| 28 |
</main>
|
| 29 |
<footer class="footer">
|
| 30 |
<ul class="footer__text">
|
templates/find_match.html
CHANGED
|
@@ -20,9 +20,11 @@
|
|
| 20 |
</ul>
|
| 21 |
</header>
|
| 22 |
<main class="main">
|
| 23 |
-
<h1 class="pagetitle">
|
| 24 |
-
<h2 class="pagesubtitle">We're sorry! This page is currently under construction.
|
| 25 |
-
|
|
|
|
|
|
|
| 26 |
<footer class="footer">
|
| 27 |
<ul class="footer__text">
|
| 28 |
<li class="footer__text-item">© 2023 Pathfinder</li>
|
|
|
|
| 20 |
</ul>
|
| 21 |
</header>
|
| 22 |
<main class="main">
|
| 23 |
+
<h1 class="pagetitle">Matching Jobs</h1>
|
| 24 |
+
<h2 class="pagesubtitle">We're sorry! This page is currently under construction.</h2>
|
| 25 |
+
<h2 class="pagesubtitle">Please check back soon to get {{ jobselection }} jobs that are a great match for your skillset and interests!</h2>
|
| 26 |
+
<br>
|
| 27 |
+
<br> </main>
|
| 28 |
<footer class="footer">
|
| 29 |
<ul class="footer__text">
|
| 30 |
<li class="footer__text-item">© 2023 Pathfinder</li>
|
templates/find_my_match.html
CHANGED
|
@@ -57,7 +57,7 @@
|
|
| 57 |
{% for n in range(1,11) %}
|
| 58 |
<tr>
|
| 59 |
<th class="output__list-item" scope="row">
|
| 60 |
-
<input type="radio"
|
| 61 |
<a class="output__table-item" href={{ links[n] }}>{{ simResults.loc[n, 'JobTitle'] }}</a>
|
| 62 |
</th>
|
| 63 |
<td class="output__list-item" style="text-align: center">
|
|
|
|
| 57 |
{% for n in range(1,11) %}
|
| 58 |
<tr>
|
| 59 |
<th class="output__list-item" scope="row">
|
| 60 |
+
<input type="radio" name="jobselection" class="jobselection" value={{ simResults.loc[n, 'JobTitle'].replace(' ', '-') }} />
|
| 61 |
<a class="output__table-item" href={{ links[n] }}>{{ simResults.loc[n, 'JobTitle'] }}</a>
|
| 62 |
</th>
|
| 63 |
<td class="output__list-item" style="text-align: center">
|