Use scopes #18

Merged
nomadjimbob merged 39 commits from useScopes into main 2023-03-13 09:49:42 +00:00
3 changed files with 19 additions and 3 deletions
Showing only changes of commit 7ecec70520 - Show all commits

View File

@@ -27,11 +27,12 @@ class EventStoreRequest extends BaseRequest
Rule::in(['draft', 'soon', 'open', 'closed', 'cancelled']),
],
'registration_type' => [
Rule::in(['none', 'email', 'link']),
Rule::in(['none', 'email', 'link', 'message']),
],
'registration_data' => [
Rule::when(strcasecmp('email', $this->attributes->get('registration_type')) == 0, 'required|email'),
Rule::when(strcasecmp('link', $this->attributes->get('registration_type')) == 0, 'required|url')
Rule::when(strcasecmp('link', $this->attributes->get('registration_type')) == 0, 'required|url'),
Rule::when(strcasecmp('message', $this->attributes->get('registration_type')) == 0, 'required|message'),
],
'hero' => 'uuid|exists:media,id',
];

View File

@@ -60,6 +60,15 @@
:block="true"
label="Register for Event"></SMButton>
</div>
<div
v-if="
event.status == 'open' &&
expired == false &&
event.registration_type == 'message'
"
class="sm-workshop-registration sm-workshop-registration-message">
{{ event.registration_data }}
</div>
<div class="sm-workshop-date">
<h4>
<ion-icon
@@ -380,7 +389,8 @@ handleLoad();
}
.sm-workshop-registration-none,
.sm-workshop-registration-soon {
.sm-workshop-registration-soon,
.sm-workshop-registration-message {
border: 1px solid #ffeeba;
background-color: #fff3cd;
color: #856404;

View File

@@ -84,6 +84,7 @@
none: 'None',
email: 'Email',
link: 'Link',
message: 'Message',
}" />
</SMColumn>
<SMColumn>
@@ -186,6 +187,10 @@ const registration_data = computed(() => {
data.visible = true;
data.title = "Registration URL";
data.type = "url";
} else if (form?.controls.registration_type.value === "message") {
data.visible = true;
data.title = "Registration message";
data.type = "test";
}
return data;