@ddj-v2/shop 0.0.1 → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.npmignore +20 -20
- package/README.md +283 -266
- package/frontend/foo.page.ts +232 -229
- package/index.ts +698 -681
- package/model.ts +168 -164
- package/package.json +19 -19
- package/templates/coin_base.html +101 -101
- package/templates/coin_bill.html +59 -59
- package/templates/coin_exchange.html +43 -40
- package/templates/coin_gift.html +43 -43
- package/templates/coin_import.html +25 -25
- package/templates/coin_inc.html +39 -39
- package/templates/coin_mall.html +90 -90
- package/templates/coin_myrecord.html +74 -74
- package/templates/coin_record.html +54 -54
- package/templates/coin_show.html +62 -62
- package/templates/domain_coin_setting.html +30 -30
- package/templates/goods_add.html +55 -50
- package/templates/goods_edit.html +63 -57
- package/templates/goods_manage.html +79 -79
- package/templates/shop_manage_entries.html +22 -22
- package/templates/uname_change.html +42 -42
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
{% import "components/paginator.html" as paginator with context %}
|
|
2
|
-
{% import "components/nothing.html" as nothing with context %}
|
|
3
|
-
{% extends "coin_base.html" %}
|
|
4
|
-
{% block coin_content %}
|
|
5
|
-
<div class="section">
|
|
6
|
-
<div class="section__header">
|
|
7
|
-
<h1 class="section__title">{{ _('coin_myrecord') }}</h1>
|
|
8
|
-
</div>
|
|
9
|
-
<div class="section__body">
|
|
10
|
-
<form method="get" class="row">
|
|
11
|
-
<div class="medium-5 columns">
|
|
12
|
-
{{ form.form_text({
|
|
13
|
-
label:'關鍵字',
|
|
14
|
-
name:'keyword',
|
|
15
|
-
value:keyword|default(''),
|
|
16
|
-
placeholder:'依原因文字搜尋'
|
|
17
|
-
}) }}
|
|
18
|
-
</div>
|
|
19
|
-
<div class="medium-4 columns">
|
|
20
|
-
{{ form.form_text({
|
|
21
|
-
label:'物件ID',
|
|
22
|
-
name:'objectId',
|
|
23
|
-
value:objectId|default(''),
|
|
24
|
-
placeholder:'例如:badge:3'
|
|
25
|
-
}) }}
|
|
26
|
-
</div>
|
|
27
|
-
<div class="medium-3 columns">
|
|
28
|
-
<button type="submit" class="rounded primary button">{{ _('搜尋') }}</button>
|
|
29
|
-
<a href="{{ url('coin_myrecord') }}" class="rounded button">{{ _('清除') }}</a>
|
|
30
|
-
</div>
|
|
31
|
-
</form>
|
|
32
|
-
</div>
|
|
33
|
-
<div class="section__body no-padding">
|
|
34
|
-
{% if not bills.length %}
|
|
35
|
-
{{ nothing.render('沒有兌換紀錄!') }}
|
|
36
|
-
{% else %}
|
|
37
|
-
<table class="data-table">
|
|
38
|
-
<colgroup>
|
|
39
|
-
<col class="col--time" style="width:6rem">
|
|
40
|
-
<col class="col--uid" style="width:12rem">
|
|
41
|
-
<col class="col--uid" style="width:12rem">
|
|
42
|
-
<col class="col--amount" style="width:4rem">
|
|
43
|
-
<col class="col--text">
|
|
44
|
-
</colgroup>
|
|
45
|
-
<thead>
|
|
46
|
-
<tr>
|
|
47
|
-
<th>{{ _('Time') }}</th>
|
|
48
|
-
<th>{{ _('發放者') }}</th>
|
|
49
|
-
<th>{{ _('接收者') }}</th>
|
|
50
|
-
<th>{{ _('數額') }}</th>
|
|
51
|
-
<th>{{ _('原因') }}</th>
|
|
52
|
-
</tr>
|
|
53
|
-
</thead>
|
|
54
|
-
<tbody>
|
|
55
|
-
{%- for bill in bills -%}
|
|
56
|
-
<tr data-uid="{{ udoc.uid }}">
|
|
57
|
-
<td>{{ datetimeSpan(bill._id)|safe }}</td>
|
|
58
|
-
<td>{{ user.render_inline(udict[bill.rootId],avatar=false,badge=false,inline=false) }}</td>
|
|
59
|
-
<td>
|
|
60
|
-
<a href="{{ url('coin_bill',query={uid:bill.userId}) }}">
|
|
61
|
-
{{ user.render_inline(udict[bill.userId],avatar=false,badge=false,inline=false) }}
|
|
62
|
-
</a>
|
|
63
|
-
</td>
|
|
64
|
-
<td>{{ bill.amount }}</td>
|
|
65
|
-
<td>{{ bill.text }}</td>
|
|
66
|
-
</tr>
|
|
67
|
-
{%- endfor -%}
|
|
68
|
-
</tbody>
|
|
69
|
-
</table>
|
|
70
|
-
{{ paginator.render(page, upcount) }}
|
|
71
|
-
{% endif %}
|
|
72
|
-
</div>
|
|
73
|
-
</div>
|
|
74
|
-
{% endblock %}
|
|
1
|
+
{% import "components/paginator.html" as paginator with context %}
|
|
2
|
+
{% import "components/nothing.html" as nothing with context %}
|
|
3
|
+
{% extends "coin_base.html" %}
|
|
4
|
+
{% block coin_content %}
|
|
5
|
+
<div class="section">
|
|
6
|
+
<div class="section__header">
|
|
7
|
+
<h1 class="section__title">{{ _('coin_myrecord') }}</h1>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="section__body">
|
|
10
|
+
<form method="get" class="row">
|
|
11
|
+
<div class="medium-5 columns">
|
|
12
|
+
{{ form.form_text({
|
|
13
|
+
label:'關鍵字',
|
|
14
|
+
name:'keyword',
|
|
15
|
+
value:keyword|default(''),
|
|
16
|
+
placeholder:'依原因文字搜尋'
|
|
17
|
+
}) }}
|
|
18
|
+
</div>
|
|
19
|
+
<div class="medium-4 columns">
|
|
20
|
+
{{ form.form_text({
|
|
21
|
+
label:'物件ID',
|
|
22
|
+
name:'objectId',
|
|
23
|
+
value:objectId|default(''),
|
|
24
|
+
placeholder:'例如:badge:3'
|
|
25
|
+
}) }}
|
|
26
|
+
</div>
|
|
27
|
+
<div class="medium-3 columns">
|
|
28
|
+
<button type="submit" class="rounded primary button">{{ _('搜尋') }}</button>
|
|
29
|
+
<a href="{{ url('coin_myrecord') }}" class="rounded button">{{ _('清除') }}</a>
|
|
30
|
+
</div>
|
|
31
|
+
</form>
|
|
32
|
+
</div>
|
|
33
|
+
<div class="section__body no-padding">
|
|
34
|
+
{% if not bills.length %}
|
|
35
|
+
{{ nothing.render('沒有兌換紀錄!') }}
|
|
36
|
+
{% else %}
|
|
37
|
+
<table class="data-table">
|
|
38
|
+
<colgroup>
|
|
39
|
+
<col class="col--time" style="width:6rem">
|
|
40
|
+
<col class="col--uid" style="width:12rem">
|
|
41
|
+
<col class="col--uid" style="width:12rem">
|
|
42
|
+
<col class="col--amount" style="width:4rem">
|
|
43
|
+
<col class="col--text">
|
|
44
|
+
</colgroup>
|
|
45
|
+
<thead>
|
|
46
|
+
<tr>
|
|
47
|
+
<th>{{ _('Time') }}</th>
|
|
48
|
+
<th>{{ _('發放者') }}</th>
|
|
49
|
+
<th>{{ _('接收者') }}</th>
|
|
50
|
+
<th>{{ _('數額') }}</th>
|
|
51
|
+
<th>{{ _('原因') }}</th>
|
|
52
|
+
</tr>
|
|
53
|
+
</thead>
|
|
54
|
+
<tbody>
|
|
55
|
+
{%- for bill in bills -%}
|
|
56
|
+
<tr data-uid="{{ udoc.uid }}">
|
|
57
|
+
<td>{{ datetimeSpan(bill._id)|safe }}</td>
|
|
58
|
+
<td>{{ user.render_inline(udict[bill.rootId],avatar=false,badge=false,inline=false) }}</td>
|
|
59
|
+
<td>
|
|
60
|
+
<a href="{{ url('coin_bill',query={uid:bill.userId}) }}">
|
|
61
|
+
{{ user.render_inline(udict[bill.userId],avatar=false,badge=false,inline=false) }}
|
|
62
|
+
</a>
|
|
63
|
+
</td>
|
|
64
|
+
<td>{{ bill.amount }}</td>
|
|
65
|
+
<td>{{ bill.text }}</td>
|
|
66
|
+
</tr>
|
|
67
|
+
{%- endfor -%}
|
|
68
|
+
</tbody>
|
|
69
|
+
</table>
|
|
70
|
+
{{ paginator.render(page, upcount) }}
|
|
71
|
+
{% endif %}
|
|
72
|
+
</div>
|
|
73
|
+
</div>
|
|
74
|
+
{% endblock %}
|
|
@@ -1,54 +1,54 @@
|
|
|
1
|
-
{% import "components/paginator.html" as paginator with context %}
|
|
2
|
-
{% import "components/nothing.html" as nothing with context %}
|
|
3
|
-
{% extends "coin_base.html" %}
|
|
4
|
-
{% block coin_content %}
|
|
5
|
-
<div class="section">
|
|
6
|
-
<div class="section__header">
|
|
7
|
-
<h1 class="section__title">{{ _('coin_record') }}</h1>
|
|
8
|
-
</div>
|
|
9
|
-
<div class="section__body no-padding">
|
|
10
|
-
{% if not bills.length %}
|
|
11
|
-
{{ nothing.render('沒有兌換紀錄!') }}
|
|
12
|
-
{% else %}
|
|
13
|
-
<table class="data-table">
|
|
14
|
-
<colgroup>
|
|
15
|
-
<col class="col--time" style="width:6rem">
|
|
16
|
-
<col class="col--uid" style="width:12rem">
|
|
17
|
-
<col class="col--uid" style="width:12rem">
|
|
18
|
-
<col class="col--amount" style="width:4rem">
|
|
19
|
-
<col class="col--text">
|
|
20
|
-
</colgroup>
|
|
21
|
-
<thead>
|
|
22
|
-
<tr>
|
|
23
|
-
<th>{{ _('Time') }}</th>
|
|
24
|
-
<th>{{ _('發放者') }}</th>
|
|
25
|
-
<th>{{ _('接收者') }}</th>
|
|
26
|
-
<th>{{ _('數額') }}</th>
|
|
27
|
-
<th>{{ _('原因') }}</th>
|
|
28
|
-
</tr>
|
|
29
|
-
</thead>
|
|
30
|
-
<tbody>
|
|
31
|
-
{%- for bill in bills -%}
|
|
32
|
-
<tr data-uid="{{ udoc.uid }}">
|
|
33
|
-
<td>{{ datetimeSpan(bill._id)|safe }}</td>
|
|
34
|
-
<td>
|
|
35
|
-
<a href="{{ url('coin_record',query={uid:bill.rootId}) }}">
|
|
36
|
-
{{ user.render_inline(udict[bill.rootId],avatar=false,badge=false,inline=false) }}
|
|
37
|
-
</a>
|
|
38
|
-
</td>
|
|
39
|
-
<td>
|
|
40
|
-
<a href="{{ url('coin_record',query={uid:bill.userId}) }}">
|
|
41
|
-
{{ user.render_inline(udict[bill.userId],avatar=false,badge=false,inline=false) }}
|
|
42
|
-
</a>
|
|
43
|
-
</td>
|
|
44
|
-
<td>{{ bill.amount }}</td>
|
|
45
|
-
<td>{{ bill.text }}</td>
|
|
46
|
-
</tr>
|
|
47
|
-
{%- endfor -%}
|
|
48
|
-
</tbody>
|
|
49
|
-
</table>
|
|
50
|
-
{{ paginator.render(page, upcount,add_qs=('uid=' + uid)) }}
|
|
51
|
-
{% endif %}
|
|
52
|
-
</div>
|
|
53
|
-
</div>
|
|
54
|
-
{% endblock %}
|
|
1
|
+
{% import "components/paginator.html" as paginator with context %}
|
|
2
|
+
{% import "components/nothing.html" as nothing with context %}
|
|
3
|
+
{% extends "coin_base.html" %}
|
|
4
|
+
{% block coin_content %}
|
|
5
|
+
<div class="section">
|
|
6
|
+
<div class="section__header">
|
|
7
|
+
<h1 class="section__title">{{ _('coin_record') }}</h1>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="section__body no-padding">
|
|
10
|
+
{% if not bills.length %}
|
|
11
|
+
{{ nothing.render('沒有兌換紀錄!') }}
|
|
12
|
+
{% else %}
|
|
13
|
+
<table class="data-table">
|
|
14
|
+
<colgroup>
|
|
15
|
+
<col class="col--time" style="width:6rem">
|
|
16
|
+
<col class="col--uid" style="width:12rem">
|
|
17
|
+
<col class="col--uid" style="width:12rem">
|
|
18
|
+
<col class="col--amount" style="width:4rem">
|
|
19
|
+
<col class="col--text">
|
|
20
|
+
</colgroup>
|
|
21
|
+
<thead>
|
|
22
|
+
<tr>
|
|
23
|
+
<th>{{ _('Time') }}</th>
|
|
24
|
+
<th>{{ _('發放者') }}</th>
|
|
25
|
+
<th>{{ _('接收者') }}</th>
|
|
26
|
+
<th>{{ _('數額') }}</th>
|
|
27
|
+
<th>{{ _('原因') }}</th>
|
|
28
|
+
</tr>
|
|
29
|
+
</thead>
|
|
30
|
+
<tbody>
|
|
31
|
+
{%- for bill in bills -%}
|
|
32
|
+
<tr data-uid="{{ udoc.uid }}">
|
|
33
|
+
<td>{{ datetimeSpan(bill._id)|safe }}</td>
|
|
34
|
+
<td>
|
|
35
|
+
<a href="{{ url('coin_record',query={uid:bill.rootId}) }}">
|
|
36
|
+
{{ user.render_inline(udict[bill.rootId],avatar=false,badge=false,inline=false) }}
|
|
37
|
+
</a>
|
|
38
|
+
</td>
|
|
39
|
+
<td>
|
|
40
|
+
<a href="{{ url('coin_record',query={uid:bill.userId}) }}">
|
|
41
|
+
{{ user.render_inline(udict[bill.userId],avatar=false,badge=false,inline=false) }}
|
|
42
|
+
</a>
|
|
43
|
+
</td>
|
|
44
|
+
<td>{{ bill.amount }}</td>
|
|
45
|
+
<td>{{ bill.text }}</td>
|
|
46
|
+
</tr>
|
|
47
|
+
{%- endfor -%}
|
|
48
|
+
</tbody>
|
|
49
|
+
</table>
|
|
50
|
+
{{ paginator.render(page, upcount,add_qs=('uid=' + uid)) }}
|
|
51
|
+
{% endif %}
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
{% endblock %}
|
package/templates/coin_show.html
CHANGED
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
{% import "components/nothing.html" as nothing with context %}
|
|
2
|
-
{% import "components/paginator.html" as paginator with context %}
|
|
3
|
-
{% extends "coin_base.html" %}
|
|
4
|
-
{% block coin_content %}
|
|
5
|
-
<div class="section">
|
|
6
|
-
<div class="section__header">
|
|
7
|
-
<h1 class="section__title">{{ _('所有有過硬幣的學員') }}</h1>
|
|
8
|
-
</div>
|
|
9
|
-
<div class="section__body no-padding">
|
|
10
|
-
<table class="data-table">
|
|
11
|
-
<colgroup>
|
|
12
|
-
<col class="col--uid" style="width:5rem">
|
|
13
|
-
<col class="col--user">
|
|
14
|
-
<col class="col--groups" style="width:8rem">
|
|
15
|
-
<col class="col--coin_all" style="width:8rem">
|
|
16
|
-
<col class="col--coin_now" style="width:8rem">
|
|
17
|
-
<col class="col--actions" style="width:8rem">
|
|
18
|
-
</colgroup>
|
|
19
|
-
<thead>
|
|
20
|
-
<tr>
|
|
21
|
-
<th>{{ _('User ID') }}</th>
|
|
22
|
-
<th>{{ _('Username') }}</th>
|
|
23
|
-
<th>
|
|
24
|
-
<form method="get" class="inline">
|
|
25
|
-
<select name="groupName" class="compact select" onchange="this.form.submit()">
|
|
26
|
-
<option value="">{{ _('所有小組') }}</option>
|
|
27
|
-
{% for group in groups %}
|
|
28
|
-
<option value="{{ group.name }}" {% if groupName == group.name %}selected{% endif %}>
|
|
29
|
-
{{ group.name }} ({{ group.uids.length }} {{ _('users') }})
|
|
30
|
-
</option>
|
|
31
|
-
{% endfor %}
|
|
32
|
-
</select>
|
|
33
|
-
</form>
|
|
34
|
-
</th>
|
|
35
|
-
<th>{{ _('累計獲得硬幣') }}</th>
|
|
36
|
-
<th>{{ _('目前剩餘硬幣') }}</th>
|
|
37
|
-
<th>{{ _('Actions') }}</th>
|
|
38
|
-
</tr>
|
|
39
|
-
</thead>
|
|
40
|
-
<tbody>
|
|
41
|
-
{%- for udoc in udocs -%}
|
|
42
|
-
<tr>
|
|
43
|
-
<td>{{ udoc._id }}</td>
|
|
44
|
-
<td>{{ user.render_inline(udoc) }}</td>
|
|
45
|
-
<td>
|
|
46
|
-
{%- for group in groups -%}
|
|
47
|
-
{%- if udoc._id in group.uids -%}
|
|
48
|
-
{{ group.name }}{{ ' ' }}
|
|
49
|
-
{%- endif -%}
|
|
50
|
-
{%- endfor -%}
|
|
51
|
-
</td>
|
|
52
|
-
<td>{{ udoc.coin_all | default(0) }}</td>
|
|
53
|
-
<td>{{ udoc.coin_now }}</td>
|
|
54
|
-
<td><a href="{{ url('coin_bill',query={uid:udoc._id}) }}" class="typo-a contest-tag">{{ _('查看明細') }}</a></td>
|
|
55
|
-
</tr>
|
|
56
|
-
{%- endfor -%}
|
|
57
|
-
</tbody>
|
|
58
|
-
</table>
|
|
59
|
-
{{ paginator.render(page, upcount,add_qs=('groupName=' + groupName if groupName else '')) }}
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
|
-
{% endblock %}
|
|
1
|
+
{% import "components/nothing.html" as nothing with context %}
|
|
2
|
+
{% import "components/paginator.html" as paginator with context %}
|
|
3
|
+
{% extends "coin_base.html" %}
|
|
4
|
+
{% block coin_content %}
|
|
5
|
+
<div class="section">
|
|
6
|
+
<div class="section__header">
|
|
7
|
+
<h1 class="section__title">{{ _('所有有過硬幣的學員') }}</h1>
|
|
8
|
+
</div>
|
|
9
|
+
<div class="section__body no-padding">
|
|
10
|
+
<table class="data-table">
|
|
11
|
+
<colgroup>
|
|
12
|
+
<col class="col--uid" style="width:5rem">
|
|
13
|
+
<col class="col--user">
|
|
14
|
+
<col class="col--groups" style="width:8rem">
|
|
15
|
+
<col class="col--coin_all" style="width:8rem">
|
|
16
|
+
<col class="col--coin_now" style="width:8rem">
|
|
17
|
+
<col class="col--actions" style="width:8rem">
|
|
18
|
+
</colgroup>
|
|
19
|
+
<thead>
|
|
20
|
+
<tr>
|
|
21
|
+
<th>{{ _('User ID') }}</th>
|
|
22
|
+
<th>{{ _('Username') }}</th>
|
|
23
|
+
<th>
|
|
24
|
+
<form method="get" class="inline">
|
|
25
|
+
<select name="groupName" class="compact select" onchange="this.form.submit()">
|
|
26
|
+
<option value="">{{ _('所有小組') }}</option>
|
|
27
|
+
{% for group in groups %}
|
|
28
|
+
<option value="{{ group.name }}" {% if groupName == group.name %}selected{% endif %}>
|
|
29
|
+
{{ group.name }} ({{ group.uids.length }} {{ _('users') }})
|
|
30
|
+
</option>
|
|
31
|
+
{% endfor %}
|
|
32
|
+
</select>
|
|
33
|
+
</form>
|
|
34
|
+
</th>
|
|
35
|
+
<th>{{ _('累計獲得硬幣') }}</th>
|
|
36
|
+
<th>{{ _('目前剩餘硬幣') }}</th>
|
|
37
|
+
<th>{{ _('Actions') }}</th>
|
|
38
|
+
</tr>
|
|
39
|
+
</thead>
|
|
40
|
+
<tbody>
|
|
41
|
+
{%- for udoc in udocs -%}
|
|
42
|
+
<tr>
|
|
43
|
+
<td>{{ udoc._id }}</td>
|
|
44
|
+
<td>{{ user.render_inline(udoc) }}</td>
|
|
45
|
+
<td>
|
|
46
|
+
{%- for group in groups -%}
|
|
47
|
+
{%- if udoc._id in group.uids -%}
|
|
48
|
+
{{ group.name }}{{ ' ' }}
|
|
49
|
+
{%- endif -%}
|
|
50
|
+
{%- endfor -%}
|
|
51
|
+
</td>
|
|
52
|
+
<td>{{ udoc.coin_all | default(0) }}</td>
|
|
53
|
+
<td>{{ udoc.coin_now }}</td>
|
|
54
|
+
<td><a href="{{ url('coin_bill',query={uid:udoc._id}) }}" class="typo-a contest-tag">{{ _('查看明細') }}</a></td>
|
|
55
|
+
</tr>
|
|
56
|
+
{%- endfor -%}
|
|
57
|
+
</tbody>
|
|
58
|
+
</table>
|
|
59
|
+
{{ paginator.render(page, upcount,add_qs=('groupName=' + groupName if groupName else '')) }}
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
{% endblock %}
|
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
{% extends "domain_base.html" %}
|
|
2
|
-
{% block domain_content %}
|
|
3
|
-
<div class="section">
|
|
4
|
-
<div class="section__header">
|
|
5
|
-
<h1 class="section__title">{{ _('domain_coin_setting') }}</h1>
|
|
6
|
-
</div>
|
|
7
|
-
<div class="section__body">
|
|
8
|
-
<form method="POST">
|
|
9
|
-
{{ form.form_checkbox({
|
|
10
|
-
label: '自動發放硬幣',
|
|
11
|
-
name: 'coin_enabled',
|
|
12
|
-
help_text: '為此網域啟用首次 AC 硬幣發放功能',
|
|
13
|
-
value: coin_enabled
|
|
14
|
-
}) }}
|
|
15
|
-
{{ form.form_text({
|
|
16
|
-
label: '每題硬幣數量',
|
|
17
|
-
name: 'coin_amount',
|
|
18
|
-
help_text: '每題首次 AC 可獲得的硬幣數量',
|
|
19
|
-
value: coin_amount,
|
|
20
|
-
type: 'number'
|
|
21
|
-
}) }}
|
|
22
|
-
<button class="rounded primary button" type="submit">
|
|
23
|
-
{{ _('Save All Changes') }}
|
|
24
|
-
</button>
|
|
25
|
-
<button type="button" class="rounded button" onclick="window.history.go(-1)">
|
|
26
|
-
{{ _('Cancel') }}
|
|
27
|
-
</button>
|
|
28
|
-
</form>
|
|
29
|
-
</div>
|
|
30
|
-
</div>
|
|
1
|
+
{% extends "domain_base.html" %}
|
|
2
|
+
{% block domain_content %}
|
|
3
|
+
<div class="section">
|
|
4
|
+
<div class="section__header">
|
|
5
|
+
<h1 class="section__title">{{ _('domain_coin_setting') }}</h1>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="section__body">
|
|
8
|
+
<form method="POST">
|
|
9
|
+
{{ form.form_checkbox({
|
|
10
|
+
label: '自動發放硬幣',
|
|
11
|
+
name: 'coin_enabled',
|
|
12
|
+
help_text: '為此網域啟用首次 AC 硬幣發放功能',
|
|
13
|
+
value: coin_enabled
|
|
14
|
+
}) }}
|
|
15
|
+
{{ form.form_text({
|
|
16
|
+
label: '每題硬幣數量',
|
|
17
|
+
name: 'coin_amount',
|
|
18
|
+
help_text: '每題首次 AC 可獲得的硬幣數量',
|
|
19
|
+
value: coin_amount,
|
|
20
|
+
type: 'number'
|
|
21
|
+
}) }}
|
|
22
|
+
<button class="rounded primary button" type="submit">
|
|
23
|
+
{{ _('Save All Changes') }}
|
|
24
|
+
</button>
|
|
25
|
+
<button type="button" class="rounded button" onclick="window.history.go(-1)">
|
|
26
|
+
{{ _('Cancel') }}
|
|
27
|
+
</button>
|
|
28
|
+
</form>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
31
31
|
{% endblock %}
|
package/templates/goods_add.html
CHANGED
|
@@ -1,50 +1,55 @@
|
|
|
1
|
-
{% extends "coin_base.html" %}
|
|
2
|
-
{% block coin_content %}
|
|
3
|
-
<div class="section">
|
|
4
|
-
<div class="section__header">
|
|
5
|
-
<h1 class="section__title">{{ _('goods_add') }}</h1>
|
|
6
|
-
</div>
|
|
7
|
-
<div class="section__body">
|
|
8
|
-
<form method="post">
|
|
9
|
-
{{ form.form_text({
|
|
10
|
-
label:'物件 ID(可重複)',
|
|
11
|
-
name:'objectId',
|
|
12
|
-
placeholder:'例如:problem-1001'
|
|
13
|
-
}) }}
|
|
14
|
-
{{ form.form_text({
|
|
15
|
-
label:'
|
|
16
|
-
name:'
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
label:'
|
|
28
|
-
name:'
|
|
29
|
-
|
|
30
|
-
}) }}
|
|
31
|
-
{{ form.form_text({
|
|
32
|
-
label:'
|
|
33
|
-
name:'
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
</
|
|
50
|
-
|
|
1
|
+
{% extends "coin_base.html" %}
|
|
2
|
+
{% block coin_content %}
|
|
3
|
+
<div class="section">
|
|
4
|
+
<div class="section__header">
|
|
5
|
+
<h1 class="section__title">{{ _('goods_add') }}</h1>
|
|
6
|
+
</div>
|
|
7
|
+
<div class="section__body">
|
|
8
|
+
<form method="post">
|
|
9
|
+
{{ form.form_text({
|
|
10
|
+
label:'物件 ID(可重複)',
|
|
11
|
+
name:'objectId',
|
|
12
|
+
placeholder:'例如:problem-1001'
|
|
13
|
+
}) }}
|
|
14
|
+
{{ form.form_text({
|
|
15
|
+
label:'購買後跳轉連結(選填)',
|
|
16
|
+
name:'redirectUrl',
|
|
17
|
+
placeholder:'例如:/problem/1001 或 https://example.com'
|
|
18
|
+
}) }}
|
|
19
|
+
{{ form.form_text({
|
|
20
|
+
label:'商品名稱',
|
|
21
|
+
name:'name',
|
|
22
|
+
autofocus:true,
|
|
23
|
+
required:true
|
|
24
|
+
}) }}
|
|
25
|
+
{{ form.form_textarea({
|
|
26
|
+
columns:null,
|
|
27
|
+
label:'商品描述(Markdown)',
|
|
28
|
+
name:'description',
|
|
29
|
+
placeholder:'輸入商品描述,支援 Markdown 語法'
|
|
30
|
+
}) }}
|
|
31
|
+
{{ form.form_text({
|
|
32
|
+
label:'商品價格',
|
|
33
|
+
name:'price',
|
|
34
|
+
required:true
|
|
35
|
+
}) }}
|
|
36
|
+
{{ form.form_text({
|
|
37
|
+
label:'商品數量',
|
|
38
|
+
name:'num',
|
|
39
|
+
placeholder:'輸入 -1 表示無限供應',
|
|
40
|
+
required:true
|
|
41
|
+
}) }}
|
|
42
|
+
<div class="row">
|
|
43
|
+
<div class="columns">
|
|
44
|
+
<button type="submit" class="rounded primary button">
|
|
45
|
+
{{ _('Add') }}
|
|
46
|
+
</button>
|
|
47
|
+
<button type="button" class="rounded button" onclick="window.history.go(-1)">
|
|
48
|
+
{{ _('Cancel') }}
|
|
49
|
+
</button>
|
|
50
|
+
</div>
|
|
51
|
+
</div>
|
|
52
|
+
</form>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
{% endblock %}
|