|
|
@ -11,165 +11,167 @@
|
|
|
|
subTitle="let us know you better, it comes handy."
|
|
|
|
subTitle="let us know you better, it comes handy."
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<v-row class="mt-4">
|
|
|
|
<v-form @submit.prevent="submit">
|
|
|
|
<v-col cols="3">
|
|
|
|
<v-row class="mt-4">
|
|
|
|
<div class="pb-14 h-100">
|
|
|
|
<v-col cols="3">
|
|
|
|
<div class="add__workout dark w-100 h-100">
|
|
|
|
<div class="pb-14 h-100">
|
|
|
|
<ImageCropper
|
|
|
|
<div class="add__workout dark w-100 h-100">
|
|
|
|
label="manager image"
|
|
|
|
<ImageCropper
|
|
|
|
:url.sync="form.thumbnail"
|
|
|
|
label="manager image"
|
|
|
|
v-model="fileForm.media"
|
|
|
|
:url.sync="form.thumbnail"
|
|
|
|
/>
|
|
|
|
v-model="fileForm.media"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</v-col>
|
|
|
|
</v-col>
|
|
|
|
<v-col cols="9">
|
|
|
|
<v-col cols="9">
|
|
|
|
<v-row>
|
|
|
|
<v-row>
|
|
|
|
<v-col cols="4">
|
|
|
|
<v-col cols="4">
|
|
|
|
<v-autocomplete
|
|
|
|
<v-autocomplete
|
|
|
|
dark
|
|
|
|
dark
|
|
|
|
item-text="name"
|
|
|
|
item-text="name"
|
|
|
|
item-value="id"
|
|
|
|
item-value="id"
|
|
|
|
label="workout category"
|
|
|
|
label="workout category"
|
|
|
|
:items="getSportCategories"
|
|
|
|
:items="getSportCategories"
|
|
|
|
v-model="form.sport_category_id"
|
|
|
|
v-model="form.sport_category_id"
|
|
|
|
@change="changeSportCategories"
|
|
|
|
@change="changeSportCategories"
|
|
|
|
></v-autocomplete>
|
|
|
|
></v-autocomplete>
|
|
|
|
</v-col>
|
|
|
|
</v-col>
|
|
|
|
<v-col cols="4">
|
|
|
|
<v-col cols="4">
|
|
|
|
<v-autocomplete
|
|
|
|
<v-autocomplete
|
|
|
|
dark
|
|
|
|
dark
|
|
|
|
item-text="name"
|
|
|
|
item-text="name"
|
|
|
|
item-value="id"
|
|
|
|
item-value="id"
|
|
|
|
label="workout subcategory"
|
|
|
|
label="workout subcategory"
|
|
|
|
:items="getWorkoutCategories"
|
|
|
|
:items="getWorkoutCategories"
|
|
|
|
v-model="form.workout_category_id"
|
|
|
|
v-model="form.workout_category_id"
|
|
|
|
></v-autocomplete>
|
|
|
|
></v-autocomplete>
|
|
|
|
</v-col>
|
|
|
|
</v-col>
|
|
|
|
<v-col cols="4"></v-col>
|
|
|
|
<v-col cols="4"></v-col>
|
|
|
|
</v-row>
|
|
|
|
</v-row>
|
|
|
|
<v-row>
|
|
|
|
<v-row>
|
|
|
|
<v-col cols="4"
|
|
|
|
<v-col cols="4"
|
|
|
|
><v-text-field
|
|
|
|
><v-text-field
|
|
|
|
dark
|
|
|
|
dark
|
|
|
|
placeholder="workout name"
|
|
|
|
placeholder="workout name"
|
|
|
|
label="workout name"
|
|
|
|
label="workout name"
|
|
|
|
class="no-error-msg pt-0 mt-0"
|
|
|
|
class="no-error-msg pt-0 mt-0"
|
|
|
|
v-model="form.name"
|
|
|
|
v-model="form.name"
|
|
|
|
></v-text-field>
|
|
|
|
></v-text-field>
|
|
|
|
</v-col>
|
|
|
|
</v-col>
|
|
|
|
<v-col cols="8"
|
|
|
|
<v-col cols="8"
|
|
|
|
><v-text-field
|
|
|
|
><v-text-field
|
|
|
|
dark
|
|
|
|
dark
|
|
|
|
placeholder="a short quote"
|
|
|
|
placeholder="a short quote"
|
|
|
|
label="a short quote"
|
|
|
|
label="a short quote"
|
|
|
|
class="no-error-msg pt-0 mt-0"
|
|
|
|
class="no-error-msg pt-0 mt-0"
|
|
|
|
v-model="form.title"
|
|
|
|
v-model="form.title"
|
|
|
|
></v-text-field
|
|
|
|
></v-text-field
|
|
|
|
></v-col>
|
|
|
|
></v-col>
|
|
|
|
</v-row>
|
|
|
|
</v-row>
|
|
|
|
<v-row>
|
|
|
|
<v-row>
|
|
|
|
<v-col cols="12">
|
|
|
|
<v-col cols="12">
|
|
|
|
<v-textarea
|
|
|
|
<v-textarea
|
|
|
|
dark
|
|
|
|
dark
|
|
|
|
rows="3"
|
|
|
|
rows="3"
|
|
|
|
label="description"
|
|
|
|
label="description"
|
|
|
|
placeholder="description"
|
|
|
|
placeholder="description"
|
|
|
|
v-model="form.description"
|
|
|
|
v-model="form.description"
|
|
|
|
></v-textarea>
|
|
|
|
></v-textarea>
|
|
|
|
</v-col>
|
|
|
|
</v-col>
|
|
|
|
</v-row>
|
|
|
|
</v-row>
|
|
|
|
</v-col>
|
|
|
|
</v-col>
|
|
|
|
</v-row>
|
|
|
|
</v-row>
|
|
|
|
<v-divider dark></v-divider>
|
|
|
|
<v-divider dark></v-divider>
|
|
|
|
<v-row>
|
|
|
|
<v-row>
|
|
|
|
<v-col cols="12">
|
|
|
|
<v-col cols="12">
|
|
|
|
<v-row>
|
|
|
|
<v-row>
|
|
|
|
<v-col cols="2"
|
|
|
|
<v-col cols="2"
|
|
|
|
><v-text-field
|
|
|
|
><v-text-field
|
|
|
|
dark
|
|
|
|
dark
|
|
|
|
placeholder="suggested course time?"
|
|
|
|
placeholder="suggested course time?"
|
|
|
|
label="suggested course time?"
|
|
|
|
label="suggested course time?"
|
|
|
|
class="no-error-msg pt-0 mt-0"
|
|
|
|
class="no-error-msg pt-0 mt-0"
|
|
|
|
v-model="form.suggested_set"
|
|
|
|
v-model="form.suggested_set"
|
|
|
|
></v-text-field
|
|
|
|
></v-text-field
|
|
|
|
></v-col>
|
|
|
|
></v-col>
|
|
|
|
<v-col cols="2"
|
|
|
|
<v-col cols="2"
|
|
|
|
><v-text-field
|
|
|
|
><v-text-field
|
|
|
|
dark
|
|
|
|
dark
|
|
|
|
placeholder="suggested times each course?"
|
|
|
|
placeholder="suggested times each course?"
|
|
|
|
label="suggested times each course?"
|
|
|
|
label="suggested times each course?"
|
|
|
|
class="no-error-msg pt-0 mt-0"
|
|
|
|
class="no-error-msg pt-0 mt-0"
|
|
|
|
v-model="form.suggested_per_set"
|
|
|
|
v-model="form.suggested_per_set"
|
|
|
|
></v-text-field
|
|
|
|
></v-text-field
|
|
|
|
></v-col>
|
|
|
|
></v-col>
|
|
|
|
<v-col cols="2">
|
|
|
|
<v-col cols="2">
|
|
|
|
<TimeInput
|
|
|
|
<TimeInput
|
|
|
|
v-model="form.suggested_time"
|
|
|
|
v-model="form.suggested_time"
|
|
|
|
class="no-error-msg pt-0 mt-0"
|
|
|
|
class="no-error-msg pt-0 mt-0"
|
|
|
|
placeholder="suggested ESTIMATED TIME"
|
|
|
|
placeholder="suggested ESTIMATED TIME"
|
|
|
|
label="suggested ESTIMATED TIME"
|
|
|
|
label="suggested ESTIMATED TIME"
|
|
|
|
/></v-col>
|
|
|
|
/></v-col>
|
|
|
|
<v-col cols="6"
|
|
|
|
<v-col cols="6"
|
|
|
|
><v-text-field
|
|
|
|
><v-text-field
|
|
|
|
dark
|
|
|
|
dark
|
|
|
|
placeholder="video link"
|
|
|
|
placeholder="video link"
|
|
|
|
label="video link"
|
|
|
|
label="video link"
|
|
|
|
class="no-error-msg pt-0 mt-0"
|
|
|
|
class="no-error-msg pt-0 mt-0"
|
|
|
|
v-model="form.video"
|
|
|
|
v-model="form.video"
|
|
|
|
></v-text-field
|
|
|
|
></v-text-field
|
|
|
|
></v-col>
|
|
|
|
></v-col>
|
|
|
|
</v-row>
|
|
|
|
</v-row>
|
|
|
|
<v-row>
|
|
|
|
<v-row>
|
|
|
|
<v-col cols="12">
|
|
|
|
<v-col cols="12">
|
|
|
|
<v-combobox
|
|
|
|
<v-combobox
|
|
|
|
v-model="form.tags"
|
|
|
|
v-model="form.tags"
|
|
|
|
clearable
|
|
|
|
clearable
|
|
|
|
:append-icon="null"
|
|
|
|
:append-icon="null"
|
|
|
|
hide-selected
|
|
|
|
hide-selected
|
|
|
|
class="multiple"
|
|
|
|
class="multiple"
|
|
|
|
label="Add some tags"
|
|
|
|
label="Add some tags"
|
|
|
|
placeholder="Add some tags"
|
|
|
|
placeholder="Add some tags"
|
|
|
|
multiple
|
|
|
|
multiple
|
|
|
|
persistent-hint
|
|
|
|
persistent-hint
|
|
|
|
small-chips
|
|
|
|
small-chips
|
|
|
|
dark
|
|
|
|
dark
|
|
|
|
>
|
|
|
|
>
|
|
|
|
<template #selection="{ item }">
|
|
|
|
<template #selection="{ item }">
|
|
|
|
<Chip
|
|
|
|
<Chip
|
|
|
|
label
|
|
|
|
label
|
|
|
|
color="white"
|
|
|
|
color="white"
|
|
|
|
text-color="black"
|
|
|
|
text-color="black"
|
|
|
|
sm
|
|
|
|
sm
|
|
|
|
@close="removeTags(item)"
|
|
|
|
@close="removeTags(item)"
|
|
|
|
:text="item"
|
|
|
|
:text="item"
|
|
|
|
close
|
|
|
|
close
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
</v-combobox>
|
|
|
|
</v-combobox>
|
|
|
|
</v-col>
|
|
|
|
</v-col>
|
|
|
|
</v-row>
|
|
|
|
</v-row>
|
|
|
|
</v-col>
|
|
|
|
</v-col>
|
|
|
|
</v-row>
|
|
|
|
</v-row>
|
|
|
|
<div class="mt-2">
|
|
|
|
<div class="mt-2">
|
|
|
|
<v-divider dark class="mb-2"></v-divider>
|
|
|
|
<v-divider dark class="mb-2"></v-divider>
|
|
|
|
<div class="d-flex justify-space-between">
|
|
|
|
<div class="d-flex justify-space-between">
|
|
|
|
<router-link :to="{ name: 'workouts' }">
|
|
|
|
<router-link :to="{ name: 'workouts' }">
|
|
|
|
<RectangleButton
|
|
|
|
|
|
|
|
text="I’VE CHANGED MY MIND"
|
|
|
|
|
|
|
|
icon="WMi-cancel"
|
|
|
|
|
|
|
|
class="px-0"
|
|
|
|
|
|
|
|
height="19"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</router-link>
|
|
|
|
<RectangleButton
|
|
|
|
<RectangleButton
|
|
|
|
text="I’VE CHANGED MY MIND"
|
|
|
|
:text="(workoutId ? 'update' : 'add') + ' the workout'"
|
|
|
|
icon="WMi-cancel"
|
|
|
|
type="submit"
|
|
|
|
class="px-0"
|
|
|
|
class="custom-btn add-btn"
|
|
|
|
height="19"
|
|
|
|
height="25"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</router-link>
|
|
|
|
</div>
|
|
|
|
<RectangleButton
|
|
|
|
|
|
|
|
:text="(workoutId ? 'update' : 'add') + ' the workout'"
|
|
|
|
|
|
|
|
@click.native="submit"
|
|
|
|
|
|
|
|
class="custom-btn add-btn"
|
|
|
|
|
|
|
|
height="25"
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</v-form>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</main-back>
|
|
|
|
</main-back>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -223,10 +225,12 @@ export default {
|
|
|
|
if (this.fileForm.media.file) {
|
|
|
|
if (this.fileForm.media.file) {
|
|
|
|
await repository.store(this.fileForm);
|
|
|
|
await repository.store(this.fileForm);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
this.updateWorkout(this.form);
|
|
|
|
await this.updateWorkout(this.form);
|
|
|
|
|
|
|
|
this.$router.push({ name: "workouts" });
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
await repository.store(this.fileForm);
|
|
|
|
await repository.store(this.fileForm);
|
|
|
|
this.addWorkout(this.form);
|
|
|
|
await this.addWorkout(this.form);
|
|
|
|
|
|
|
|
this.$router.push({ name: "workouts" });
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (e) {
|
|
|
|
} catch (e) {
|
|
|
|
return e;
|
|
|
|
return e;
|
|
|
@ -235,6 +239,7 @@ export default {
|
|
|
|
async load() {
|
|
|
|
async load() {
|
|
|
|
await this.loadWorkout(this.workoutId);
|
|
|
|
await this.loadWorkout(this.workoutId);
|
|
|
|
this.form = this.getWorkout;
|
|
|
|
this.form = this.getWorkout;
|
|
|
|
|
|
|
|
this.form["batch_id"] = RANDOM_TOKEN;
|
|
|
|
this.loadWorkoutCategories(this.form.sport_category_id);
|
|
|
|
this.loadWorkoutCategories(this.form.sport_category_id);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
changeSportCategories() {
|
|
|
|
changeSportCategories() {
|
|
|
|