Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Development #442

Merged
merged 13 commits into from
Sep 11, 2023
4 changes: 0 additions & 4 deletions src/adonisjs/public/author/edit/inplace-editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,12 +223,9 @@ class EditDCC {
const ep = await this._extendedPanel(
EditDCC.imageBrowseTemplate, mtype, ftypes)
let path = null
console.log('=== selected')
console.log(ep.select.options[ep.select.selectedIndex].value)
if (ep.select != null &&
ep.select.options[ep.select.selectedIndex].value.length > 0)
path = ep.select.options[ep.select.selectedIndex].value
/*
else {
console.log('===== files selected')
for (let f of ep.browse.files)
Expand All @@ -243,7 +240,6 @@ class EditDCC {
path = asset.message.filename
}
}
*/
this._removeExtendedPanel()
return path
}
Expand Down
66 changes: 45 additions & 21 deletions src/adonisjs/public/author/env/inf331_2023/css/lab.css
Original file line number Diff line number Diff line change
Expand Up @@ -6,62 +6,86 @@
--light: #FDE8E9;
}
.bg-lab-light {
background-color: var(--light) !important;
background-color: #FDE8E9 !important;
}
.bg-lab-light-pink {
background-color: var(--light-pink) !important;
background-color: #E3BAC6 !important;
}
.bg-lab-primary {
background-color: var(--primary) !important;
background-color: #BC9EC1 !important;
}
.bg-lab-secondary {
background-color: var(--secondary) !important;
background-color: #596475 !important;
}
.bg-lab-dark {
background-color: var(--dark) !important;
background-color: #1F2232 !important;
}

.text-lab-dark {
color: var(--dark) !important;
color: #1F2232 !important;
}

.text-lab-secondary {
color: var(--secondary) !important;
color: #596475 !important;
}

.text-lab-primary {
color: var(--primary) !important;
color: #BC9EC1 !important;
}
.text-primary {
color: var(--dark) !important;
color: #1F2232 !important;
}

.text-lab-light-pink {
color: var(--light-pink) !important;
color: #E3BAC6 !important;
}

.text-lab-light {
color: var(--light) !important;
color: #FDE8E9 !important;
}

.btn-lab-primary {
color: var(--light);
background-color: var(--dark);
border-color: var(--dark);
color: #FDE8E9 !important;
background-color: #1F2232 !important;
border-color: #1F2232 !important;
}
.btn-lab-primary:hover {
color: var(--primary) !important;
color: #BC9EC1 !important;
font-size: 1.1rem !important;
}

.btn-lab-secondary {
color: var(--light);
background-color: var(--secondary);
border-color: var(--secondary);
color: #FDE8E9 !important;
background-color: #596475 !important;
border-color: #596475 !important;
}
.btn-lab-secondary:hover {
color: #BC9EC1 !important;
}

.btn-lab-save {
color: #1F2232 !important;
background-color: #E3BAC6 !important;
border-color: #1F2232 !important;
border-width: 0.2rem !important;
}
.btn-lab-save:hover {
background: #BC9EC1 !important;
}

.disabled-lock, .disabled-look{
pointer-events: none;
background-color: var(--light-pink);
opacity: 0.8
pointer-events: none !important;
background-color: #E3BAC6 !important;
opacity: 0.8 !important;
}

.border-lab-dark{
border-color: #1F2232 !important;
}
.border-lab-primary{
border-color: #BC9EC1 !important;
}

.no-pointers, .no-pointer{
pointer-events: none;
}
54 changes: 47 additions & 7 deletions src/adonisjs/public/author/env/inf331_2023/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,8 @@
<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/token-validator-swe.js"></script>
<script src="/infra/conditional-layout.js"></script>
<script src="/prognosis/js/prognosis-bus.js"></script>
<script src="/prognosis/js/prognosis-bus-driver.js"></script>

<script src="/dccs/components/visual/dcc-markdown.js"></script>
<script src="/dccs/components/visual/dcc-annotation.js"></script>
Expand Down Expand Up @@ -88,7 +86,6 @@
<script src="/dccs/base/property-dcc.js"></script>
<script src="/dccs/base/connect-dcc.js"></script>


<script src="/dccs/components/data/dcc-model.js"></script>
<script src="/dccs/components/data/dcc-submit.js"></script>
<script src="/dccs/components/data/dcc-record.js"></script>
Expand All @@ -98,7 +95,7 @@
<script src="/dccs/components/web/dcc-rest.js"></script>

<script src="/infra/dcc-rest-proxy.js"></script>
<script src="/infra/dcc-basic.js"></script>
<script src="/infra/dcc-basic-swe.js"></script>

<script src="/lib/showdown/showdown.min.js"></script>
<script src="/translator/translator.js"></script>
Expand All @@ -112,8 +109,51 @@
</head>

<body>

<dcc-include src="/author/partials/header.html"></dcc-include>
<div class="fixed-top up-scroll" style="transition: top 0.3s !important;">
<dcc-rest id="harena-login" bind="harena-login"></dcc-rest>
<nav>
<div class="d-flex overflow-hidden pt-2 mr-4" id="harena-header">

<span class="inline-flex rounded-md ml-auto " id="header-login">
<div id="login-block">
<button id="loginDropdownBtn" class="btn btn-light border-top border-left border-right text-primary pl-4 pt-1 dropdown-toggle " type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Login
</button>
<form class="needs-validation dropdown-menu p-4 mr-5" novalidate>
<div class="form-group">
<label for="email">Email address</label>
<input type="email" class="form-control" id="email" name="email" placeholder="[email protected]" required>
<div class="invalid-feedback">
Please type a valid email.
</div>
</div>
<div class="form-group">
<label for="password">Password</label>
<input type="password" class="form-control" id="password" name="password" placeholder="Password" required>
</div>
<dcc-submit id="btn-submit-login" bind="submit-login" label="Login" xstyle="btn btn-outline-primary" connect="submit:harena-login:service/request/post"></dcc-submit>
<div id="login-message-alert" class="alert mt-3" role="alert">
</div>
</form>
</div>
<div id="logout-block" style="display: none;">
<dcc-rest id="harena-logout" bind="harena-logout"></dcc-rest>
<button id="logoutDropdownBtn" class="btn btn-light border-top border-left border-right text-lab-primary px-1 pt-1 dropdown-toggle " type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Logout
</button>
<div class="dropdown-menu mr-5" aria-labelledby="logoutDropdownBtn">
<a class="dropdown-item" href="/user/settings">Change Password</a>
<div class="dropdown-divider"></div>

<dcc-submit xstyle="dropdown-item" id="logout-button" bind="submit-logout" label="Logout" connect="submit:harena-logout:service/request/post">

</div>
</div>
</span>
</div>
</nav>
</div>
<!-- <dcc-include src="/author/partials/header.html"></dcc-include> -->
<!-- Notice modal -->
<div class="modal fade" id="notice-modal" tabindex="-1" role="dialog" aria-labelledby="notice-modal" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered" role="document">
Expand Down
43 changes: 24 additions & 19 deletions src/adonisjs/public/author/env/inf331_2023/js/lab-progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,12 @@
// this.labRelease = {1:new Date('2023/08/31'),2:new Date('2023/09/06'),
// 3:new Date('2023/09/06'),4:new Date('2023/09/13'),
// 5:new Date('2023/09/20'),6:new Date('2023/09/27')}
this.labRelease = {1:this.setDateToISO(hourExpiration(new Date('2023/08/31 GMT-0300'),18)),2:this.setDateToISO(hourExpiration(new Date('2023/09/06 GMT-0300'),15)),
3:this.setDateToISO(hourExpiration(new Date('2023/09/06 GMT-0300'),18)),4:this.setDateToISO(hourExpiration(new Date('2023/09/13 GMT-0300'),18)),
this.labRelease = {1:this.setDateToISO(hourExpiration(new Date('2023/09/05 GMT-0300'),13)),2:this.setDateToISO(hourExpiration(new Date('2023/09/05 GMT-0300'),14)),
3:this.setDateToISO(hourExpiration(new Date('2023/09/11 GMT-0300'),14)),4:this.setDateToISO(hourExpiration(new Date('2023/09/13 GMT-0300'),18)),
5:this.setDateToISO(hourExpiration(new Date('2023/09/20 GMT-0300'),18)),6:this.setDateToISO(hourExpiration(new Date('2023/09/27 GMT-0300'),18))}
this.labExpiration = {1:this.setDateToISO(hourExpiration(new Date('2023/09/07 GMT-0300'),8)), 2:this.setDateToISO(hourExpiration(new Date('2023/09/16 GMT-0300'),8)),
3:this.setDateToISO(hourExpiration(new Date('2023/09/16 GMT-0300'),8)),4:this.setDateToISO(hourExpiration(new Date('2023/09/23 GMT-0300'),8)),
5:this.setDateToISO(hourExpiration(new Date('2023/09/30 GMT-0300'),8)),6:this.setDateToISO(hourExpiration(new Date('2023/10/06 GMT-0300'),8))}
this.labExpiration = {1:this.setDateToISO(hourExpiration(new Date('2023/09/09 GMT-0300'),23)), 2:this.setDateToISO(hourExpiration(new Date('2023/09/16 GMT-0300'),23)),
3:this.setDateToISO(hourExpiration(new Date('2023/09/16 GMT-0300'),23)),4:this.setDateToISO(hourExpiration(new Date('2023/09/23 GMT-0300'),23)),
5:this.setDateToISO(hourExpiration(new Date('2023/09/30 GMT-0300'),23)),6:this.setDateToISO(hourExpiration(new Date('2023/10/06 GMT-0300'),23))}
this.start = this.start.bind(this)
MessageBus.i.subscribe('control/html/ready', this.start)
}
Expand Down Expand Up @@ -173,8 +173,6 @@
return convertedT
}



getDateString(date){
return date.toLocaleDateString('pt-BR', { hour12:false })
}
Expand All @@ -184,7 +182,8 @@
}

async lockedLvls (wrapper, highest, limitLvl){
let i = parseInt(highest+1)
console.log(highest);
let i = parseInt(highest+1 )
let released = true
for (i; i <= limitLvl; i++) {
// let labTemplate = await MessageBus.i.request(
Expand Down Expand Up @@ -212,6 +211,7 @@
let labDelivered = false
let labLastEdit = null
const highestLab = Object.keys(labList).length
let nLabReleased = 0
const currentDate = new Date()
// console.log('============',this.convertToLocalTz(new Date(),'date'))
// let tzOffset = this.prependZero(-1*(currentDate.getTimezoneOffset()/60))
Expand All @@ -226,7 +226,8 @@
const lateReleaseTxt = 'Não publicado...(atraso)'
progressWrapper.innerHTML = ''
for (var i = 1; i <= Object.keys(this.labRelease).length; i++) {

labCompleted = false
labDelivered = false
let labTemplate = await MessageBus.i.request(
'data/template/' + `labs/lab_${i}`.replace(/\//g, '.') +
'/get', {static: false}, null, true)
Expand Down Expand Up @@ -259,10 +260,10 @@
.replace(/\[labNumber\]/ig, Object.keys(this.labRelease)[i-1])
.replace(/\[progress\]/ig, 'Fechado')
.replace(/\[progressColor\]/ig, labCompleted?successColor:'bg-lab-dark text-lab-light')
.replace(/\[this.labExpirationColor\]/ig, 'btn-lab-primary text-lab-light-pink')
.replace(/\[this.labExpirationColor\]/ig, 'bg-lab-dark text-lab-light-pink')
.replace(/\[this.labExpiration\]/ig,
`${this.convertToLocalTz(this.labExpiration[i],'string')}`)
.replace(/\[labDelivered\]/ig, labDelivered?'Sim':'Não')
.replace(/\[labDelivered\]/ig, labDelivered?'Sim!':'Não')
.replace(/\[labDeliveredColor\]/ig, labDelivered?successColor:failColor)
.replace(/\[labLastEdit\]/ig, labLastEdit)
.replace(/\[labLastEditColor\]/ig, (failColor))
Expand All @@ -273,7 +274,7 @@
.replace(/\[labNumber\]/ig, Object.keys(labList)[i-1])
.replace(/\[progress\]/ig, 'Em aberto')
.replace(/\[progressColor\]/ig, labCompleted?successColor:'bg-lab-dark text-lab-light')
.replace(/\[this.labExpirationColor\]/ig, 'btn-lab-primary text-lab-light-pink')
.replace(/\[this.labExpirationColor\]/ig, 'bg-lab-dark text-lab-light-pink')
.replace(/\[this.labExpiration\]/ig,
`${this.convertToLocalTz(this.labExpiration[i],'string')}`)
.replace(/\[labDelivered\]/ig, labDelivered?'Sim!':'Não')
Expand All @@ -292,18 +293,18 @@
.replace(/\[labNumber\]/ig, Object.keys(this.labRelease)[i-1])
.replace(/\[progress\]/ig, 'Fechado')
.replace(/\[progressColor\]/ig, labCompleted?successColor:'bg-lab-dark text-lab-light')
.replace(/\[this.labExpirationColor\]/ig, 'btn-lab-primary text-lab-light-pink')
.replace(/\[this.labExpirationColor\]/ig, 'bg-lab-dark text-lab-light-pink')
.replace(/\[this.labExpiration\]/ig,
`${this.convertToLocalTz(this.labExpiration[i],'string')}`)
.replace(/\[labDelivered\]/ig, labDelivered?'Sim':'Não')
.replace(/\[labDelivered\]/ig, labDelivered?'Sim!':'Não')
.replace(/\[labDeliveredColor\]/ig, labDelivered?successColor:failColor)
.replace(/\[labLastEdit\]/ig, labLastEdit)
.replace(/\[labLastEditColor\]/ig, (failColor))
}else if (currentDate > this.labRelease[i]){
if (released == false){
template.innerHTML = labProgressManager.lvlContainerLocked
.replace(/\[difficulty\]/ig, i)
.replace(/\[labRelease\]/ig, `${this.getDateStringthis(this.labRelease[i])}`)
.replace(/\[labRelease\]/ig, `${this.convertToLocalTz(this.labRelease[i],'string')}`)
.replace(/\[labText\]/ig, lateReleaseTxt)

}else{
Expand All @@ -314,15 +315,20 @@
.replace(/\[labNumber\]/ig, Object.keys(this.labRelease)[i-1])
.replace(/\[progress\]/ig, 'Em aberto')
.replace(/\[progressColor\]/ig, labCompleted?successColor:'bg-lab-dark text-lab-light')
.replace(/\[this.labExpirationColor\]/ig, 'btn-lab-primary text-lab-light-pink')
.replace(/\[this.labExpirationColor\]/ig, 'bg-lab-dark text-lab-light-pink')
.replace(/\[this.labExpiration\]/ig,
`${this.convertToLocalTz(this.labExpiration[i],'string')}`)
.replace(/\[labDelivered\]/ig, labDelivered?'Sim':'Não')
.replace(/\[labDelivered\]/ig, labDelivered?'Sim!':'Não')
.replace(/\[labDeliveredColor\]/ig, labDelivered?successColor:failColor)
.replace(/\[labLastEdit\]/ig, labLastEdit)
.replace(/\[labLastEditColor\]/ig, (failColor))
.replace(/\[buttonIcon\]/ig, 'plus')
}
}else if (currentDate < this.labRelease[i]){
template.innerHTML = labProgressManager.lvlContainerLocked
.replace(/\[difficulty\]/ig, i)
.replace(/\[labRelease\]/ig, `${this.convertToLocalTz(this.labRelease[i],'string')}`)
.replace(/\[labText\]/ig, 'Ainda não publicado...')
}

progressWrapper.appendChild(template.content.cloneNode(true))
Expand Down Expand Up @@ -363,7 +369,6 @@
}
}


}
let template = document.createElement('template')
/*if(highestLab == '10'){
Expand Down Expand Up @@ -420,7 +425,7 @@
}*/

// lastAvailable(progressWrapper, highestLvl)
this.lockedLvls(progressWrapper, highestLab+1, 6)
// this.lockedLvls(progressWrapper, highestLab+nLabReleased, 6)

}

Expand Down
Loading
Loading