dev #10
|
@ -128,6 +128,38 @@
|
||||||
"detail": "django.db",
|
"detail": "django.db",
|
||||||
"documentation": {}
|
"documentation": {}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"label": "migrations",
|
||||||
|
"importPath": "django.db",
|
||||||
|
"description": "django.db",
|
||||||
|
"isExtraImport": true,
|
||||||
|
"detail": "django.db",
|
||||||
|
"documentation": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "models",
|
||||||
|
"importPath": "django.db",
|
||||||
|
"description": "django.db",
|
||||||
|
"isExtraImport": true,
|
||||||
|
"detail": "django.db",
|
||||||
|
"documentation": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "migrations",
|
||||||
|
"importPath": "django.db",
|
||||||
|
"description": "django.db",
|
||||||
|
"isExtraImport": true,
|
||||||
|
"detail": "django.db",
|
||||||
|
"documentation": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "models",
|
||||||
|
"importPath": "django.db",
|
||||||
|
"description": "django.db",
|
||||||
|
"isExtraImport": true,
|
||||||
|
"detail": "django.db",
|
||||||
|
"documentation": {}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"label": "models",
|
"label": "models",
|
||||||
"importPath": "django.db",
|
"importPath": "django.db",
|
||||||
|
@ -1110,6 +1142,24 @@
|
||||||
"detail": "back.object.migrations.0005_remove_scene3d_gainmap_remove_scene3d_json_and_more",
|
"detail": "back.object.migrations.0005_remove_scene3d_gainmap_remove_scene3d_json_and_more",
|
||||||
"documentation": {}
|
"documentation": {}
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"label": "Migration",
|
||||||
|
"kind": 6,
|
||||||
|
"importPath": "back.object.migrations.0006_element3d_can_disabled_element3d_is_enabled",
|
||||||
|
"description": "back.object.migrations.0006_element3d_can_disabled_element3d_is_enabled",
|
||||||
|
"peekOfCode": "class Migration(migrations.Migration):\n dependencies = [\n ('object', '0005_remove_scene3d_gainmap_remove_scene3d_json_and_more'),\n ]\n operations = [\n migrations.AddField(\n model_name='element3d',\n name='can_disabled',\n field=models.BooleanField(default=False),\n ),",
|
||||||
|
"detail": "back.object.migrations.0006_element3d_can_disabled_element3d_is_enabled",
|
||||||
|
"documentation": {}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "Migration",
|
||||||
|
"kind": 6,
|
||||||
|
"importPath": "back.object.migrations.0007_alter_element3d_description",
|
||||||
|
"description": "back.object.migrations.0007_alter_element3d_description",
|
||||||
|
"peekOfCode": "class Migration(migrations.Migration):\n dependencies = [\n ('object', '0006_element3d_can_disabled_element3d_is_enabled'),\n ]\n operations = [\n migrations.AlterField(\n model_name='element3d',\n name='description',\n field=models.TextField(blank=True, null=True),\n ),",
|
||||||
|
"detail": "back.object.migrations.0007_alter_element3d_description",
|
||||||
|
"documentation": {}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"label": "Scene3DAdmin",
|
"label": "Scene3DAdmin",
|
||||||
"kind": 6,
|
"kind": 6,
|
||||||
|
@ -1133,7 +1183,7 @@
|
||||||
"kind": 6,
|
"kind": 6,
|
||||||
"importPath": "back.object.models",
|
"importPath": "back.object.models",
|
||||||
"description": "back.object.models",
|
"description": "back.object.models",
|
||||||
"peekOfCode": "class Element3D(models.Model):\n parent = models.ForeignKey(\"self\", on_delete=models.PROTECT, blank=True, null=True)\n model_file = models.FileField(upload_to=group_based_upload_to)\n name = models.CharField(max_length=255)\n description = models.TextField()\n def __str__(self):\n return self.name\nclass Scene3D(models.Model):\n filter_horizontal = (\"elements\",)\n name = models.CharField(",
|
"peekOfCode": "class Element3D(models.Model):\n parent = models.ForeignKey(\"self\", on_delete=models.PROTECT, blank=True, null=True)\n model_file = models.FileField(upload_to=group_based_upload_to)\n name = models.CharField(max_length=255)\n description = models.TextField(blank=True, null=True)\n is_enabled = models.BooleanField(default=True)\n can_disabled = models.BooleanField(default=False)\n def __str__(self):\n return self.name\nclass Scene3D(models.Model):",
|
||||||
"detail": "back.object.models",
|
"detail": "back.object.models",
|
||||||
"documentation": {}
|
"documentation": {}
|
||||||
},
|
},
|
||||||
|
@ -1160,7 +1210,7 @@
|
||||||
"kind": 2,
|
"kind": 2,
|
||||||
"importPath": "back.object.models",
|
"importPath": "back.object.models",
|
||||||
"description": "back.object.models",
|
"description": "back.object.models",
|
||||||
"peekOfCode": "def group_based_upload_to(instance, filename):\n logger.info(instance)\n return \"files/image/{}/{}/{}\".format(\n type(instance).__name__.lower(), instance.id, filename\n )\nclass Element3D(models.Model):\n parent = models.ForeignKey(\"self\", on_delete=models.PROTECT, blank=True, null=True)\n model_file = models.FileField(upload_to=group_based_upload_to)\n name = models.CharField(max_length=255)\n description = models.TextField()",
|
"peekOfCode": "def group_based_upload_to(instance, filename):\n logger.info(instance)\n return \"files/image/{}/{}/{}\".format(\n type(instance).__name__.lower(), instance.id, filename\n )\nclass Element3D(models.Model):\n parent = models.ForeignKey(\"self\", on_delete=models.PROTECT, blank=True, null=True)\n model_file = models.FileField(upload_to=group_based_upload_to)\n name = models.CharField(max_length=255)\n description = models.TextField(blank=True, null=True)",
|
||||||
"detail": "back.object.models",
|
"detail": "back.object.models",
|
||||||
"documentation": {}
|
"documentation": {}
|
||||||
},
|
},
|
||||||
|
|
|
@ -18,8 +18,9 @@ class Element3D(models.Model):
|
||||||
parent = models.ForeignKey("self", on_delete=models.PROTECT, blank=True, null=True)
|
parent = models.ForeignKey("self", on_delete=models.PROTECT, blank=True, null=True)
|
||||||
model_file = models.FileField(upload_to=group_based_upload_to)
|
model_file = models.FileField(upload_to=group_based_upload_to)
|
||||||
name = models.CharField(max_length=255)
|
name = models.CharField(max_length=255)
|
||||||
description = models.TextField()
|
description = models.TextField(blank=True, null=True)
|
||||||
|
is_enabled = models.BooleanField(default=True)
|
||||||
|
can_disabled = models.BooleanField(default=False)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
return self.name
|
return self.name
|
||||||
|
|
|
@ -61,7 +61,7 @@ const loadModels = async () => {
|
||||||
clickable_items.value = []
|
clickable_items.value = []
|
||||||
for (let index = 0; index < data.length; index++) {
|
for (let index = 0; index < data.length; index++) {
|
||||||
const element = data[index];
|
const element = data[index];
|
||||||
sidebar_items.push({ ...element, is_enabled: true })
|
sidebar_items.push({ ...element })
|
||||||
const item = {} as model3DType
|
const item = {} as model3DType
|
||||||
|
|
||||||
item.modelUrl = `${IMAGE_URL}/${element.model_file}`
|
item.modelUrl = `${IMAGE_URL}/${element.model_file}`
|
||||||
|
|
|
@ -18,18 +18,20 @@ const sidebar_obj = ref()
|
||||||
</a>
|
</a>
|
||||||
<div class="sidebar-content">
|
<div class="sidebar-content">
|
||||||
<template v-if="!sidebar.is_open"></template>
|
<template v-if="!sidebar.is_open"></template>
|
||||||
<template v-else-if="(sidebar.description && sidebar.title)">
|
<template v-else-if="sidebar.title">
|
||||||
<h2>{{ sidebar.title }}</h2>
|
<h2>{{ sidebar.title }}</h2>
|
||||||
|
<template v-if="sidebar.description">
|
||||||
<template v-for="p in sidebar.description.split('\n')">
|
<template v-for="p in sidebar.description.split('\n')">
|
||||||
<p>{{ p }}</p>
|
<p>{{ p }}</p>
|
||||||
</template>
|
</template>
|
||||||
|
</template>
|
||||||
<RouterLink class="btn" :to="`/promo/main/${sidebar.target}`" v-if="sidebar.target">
|
<RouterLink class="btn" :to="`/promo/main/${sidebar.target}`" v-if="sidebar.target">
|
||||||
{{ sidebar.target_name }}
|
{{ sidebar.target_name }}
|
||||||
</RouterLink>
|
</RouterLink>
|
||||||
</template>
|
</template>
|
||||||
<template v-else>
|
<template v-else>
|
||||||
<span class="sidebar-list-item" v-for="item in sidebar_scene.list">
|
<span class="sidebar-list-item" v-for="item in sidebar_scene.list">
|
||||||
<input type="checkbox" v-model="item.is_enabled" :id="item.name" />
|
<input type="checkbox" v-model="item.is_enabled" :id="item.name" :disabled="item.can_disabled" />
|
||||||
<label :for="item.name">
|
<label :for="item.name">
|
||||||
<h3>{{ item.name }}</h3>
|
<h3>{{ item.name }}</h3>
|
||||||
<template v-for="p in item.description.split('\n')">
|
<template v-for="p in item.description.split('\n')">
|
||||||
|
@ -42,7 +44,6 @@ const sidebar_obj = ref()
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
|
|
||||||
.sidebar {
|
.sidebar {
|
||||||
width: 23vw;
|
width: 23vw;
|
||||||
background-color: #fff;
|
background-color: #fff;
|
||||||
|
@ -74,6 +75,7 @@ const sidebar_obj = ref()
|
||||||
|
|
||||||
&-list-item {
|
&-list-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
||||||
label {
|
label {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
margin-left: 0.25rem
|
margin-left: 0.25rem
|
||||||
|
|
|
@ -23,10 +23,12 @@ interface element3DType {
|
||||||
id: number
|
id: number
|
||||||
model_file: string
|
model_file: string
|
||||||
name: string
|
name: string
|
||||||
description: string
|
description?: string
|
||||||
parent?: number,
|
parent?: number,
|
||||||
min_distance?: number,
|
min_distance?: number,
|
||||||
max_distance?: number,
|
max_distance?: number,
|
||||||
|
is_enabled: boolean
|
||||||
|
can_disabled: boolean
|
||||||
}
|
}
|
||||||
interface model3DType {
|
interface model3DType {
|
||||||
modelUrl?: string,
|
modelUrl?: string,
|
||||||
|
|
Loading…
Reference in New Issue