@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.
@@ -1,57 +1,63 @@
1
- {% extends "coin_base.html" %}
2
- {% block coin_content %}
3
- <div class="section">
4
- <div class="section__header">
5
- <h1 class="section__title">{{ _('goods_edit') }}</h1>
6
- </div>
7
- <div class="section__body">
8
- <form method="post">
9
- {{ form.form_text({
10
- label:'物件 ID(可重複)',
11
- name:'objectId',
12
- value:goods.objectId|default('')
13
- }) }}
14
- {{ form.form_text({
15
- label:'商品名稱',
16
- name:'name',
17
- value:goods.name|default(''),
18
- autofocus:true,
19
- required:true
20
- }) }}
21
- {{ form.form_textarea({
22
- columns:null,
23
- label:'商品描述(Markdown)',
24
- name:'description',
25
- value:goods.description|default(''),
26
- placeholder:'輸入商品描述,支援 Markdown 語法'
27
- }) }}
28
- {{ form.form_text({
29
- label:'商品價格',
30
- name:'price',
31
- value:goods.price|default(''),
32
- required:true
33
- }) }}
34
- {{ form.form_text({
35
- label:'商品數量',
36
- name:'num',
37
- value:goods.num|default(''),
38
- placeholder:'輸入 -1 表示無限供應',
39
- required:true
40
- }) }}
41
- <div class="row">
42
- <div class="columns">
43
- <button name="operation" value="update" type="submit" class="rounded primary button">
44
- {{ _('Update') }}
45
- </button>
46
- <button name="operation" value="delete" type="submit" class="rounded button">
47
- {{ _('Delete') }}
48
- </button>
49
- <button type="button" class="rounded button" onclick="window.history.go(-1)">
50
- {{ _('Cancel') }}
51
- </button>
52
- </div>
53
- </div>
54
- </form>
55
- </div>
56
- </div>
57
- {% endblock %}
1
+ {% extends "coin_base.html" %}
2
+ {% block coin_content %}
3
+ <div class="section">
4
+ <div class="section__header">
5
+ <h1 class="section__title">{{ _('goods_edit') }}</h1>
6
+ </div>
7
+ <div class="section__body">
8
+ <form method="post">
9
+ {{ form.form_text({
10
+ label:'物件 ID(可重複)',
11
+ name:'objectId',
12
+ value:goods.objectId|default('')
13
+ }) }}
14
+ {{ form.form_text({
15
+ label:'購買後跳轉連結(選填)',
16
+ name:'redirectUrl',
17
+ value:goods.redirectUrl|default(''),
18
+ placeholder:'例如:/problem/1001 或 https://example.com'
19
+ }) }}
20
+ {{ form.form_text({
21
+ label:'商品名稱',
22
+ name:'name',
23
+ value:goods.name|default(''),
24
+ autofocus:true,
25
+ required:true
26
+ }) }}
27
+ {{ form.form_textarea({
28
+ columns:null,
29
+ label:'商品描述(Markdown)',
30
+ name:'description',
31
+ value:goods.description|default(''),
32
+ placeholder:'輸入商品描述,支援 Markdown 語法'
33
+ }) }}
34
+ {{ form.form_text({
35
+ label:'商品價格',
36
+ name:'price',
37
+ value:goods.price|default(''),
38
+ required:true
39
+ }) }}
40
+ {{ form.form_text({
41
+ label:'商品數量',
42
+ name:'num',
43
+ value:goods.num|default(''),
44
+ placeholder:'輸入 -1 表示無限供應',
45
+ required:true
46
+ }) }}
47
+ <div class="row">
48
+ <div class="columns">
49
+ <button name="operation" value="update" type="submit" class="rounded primary button">
50
+ {{ _('Update') }}
51
+ </button>
52
+ <button name="operation" value="delete" type="submit" class="rounded button">
53
+ {{ _('Delete') }}
54
+ </button>
55
+ <button type="button" class="rounded button" onclick="window.history.go(-1)">
56
+ {{ _('Cancel') }}
57
+ </button>
58
+ </div>
59
+ </div>
60
+ </form>
61
+ </div>
62
+ </div>
63
+ {% endblock %}
@@ -1,79 +1,79 @@
1
- {% extends "coin_base.html" %}
2
- {% import "components/paginator.html" as paginator with context %}
3
- {% import "components/nothing.html" as nothing with context %}
4
- {% block coin_content %}
5
- <div class="section">
6
- <div class="section__header">
7
- <h1 class="section__title">{{ _('goods_manage')}}</h1>
8
- <div class="section__tools">
9
- <a class="primary rounded button" href="{{ url('goods_add') }}">{{ _('goods_add') }}</a>
10
- </div>
11
- </div>
12
- <div class="section__body">
13
- <form method="get" class="row">
14
- <div class="medium-5 columns">
15
- {{ form.form_text({
16
- label:'搜尋關鍵字',
17
- name:'keyword',
18
- value:keyword|default(''),
19
- placeholder:'商品名 / 物件ID / 描述'
20
- }) }}
21
- </div>
22
- <div class="medium-3 columns">
23
- <label>{{ _('庫存篩選') }}</label>
24
- <select name="stock">
25
- <option value="all" {% if stock == 'all' %}selected{% endif %}>全部</option>
26
- <option value="in" {% if stock == 'in' %}selected{% endif %}>有庫存</option>
27
- <option value="out" {% if stock == 'out' %}selected{% endif %}>已售罄</option>
28
- <option value="infinite" {% if stock == 'infinite' %}selected{% endif %}>無限供應</option>
29
- </select>
30
- </div>
31
- <div class="medium-4 columns">
32
- <button type="submit" class="rounded primary button">{{ _('搜尋') }}</button>
33
- <a href="{{ url('goods_manage') }}" class="rounded button">{{ _('清除') }}</a>
34
- </div>
35
- </form>
36
- </div>
37
- <div class="section__body no-padding">
38
- {% if not ddocs.length %}
39
- {{ nothing.render('抱歉,目前沒有商品。') }}
40
- {% else %}
41
- <div class="section__table-container">
42
- <table class="data-table section__table-heade">
43
- <colgroup>
44
- <col class="col--id" style="width:5rem">
45
- <col class="col--id" style="width:10rem">
46
- <col class="col--name">
47
- <col class="col--price">
48
- <col class="col--num">
49
- <col class="col--actions">
50
- </colgroup>
51
- <thead>
52
- <tr>
53
- <th>{{ _('商品 ID') }}</th>
54
- <th>{{ _('物件ID') }}</th>
55
- <th>{{ _('商品名稱') }}</th>
56
- <th>{{ _('商品價格') }}</th>
57
- <th>{{ _('商品數量') }}</th>
58
- <th>{{ _('Action') }}</th>
59
- </tr>
60
- </thead>
61
- <tbody>
62
- {%- for ddoc in ddocs -%}
63
- <tr>
64
- <td>{{ ddoc._id }}</td>
65
- <td>{{ ddoc.objectId|default('-') }}</td>
66
- <td>{{ _(ddoc.name) }}</td>
67
- <td>{{ ddoc.price }}</td>
68
- <td>{% if ddoc.num < 0 %}無限{% else %}{{ ddoc.num }}{% endif %}</td>
69
- <td><a href="{{ url('goods_edit', id=ddoc._id) }}" class="typo-a contest-tag">{{ _('Edit') }}</a></td>
70
- </tr>
71
- {%- endfor -%}
72
- </tbody>
73
- </table>
74
- {{ paginator.render(page, dpcount) }}
75
- </div>
76
- {% endif %}
77
- </div>
78
- </div>
79
- {% endblock%}
1
+ {% extends "coin_base.html" %}
2
+ {% import "components/paginator.html" as paginator with context %}
3
+ {% import "components/nothing.html" as nothing with context %}
4
+ {% block coin_content %}
5
+ <div class="section">
6
+ <div class="section__header">
7
+ <h1 class="section__title">{{ _('goods_manage')}}</h1>
8
+ <div class="section__tools">
9
+ <a class="primary rounded button" href="{{ url('goods_add') }}">{{ _('goods_add') }}</a>
10
+ </div>
11
+ </div>
12
+ <div class="section__body">
13
+ <form method="get" class="row">
14
+ <div class="medium-5 columns">
15
+ {{ form.form_text({
16
+ label:'搜尋關鍵字',
17
+ name:'keyword',
18
+ value:keyword|default(''),
19
+ placeholder:'商品名 / 物件ID / 描述'
20
+ }) }}
21
+ </div>
22
+ <div class="medium-3 columns">
23
+ <label>{{ _('庫存篩選') }}</label>
24
+ <select name="stock">
25
+ <option value="all" {% if stock == 'all' %}selected{% endif %}>全部</option>
26
+ <option value="in" {% if stock == 'in' %}selected{% endif %}>有庫存</option>
27
+ <option value="out" {% if stock == 'out' %}selected{% endif %}>已售罄</option>
28
+ <option value="infinite" {% if stock == 'infinite' %}selected{% endif %}>無限供應</option>
29
+ </select>
30
+ </div>
31
+ <div class="medium-4 columns">
32
+ <button type="submit" class="rounded primary button">{{ _('搜尋') }}</button>
33
+ <a href="{{ url('goods_manage') }}" class="rounded button">{{ _('清除') }}</a>
34
+ </div>
35
+ </form>
36
+ </div>
37
+ <div class="section__body no-padding">
38
+ {% if not ddocs.length %}
39
+ {{ nothing.render('抱歉,目前沒有商品。') }}
40
+ {% else %}
41
+ <div class="section__table-container">
42
+ <table class="data-table section__table-heade">
43
+ <colgroup>
44
+ <col class="col--id" style="width:5rem">
45
+ <col class="col--id" style="width:10rem">
46
+ <col class="col--name">
47
+ <col class="col--price">
48
+ <col class="col--num">
49
+ <col class="col--actions">
50
+ </colgroup>
51
+ <thead>
52
+ <tr>
53
+ <th>{{ _('商品 ID') }}</th>
54
+ <th>{{ _('物件ID') }}</th>
55
+ <th>{{ _('商品名稱') }}</th>
56
+ <th>{{ _('商品價格') }}</th>
57
+ <th>{{ _('商品數量') }}</th>
58
+ <th>{{ _('Action') }}</th>
59
+ </tr>
60
+ </thead>
61
+ <tbody>
62
+ {%- for ddoc in ddocs -%}
63
+ <tr>
64
+ <td>{{ ddoc._id }}</td>
65
+ <td>{{ ddoc.objectId|default('-') }}</td>
66
+ <td>{{ _(ddoc.name) }}</td>
67
+ <td>{{ ddoc.price }}</td>
68
+ <td>{% if ddoc.num < 0 %}無限{% else %}{{ ddoc.num }}{% endif %}</td>
69
+ <td><a href="{{ url('goods_edit', id=ddoc._id) }}" class="typo-a contest-tag">{{ _('Edit') }}</a></td>
70
+ </tr>
71
+ {%- endfor -%}
72
+ </tbody>
73
+ </table>
74
+ {{ paginator.render(page, dpcount) }}
75
+ </div>
76
+ {% endif %}
77
+ </div>
78
+ </div>
79
+ {% endblock%}
@@ -1,22 +1,22 @@
1
- {% extends "coin_base.html" %}
2
- {% import "components/nothing.html" as nothing with context %}
3
- {% block coin_content %}
4
- <div class="section">
5
- <div class="section__header">
6
- <h1 class="section__title">{{ _('shop_manage_entries') }}</h1>
7
- </div>
8
- <div class="section__body">
9
- {% if not manageEntries or not manageEntries.length %}
10
- {{ nothing.render('暫無可用擴充入口。') }}
11
- {% else %}
12
- <div class="typo">
13
- <ul>
14
- {% for entry in manageEntries %}
15
- <li><a href="{{ entry.href }}">{{ _(entry.title) }}</a></li>
16
- {% endfor %}
17
- </ul>
18
- </div>
19
- {% endif %}
20
- </div>
21
- </div>
22
- {% endblock %}
1
+ {% extends "coin_base.html" %}
2
+ {% import "components/nothing.html" as nothing with context %}
3
+ {% block coin_content %}
4
+ <div class="section">
5
+ <div class="section__header">
6
+ <h1 class="section__title">{{ _('shop_manage_entries') }}</h1>
7
+ </div>
8
+ <div class="section__body">
9
+ {% if not manageEntries or not manageEntries.length %}
10
+ {{ nothing.render('暫無可用擴充入口。') }}
11
+ {% else %}
12
+ <div class="typo">
13
+ <ul>
14
+ {% for entry in manageEntries %}
15
+ <li><a href="{{ entry.href }}">{{ _(entry.title) }}</a></li>
16
+ {% endfor %}
17
+ </ul>
18
+ </div>
19
+ {% endif %}
20
+ </div>
21
+ </div>
22
+ {% endblock %}
@@ -1,42 +1,42 @@
1
- {% extends "layout/immersive.html" %}
2
- {% block content %}
3
- <div class="row"><div class="columns">
4
- <div class="immersive--content immersive--center">
5
- <h1>{{ _('uname_change') }}</h1>
6
- <div class="row"><div class="columns">
7
- <label class="inverse material textbox">
8
- {{ _('Username') }}
9
- <input name="Uname" type="text" value="{{ uidOrName }}" readonly>
10
- </label>
11
- </div></div>
12
- <form method="POST">
13
- <div class="row"><div class="columns">
14
- <label class="inverse material textbox">
15
- {{ _('Current Password') }}
16
- <input name="password" type="password" autofocus>
17
- </label>
18
- </div></div>
19
- <div class="row"><div class="columns">
20
- <label class="inverse material textbox">
21
- {{ _('新使用者名稱') }}
22
- <input name="newUname" type="text" autocomplete="username webauthn">
23
- </label>
24
- </div></div>
25
- <br/>
26
- <div class="row"><div class="columns">
27
- <div class="text-center">
28
- {% if handler.user.olduname %}
29
- <button name="operation" value="bycoin" type="submit" class="inverse expanded rounded primary button">
30
- {{ _('修改使用者名稱( {0} 硬幣)').format(coinCost) }}
31
- </button>
32
- {% else %}
33
- <button name="operation" value="free" type="submit" class="inverse expanded rounded primary button">
34
- {{ _('修改使用者名稱(首次免費)') }}
35
- </button>
36
- {% endif %}
37
- </div>
38
- </div></div>
39
- </form>
40
- </div>
41
- </div></div>
42
- {% endblock %}
1
+ {% extends "layout/immersive.html" %}
2
+ {% block content %}
3
+ <div class="row"><div class="columns">
4
+ <div class="immersive--content immersive--center">
5
+ <h1>{{ _('uname_change') }}</h1>
6
+ <div class="row"><div class="columns">
7
+ <label class="inverse material textbox">
8
+ {{ _('Username') }}
9
+ <input name="Uname" type="text" value="{{ uidOrName }}" readonly>
10
+ </label>
11
+ </div></div>
12
+ <form method="POST">
13
+ <div class="row"><div class="columns">
14
+ <label class="inverse material textbox">
15
+ {{ _('Current Password') }}
16
+ <input name="password" type="password" autofocus>
17
+ </label>
18
+ </div></div>
19
+ <div class="row"><div class="columns">
20
+ <label class="inverse material textbox">
21
+ {{ _('新使用者名稱') }}
22
+ <input name="newUname" type="text" autocomplete="username webauthn">
23
+ </label>
24
+ </div></div>
25
+ <br/>
26
+ <div class="row"><div class="columns">
27
+ <div class="text-center">
28
+ {% if handler.user.olduname %}
29
+ <button name="operation" value="bycoin" type="submit" class="inverse expanded rounded primary button">
30
+ {{ _('修改使用者名稱( {0} 硬幣)').format(coinCost) }}
31
+ </button>
32
+ {% else %}
33
+ <button name="operation" value="free" type="submit" class="inverse expanded rounded primary button">
34
+ {{ _('修改使用者名稱(首次免費)') }}
35
+ </button>
36
+ {% endif %}
37
+ </div>
38
+ </div></div>
39
+ </form>
40
+ </div>
41
+ </div></div>
42
+ {% endblock %}