Skip to content

Commit

Permalink
Merge pull request #25 from USB-CI3715/modificar-formulario-registro
Browse files Browse the repository at this point in the history
Modificar formulario registro
  • Loading branch information
EliezerMCR authored Nov 2, 2024
2 parents 08883bc + 2a334b0 commit cc18c0e
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 0 deletions.
16 changes: 16 additions & 0 deletions nodebb-theme-quantum-devs/templates/account/profile.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@
</div>
</div>

{{{ if isProfessor }}}
<div class="stat">
<div class="align-items-center justify-content-center card card-header px-0 py-3 border-0 rounded-1 h-100">
<span class="stat-label text-m fw-semibold">Profesor</span>
<span class="timeago fs-6 ff-secondary" title="{isProfessor}"></span>
</div>
</div>
{{{ else }}}
<div class="stat">
<div class="align-items-center justify-content-center card card-header px-0 py-3 border-0 rounded-1 h-100">
<span class="stat-label text-m fw-semibold">Estudiante</span>
<span class="timeago fs-6 ff-secondary" title="{isProfessor}"></span>
</div>
</div>
{{{ end }}}

{{{ if email }}}
<div class="stat">
<div class="align-items-center justify-content-center card card-header px-0 py-3 border-0 rounded-1 h-100 gap-2">
Expand Down
7 changes: 7 additions & 0 deletions nodebb-theme-quantum-devs/templates/register.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
<span class="form-text text-xs">[[register:help.username-restrictions, {minimumUsernameLength}, {maximumUsernameLength}]]</span>
</div>
</div>
<div class="mb-2 d-flex flex-column gap-2">
<label for="isProfessor">Seleccione si es Profesor</label>
<div class="d-flex flex-column">
<input class="form-check-input" type="checkbox" name="isProfessor" id="isProfessor"/>
<span class="register-feedback text-xs text-danger" id="isProfessor-notify" aria-live="polite"></span>
</div>
</div>

<div class="mb-2 d-flex flex-column gap-2">
<label for="password">[[register:password]]</label>
Expand Down
2 changes: 2 additions & 0 deletions public/src/client/register.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ define('forum/register', [
Register.init = function () {
const username = $('#username');
const password = $('#password');
const isProfessor = $('#isProfessor');
const password_confirm = $('#password-confirm');
const register = $('#register');

showSuccess(isProfessor)

Check failure on line 18 in public/src/client/register.js

View workflow job for this annotation

GitHub Actions / lint-and-test / test

Missing semicolon
handleLanguageOverride();

$('#content #noscript').val('false');
Expand Down
2 changes: 2 additions & 0 deletions src/user/create.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ module.exports = function (User) {
}

async function create(data) {

const timestamp = data.timestamp || Date.now();

let userData = {
Expand All @@ -49,6 +50,7 @@ module.exports = function (User) {
joindate: timestamp,
lastonline: timestamp,
status: 'online',
isProfessor: data.isProfessor == 'on'
};
['picture', 'fullname', 'location', 'birthday'].forEach((field) => {
if (data[field]) {
Expand Down

0 comments on commit cc18c0e

Please sign in to comment.