Skip to content

Commit

Permalink
Merge pull request #669 from ZeusWPI/feat/cammie
Browse files Browse the repository at this point in the history
Cammie - no username
  • Loading branch information
Topvennie authored Oct 28, 2024
2 parents 7adf0b4 + 9f02371 commit d4cdf5b
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 29 deletions.
43 changes: 19 additions & 24 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,17 @@ GEM
specs:
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
adsf (1.5.0)
adsf (1.5.2)
rack (>= 1.0.0, < 4.0.0)
rackup (~> 2.1)
adsf-live (1.5.0)
adsf-live (1.5.2)
adsf (~> 1.3)
em-websocket (~> 0.5)
eventmachine (~> 1.2)
listen (~> 3.0)
rack-livereload (~> 0.3)
autoprefixer-rails (10.4.19.0)
execjs (~> 2)
base64 (0.2.0)
bigdecimal (3.1.8)
builder (3.3.0)
coderay (1.1.3)
colored (1.2)
Expand All @@ -31,9 +29,7 @@ GEM
execjs (2.9.1)
ffi (1.17.0)
formatador (1.1.0)
google-protobuf (4.28.2)
bigdecimal
rake (>= 13)
google-protobuf (3.25.5)
guard (2.18.1)
formatador (>= 0.2.4)
listen (>= 2.7, < 4.0)
Expand Down Expand Up @@ -77,30 +73,31 @@ GEM
lumberjack (1.2.10)
memo_wise (1.10.0)
method_source (1.1.0)
mime-types (3.5.2)
mime-types (3.6.0)
logger
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0903)
mime-types-data (3.2024.1001)
mini_portile2 (2.8.7)
nanoc (4.13.0)
nanoc (4.12.21)
addressable (~> 2.5)
colored (~> 1.2)
nanoc-checking (~> 1.0, >= 1.0.2)
nanoc-cli (= 4.13.0)
nanoc-core (= 4.13.0)
nanoc-cli (= 4.12.21)
nanoc-core (= 4.12.21)
nanoc-deploying (~> 1.0)
parallel (~> 1.12)
tty-command (~> 0.8)
tty-which (~> 0.4)
nanoc-checking (1.0.5)
nanoc-cli (~> 4.12, >= 4.12.5)
nanoc-core (~> 4.12, >= 4.12.5)
nanoc-cli (4.13.0)
nanoc-cli (4.12.21)
cri (~> 2.15)
diff-lcs (~> 1.3)
nanoc-core (= 4.13.0)
nanoc-core (= 4.12.21)
pry
zeitwerk (~> 2.1)
nanoc-core (4.13.0)
nanoc-core (4.12.21)
base64 (~> 0.2)
concurrent-ruby (~> 1.1)
ddmetrics (~> 1.0)
Expand All @@ -116,7 +113,7 @@ GEM
nanoc-checking (~> 1.0)
nanoc-cli (~> 4.11, >= 4.11.15)
nanoc-core (~> 4.11, >= 4.11.15)
nanoc-live (1.1.0)
nanoc-live (1.0.0)
adsf-live (~> 1.4)
listen (~> 3.0)
nanoc-cli (~> 4.11, >= 4.11.14)
Expand Down Expand Up @@ -148,9 +145,7 @@ GEM
mime-types (>= 3.0)
websocket-driver (>= 0.6.0)
racc (1.8.1)
rack (3.1.7)
rack-livereload (0.5.1)
rack
rack (3.1.8)
rackup (2.1.0)
rack (>= 3)
webrick (~> 1.8)
Expand All @@ -162,11 +157,11 @@ GEM
rbtree (0.4.6)
reline (0.5.10)
io-console (~> 0.5)
rexml (3.3.7)
rexml (3.3.8)
rubypants (0.7.1)
sass-embedded (1.79.3)
google-protobuf (~> 4.27)
rake (>= 13)
sass-embedded (1.69.5)
google-protobuf (~> 3.23)
rake (>= 13.0.0)
sassc (2.4.0)
ffi (~> 1.9)
set (1.1.0)
Expand All @@ -178,7 +173,7 @@ GEM
stringio (3.1.1)
terminal-notifier (2.0.0)
terminal-notifier-guard (1.7.0)
terser (1.2.3)
terser (1.2.4)
execjs (>= 0.3.0, < 3)
thor (1.3.2)
tty-color (0.6.0)
Expand Down
24 changes: 22 additions & 2 deletions content/assets/scripts/message.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,22 @@
const form = $("#cammieForm");
const formName = form.find('input[name="name"]');
const formMessage = form.find('input[name="message"]');
const formName = $('#cammieFormName');
const formMessage = $('#cammieFormMessage');
const formButton = form.find('button[type="submit"]');
const responseError = $("#cammieFormResponseError");
const responseSuccess = $("#cammieFormResponseSuccess");
const modal = $("#cammieFormModal");
const modalName = $("#cammieModalName");
const modalCancel = $("#cammieModalCancel");

$("#cammieForm").submit((e) => {
e.preventDefault();
formButton.addClass("is-loading");

if (!formName.val() || formName.val() === "") {
modal.addClass("is-active");
return
}

return $.ajax({
url: "https://kelder.zeus.ugent.be/messages/",
contentType: "text/plain",
Expand All @@ -30,3 +39,14 @@ $("#cammieForm").submit((e) => {
},
});
});

$("#cammieModalSend").on("click", e => {
modal.removeClass("is-active");
formName.val(modalName.val() || "-");
modal.removeClass("is-active");
form.submit();
});

$("#cammieModalCancel").on("click", e => {
modal.removeClass("is-active");
});
27 changes: 25 additions & 2 deletions content/cammie.erb
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,35 @@ socket.on('replymessage', function(obj) {
<!-- Response Success -->
<div id="cammieFormResponseSuccess" class="notification is-success is-light is-hidden"></div>

<!-- No username modal -->
<div id="cammieFormModal" class="modal">
<div class="modal-background"></div>
<div class="modal-card">
<header class="modal-card-head">
<p class="modal-card-title">Empty username message</p>
</header>
<section class="modal-card-body">
<p>It's nice to know who's talking to us.</p>
<p>You can still let us know 🙂</p>
<div class="column">
<input id="cammieModalName" class="input is-medium is-full-width" name="name" type="text" placeholder="Name" />
</div>
</section>
<footer class="modal-card-foot">
<div class="buttons">
<button id="cammieModalSend" type="button" class="button is-primary">Send to kelder</button>
<button id="cammieModalCancel" type="button" class="button">Cancel</button>
</div>
</footer>
</div>
</div>

<nav class="columns mt-0">
<div class="column">
<input class="input is-medium is-full-width" name="name" type="text" placeholder="Name">
<input id="cammieFormName" class="input is-medium is-full-width" name="name" type="text" placeholder="Name" />
</div>
<div class="column is-half">
<input class="input is-medium is-full-width" name="message" type="text" placeholder="Message...">
<input id="cammieFormMessage" class="input is-medium is-full-width" name="message" type="text" placeholder="Message..." />
</div>
<div class="column">
<button class="button is-medium is-primary is-full-width" type="submit">
Expand Down
2 changes: 1 addition & 1 deletion content/events/24-25/LAN.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Volg de straat naar beneden tot aan de trappen. Onderaan de trappen ga naar link
Het is mogelijk om je desktop af te zetten met de auto.
Afzetten is mogelijk tussen 17h30 en 18h30 en ophalen is mogelijk om 03h00 of 06h00.
Het is niet mogelijk om je auto te parkeren bij de Therminal maar het Sint-Pietersplein parking ligt op wandelafstand.
Gelieve hiervoor contact op te nemen via mail naar [email protected] met het onderwerp [Auto Materiaal].
Gelieve hiervoor contact op te nemen via mail naar [email protected] met het onderwerp \[Auto Materiaal\].

Tot dan!
Zeus WPI

0 comments on commit d4cdf5b

Please sign in to comment.