-
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.
Criado componente para carregar o warning Ref.: #1
- Loading branch information
1 parent
6f2138a
commit 6d49c02
Showing
3 changed files
with
58 additions
and
0 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,11 @@ | ||
.spam-warning { | ||
position: relative; | ||
top: 20px; | ||
text-align: center; | ||
z-index: 1000; | ||
padding: 10px; | ||
} | ||
|
||
.spam-warning input[type="checkbox"] { | ||
margin-left: 10px; | ||
} |
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,27 @@ | ||
app.component('spam-warning', { | ||
template: $TEMPLATES['spam-warning'], | ||
|
||
props: { | ||
entity: { | ||
type: Entity, | ||
required: true, | ||
}, | ||
}, | ||
|
||
data() { | ||
return { | ||
spamStatus: this.entity?.spam_status ?? true | ||
} | ||
}, | ||
|
||
methods: { | ||
setSpamStatus() { | ||
this.entity.spam_status = this.spamStatus; | ||
this.entity.save(); | ||
} | ||
}, | ||
|
||
mounted() { | ||
console.log("ENTITY =>", this.entity); | ||
} | ||
}); |
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,20 @@ | ||
<?php | ||
/** | ||
* @var MapasCulturais\App $app | ||
* @var MapasCulturais\Themes\BaseV2\Theme $this | ||
*/ | ||
use MapasCulturais\i; | ||
|
||
$this->import(' | ||
mc-alert | ||
'); | ||
?> | ||
|
||
<div class="spam-warning"> | ||
<mc-alert type="warning" class="spam-warning"> | ||
<label> | ||
<?= i::__('Um termo de spam foi detectado.') ?> | ||
<input type="checkbox" v-model="spamStatus" @change="setSpamStatus"/><?= i::__('Classificar como Spam') ?> | ||
</label> | ||
</mc-alert> | ||
</div> |