Display business items

This commit is contained in:
eraden 2022-07-14 22:27:46 +02:00
parent e1bd032e2a
commit ce997cb7c8
3 changed files with 21 additions and 2 deletions

View File

@ -9,7 +9,17 @@
name="{{business.name}}" name="{{business.name}}"
state="{{ business.state }}" state="{{ business.state }}"
> >
{{business.description|safe}} <p slot="description">{{business.description|safe}}</p>
{% for item in business.items %}
<local-business-item
slot="item"
name="{{item.name}}"
price="{{item.price}}"
picture-url="{{item.picture_url}}"
>
</local-business-item>
{% endfor %}
</admin-business> </admin-business>
</admin-edit-business> </admin-edit-business>
{% endfor %} {% endfor %}

View File

@ -11,12 +11,18 @@ customElements.define('admin-business', class extends Component {
:host { :host {
display: block; display: block;
} }
::slotted(local-business-item) {
width: 100%;
}
</style> </style>
<article> <article>
<h1 id="name"></h1> <h1 id="name"></h1>
</article> </article>
<article> <article>
<slot></slot> <slot name="description"></slot>
</article>
<article>
<slot name="item"></slot>
</article> </article>
`); `);
} }

View File

@ -19,6 +19,9 @@ customElements.define('admin-edit-business', class extends Component {
#actions > input:not(:last-child) { #actions > input:not(:last-child) {
margin-right: .5rem; margin-right: .5rem;
} }
::slotted(admin-business) {
width: 100%;
}
${ BUTTON_STYLE } ${ BUTTON_STYLE }
${ INPUT_STYLE } ${ INPUT_STYLE }
</style> </style>