Corin1998 commited on
Commit
bc8891c
·
verified ·
1 Parent(s): 45e70d7

Update app/templates/index.html

Browse files
Files changed (1) hide show
  1. app/templates/index.html +23 -33
app/templates/index.html CHANGED
@@ -1,39 +1,29 @@
1
  {% extends "base.html" %}
2
  {% block body %}
3
- <div class="card">
4
- <h2>新規ドラフト</h2>
5
- <form action="/content/create" method="post" enctype="multipart/form-data">
6
- <label>種別</label>
7
- <select name="content_type">
8
- {% for ct in ContentType %}<option value="{{ ct.value }}">{{ ct.value }}</option>{% endfor %}
9
- </select>
10
- <label>トーン</label>
11
- <select name="tone">
12
- {% for t in Tone %}<option value="{{ t.value }}">{{ t.value }}</option>{% endfor %}
13
- </select>
14
- <p class="muted">ソース(URL / PDF / テキストのいずれか)</p>
15
- <input type="hidden" name="source_type" id="source_type" value="url"/>
16
- <div style="display:flex;gap:8px;flex-wrap:wrap">
17
- <input type="url" name="url" placeholder="https://..." style="flex:1"/>
18
- <input type="file" name="file" accept="application/pdf"/>
19
- </div>
20
- <p><textarea name="text" placeholder="ここにテキストを貼り付け..."></textarea></p>
21
- <button type="submit">ドラフト生成をキューに追加</button>
22
- </form>
23
- </div>
24
 
25
- <div class="card">
26
- <h2>最近のドラフト</h2>
27
- {% for d in drafts %}
28
  <div class="card">
29
- <div style="display:flex;justify-content:space-between;align-items:center">
30
- <div>
31
- <strong>#{{ d.id }} {{ d.title or '(無題)' }}</strong>
32
- <div class="muted">status: {{ d.status.value }} / tone: {{ d.tone.value }} / type: {{ d.content_type.value }}</div>
33
- </div>
34
- <a href="/draft/{{ d.id }}">開く →</a>
35
- </div>
 
 
 
 
 
 
 
36
  </div>
37
- {% endfor %}
38
- </div>
39
  {% endblock %}
 
1
  {% extends "base.html" %}
2
  {% block body %}
3
+ {% if not d %}
4
+ <p>見つかりませんでした。</p>
5
+ {% else %}
6
+ <div class="card">
7
+ <h2>#{{ d.id }} {{ d.title }}</h2>
8
+ <div class="muted">status: {{ d.status.value }} / subjectA: {{ d.subject_a }} / subjectB: {{ d.subject_b }}</div>
9
+ <pre style="white-space:pre-wrap">{{ d.body_md }}</pre>
10
+ </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
11
 
 
 
 
12
  <div class="card">
13
+ <h3>承認/配信設定</h3>
14
+ <form method="post" action="/content/{{ d.id }}/approve">
15
+ <label>承認</label>
16
+ <select name="approve"><option value="true">承認</option><option value="false">差戻し</option></select>
17
+ <p>件名A <input type="text" name="subject_a" value="{{ d.subject_a or '' }}" style="width:100%"/></p>
18
+ <p>件名B <input type="text" name="subject_b" value="{{ d.subject_b or '' }}" style="width:100%"/></p>
19
+ <p>メール宛先(カンマ区切り)<input type="text" name="deliver_email_list" value="{{ d.deliver_email_list or '' }}" style="width:100%"/></p>
20
+ <label><input type="checkbox" name="deliver_x" {% if d.deliver_x %}checked{% endif %}/> Xにも投稿</label>
21
+ <label><input type="checkbox" name="deliver_note" {% if d.deliver_note %}checked{% endif %}/> noteにも投稿(Webhook)</label>
22
+ <p><button type="submit">保存</button></p>
23
+ </form>
24
+ <form method="post" action="/deliver/{{ d.id }}">
25
+ <button type="submit">今すぐ配信</button>
26
+ </form>
27
  </div>
28
+ {% endif %}
 
29
  {% endblock %}