-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
656 additions
and
11 deletions.
There are no files selected for viewing
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,116 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<!-- meta tags --> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | ||
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | ||
|
||
<link rel="stylesheet" href="/author/css/author.css"> | ||
|
||
<script src="/lib/axios-0.21.0/axios.min.js"></script> | ||
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script> | ||
|
||
<script src="/lib/jquery-3-4-1/jquery-3.4.1.slim.min.js"></script> | ||
<script src="/lib/popper-1-15-0/popper.min.js"></script> | ||
<script src="/lib/bootstrap-4.4.1/js/bootstrap.bundle.min.js"></script> | ||
|
||
<script src="/config/config.js"></script> | ||
<script src="/infra/bus.js"></script> | ||
<script src="/infra/basic.js"></script> | ||
<script src="/infra/dcc-common-server-proxy.js"></script> | ||
<script src="/infra/dcc-common-server-address.js"></script> | ||
<script src="/infra/simple-page-tasks.js"></script> | ||
<script src="/infra/token-validator.js"></script> | ||
<script src="/infra/conditional-layout.js"></script> | ||
|
||
<script src="/dccs/base/primitive-dcc.js"></script> | ||
<script src="/dccs/base/scope-dcc.js"></script> | ||
<script src="/dccs/base/dcc.js"></script> | ||
<script src="/dccs/base/dcc-base.js "></script> | ||
<script src="/dccs/base/dcc-visual.js "></script> | ||
<script src="/dccs/base/dcc-block.js"></script> | ||
<script src="/dccs/components/visual/dcc-button.js"></script> | ||
<script src="/dccs/components/visual/dcc-notice-input.js"></script> | ||
|
||
<script src="/dccs/components/web/dcc-rest.js"></script> | ||
<script src="/dccs/components/web/dcc-include.js"></script> | ||
<script src="/dccs/components/web/dcc-dhtml.js"></script> | ||
|
||
<script src="/dccs/components/data/dcc-submit.js"></script> | ||
<script src="/dccs/components/data/dcc-model.js"></script> | ||
<script src="/dccs/components/data/dcc-record.js"></script> | ||
|
||
<script src="/dccs/base/subscribe-dcc.js"></script> | ||
<script src="/dccs/base/trigger-dcc.js"></script> | ||
<script src="/dccs/base/property-dcc.js"></script> | ||
<script src="/dccs/base/connect-dcc.js"></script> | ||
|
||
<script src="/infra/dcc-rest-proxy.js"></script> | ||
<script src="/infra/dcc-basic.js"></script> | ||
|
||
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png"> | ||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png"> | ||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png"> | ||
<link rel="shortcut icon" href="/icons/favicon.ico"> | ||
<link rel="manifest" href="/site.webmanifest"> | ||
|
||
<link rel="stylesheet" href="/lib/fontawesome-5-10-1/css/all.min.css"> | ||
<link rel="stylesheet" href="/lib/bootstrap-4.4.1/css/bootstrap.min.css"> | ||
|
||
<link rel="stylesheet" href="/dccs/css/dccs.css"> | ||
<link rel="stylesheet" href="/dccs/css/properties.css"> | ||
<link rel="stylesheet" href="/infra/css/common-player.css"> | ||
<link rel="stylesheet" href="/infra/css/common-author.css"> | ||
|
||
<script src="author/js/dcc-author-server-proxy.js"></script> | ||
|
||
<script src="/author/js/create.js"></script> | ||
<script src="/author/js/template-case.js"></script> | ||
<script src="/author/js/draft.js"></script> | ||
<!-- Reference CSS --> | ||
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> | ||
<link rel="stylesheet" href="/start/css/main.css"/> | ||
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato"/> | ||
|
||
<!-- Favicon --> | ||
<link rel="shortcut icon" href="#"> | ||
|
||
<title>Phil Muchbetter Game</title> | ||
|
||
</head> | ||
|
||
<body onload="TokenController.instance.checkToken()"> | ||
<!-- Login/logout header --> | ||
<dcc-include src="/author/partials/header.html"></dcc-include> | ||
<main> | ||
<div class="d-flex vh-100 vw-100" style="background-color: rgb(245,245,245);"> | ||
<div class="d-flex w-100 mx-5 home-image-margin" style=""> | ||
|
||
<div class="d-flex ml-auto flex-column align-items-center justify-content-center align-items-center"> | ||
<div class="d-flex flex-column"> | ||
<h1 class="home-header-text"> Plataforma Museu</h1> | ||
<p class="home-p-text">Junte-se a nós nesta aventura!</p> | ||
<div class="container-fluid"> | ||
<div class="row home-play-container"> | ||
<button id="player-btn" class="btn col-4 ml-4 lets-play rounded-pill" onclick="location.href='/user/signup/tale-check.html'">Player</button> | ||
</div> | ||
|
||
</div> | ||
</div> | ||
</div> | ||
<div class="d-flex ml-auto w-50 flex-column align-items-center justify-content-center" | ||
style="background: url('start/img/background_museu.png');"> | ||
<div> | ||
<img src="start/img/home_museu.png" alt="" class="h-100 float-right" id="home-image"/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</main> | ||
<div id="version-footnote" class="fixed-bottom" style="text-align:center"> | ||
</div> | ||
|
||
</body> | ||
|
||
</html> |
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,135 @@ | ||
class UserTale { | ||
async start () { | ||
this._userId = new URL(document.location).searchParams.get('user') | ||
const userTerm = await this._retrieveTerm() | ||
if (!userTerm.message.error) | ||
await this._requestAgree(userTerm.message[0]) | ||
} | ||
|
||
async check() { | ||
this._userId = null | ||
const userTerm = await this._retrieveTerm() | ||
if (!userTerm.message.error) { | ||
if (userTerm.message.length > 1 || userTerm.message[0].agree == '0') | ||
document.querySelector('#proceed').style.display = 'initial' | ||
else { | ||
document.querySelector('#title-form').style.display = 'initial' | ||
document.querySelector('#complete-form').style.display = 'initial' | ||
await this._requestAgree(userTerm.message[0]) | ||
} | ||
} | ||
} | ||
|
||
async _retrieveTerm() { | ||
this._termId = 'museu_harena_2021' | ||
const userTermJson = { | ||
userId: this._userId, | ||
termId: this._termId | ||
} | ||
let userTerm = await MessageBus.i.request('user/term/get', userTermJson) | ||
console.log(userTerm.message) | ||
if (userTerm.message.error) { | ||
console.log('--- error') | ||
console.log(userTerm.message) | ||
this._showFeedback('Houve algum erro na recuperação do seu cadastro.') | ||
} else if (this._userId == null) | ||
this._userId = userTerm.message[0].user_id | ||
return userTerm | ||
} | ||
|
||
async _requestAgree (userTerm) { | ||
this._userTerm = userTerm | ||
document.querySelector('#username_1').innerHTML = this._userTerm.name_participant | ||
document.querySelector('#username_2').innerHTML = this._userTerm.name_participant | ||
document.querySelector('#respname_1').innerHTML = this._userTerm.name_responsible | ||
|
||
this._expandTermA = this._expandTermA.bind(this) | ||
MessageBus.i.subscribe('/user/term/expand/a', this._expandTermA) | ||
this._expandTermB = this._expandTermB.bind(this) | ||
MessageBus.i.subscribe('/user/term/expand/b', this._expandTermB) | ||
this._retractTerm = this._retractTerm.bind(this) | ||
MessageBus.i.subscribe('/user/term/retract', this._retractTerm) | ||
this._agreement = this._agreement.bind(this) | ||
MessageBus.i.subscribe('/user/agreement', this._agreement) | ||
this.update = this.update.bind(this) | ||
|
||
const now = new Date() | ||
const sdate = now.getDate() + '/' + (now.getMonth()+1) + '/' + now.getFullYear() | ||
document.querySelector('#date_agree_1').value = sdate | ||
document.querySelector('#date_agree_2').innerHTML = sdate | ||
} | ||
|
||
update () { | ||
document.querySelector('#answer_agree').innerHTML = | ||
(document.querySelector('#agree_radio').checked) | ||
? 'Concordo em participar da pesquisa' | ||
: (document.querySelector('#not_agree_radio').checked) | ||
? 'Não desejo participar da pesquisa' | ||
: '' | ||
} | ||
|
||
_expandTermA () { | ||
document.querySelector('#term-part-a').style.display = 'initial' | ||
document.querySelector('#term-part-both').style.display = 'initial' | ||
document.querySelector('#button-expand-a').style.display = 'none' | ||
document.querySelector('#button-expand-b').style.display = 'none' | ||
} | ||
|
||
_expandTermB () { | ||
document.querySelector('#term-part-b').style.display = 'initial' | ||
document.querySelector('#term-part-both').style.display = 'initial' | ||
document.querySelector('#button-expand-a').style.display = 'none' | ||
document.querySelector('#button-expand-b').style.display = 'none' | ||
} | ||
|
||
_retractTerm () { | ||
document.querySelector('#term-part-a').style.display = 'none' | ||
document.querySelector('#term-part-b').style.display = 'none' | ||
document.querySelector('#term-part-both').style.display = 'none' | ||
document.querySelector('#button-expand-a').style.display = 'initial' | ||
document.querySelector('#button-expand-b').style.display = 'initial' | ||
} | ||
|
||
_showFeedback (message, color) { | ||
const feed1 = document.querySelector('#feedback-message-1') | ||
const feed2 = document.querySelector('#feedback-message-2') | ||
if (color != null) { | ||
feed1.style.color = 'blue' | ||
feed2.style.color = 'blue' | ||
} | ||
feed1.innerHTML = message | ||
feed2.innerHTML = message | ||
} | ||
|
||
async _agreement (topic, message) { | ||
const parameters = (message && message.value) ? message.value : null | ||
console.log('===== user parameters') | ||
console.log(parameters) | ||
|
||
const agree = (parameters.agree && parameters.agree.length > 0 && parameters.agree == 'agree') | ||
const termJson = { | ||
userId: this._userId, | ||
termId: this._termId, | ||
nameResponsible: this._userTerm.name_responsible, | ||
emailResponsible: this._userTerm.email_responsible, | ||
nameParticipant: this._userTerm.name_participant, | ||
date: parameters.date_agree_1, | ||
role: parameters.role, | ||
agree: (agree) ? '1' : '0' | ||
} | ||
console.log('=== term json') | ||
console.log(termJson) | ||
let term = await MessageBus.i.request('user/term/post', termJson) | ||
console.log('=== term add') | ||
console.log(term) | ||
document.querySelector('#complete-form').style.display = 'none' | ||
if (agree) | ||
this._showFeedback('Termo aceito com sucesso.', 'blue') | ||
else | ||
this._showFeedback('O termo não foi aceito pelo participante.', 'blue') | ||
} | ||
} | ||
|
||
(function () { | ||
UserTale.i = new UserTale() | ||
})() |
Oops, something went wrong.