-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdiscussion.html
299 lines (269 loc) · 17.4 KB
/
discussion.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
<!DOCTYPE html>
{% autoescape true %}
<!DOCTYPE html>
<html lang="en">
<head>
<base target="_self">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>medReach</title>
<meta name="google-site-verification" content="3YZMYT6XcVJlav0ZKb7MQrzjnRGApJS8FOsrG4fPrXo" />
<link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
<link href='http://fonts.googleapis.com/css?family=Roboto:400,100,500,300,700' rel='stylesheet' type='text/css'>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="/stylesheets/main.css" />
<script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
<script src='js/jquery.zoom.min.js'></script>
<!-- <script src="//code.jquery.com/jquery-1.10.2.js"></script>-->
<style>
.icon-vote {
height:32px;
width:32px;
border: none;
cursor: pointer;
/* color:white;*/
background-color: Transparent;
position:relative;
}
.fileUpload input.upload {
/* position: absolute;*/
cursor: pointer;
opacity: 0;
filter: alpha(opacity=1);
}
/*
@media all and (max-width:400px){
.navbar.navbar-default.navbar-fixed-top {
position: relative;
}
}
*/
/* This is for the editing of the topic text */
section div {
padding: 1em;
background: #E6E6E6;
border-radius: 3px;
/*box-shadow: 0 1px 5px rgba(0,0,0,0.15) inset;*/
outline: none;
border: 2px solid transparent;
}
section div:focus {
background: #FFF;
border-color: #91979d;
}
/* these styles are for the demo, but are not required for the plugin */
.zoom {
display:inline-block;
position: relative;
}
/* magnifying glass icon */
.zoom:after {
content:'';
display:block;
width:33px;
height:33px;
position:absolute;
top:0;
right:0;
background:url(icon.png);
}
.zoom img {
display: block;
}
.zoom img::selection { background-color: transparent; }
</style>
</head>
<body>
<!-- <div id="wrap">-->
<nav class="navbar navbar-bright navbar-fixed-top" role="banner">
<div class="container">
<div class="navbar-header">
<button class="navbar-toggle" type="button" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" id="brand" href="/" title="">med<span style="color:#f9f9f9;font-weight:200;">Reach</span></a>
</div>
<div class="collapse navbar-collapse">
<form action="/" class="navbar-form navbar-right" role="search">
<div class="form-group">
<input type="text" class="form-control input-sm" placeholder="Search">
</div>
<button type="submit" class="btn btn-primary btn-sm">Submit</button>
</form>
<ul class="nav navbar-nav navbar-right">
<li><a href="/" rel="nofollow">Home</a></li>
<li><a href="/settings" rel="nofollow">My medReach</a></li>
<li><a href="/about" rel="nofollow" >About</a></li>
<li><a id="btnAbout" href="{{ url|safe }}">{{ url_linktext }} </a></li>
</ul>
</div>
</div>
</nav>
<div id="masthead">
<div class="container">
<div class="col-md-8">
<img src="https://s3.amazonaws.com/glengoffin/uploads/engeye-health-clinic-in-uganda.jpg" style="padding-top:50px; max-height:260px; max-width:100%; overflow:hidden; float:right;">
<h1>medReach<p class="lead"><span style="color:#CCFF33;">Reaching the </span>Need</p></h1>
<p style="font-style:italic; font-size:1.2em; line-height: 1.2em;">"Verily I say unto you, Inasmuch as ye have done it unto one of the least of these my brethren, ye have done it unto me."</p>
</div>
</div>
</div>
<div class="container" >
<div class="col-md-8">
<!-- Present the topic header -->
<div ><p class="discussion-title">{{ discussion_title }}</p><p class="discussion-title3" style="font-weight:300; font-size:1em; padding-left:5px;">{{ discussion.owner.email }}</p></div>
<!-- Insert the discussion here through javascript so that it is editable -->
<div class="update-form"></div>
<br>
<!-- Present the list of opinions and sub-opinions -->
<table class="table table-responsive">
{% for list in greeting_list %}
{% set oloop = loop %}
{% for greeting in list %}
{% if greeting.subcomment == False or greeting.subcomment == None %}
<tr>
<td style="width:80%;">
{% if greeting.author %}
<p>
{% if mr_user.avatar == None or mr_user.avatar == "" %}
<span class="glyphicon glyphicon-user"></span>
{% else %}
<img src="/img?img_id={{ greeting.key.urlsafe() }}">
{% endif %}
<a class="comment-owner"> {{ greeting.author.email }} </a><a class="comment-title">wrote: </a></p>
{% else %}
<p>
<span class="glyphicon glyphicon-user"></span>
Anonymous <a class="comment-title">wrote: </a></p>
{% endif %}
<p style="font-size: .7em; font-weight: 300; line-height: .6em;">{{ greeting.date.ctime() }}</p>
<p style="padding-left:10px;">{{ greeting.content }}</p>
{% for photo in greeting.photos %}
<!-- <div style="float:right; padding-right: 2px; padding-bottom: 2px;"><a href="/photo?img_id={{ greeting.key.urlsafe() }}&loop_index={{ loop.index }}" data-lightbox="{{ (10 * oloop.index) + loop.index }}"><img src="/photo?img_id={{ greeting.key.urlsafe() }}&loop_index={{ loop.index }}" style="max-height:200px; max-width:100%; border:1px solid #666;"></a></div>-->
<div style="float:right; padding-right: 2px; padding-bottom: 2px;"><a href="/photo?img_id={{ greeting.key.urlsafe() }}&loop_index={{ loop.index }}"><span class="zoom" id="zoomable-{{ (10 * oloop.index) + loop.index }}"><img src="/photo?img_id={{ greeting.key.urlsafe() }}&loop_index={{ loop.index }}" style="max-height:200px; max-width:100%; border:1px solid #666;"></span></a></div>
<script>
(function($) {
// $(document).ready(function(){
$('#zoomable-{{ (10 * oloop.index) + loop.index }}').zoom();
// });
})(jQuery);
</script>
{% endfor %}
<span style="font-size: .9em; font-weight:300;">
<form action="/vote?vote_type=up&greeting_key={{ greeting.key.urlsafe() }}&discussion_key={{ discussion.key.urlsafe() }}" enctype="multipart/form-data" method="post"><button type="submit" id="submit" style=" border:none; background-color:Transparent;">agree <span class="fa fa-thumbs-o-up"></span> {{greeting.upvotes}}</button></form>
<form action="/vote?vote_type=down&greeting_key={{ greeting.key.urlsafe() }}&discussion_key={{ discussion.key.urlsafe() }}" enctype="multipart/form-data" method="post"><button type="submit" id="submit" style=" border:none; background-color:Transparent;">disagree <span class="fa fa-thumbs-o-down"></span> {{greeting.downvotes}}</button></form>
</span>
</td>
<td style="float:right;" style="width:20%;">
<div class="fileUpload">
<form action="/upload_img?greeting_key={{ greeting.key.urlsafe() }}&discussion_key={{ discussion.key.urlsafe() }}" enctype="multipart/form-data" method="post">
<!-- <a style="position:absolute; font-size: 0.9em; font-weight:300; display:inline-block; float:right">Upload Photo</a><input type="file" onchange="this.form.submit()" name="photo" class="upload" style="width:1px;"/>-->
<a style="font-size: 0.9em; font-weight:300; display:inline-block; float:right">Upload Photo</a><input type="file" onchange="this.form.submit()" name="photo" class="upload" style="width:1px;"/>
</form></div>
<form action="/delete?del_type=greeting&greeting_key={{ greeting.key.urlsafe() }}&discussion_key={{ discussion.key.urlsafe() }}" method="post">
<input type="submit" id="submit" value="Delete Comment" style="font-size: 0.9em; font-weight:300; display:inline-block; float:right">
</form>
<a id="addcmt-{{oloop.index}}" class="addcmt" data-value={{oloop.index}} style="font-size: 0.9em; font-weight:300; display:inline-block; float:right">Enter Reply</a>
<form action="/sign?parent=greeting&key={{ greeting.key.urlsafe() }}&discussion_key={{ discussion.key.urlsafe() }}" enctype="multipart/form-data" method="post">
<textarea name="content" tabindex="2" class="commentarea-{{oloop.index}}" style="display:none;"></textarea>
<input type="submit" id="submit" class="commentarea-{{oloop.index}}" value="Post Reply" style="font-size: 0.9em; font-weight:300; display:none; float:right">
</form>
<script>
(function($) {
// You pass-in jQuery and then alias it with the $-sign
// So your internal code doesn't change
// Hide the comment entry area until user clicks on it
$('#addcmt-{{oloop.index}}').bind( "click", function(event) {
$(".commentarea-{{oloop.index}}").toggle();
if ($("#addcmt-{{oloop.index}}").text() == "Enter Reply") {
$("#addcmt-{{oloop.index}}").text("Remove Reply");
}
else {
$("#addcmt-{{oloop.index}}").text("Enter Reply");
}
});
})(jQuery);
</script>
</td>
</tr>
<!-- This is a reply to a comment -->
{% elif greeting.subcomment == True %}
<tr>
<!-- <td></td> this balances the voting column in the parent row -->
<td>
<div style="padding-left:50px;">
{% if greeting.author %}
<p>
{% if mr_user.avatar == None %}
<span class="glyphicon glyphicon-user"></span>
{% else %}
<img src="/img?img_id={{ greeting.key.urlsafe() }}">
{% endif %}
<a style="font-size: .8em; font-weight: 400; line-height: 1em; padding-left: 5px;"> {{ greeting.author.email }} </a><a style="font-size: .8em; font-weight: 400; line-height: 1em; padding-left: 5px;">wrote: </a></p>
{% else %}
<p>
<span class="glyphicon glyphicon-user"></span>
Anonymous <a>wrote: </a></p>
{% endif %}
<p style="font-size: .7em; font-weight: 300; line-height: .6em;">{{ greeting.date.ctime() }}</p>
<p style="font-size: .8em; font-weight: 400; line-height: 1em; padding-left: 5px;">{{ greeting.content }}</p>
{% for photo in greeting.photos %}
<!-- <div style="float:right; padding-right: 2px; padding-bottom: 2px;"><a href="/photo?img_id={{ greeting.key.urlsafe() }}&loop_index={{ loop.index }}"><img src="/photo?img_id={{ greeting.key.urlsafe() }}&loop_index={{ loop.index }}" style="max-height:200px; max-width:100%; border:1px solid #666;"></a></div>-->
<div style="float:right; padding-right: 2px; padding-bottom: 2px;"><a href="/photo?img_id={{ greeting.key.urlsafe() }}&loop_index={{ loop.index }}"><span class="zoom" id="zoomable2-{{ (10 * oloop.index) + loop.index }}"><img src="/photo?img_id={{ greeting.key.urlsafe() }}&loop_index={{ loop.index }}" style="max-height:200px; max-width:100%; border:1px solid #666;"></span></a></div>
<script>
(function($) {
// $(document).ready(function(){
$('#zoomable2-{{ (10 * oloop.index) + loop.index }}').zoom();
// });
})(jQuery);
</script>
{% endfor %}
</div>
</td>
<td style="float:right;">
<div class="fileUpload">
<form action="/upload_img?greeting_key={{ greeting.key.urlsafe() }}&discussion_key={{ discussion.key.urlsafe() }}" enctype="multipart/form-data" method="post">
<a style="font-size: 0.8em; font-weight:300; display:inline-block; float:right">Upload Photo</a><input type="file" onchange="this.form.submit()" name="photo" class="upload" style="width:1px;"/>
</form>
<form action="/delete?del_type=greeting&greeting_key={{ greeting.key.urlsafe() }}&discussion_key={{ discussion.key.urlsafe() }}" method="post">
<input type="submit" id="submit" value="Delete Comment" style="font-size: 0.8em; font-weight:300; display:inline-block; float:right;">
</form>
</div>
<!-- </td>-->
</td>
</tr>
{% endif %}
{% endfor %} <!-- end of inner-list iterator -->
{% endfor %} <!-- end of outer-list iterator-->
</table>
<hr class="line_break">
<p class="discussion-title2">Add Your Opinion</p>
<form action="/sign?parent=discussion&key={{ discussion.key.urlsafe() }}&discussion_key={{ discussion.key.urlsafe() }}" enctype="multipart/form-data" method="post">
<textarea class="style-4" name="content" rows="3" style="width:100%; padding-left: 15px;" placeholder="Add Your Opinion . . . "></textarea>
<div align="right"><input class="btn btn-secondary-outline" type="submit" id="submit" value="Add Opinion"></div>
</form>
<div class="mr-footer-small" align="center"><p>(c) 2016 medReach</p></div>
</div>
</div>
<script src="http://netdna.bootstrapcdn.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
<!-- This is for editing the description by clicking on the text itself-->
<script>
(function($) {
// Insert the normal discussion text
$('div.update-form').replaceWith("<div id=\x22update-form\x22><blockquote><p id=\x22update-form\x22 style=\x22color:gray; font-size: 1em; font-weight: 400;\x22>{{discussion.content}}</p></blockquote><a style=\x22font-size: 0.9em; font-weight:300; display:inline-block; float:right\x22>Click Text to Edit</a></div>");
// Clicking on the discussion text inserts the update form
$('p#update-form').click(function() {
$('div#update-form').replaceWith("<form action=\x22/update?discussion_key={{ discussion.key.urlsafe() }}\x22 enctype=\x22multipart/form-data\x22 method=\x22post\x22><input type=\x22text\x22 class=\x22style-4\x22 name=\x22disc-title\x22 rows=\x221\x22 style=\x22width:100%; padding-left: 15px;\x22 placeholder=\x22{{discussion.title}}\x22><p></p><textarea class=\x22style-4\x22 name=\x22content\x22 rows=\x222\x22 style=\x22width:100%; padding-left: 15px; border:None;\x22 placeholder=\x22{{discussion.content}}\x22>{{discussion.content}}</textarea><div align=\x22right\x22><select name=\x22medical-category\x22><option value=\x22pediatrics\x22>Pediatrics</option><option value=\x22obstetrics\x22>Obstetrics</option><option value=\x22cardiology\x22>Cardiology</option><option value=\x22neurology\x22>Neurology</option><option value=\x22dentistry\x22>Dentistry</option><option value=\x22opthamology\x22>Opthamology</option><option value=\x22orthopedics\x22>Orthopedics</option></select><input class=\x22btn btn-secondary-outline\x22 type=\x22submit\x22 id=\x22submit\x22 value=\x22Update\x22></div></form>");
});
})(jQuery);
</script>
</body>
</html>
{% endautoescape %}