-
Notifications
You must be signed in to change notification settings - Fork 3
/
default_layout.html
370 lines (312 loc) · 15.6 KB
/
default_layout.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
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
{% load item_tags %}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
{% if item %}
<title>Deme » {% viewable_name item %}{% if action_title %} » {{ action_title }}{% endif %}</title>
{% else %}
<title>Deme{% if action_title %} » {{ action_title }}{% endif %}</title>
{% endif %}
<link rel="shortcut icon" href="{% block favicon %}{% if item %}{{ item.actual_item_type|icon_url:24 }}{% else %}{{ accepted_item_type|icon_url:24 }}{% endif %}{% endblock favicon %}" type="image/x-icon" />
<!--<link rel="shortcut icon" href="{% media_url "favicon.ico" %}" type="image/x-icon" />-->
{% universal_edit_button %}
<link rel="stylesheet" href="{% media_url "stylesheets/blueprint/screen.css" %}" type="text/css" media="screen, projection" />
<link rel="stylesheet" href="{% media_url "stylesheets/blueprint/print.css" %}" type="text/css" media="print" />
<!--[if IE]>
<link rel="stylesheet" href="{% media_url "stylesheets/blueprint/ie.css" %}" type="text/css" media="screen, projection" />
<![endif]-->
<link href="{% media_url "stylesheets/base.css" %}" media="all" rel="Stylesheet" type="text/css" />
<script type="text/javascript" src="{% media_url "javascripts/jquery-1.3.2.min.js" %}"></script>
<script type="text/javascript" src="{% media_url "javascripts/jquery-ui-1.7.1.custom.min.js" %}"></script>
<link href="{% media_url "stylesheets/smoothness/jquery-ui-1.7.1.custom.css" %}" media="all" rel="Stylesheet" type="text/css" />
<script type="text/javascript" src="{% media_url "javascripts/grid.locale-en.js" %}"></script>
<script type="text/javascript" src="{% media_url "javascripts/jquery.jqGrid.min.js" %}"></script>
<link href="{% media_url "stylesheets/ui.jqgrid.css" %}" media="all" rel="Stylesheet" type="text/css" />
<script type="text/javascript" src="{% media_url "javascripts/fg.menu.js" %}"></script>
<link href="{% media_url "stylesheets/fg.menu.css" %}" media="screen" rel="stylesheet" type="text/css" />
<!-- style exceptions for IE 6 -->
<!--[if IE 6]>
<style type="text/css">
.fg-menu-ipod .fg-menu li { width: 95%; }
.fg-menu-ipod .ui-widget-content { border:0; }
</style>
<![endif]-->
{% ifequal action 'show' %}
{% if item %}
<link rel="alternate" type="application/rss+xml" title="Action notice feed" href="{% url item_url viewer=viewer_name,action="show",noun=item.pk,format="rss" %}" />
{% endif %}
{% endifequal %}
{% ifequal action 'list' %}
<link rel="alternate" type="application/rss+xml" title="Item feed" href="{% url item_type_url viewer=viewer_name,action="list",format="rss" %}" />
{% endifequal %}
<script type="text/javascript">
// from http://www.filamentgroup.com/examples/buttonFrameworkCSS/
$(function(){
//all hover and click logic for buttons
$(".fg-button:not(.ui-state-disabled)")
.hover(
function(){
$(this).addClass("ui-state-hover");
},
function(){
$(this).removeClass("ui-state-hover");
}
)
.mousedown(function(){
$(this).parents('.fg-buttonset-single:first').find(".fg-button.ui-state-active").removeClass("ui-state-active");
if( $(this).is('.ui-state-active.fg-button-toggleable, .fg-buttonset-multi .ui-state-active') ){ $(this).removeClass("ui-state-active"); }
else { $(this).addClass("ui-state-active"); }
})
.mouseup(function(){
if(! $(this).is('.fg-button-toggleable, .fg-buttonset-single .fg-button, .fg-buttonset-multi .fg-button') ){
$(this).removeClass("ui-state-active");
}
});
});
// To give the gray "Search" text in the search box
$(document).ready(function () {
var search_box_changed = {% if search_query %}true{% else %}false{% endif %};
var search_box = document.getElementById('search_box');
search_box.onfocus = function(e){
if (!search_box_changed) {
search_box_changed = true;
search_box.value = '';
search_box.style.color = 'inherit';
}
};
search_box.onblur = function(e){
if (search_box.value == '') {
search_box_changed = false;
search_box.value = 'Search';
search_box.style.color = '#777';
}
};
search_box.onblur();
});
$(document).ready(function () {
$("#right_accordion").accordion({
fillSpace: false,
autoHeight: false,
});
});
</script>
<script type="text/javascript">
function max()
{
self.moveTo(0,0);
self.resizeTo(screen.availWidth,screen.availHeight);
}
</script>
</head>
<body>
<div class="site_outer">
<div class="site_inner">
<div class="header" style="padding-top: 3px; padding-bottom: 3px;">
<table style="margin-bottom: 0;">
<tr>
<td style="vertical-align: top; width: 200px; padding: 0;" rowspan="2">
<div class="top_left">
<a href="/"><img src="{% media_url "spacer.gif" %}" alt="Deme Logo" style="height: 100px; width: 200px; border: 1px solid #aaa; background-color: #00c; -moz-border-radius: 8px; -webkit-border-radius: 8px;" /></a>
</div>
</td>
<td style="vertical-align: top; text-align: center; padding: 0; padding-left: 5px; padding-right: 5px;">
{% new_item_menu %}
<form method="get" action="{% url item_type_url viewer="item" %}" style="display: inline;">
<input type="search" id="search_box" name="q" value="{{ search_query }}" style="width: 20em;" />
{# TODO add magnifying glass #}
</form>
</td>
<td style="vertical-align: top; text-align: right; padding: 0;">
<div style="float: right;">
{% login_menu %}
</div>
<div style="clear: both;">
</div>
</td>
</tr>
<tr>
<td style="vertical-align: bottom; padding: 0; padding-left: 5px;" colspan="2">
<div style="clear: both;"></div>
{% if item %}
<div style="float: right;">
{% itemtoolbar %}
</div>
{% endif %}
<div class="crumbs">
{% crumbs %}
</div>
<div class="title">
{% block title %}
{% if item %}
<img src="{{ item.actual_item_type|icon_url:24 }}" title="{% item_type_verbose_name item %}" /> {% viewable_name item %}{% if action_title %} » {{ action_title }}{% endif %}
{% else %}
<img src="{{ accepted_item_type|icon_url:24 }}" title="{% item_type_verbose_name accepted_item_type %}" /> {% if action_title %}{{ action_title }}{% else %}{{ accepted_item_type_name_plural|capfirst }}{% endif %}
{% endif %}
{% endblock title %}
</div>
</td>
</tr>
</table>
</div>
<script type="text/javascript">
//TODO figure out padding
var PAGE_WIDTH = 960;
function increase_column_right()
{
var right_width = $('#right_table_column').width();
if( right_width >= PAGE_WIDTH*.75 ){
$('#center_table_column').hide();
$('#increasebutton').hide();
$('#right_table_column').width( .875*PAGE_WIDTH );
}
else{
$('#right_table_column').width( right_width + PAGE_WIDTH*.125 );
$('#center_table_column').width( PAGE_WIDTH*.75 - right_width );
}
}
function decrease_column_right()
{
var right_width = $('#right_table_column').width();
if( right_width <= PAGE_WIDTH*.25 ){
$('#right_table_column').hide();
$('#right_table_column_hidden').show();
$('#right_table_column_hidden').width($('#right_table_column_hidden a').width());
$('#center_table_column').width( .875*PAGE_WIDTH - $('#right_table_column_hidden').width() );
}
else{
$('#right_table_column').width( right_width - PAGE_WIDTH*.125 );
$('#center_table_column').width( PAGE_WIDTH - right_width );
$('#center_table_column').show();
$('#increasebutton').show();
}
}
function show_column_right() {
$('#right_table_column').show();
$('#right_table_column_hidden').hide();
$('#center_table_column').width(960 - $('#right_table_column').width() - $('#left_table_column').width());
}
function show_comments_big() {
$('#make_big').hide();
$('#make_normal').show();
$('.comment_body').show();
}
function hide_comments_big() {
$('#make_big').show();
$('#make_normal').hide();
$('.comment_body').hide();
}
function openCommentDialog(name)
{
var dialogBox = $('#' + name);
dialogBox.dialog({
autoOpen: false,
bgiframe: true,
modal: true,
close: function(event, ui) {dialogBox.dialog('destroy')}
});
dialogBox.dialog('open');
}
function displayHiddenDiv(name)
{
var hiddenDiv = $('#' + name);
hiddenDiv.show();
}
</script>
<div class="content_box">
{% if layout_permissions_problem %}
<div style="color: #a00; padding: 15px; margin: 15px; border: thin dotted #a00; text-align: center;">
Permissions Error: You are not authorized to view the layout, so this page is being displayed in the default layout.
</div>
{% endif %}
<table cellspacing="0">
<tr>
<td style="vertical-align: top; width: 120px; padding:0;" id="left_table_column">
<div class="ui-widget-header ui-corner-top ui-helper-clearfix" style="padding: 5px;">
Navigation
</div>
<div class="ui-widget-content ui-corner-bottom ui-helper-clearfix" style="padding: 5px;">
<ul style="list-style-type: none; margin: 0; padding: 0;">
<li{% ifequal full_path "/"%} style="font-weight: bold;"{% endifequal %}><a href="/">Home</a></li>
<li{% ifequal action "list" %}{% ifequal viewer_name "item" %} style="font-weight: bold;"{% endifequal %}{% endifequal %}><a href="{% url item_type_url viewer="item" %}">Items</a></li>
<li{% ifequal viewer_name "codegraph"%} style="font-weight: bold;"{% endifequal %}><a href="{% url item_type_url viewer="codegraph" %}">Codegraph</a></li>
<li><a href="http://deme.stanford.edu/static/docs/index.html">Docs</a></li>
</ul>
</div>
{% if item %}
<br>
<div class="ui-widget-header ui-corner-top ui-helper-clearfix" style="padding: 5px;">
Member Of
</div>
{% calculaterelationships %}
<div class="ui-widget-content ui-corner-bottom ui-helper-clearfix" style="padding: 5px;">
{{ memberOf_box }}
</div>
{% endif %}
</td>
<td style="vertical-align: top; {% if item %} width: 600px; {% else %} width: 840px; {% endif %} padding:0;" id="center_table_column">
<div style="padding: 0 5px 0 5px;">
{% block content %}
{% endblock %}
</div>
</td>
{% if item %}
<td style="vertical-align: top; display: none; padding:0;" id="right_table_column_hidden">
<div class="ui-helper-clearfix" style="font-size: 60%;">
<a href="#" onclick="show_column_right(); return false;" class="fg-button ui-state-default ui-corner-all" title="Show"><div style="font-size: 9pt;">Item Data</div></a>
</div>
</td>
<td style="vertical-align: top; width: 240px; padding:0;" id="right_table_column">
<div class="ui-helper-clearfix" style="font-size: 60%;">
<a href="#" id="increasebutton" onclick="increase_column_right(); return false;" class="fg-button ui-state-default fg-button-icon-solo ui-corner-all" title="Show"><span class="ui-icon ui-icon-arrowthickstop-1-w"></span> Show</a>
<a href="#" id="decreasebutton" onclick="decrease_column_right(); return false;" class="fg-button ui-state-default fg-button-icon-solo ui-corner-all" title="Hide"><span class="ui-icon ui-icon-arrowthickstop-1-e"></span> Hide</a>
</div>
{# TODO links are black because of ui-widget-content to a #}
<div id="right_accordion">
<h3><a href="#">Item Details</a></h3>
<div id="accordion_details">
{% itemdetails %}
</div>
{% calculatecomments %}
<h3><a href="#">{{ n_comments }} comment{{ n_comments|pluralize }}</a></h3>
<div>
<div id="make_big"><a href="#" onclick="show_comments_big(); return false;">Expand Comments</a></div>
<div id="make_normal" style="display: none;"><a href="#" onclick="hide_comments_big(); return false;">Collapse Comments</a></div>
{{ comment_box }}
</div>
{% calculateactionnotices %}
<h3><a href="#">{{ n_action_notices }} action notice{{ n_action_notices|pluralize }}</a></h3>
<div>
{{ action_notice_box }}
</div>
{% calculatehistory %}
<h3><a href="#">{{ n_versions }} version{{ n_versions|pluralize }}</a></h3>
<div>
{{ history_box }}
</div>
{% calculaterelationships %}
<h3><a href="#">{{ n_relationships }} related item{{ n_relationships|pluralize }}</a></h3>
<div>
{{ relationships_box }}
</div>
<h3><a href="#">Permissions</a></h3>
<div>
{% permissions_box %}
</div>
</div>
</td>
{% endif %}
</tr>
</table>
</div>
<input type="button" value="Open Fullscreen" onclick="max()" />
<input type="button" value="Increase text size" onclick="resizeText(1)" />
<input type="button" value="Decrease text size" onclick="resizeText(-1)" />
<div class="footer">
<p>Copyright ©2008-{% now "Y" %} to Deme | <a href="http://github.com/mikemintz/deme/tree/master">Source Code</a> <span class="pipe">|</span> <a href="http://www.stanford.edu/~davies/">Authors</a> | <a href="{% url item_type_url viewer="item",action="admin" %}">Admin</a> | <a href="{% url item_type_url viewer="item",action="recentchanges" %}">Recent Changes</a></p>
<p>Desktop browser | <a href="list.mobi">Mobile</a> | <a href="list.rss">RSS</a></p> {# TODO generate formats list #}
</div>
</div>
</div>
</body>
</html>