forked from cdhigh/KindleEar
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmy.html
103 lines (102 loc) · 4.15 KB
/
my.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
{% extends "base.html" %}
{% block content -%}
{% if myfeeds -%}
<fieldset id="ownfeeds">
<legend>{{_("Custom Rss")}}</legend>
{% for feed in myfeeds -%}
<div class="book">
<div class="titleRow">{{feed.title}} {% if feed.isfulltext %}
<img alt="{{_("Fulltext")}}" src="static/fulltext.gif" border="0" />{% endif %}
</div>
<div class="cornerControls">
<a href="/delfeed/{{feed.key().id()}}" class="actionButton">{{_("Delete")}}</a>
</div>
<div class="summaryRow">
<a href="{{feed.url}}" target="_blank" style="text-decoration:none;color:grey;"
{%if feed.url|length>80%}title="{{feed.url}}"{%endif%}>
{%if feed.url|length>80%}{{feed.url[:80]}}...{%else%}{{feed.url}}{%endif%}</a>
</div>
</div>
{% endfor -%}
<form class="pure-form" action="" method="POST">
<div class="book" style="border-bottom:0;">
<div class="titleRow">
<input type="text" name="t" placeholder={{_("Title")}} style="width:250px;" />
<input type="checkbox" name="fulltext" id="fulltext" />
<img alt="{{_("Fulltext")}}" src="static/fulltext.gif" border="0" onclick="toggleFulltext();" />
</div>
<div class="summaryRow">
<input type="text" name="url" style="width:600px;margin-top:8px;" placeholder="URL" />
</div>
<input type="submit" value="{{_("Add")}}" class="pure-button pure-button-primary" style="margin-top:8px;" />
{% if tips %}<p style="color:red;font-size:0.7em;">{{tips}}</p>{% endif %}
</div>
</form>
</fieldset>
{% endif -%}
<fieldset id="mybooks" style="margin-top:10px;">
<legend>{{_("Subscribed")}}</legend>
{% for book in books -%}
{% if nickname in book.users -%}
<div class="book">
<div class="titleRow">{{book.title}}
{% if book.separate -%}
<img alt="{{_("Separate")}}" src="static/separate.gif" border="0" />
{% endif -%}
</div>
<div class="cornerControls">
{% if book.needs_subscription -%}
<a href="/booklogininfo/{{book.key().id()}}" class="actionButton"
{% if not user.subscription_info(book.title) %}style="color:red;"{% endif %}
>{{_("Login Info")}}</a>
{% endif -%}
<a href="/unsubscribe/{{book.key().id()}}" class="actionButton">{{_("Unsubscribe")}}</a>
</div>
<div class="summaryRow">
{%if book.description|length>80%}{{book.description[:80]}}...<span>{{book.description}}</span>{%else%}{{book.description}}{%endif%}
</div>
</div>
{% endif -%}
{% endfor -%}
</fieldset>
<fieldset id="books" style="margin-top:10px;">
<legend>{{_("Unsubscribed")}}</legend>
{% for book in books -%}
{% if nickname not in book.users -%}
<div class="book">
<div class="titleRow">{{book.title}}
<input type="checkbox" id="separate_{{book.key().id()}}" style="margin-left:1em;" />
<img alt="{{_("Separate")}}" src="static/separate.gif" border="0" onclick="toggleSeparate('{{book.key().id()}}');" />
</div>
<div class="cornerControls">
<!--<a href="/subscribe/{{book.key().id()}}" class="actionButton">{{_("Subscribe")}}</a>-->
<a href="javascript:void(0)" onclick="doSubscribe('{{book.key().id()}}')" class="actionButton">{{_("Subscribe")}}</a>
</div>
<div class="summaryRow">
{%if book.description|length>80%}{{book.description[:80]}}...<span>{{book.description}}</span>{%else%}{{book.description}}{%endif%}
</div>
</div>
{% endif -%}
{% endfor -%}
</fieldset>
{% endblock -%}
{% block js -%}
<script type="text/javascript">
function toggleFulltext() {
var btnft = document.getElementById("fulltext");
btnft.checked = !btnft.checked;
}
function toggleSeparate(id) {
id = "separate_" + id
var btnft = document.getElementById(id);
btnft.checked = !btnft.checked;
}
function doSubscribe(id) {
var btnSeparate = document.getElementById("separate_" + id);
target = "/subscribe/" + id
if (btnSeparate.checked)
target += "?separate=true"
window.location.href = target
}
</script>
{% endblock -%}