dev #10
|
@ -128,6 +128,38 @@
|
|||
"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": "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",
|
||||
"importPath": "django.db",
|
||||
|
@ -1110,6 +1142,24 @@
|
|||
"detail": "back.object.migrations.0005_remove_scene3d_gainmap_remove_scene3d_json_and_more",
|
||||
"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",
|
||||
"kind": 6,
|
||||
|
@ -1133,7 +1183,7 @@
|
|||
"kind": 6,
|
||||
"importPath": "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",
|
||||
"documentation": {}
|
||||
},
|
||||
|
@ -1160,7 +1210,7 @@
|
|||
"kind": 2,
|
||||
"importPath": "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",
|
||||
"documentation": {}
|
||||
},
|
||||
|
|
|
@ -18,8 +18,9 @@ class Element3D(models.Model):
|
|||
parent = models.ForeignKey("self", on_delete=models.PROTECT, blank=True, null=True)
|
||||
model_file = models.FileField(upload_to=group_based_upload_to)
|
||||
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):
|
||||
return self.name
|
||||
|
|
|
@ -61,7 +61,7 @@ const loadModels = async () => {
|
|||
clickable_items.value = []
|
||||
for (let index = 0; index < data.length; index++) {
|
||||
const element = data[index];
|
||||
sidebar_items.push({ ...element, is_enabled: true })
|
||||
sidebar_items.push({ ...element })
|
||||
const item = {} as model3DType
|
||||
|
||||
item.modelUrl = `${IMAGE_URL}/${element.model_file}`
|
||||
|
|
|
@ -18,10 +18,12 @@ const sidebar_obj = ref()
|
|||
</a>
|
||||
<div class="sidebar-content">
|
||||
<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>
|
||||
<template v-for="p in sidebar.description.split('\n')">
|
||||
<p>{{ p }}</p>
|
||||
<template v-if="sidebar.description">
|
||||
<template v-for="p in sidebar.description.split('\n')">
|
||||
<p>{{ p }}</p>
|
||||
</template>
|
||||
</template>
|
||||
<RouterLink class="btn" :to="`/promo/main/${sidebar.target}`" v-if="sidebar.target">
|
||||
{{ sidebar.target_name }}
|
||||
|
@ -29,7 +31,7 @@ const sidebar_obj = ref()
|
|||
</template>
|
||||
<template v-else>
|
||||
<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">
|
||||
<h3>{{ item.name }}</h3>
|
||||
<template v-for="p in item.description.split('\n')">
|
||||
|
@ -42,7 +44,6 @@ const sidebar_obj = ref()
|
|||
</div>
|
||||
</template>
|
||||
<style scoped lang="scss">
|
||||
|
||||
.sidebar {
|
||||
width: 23vw;
|
||||
background-color: #fff;
|
||||
|
@ -74,6 +75,7 @@ const sidebar_obj = ref()
|
|||
|
||||
&-list-item {
|
||||
display: flex;
|
||||
|
||||
label {
|
||||
flex-grow: 1;
|
||||
margin-left: 0.25rem
|
||||
|
|
|
@ -23,10 +23,12 @@ interface element3DType {
|
|||
id: number
|
||||
model_file: string
|
||||
name: string
|
||||
description: string
|
||||
description?: string
|
||||
parent?: number,
|
||||
min_distance?: number,
|
||||
max_distance?: number,
|
||||
is_enabled: boolean
|
||||
can_disabled: boolean
|
||||
}
|
||||
interface model3DType {
|
||||
modelUrl?: string,
|
||||
|
|
Loading…
Reference in New Issue