Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
AE UTBM
Sith
Commits
933afd4f
Commit
933afd4f
authored
Oct 19, 2016
by
Skia
🤘
Browse files
Update eboutic main template
parent
47c01d6d
Pipeline
#311
failed with stage
in 4 minutes and 38 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
eboutic/templates/eboutic/eboutic_main.jinja
View file @
933afd4f
...
...
@@ -4,11 +4,11 @@
{%
trans
%}
Eboutic
{%
endtrans
%}
{%
endblock
%}
{%
macro
add_product
(
id
,
content
)
%}
<form
method=
"post"
action=
"
{{
url
(
'eboutic:main'
)
}}
"
class=
"inline
"
style=
"display:inline
"
>
{%
macro
add_product
(
id
,
content
,
class
=
""
)
%}
<form
method=
"post"
action=
"
{{
url
(
'eboutic:main'
)
}}
"
class=
"inline
{{
class
}}
"
>
{%
csrf_token
%}
<input
type=
"hidden"
name=
"action"
value=
"add_product"
>
<button
type=
"submit"
name=
"product_id"
value=
"
{{
id
}}
"
>
{{
content
}}
</button>
<button
type=
"submit"
name=
"product_id"
value=
"
{{
id
}}
"
>
{{
content
|
safe
}}
</button>
</form>
{%
endmacro
%}
...
...
@@ -42,7 +42,14 @@
{%
if
eboutic.products.
filter
(
product_type
=
t
)
.
exists
()
%}
<h5>
{{
t
}}
</h5>
{%
for
p
in
eboutic.products.
filter
(
product_type
=
t
)
.
all
()
%}
{{
add_product
(
p.id
,
p.name
)
}}
{%
set
file
=
None
%}
{%
if
p.icon
%}
{%
set
file
=
p.icon.url
%}
{%
else
%}
{%
set
file
=
static
(
'core/img/na.gif'
)
%}
{%
endif
%}
{%
set
prod
=
'<strong>%s</strong><hr><img src="%s" /><span>%s €</span>'
%
(
p.name
,
file
,
p.selling_price
)
%}
{{
add_product
(
p.id
,
prod
,
"form_button"
)
}}
{%
endfor
%}
{%
endif
%}
{%
endfor
%}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment