-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Remove everything from profile & add basic card grid layout * Add back first elements as cards * Add back in voucher and user data (gdpr) * Avoid nested voucher form * Add margin in mobile view when stacked * Pimp up profile card styling & add voucher redemption pattern * Move GDPR to account & use full-width for courses * Add modal for data request * Show toast upon data request * Add text to notification toast upon data request * Delete unused file (from now on unused) * Improve request data modal explanation text * Fix card header border radius * Make accordion background transparent * Decaffeinate profile code * Account for border also in voucher redemption box * Add custom wrapper class to reduce checkbox margin * Ensure equal height columns * Improve unsaved changes btn & show immediately * Add helpdesk to redeem voucher form * Print some labels in bold * Change "unsaved changed" button to warning color * Add back in accordion id * Add another div for the voucher redeem content * Replace "einige Daten" by "bestimmte Daten" * Move javascript include tag to end to avoid initialization issues * Use $(document).ready() to not miss load events * Show unsaved changes also at bottom (for small displays) * Only add margin for big displays * Fix margins below redeem voucher card * Remove left-over console log * Improve data request sent toast message * Improve redeem voucher form for small displays * Wrap text in unsaved changes button on small displays * Improve wording of content tag search & add tooltip * Use other pattern for voucher redemption card * Test changing user name (cypress) * Test changing user tutorial submission name (cypress) * Remove further `custom: true` occurrences * Test if language is correctly switched (cypress) * Start writing module settings cypress test * use voronoi pattern for voucher redemption card Signed-off-by: Florian <florianbuerckel@gmail.com> * Fix flaky language switch test & refactor * Add test for module settings (allow to subscribe to a lecture) * Remove cypress `.only` --------- Signed-off-by: Florian <florianbuerckel@gmail.com> Co-authored-by: Florian <florianbuerckel@gmail.com>
- Loading branch information
1 parent
79cb0b3
commit 8d83274
Showing
29 changed files
with
520 additions
and
228 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
$(document).ready(function () { | ||
$("#profileForm").on("change input", function () { | ||
$("#profileChange").removeClass("d-none"); | ||
$("#profileChangeBottom").removeClass("d-none"); | ||
}); | ||
|
||
$('input:checkbox[name^="user[lecture"]').on("change", function () { | ||
const courseId = this.dataset.course; | ||
const lectureId = this.dataset.lecture; | ||
const checkedCount = $('input:checked[data-course="' + courseId + '"]').length; | ||
const authRequiredLectureIds = $("#lectures-for-course-" + courseId).data("authorize"); | ||
|
||
if ($(this).prop("checked") && authRequiredLectureIds.includes(parseInt(lectureId))) { | ||
$("#pass-lecture-" + lectureId).show(); | ||
} | ||
else { | ||
$("#pass-lecture-" + lectureId).hide(); | ||
if (checkedCount === 0) { | ||
$('.courseSubInfo[data-course="' + courseId + '"]').removeClass("fas fa-check-circle") | ||
.addClass("far fa-circle"); | ||
} | ||
else { | ||
$('.courseSubInfo[data-course="' + courseId + '"]').removeClass("far fa-circle") | ||
.addClass("fas fa-check-circle"); | ||
} | ||
} | ||
}); | ||
|
||
$(".programCollapse").on("show.bs.collapse", function () { | ||
const program = $(this).data("program"); | ||
$("#program-" + program + "-collapse").find(".coursePlaceholder").each(function () { | ||
const course = $(this).data("course"); | ||
$(this).append($("#course-card-" + course)); | ||
$("#course-card-" + course).show(); | ||
}); | ||
}); | ||
|
||
$("#request-data-btn").on("click", function () { | ||
const toast = $("#request-data-toast"); | ||
bootstrap.Toast.getOrCreateInstance(toast).show(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
@import "bootstrap/functions"; | ||
@import "bootstrap/variables"; | ||
@import "bootstrap/mixins"; | ||
|
||
.voucher-redemption-pattern { | ||
background-image: image-url('voronoi_pattern.svg'); | ||
background-position: center; | ||
background-size: 110%; | ||
background-color: #FFFFFF; | ||
height: 3em; | ||
|
||
border-top-left-radius: calc(#{$card-inner-border-radius} - 2px); | ||
border-top-right-radius: calc(#{$card-inner-border-radius} - 2px); | ||
} | ||
|
||
.profile-card { | ||
height: 100%; | ||
border: 2px solid #223e62; | ||
|
||
background: linear-gradient(348deg, #f7faff 0%, #fcfdfd 60%); | ||
box-shadow: rgba(0, 0, 0, 0.25) 0px 1px 3px; | ||
|
||
.card-header { | ||
background-color: #223e62; | ||
color: white; | ||
|
||
// account for our custom border | ||
border-top-left-radius: calc(#{$card-inner-border-radius} - 2px); | ||
border-top-right-radius: calc(#{$card-inner-border-radius} - 2px); | ||
} | ||
} | ||
|
||
@include media-breakpoint-up(sm) { | ||
.voucher-card { | ||
min-width: 30em; | ||
} | ||
} | ||
|
||
// needed because of https://github.com/bootstrap-ruby/bootstrap_form/issues/738 | ||
// and https://github.com/bootstrap-ruby/bootstrap_form/pull/618 | ||
.checkbox-list { | ||
margin-bottom: 0.2em !important; | ||
} | ||
|
||
// Ensure equal height columns | ||
.row.display-flex { | ||
display: flex; | ||
flex-wrap: wrap; | ||
} | ||
|
||
.row.display-flex>[class*='col-'] { | ||
flex-grow: 1; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,14 @@ | ||
<%= link_to t('profile.change_data'), | ||
edit_user_registration_path, | ||
class: "btn btn-outline-secondary mb-2" %> | ||
class: "btn btn-outline-secondary" %> | ||
|
||
<button type="button" class="btn btn-outline-secondary" id="open-request-data" | ||
data-bs-toggle="modal" data-bs-target="#requestDataModal"> | ||
<%= t('profile.data_request') %> | ||
</button> | ||
|
||
<%= link_to t('profile.delete_account'), | ||
delete_account_path, | ||
class: "btn btn-outline-danger mb-2", | ||
class: "btn btn-outline-danger", | ||
"data-cy": "delete-account-btn", | ||
remote: true %> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
<!-- Modal --> | ||
<div class="modal fade" id="requestDataModal" tabindex="-1" | ||
aria-labelledby="exampleModalLabel" aria-hidden="true"> | ||
<div class="modal-dialog"> | ||
<div class="modal-content"> | ||
|
||
<div class="modal-header"> | ||
<h1 class="modal-title fs-5" id="exampleModalLabel"> | ||
<%= t('profile.my_data') %> | ||
</h1> | ||
<button type="button" class="btn-close" | ||
data-bs-dismiss="modal" aria-label="Close"></button> | ||
</div> | ||
|
||
<div class="modal-body"> | ||
<%= t('profile.data_explanation') %> | ||
</div> | ||
|
||
<div class="modal-footer"> | ||
<%= link_to t('profile.data_request'), | ||
request_data_path, | ||
class: "btn btn-primary", | ||
id: "request-data-btn", | ||
type: "button", | ||
data: { 'bs-dismiss': 'modal' }, | ||
remote: true %> | ||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
|
||
<!-- Notification upon successful data retrieval --> | ||
<div aria-live="polite" aria-atomic="true" | ||
class="position-fixed top-50 start-50 translate-middle" style="z-index: 1050;"> | ||
<div class="toast profile-card" id="request-data-toast" role="alert" | ||
aria-live="assertive" aria-atomic="true" data-bs-autohide="false"> | ||
|
||
<div class="toast-header"> | ||
<strong class="me-auto"><%= t('profile.data_request') %></strong> | ||
<button type="button" class="btn-close" data-bs-dismiss="toast" aria-label="Close"></button> | ||
</div> | ||
|
||
<div class="toast-body"> | ||
<%= t('profile.data_request_sent') %> | ||
</div> | ||
|
||
</div> | ||
</div> |
Oops, something went wrong.