Skip to content

Commit c01a8f0

Browse files
Dan career form (#1366)
1 parent 0307343 commit c01a8f0

File tree

31 files changed

+761
-297
lines changed

31 files changed

+761
-297
lines changed

pgml-dashboard/src/api/cms.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,17 @@ async fn get_careers(
773773
CAREERS.render(&doc_file_path, &canonical, cluster).await
774774
}
775775

776+
#[get("/careers/apply/<title>", rank = 4)]
777+
pub async fn careers_apply(title: PathBuf, cluster: &Cluster) -> Result<ResponseOk, crate::responses::NotFound> {
778+
let layout =
779+
crate::components::layouts::marketing::Base::new("Apply for a career", Some(&cluster)).no_transparent_nav();
780+
781+
let job_title = title.display().to_string().replace("-", " ");
782+
let page = crate::components::pages::careers::Apply::new().job_title(&job_title);
783+
784+
Ok(ResponseOk(layout.render(page)))
785+
}
786+
776787
#[get("/docs/<path..>", rank = 5)]
777788
async fn get_docs(
778789
path: PathBuf,
@@ -876,6 +887,7 @@ pub fn routes() -> Vec<Route> {
876887
blog_landing_page,
877888
docs_landing_page,
878889
careers_landing_page,
890+
careers_apply,
879891
get_blog,
880892
get_blog_asset,
881893
get_careers,

pgml-dashboard/src/components/accordian/accordian_controller.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,17 @@ export default class extends Controller {
1313
} else {
1414
this.bodies[i].style.maxHeight = this.bodies[i].offsetHeight + "px";
1515
}
16-
}
16+
}
1717
}
1818

19-
2019
titleClick(e) {
2120
let target = e.currentTarget.getAttribute("data-value");
2221
e.currentTarget.classList.add("selected");
2322

2423
let body = document.querySelector(`[data-accordian-target="${target}"]`);
2524
body.classList.add("selected");
2625
body.style.maxHeight = this.heights.get(body) + "px";
27-
26+
2827
for (let i = 0; i < this.bodies.length; i++) {
2928
if (body != this.bodies[i]) {
3029
this.bodies[i].classList.remove("selected");

pgml-dashboard/src/components/carousel/carousel_controller.js

Lines changed: 42 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,91 +1,87 @@
1-
import { Controller } from '@hotwired/stimulus'
1+
import { Controller } from "@hotwired/stimulus";
22

33
export default class extends Controller {
4-
static targets = [
5-
"carousel", "carouselTimer", "template"
6-
]
4+
static targets = ["carousel", "carouselTimer", "template"];
75

86
initialize() {
9-
this.paused = false
10-
this.runtime = 0
7+
this.paused = false;
8+
this.runtime = 0;
119
this.times = 1;
1210
}
1311

1412
connect() {
15-
// dont cycle carousel if it only hase one item.
16-
if ( this.templateTargets.length > 1 ) {
17-
this.cycle()
13+
// dont cycle carousel if it only hase one item.
14+
if (this.templateTargets.length > 1) {
15+
this.cycle();
1816
}
1917
}
2018

2119
changeFeatured(next) {
22-
let current = this.carouselTarget.children[0]
23-
let nextItem = next.content.cloneNode(true)
24-
25-
this.carouselTarget.appendChild(nextItem)
20+
let current = this.carouselTarget.children[0];
21+
let nextItem = next.content.cloneNode(true);
2622

27-
if( current ) {
23+
this.carouselTarget.appendChild(nextItem);
24+
25+
if (current) {
2826
current.style.marginLeft = "-100%";
29-
setTimeout( () => {
30-
this.carouselTarget.removeChild(current)
31-
}, 700)
27+
setTimeout(() => {
28+
this.carouselTarget.removeChild(current);
29+
}, 700);
3230
}
3331
}
3432

3533
changeIndicator(current, next) {
3634
let timers = this.carouselTimerTargets;
3735
let currentTimer = timers[current];
38-
let nextTimer = timers[next]
36+
let nextTimer = timers[next];
3937

40-
if ( currentTimer ) {
41-
currentTimer.classList.remove("timer-active")
42-
currentTimer.style.width = "1rem"
38+
if (currentTimer) {
39+
currentTimer.classList.remove("timer-active");
40+
currentTimer.style.width = "1rem";
41+
}
42+
if (nextTimer) {
43+
nextTimer.style.width = "4rem";
44+
nextTimer.classList.add("timer-active");
4345
}
44-
if( nextTimer) {
45-
nextTimer.style.width = "4rem"
46-
nextTimer.classList.add("timer-active")
47-
}
4846
}
4947

5048
Pause() {
51-
this.paused = true
49+
this.paused = true;
5250
}
5351

5452
Resume() {
55-
this.paused = false
53+
this.paused = false;
5654
}
5755

5856
cycle() {
5957
this.interval = setInterval(() => {
6058
// maintain paused state through entire loop
61-
let paused = this.paused
59+
let paused = this.paused;
6260

63-
let activeTimer = document.getElementsByClassName("timer-active")[0]
64-
if( paused ) {
65-
if( activeTimer ) {
66-
activeTimer.classList.add("timer-pause")
61+
let activeTimer = document.getElementsByClassName("timer-active")[0];
62+
if (paused) {
63+
if (activeTimer) {
64+
activeTimer.classList.add("timer-pause");
6765
}
6866
} else {
69-
if( activeTimer && activeTimer.classList.contains("timer-pause")) {
70-
activeTimer.classList.remove("timer-pause")
67+
if (activeTimer && activeTimer.classList.contains("timer-pause")) {
68+
activeTimer.classList.remove("timer-pause");
7169
}
7270
}
7371

74-
if( !paused && this.runtime % 5 == 0 ) {
75-
let currentIndex = this.times % this.templateTargets.length
76-
let nextIndex = (this.times + 1) % this.templateTargets.length
77-
78-
this.changeIndicator(currentIndex, nextIndex)
79-
this.changeFeatured(
80-
this.templateTargets[nextIndex]
81-
)
82-
this.times ++
72+
if (!paused && this.runtime % 5 == 0) {
73+
let currentIndex = this.times % this.templateTargets.length;
74+
let nextIndex = (this.times + 1) % this.templateTargets.length;
75+
76+
this.changeIndicator(currentIndex, nextIndex);
77+
this.changeFeatured(this.templateTargets[nextIndex]);
78+
this.times++;
8379
}
8480

85-
if( !paused ) {
86-
this.runtime++
81+
if (!paused) {
82+
this.runtime++;
8783
}
88-
}, 1000)
84+
}, 1000);
8985
}
9086

9187
disconnect() {

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy