Skip to content

Commit 5bc7521

Browse files
committed
ran precommit
1 parent 0202361 commit 5bc7521

File tree

85 files changed

+956
-598
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+956
-598
lines changed

csm_web/csm_web/apps.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22

33

44
class AdminConfig(DefaultAdminConfig):
5-
default_site = 'csm_web.admin.AdminSite'
5+
default_site = "csm_web.admin.AdminSite"

csm_web/csm_web/urls.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,25 @@
1313
1. Import the include() function: from django.urls import include, path
1414
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
1515
"""
16-
from django.contrib import admin
17-
from django.contrib.auth.views import logout_then_login
18-
from django.urls import path, include
19-
from django.shortcuts import render
2016

2117
from django.conf import settings
2218
from django.conf.urls.static import static
19+
from django.contrib import admin
20+
from django.contrib.auth.views import logout_then_login
2321
from django.contrib.staticfiles.views import serve
22+
from django.shortcuts import render
23+
from django.urls import include, path
2424
from django.views.decorators.cache import cache_control
2525

2626
urlpatterns = [
2727
path("admin/", admin.site.urls),
2828
path("api/", include("scheduler.urls")),
29-
path("login/", lambda request: render(request, "frontend/login.html", context={"DJANGO_ENV": settings.DJANGO_ENV})),
29+
path(
30+
"login/",
31+
lambda request: render(
32+
request, "frontend/login.html", context={"DJANGO_ENV": settings.DJANGO_ENV}
33+
),
34+
),
3035
path("logout/", logout_then_login),
3136
path("", include("social_django.urls", namespace="social")),
3237
path("", include("frontend.urls")),

csm_web/frontend/src/components/coord_interface/ActionButton.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,16 @@ export default function ActionButton({ copyEmail, reset }: ActionButtonProps) {
2121
<div id="default-copy">Copy Selected Emails</div>
2222
<div id="success-copy" className="hidden">
2323
<div className="checkmark"></div>
24-
2524
<div>Copied!</div>
2625
</div>
2726
</button>
2827
{isStudents ? (
2928
<button onClick={changeURL}>
30-
<div>See Mentors</div>
29+
<div>View Mentors</div>
3130
</button>
3231
) : (
3332
<button onClick={changeURL}>
34-
<div>Students</div>
33+
<div>View Students</div>
3534
</button>
3635
)}
3736
</div>

csm_web/frontend/src/components/coord_interface/CheckBox.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from "react";
2-
import styles from "../../css/coord_interface.scss";
2+
import "../../css/coord_interface.scss";
33

44
interface CheckBoxProps {
55
id: string;
@@ -8,7 +8,7 @@ interface CheckBoxProps {
88

99
export function CheckBox({ id, onClick: onClick }: CheckBoxProps) {
1010
return (
11-
<td className={styles}>
11+
<td>
1212
<div className="checkbox-wrapper">
1313
<input className="inp-cbx" id={id + "check"} type="checkbox" onClick={onClick} />
1414
<label className="cbx" htmlFor={id + "check"}>

csm_web/frontend/src/components/coord_interface/CoordTable.tsx

Lines changed: 87 additions & 89 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import ActionButton from "./ActionButton";
55
import { CheckBox } from "./CheckBox";
66
import DropBox from "./DropBox";
77
import { SearchBar } from "./SearchBar";
8-
import styles from "../../css/coord_interface.scss";
8+
import "../../css/coord_interface.scss";
99

1010
export default function CoordTable() {
1111
const [tableData, setTableData] = useState<Mentor[] | Student[]>([]);
@@ -202,112 +202,110 @@ export default function CoordTable() {
202202
// }
203203

204204
return (
205-
<div className={styles}>
206-
<div className="coord-table">
207-
<div className="search-container">
208-
<SearchBar onChange={filterSearch} />
209-
</div>
210-
<div id="table-buttons">
205+
<div className="coord-table">
206+
<div className="search-container">
207+
<SearchBar onChange={filterSearch} />
208+
</div>
209+
<div id="table-buttons">
210+
<DropBox
211+
items={["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]}
212+
name={"Day"}
213+
field={"dayTime"}
214+
func={filterString}
215+
reset={resetFilters}
216+
></DropBox>
217+
{isStudents ? (
211218
<DropBox
212-
items={["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"]}
213-
name={"Day"}
214-
field={"dayTime"}
219+
items={["0", "1", "2", "3+"]}
220+
name={"Absences"}
221+
field={"numUnexcused"}
215222
func={filterString}
216223
reset={resetFilters}
217224
></DropBox>
218-
{isStudents ? (
225+
) : (
226+
<>
227+
<DropBox
228+
items={familyNames}
229+
name={"Family"}
230+
field={"family"}
231+
func={filterString}
232+
reset={resetFilters}
233+
></DropBox>
219234
<DropBox
220-
items={["0", "1", "2", "3+"]}
221-
name={"Absences"}
222-
field={"numUnexcused"}
235+
items={sectionSizes}
236+
name={"Section Size"}
237+
field={"numStudents"}
223238
func={filterString}
224239
reset={resetFilters}
225240
></DropBox>
226-
) : (
227-
<>
228-
<DropBox
229-
items={familyNames}
230-
name={"Family"}
231-
field={"family"}
232-
func={filterString}
233-
reset={resetFilters}
234-
></DropBox>
235-
<DropBox
236-
items={sectionSizes}
237-
name={"Section Size"}
238-
field={"numStudents"}
239-
func={filterString}
240-
reset={resetFilters}
241-
></DropBox>
242-
</>
243-
)}
244-
</div>
241+
</>
242+
)}
243+
</div>
244+
245+
<div id="table-header">
246+
{isStudents ? <div className="title">Students List</div> : <div className="title">Mentors List</div>}
247+
<ActionButton copyEmail={copyEmail} reset={reset} />
248+
</div>
245249

246-
<div id="table-header">
247-
{isStudents ? <div className="title">Students List</div> : <div className="title">Mentors List</div>}
248-
<ActionButton copyEmail={copyEmail} reset={reset} />
249-
</div>
250+
<table>
251+
<thead>
252+
<tr>
253+
<CheckBox id="check" onClick={toggleAllCheckboxes} />
254+
<th>Name</th>
255+
<th>Email</th>
256+
{isStudents ? (
257+
<>
258+
<th>Mentor Name</th>
259+
<th>Time</th>
260+
<th>Unexcused Absenses</th>
261+
</>
262+
) : (
263+
<>
264+
<th>Family</th>
265+
<th>Time</th>
266+
<th>Section Size</th>
267+
</>
268+
)}
269+
</tr>
270+
</thead>
271+
<tbody>
272+
{searchData.length === 0 ? <div className="no-data">No data found...</div> : null}
250273

251-
<table>
252-
<thead>
253-
<tr>
254-
<CheckBox id="check" onClick={toggleAllCheckboxes} />
255-
<th>Name</th>
256-
<th>Email</th>
274+
{searchData.map(row => (
275+
<tr
276+
key={row.id}
277+
className="data-row"
278+
onDoubleClick={() => navigate(`/sections/${row.section}`)}
279+
onClick={() => selectCheckbox(row.id)}
280+
>
281+
<CheckBox
282+
id={row.id.toString()}
283+
onClick={e => {
284+
e.preventDefault();
285+
e.stopPropagation();
286+
}}
287+
/>
257288
{isStudents ? (
258289
<>
259-
<th>Mentor Name</th>
260-
<th>Time</th>
261-
<th>Unexcused Absenses</th>
290+
<td>{row.name}</td>
291+
<td>{row.email}</td>
292+
<td>{(row as Student).mentorName}</td>
293+
<td>{row.dayTime}</td>
294+
<td>{(row as Student).numUnexcused}</td>
262295
</>
263296
) : (
264297
<>
265-
<th>Family</th>
266-
<th>Time</th>
267-
<th>Section Size</th>
298+
<td>{row.name}</td>
299+
<td>{row.email}</td>
300+
<td>{(row as Mentor).family}</td>
301+
<td>{row.dayTime}</td>
302+
<td>{(row as Mentor).numStudents}</td>
268303
</>
269304
)}
270305
</tr>
271-
</thead>
272-
<tbody>
273-
{searchData.length === 0 ? <div className="no-data">No data found...</div> : null}
274-
275-
{searchData.map(row => (
276-
<tr
277-
key={row.id}
278-
className="data-row"
279-
onDoubleClick={() => navigate(`/sections/${row.section}`)}
280-
onClick={() => selectCheckbox(row.id)}
281-
>
282-
<CheckBox
283-
id={row.id.toString()}
284-
onClick={e => {
285-
e.preventDefault();
286-
e.stopPropagation();
287-
}}
288-
/>
289-
{isStudents ? (
290-
<>
291-
<td>{row.name}</td>
292-
<td>{row.email}</td>
293-
<td>{(row as Student).mentorName}</td>
294-
<td>{row.dayTime}</td>
295-
<td>{(row as Student).numUnexcused}</td>
296-
</>
297-
) : (
298-
<>
299-
<td>{row.name}</td>
300-
<td>{row.email}</td>
301-
<td>{(row as Mentor).family}</td>
302-
<td>{row.dayTime}</td>
303-
<td>{(row as Mentor).numStudents}</td>
304-
</>
305-
)}
306-
</tr>
307-
))}
308-
</tbody>
309-
</table>
310-
</div>
306+
))}
307+
</tbody>
308+
</table>
311309
</div>
312310
);
313311
}

csm_web/frontend/src/css/coord_interface.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
@use "base/variables" as *;
2+
13
.coord-table table {
24
width: 100%;
35
padding: 10%;

csm_web/frontend/src/css/interface.scss

Whitespace-only changes.

csm_web/frontend/src/css/resource_aggregation.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,8 @@ $modal-height: 75vh;
9191
display: grid;
9292
grid-auto-columns: 2fr 1.5fr;
9393
row-gap: 10px;
94-
align-content: center;
94+
place-content: center center;
9595
align-items: center;
96-
justify-content: center;
9796
}
9897

9998
.resource-solution a,

csm_web/frontend/src/css/whitelist_modal.scss

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@
4444
.whitelist-modal-footer {
4545
display: flex;
4646
flex-direction: row;
47-
align-content: center;
48-
justify-content: center;
47+
place-content: center center;
4948
}
5049

5150
/* Add tab */

0 commit comments

Comments
 (0)