Autocompletion. Ugly as hell, but it works
[amuse-wiki:amuse-wiki.git] / AmuseWiki / views / layouts / main.tt
1 <?xml version="1.0" encoding="utf-8"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5  <head>
6    <meta http-equiv="Content-type" content="application/xhtml+xml; charset=<% settings.charset %>" />
7    <link rel="stylesheet" media="all" href="<% request.uri_base %>/css/style.css" />
8    <!--[if lt IE 9]>
9     <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
10    <![endif]-->
11    <meta name="viewport" content="width=device-width, initial-scale=1"/>
12    <link rel="alternate" type="application/rss+xml" title="The Anarchist Library" href="<% request.uri_base %>/rss.xml" />
13
14    <% IF wantseditor %>
15    <script type="text/javascript"
16            src="<% request.uri_base %>/js/jquery.js"></script>
17    <script type="text/javascript"
18            src="<% request.uri_base %>/js/markitup/jquery.markitup.js"></script>
19    <script type="text/javascript"
20            src="<% request.uri_base %>/js/markitup/sets/muse/set.js"></script>
21    <link rel="stylesheet" type="text/css" 
22          href="<% request.uri_base %>/js/markitup/skins/markitup/style.css" />
23    <link rel="stylesheet" type="text/css"
24          href="<% request.uri_base %>/js/markitup/sets/muse/style.css" />
25    <script type="text/javascript" >
26      $(document).ready(function() {
27      $("#maintextarea").markItUp(mySettings);
28      });
29    </script>
30    <% ELSIF wantsck %>
31    <script type="text/javascript"
32            src="<% request.uri_base %>/js/jquery.js"></script>
33    <link rel="stylesheet" type="text/css"
34          href="<% request.uri_base %>/css/smoothness/jquery-ui-1.8.18.custom.css" />
35    <script type="text/javascript"
36            src="<% request.uri_base %>/js/jquery-ui-1.8.18.custom.min.js">
37    </script>
38    <% ELSIF wantsjquery %>
39    <script type="text/javascript"
40            src="<% request.uri_base %>/js/jquery.js"></script>
41    <% END %>
42
43
44    <%# title block %>
45    <title>
46      <%- USE HTML -%>
47      <%- IF pagename -%>
48        <%- IF pagename == "index" -%>
49        The Anarchist Library | An archive of anarchist literature
50        <%- ELSE -%>
51        <%- HTML.escape(pagename) FILTER ucfirst %> | The Anarchist Library
52        <%- END -%>
53      <%- ELSIF nav -%>
54        <% HTML.escape(nav) FILTER ucfirst %>
55        <%- IF nav == "search" -%>
56          | <% HTML.escape(params.query) -%>
57        <% END %>
58      <%- ELSIF (directives.title AND directives.author) -%>
59      «<% directives.title FILTER remove('<.+?>') %>»
60      by <% directives.author FILTER remove('<.+?>') -%>
61      <%- ELSE -%>
62      The Anarchist Library | An archive of anarchist literature
63      <%- END -%>
64    </title>
65  </head>
66  <body>
67    <% IF session.user %>
68    <div class="loggedin">
69      Logged is as “<% session.user %>”: 
70      <a href="/admin">Go to the queue manager</a> | <a href="/logout">Logout</a>
71    </div>
72    <% END %>
73     <div id="vwbanner">
74       <div id="wbanner">
75         <div id="banner">
76           <div id="searchbox">
77             <form id="formsearchbox" action="/search">
78               <p id="searchp">
79                 <input type="text" name="query" value="" size="12" /><br />
80                 <input type="submit" value="Full text search" /></p>
81             </form>
82           </div>
83           <div id="bannerimage">
84             <a title="The Anarchist Library" href="/">
85               <img 
86                  title="Beneath the Library the stones, beneath the stones the beach!"
87                  alt="The Anarchist Library" src="/images/titlebanner.png"
88                  id="title-banner-img" />
89             </a>
90           </div>
91         </div>
92         <div id="nav">
93           <ul>
94             <li><a href="/special/about" title="info and contacts">About</a></li>
95             <li><a href="/authors"
96                    <% IF nav == 'authors' %>id="current"<% END %>
97                 title="texts sorted by author">Authors</a></li>
98             <li><a href="/library"
99                    <% IF nav == 'titles' %>id="current"<% END %>
100                    title="texts sorted by title">Titles</a></li>
101             <li><a href="/topics"
102                    <% IF nav == 'topics' %>id="current"<% END %>
103                    title="texts sorted by topics">Topics</a></li>
104             <li><a href="/special/distro" 
105                    <% IF request.path  == "/specialdistro" %>
106                    id="current"
107                    <% END %>
108                    title="distribution">Distro</a></li>
109             <li>
110               <% IF directives.file %>
111               <a href="/library/<% directives.file %>?edit">
112                 Edit this text
113               </a>
114               <% IF session.user %>
115               <a href="/library/<%- directives.file -%>/history">History</a>
116               <% END %>
117               <% ELSE %>
118               <a href="/new"
119                    <% IF request.path  == "/new" %>
120                    id="current"
121                    <% END %>
122                    title="Add a new text to the library">
123                 Add to Library
124               </a>
125               <% END %>
126             </li>
127             <li>
128               <a href="http://bookshelf.theanarchistlibrary.org"
129                  title="general help, documentation, personal pages...">
130                 Wiki
131               </a>
132             </li>
133             <li>
134               <% IF directives.file %>
135               <a href="/bookbuilder?addme=<% directives.file %>">
136                  Add this text to your book
137               </a>
138               <% ELSE %>
139               <a href="/bookbuilder"
140                    <% IF request.path  == "/bookbuilder" %>
141                    id="current"
142                    <% END %>
143                    title="Create custom PDFs (almost) on the fly">
144                   Book builder
145               </a>
146               <% END %>
147             </li>
148           </ul>
149         </div>
150       </div>
151     </div>
152
153
154
155    <%# the flash message %>
156    <% IF flash.committed %>
157    <div class="flashmessage">
158      Thanks, <% flash.committed %> files committed;
159    </div>
160    <% END %>
161    <% IF flash.bookcreated %>
162    <div class="flashmessage">
163      Your book has been created and is waiting to be compiled. This
164      operation may take about 10 minutes. Please
165      visit <a href="/bookbuilder">this page to check the status</a>
166    </div>
167    <% ELSIF (session.latestbook && (request.path != '/bookbuilder')) %>
168    <div class="flashmessage">
169      You have a book waiting <a href="/bookbuilder">here</a>
170    </div>
171    <% END %>
172    <div id="page">
173      <% content %>
174    </div>
175    <div id="footer">
176      <a href="/rss.xml">
177        <img src="/images/feed-icon-28x28.png" alt="syndicate" id="rssicon" />
178        Syndicate
179      </a>
180    </div>
181  </body>
182  </html>