public
Description: Kete was developed by Horowhenua Library Trust and Katipo Communications Ltd. to build a digital library of Horowhenua material.
Homepage: http://kete.net.nz/
Clone URL: git://github.com/kete/kete.git
kete / app / views / layouts / application.rhtml
100644 368 lines (333 sloc) 19.963 kb
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
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
<head>
  <!-- TODO: helper for content type? -->
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
 
  <% cached_controllers = ['audio', 'documents', 'images', 'topics', 'video', 'web_links'] %>
  <% if cached_controllers.include?(params[:controller]) and params[:action] == "show" %>
    <% cache_with_privacy(current_item, {:part => 'page_title'}) do %><title><%= h(@title) %></title><% end -%>
  <% else -%>
    <title><%= h(@title) %></title>
  <% end -%>
 
  <% unless current_item.nil? -%>
    <% cache_with_privacy(current_item, {:part => 'page_keywords'}) do -%>
      <meta name="keywords" content="<%= page_keywords -%>" />
    <% end -%>
    <% cache_with_privacy(current_item, {:part => 'page_description'}) do -%>
      <meta name="description" content="<%= page_description -%>" />
    <% end -%>
  <% else -%>
    <% cache({:part => 'page_keywords'}) do -%>
      <meta name="keywords" content="<%= page_keywords -%>" />
    <% end -%>
    <% cache({:part => 'page_description'}) do -%>
      <meta name="description" content="<%= page_description -%>" />
    <% end -%>
  <% end -%>
 
  <% if using_tiny_mce? -%>
    <% # Include TinyMCE before other JS to avoid problems,
       # tinymce not compatible with bundle_fu -%>
    <%= include_tiny_mce_js -%>
    <% # point tinymce at the correct css file -%>
    <% @tiny_mce_options[:content_css] = "/stylesheets/cache/#{@theme}_theme.css" -%>
    <% @tiny_mce_options[:extended_valid_elements] = EXTENDED_VALID_ELEMENTS if @site_admin -%>
    <%= tiny_mce_init -%>
  <% end -%>
 
  <%= stylesheet_link_tag 'kete-print', :media => 'print' %>
  
  <% bundle :name => "#{@theme}_theme" do -%>
    <%= stylesheet_link_tag 'base', :media => 'screen' %>
    <%= stylesheet_link_tag 'comment', :media => 'screen' %>
    <%= stylesheet_link_tag 'redbox' %>
    <%= stylesheet_link_tag 'dan_webb_code_highlighter/styles' if !AVAILABLE_SYNTAX_HIGHLIGHTERS.empty? %>
 
    <%# James - 2008-11-19 %>
    <%# Include a custom stylesheet if a third column is enabled. %>
    <%= stylesheet_link_tag('left-hand-column') if show_basket_list_naviation_menu? %>
 
    <% load_styles(@theme).each do |stylesheet| -%>
      <%= stylesheet_link_tag stylesheet, :media => 'screen' %>
    <% end -%>
  <% end -%>
 
  <%= stylesheet_link_tag('serif') if @theme_font_family == 'serif' %>
  <% if !@header_image.blank? -%>
    <% # allows for banner style background image -%>
    <style type="text/css">
      #header { background: url('<%= @header_image -%>') no-repeat top left !important; }
    </style>
  <% end -%>
 
  <% bundle :name => "rails_defaults" do -%>
    <%= javascript_include_tag :defaults %>
    <%= javascript_include_tag 'redbox' %>
    <% if !AVAILABLE_SYNTAX_HIGHLIGHTERS.empty? %>
      <%= javascript_include_tag 'dan_webb_code_highlighter/code_highlighter' %>
      <% AVAILABLE_SYNTAX_HIGHLIGHTERS.each do |syntax| %>
        <%= javascript_include_tag "dan_webb_code_highlighter/#{syntax}" %>
      <% end %>
    <% end %>
    <%= javascript_include_tag 'kete' -%>
  <% end -%>
 
  <% if ACTIVE_SCAFFOLD_CONTROLLERS.include?(params[:controller]) -%>
    <% bundle :name => "active_scaffold" do -%>
      <%= active_scaffold_includes %>
    <% end -%>
  <% end -%>
 
  <%= @rss_tag_auto if !@rss_tag_auto.nil? -%>
 
  <!--[if IE]><%= stylesheet_link_tag 'kete-ie', :media => 'screen' %><![endif]-->
</head>
<body id="<%= @current_basket.urlified_name -%>">
<% if IS_CONFIGURED -%>
<div id="body-outer-wrapper">
  <div id="body-inner-wrapper">
    <div id="header-wrapper">
      <div id="header">
            <!-- this would be a good place for your logo -->
            <h1><%= link_to PRETTY_SITE_NAME, '/', :tabindex => '2' -%><%= header_link_to_current_basket -%></h1>
            <div id="head-search-wrapper">
                    <% form_tag :overwrite_params => { :action => 'terms_to_page_url_redirect',
                                                       :controller => 'search',
                                                       :page => nil,
                                                       :sort_type => nil,
                                                       :sort_direction => nil,
                                                       :urlified_name => @site_basket.urlified_name,
                                                       :search_terms => nil } do %>
                              <div class="wrap"><label for="search_terms">Search:</label>
                              <%= text_field_tag 'search_terms', nil, { :accesskey => '3', :tabindex => '2' } -%>
                              <%= submit_tag 'Go', :tabindex => '2' %></div>
                      <% end -%>
            </div>
        <%= header_links_to_baskets %>
      </div>
    </div>
 
    <div id="top-menu">
      <ul class="user-nav nav-list">
        <% if !logged_in? -%>
        <li class="first">
          <%= link_to_unless_current "Register",
                                     { :controller => 'account',
                                       :action => 'signup',
                                       :urlified_name => @site_basket.urlified_name},
                                     :tabindex => '2' -%>
        </li>
        <li>
          <%= link_to_unless_current "Login",
                                     { :controller => 'account',
                                       :action => 'login',
                                       :urlified_name => @site_basket.urlified_name},
                                     :tabindex => '2' -%>
        </li>
        <% else -%>
        <li id="user_baskets_list" class="first">
          <%= link_to_unless_current "#{current_user.user_name}",
                                     { :controller => 'account',
                                       :action => 'show',
                                       :urlified_name => @site_basket.urlified_name},
                                     :tabindex => '2' -%>
          <%= link_to "<em>V</em>", { :urlified_name => @site_basket.urlified_name,
                                      :controller => 'account',
                                      :action => 'baskets' },
                                    :tabindex => '2' -%>
          <ul class="submenu" style="display:none;">
            <%= users_baskets_list -%>
            <li style="padding-top:15px;"><%= link_to "all baskets",
                            { :controller => 'baskets',
                              :action => 'list' } -%></li>
          </ul>
        </li>
        <li>
          <%= link_to_unless_current "Logout",
                                     { :controller => 'account',
                                       :action => :logout,
                                       :urlified_name => @site_basket.urlified_name },
                                     :tabindex => '2' -%>
        </li>
        <% end -%>
      </ul>
      <ul id="main-nav" class="nav-list">
        <li class="first"><a href="/" accesskey="1" tabindex="2">Home</a></li>
        <%= header_browse_links %>
        <li><%= link_to_unless_current(h(@about_basket.name),
                basket_index_url(:urlified_name => @about_basket.urlified_name), :tabindex => '2') %></li>
        <li><%= link_to_unless_current(h(@help_basket.name),
                basket_index_url(:urlified_name => @help_basket.urlified_name), :tabindex => '2') %></li>
        <li><%= mail_to(CONTACT_EMAIL,'Contact', :encode => "hex", :accesskey => '9', :tabindex => '2') %></li>
        <%= header_add_links %>
        <% add_basket_link = header_add_basket_link -%>
        <% unless add_basket_link.blank? -%>
          <li><%= add_basket_link -%></li>
        <% end -%>
      </ul>
    </div> <!-- /header -->
 
    <div id="notice" <%= flash[:notice].blank? ? "style='display:none;'" : '' -%>><div><%= flash[:notice] %></div></div>
    <div id="error" <%= flash[:error].blank? ? "style='display:none;'" : '' -%>><div><%= flash[:error] %></div></div>
 
        <div id="container">
          
          <%# James - 2008-11-19 %>
          <%# Slideshow controls are shown on 'show' pages for all item types %>
          <%= render(:partial => "topics/slideshow_controls") if show_slideshow_controls? -%>
 
          <% if render_full_width_content_wrapper? and !@displaying_error %>
            <%= render(:partial => "topics/content_wrapper_start" , :locals => { :style_classes =>"full-width notabs" }) %>
          <% end %>
          <div style="width:1px;height:1px;padding:0px;margin:0px;"><a name="content">&nbsp;</a></div>
          <%= @content_for_layout %>
        </div><!-- /container -->
        <div class="cleaner">&nbsp;</div>
        <div id="footer">
                <!--Footer-->
                <% if !@rss_tag_link.nil? -%>
                        <div id="linkToRSS"><%= @rss_tag_link -%>RSS feed for
                these items</a></div>
                <% end -%>
                <% if logged_in? and @basket_admin and !@displaying_error -%>
                        <div id="basket-toolbox">
                                <h4>Tools for basket: <%= h(@current_basket.name) -%></h4>
                                <ul>
                                <li class="first"><%= link_to_unless_current "basket preferences",
                                                                              {:id => @current_basket,
                                                                              :controller => '/baskets',
                                                                              :action => :edit},
                                                                              :tabindex => '2' -%></li>
                                <li><%= link_to_unless_current "moderate basket contents",
                                                                {:controller => '/moderate',
                                                                :action => :list},
                                                                :tabindex => '2' -%></li>
                                <li><%= link_to_unless_current "basket members",
                                                                {:controller => '/members',
                                                                :action => :list},
                                                                :tabindex => '2' -%></li>
                                <% # when this is more refined, may open this up to non-tech-admins -%>
                                <% if @tech_admin -%>
                                                                <li><%= link_to_unless_current "import content into basket",
                                                                                                {:controller => '/importers',
                                                                                                :action => :list},
                                                                                                :tabindex => '2' -%></li>
                                <% end %>
                                <% if @current_basket.urlified_name != 'site' -%>
                                        <li><%= link_to_unless_current "delete this basket",
                                                        { :id => @current_basket,
                                                               :controller => '/baskets',
                                                               :action => :destroy },
                                                                :confirm => 'Are you sure? All items in this basket will be deleted forever!', :method => :post,
                                                                :tabindex => '2' -%></li>
                                <% end %>
                                </ul>
                        </div>
                <% end %>
                <% if logged_in? and @site_admin and !@displaying_error %>
                   <!-- admin toolbox, temp -->
                   <div id="adminToolbox">
                        <h4>Administrator's Toolbox</h4>
                        <p>
                        Controls:
                        <%= link_to_unless_current("add basket", {:urlified_name => @site_basket.urlified_name,
                                                               :controller => 'baskets',
                                                               :action => :new},
                                                               :tabindex => '2') %>
                        |
                        <%= link_to_unless_current "topic types", {:controller => '/topic_types',
                                                                  :action => :list,
                                                                  :urlified_name => @site_basket.urlified_name},
                                                                  :tabindex => '2' -%>
                        |
                        <%= link_to_unless_current "content types", {:controller => '/content_types',
                                                                  :action => :list,
                                                                  :urlified_name => @site_basket.urlified_name},
                                                                  :tabindex => '2' -%>
                        |
                        <%= link_to_unless_current "extended fields", {:controller => '/extended_fields',
                                                                        :action => :list,
                                                                        :urlified_name => @site_basket.urlified_name},
                                                                        :tabindex => '2' -%>
                        |
                        <%= link_to_unless_current "site members", {:controller => '/members',
                                                                        :action => :list,
                                                                        :urlified_name => @site_basket.urlified_name},
                                                                        :tabindex => '2' -%>
                        |
                        <%= link_to_unless_current "administer licenses", {:controller => '/licenses',
                            :action => :index, :urlified_name => @site_basket.urlified_name},
                            :tabindex => '2' -%>
                        |
                        <%= link_to_unless_current "List site on Kete.net.nz", {:controller => '/configure',
                                                                               :action => 'add_link_from_kete_net',
                                                                               :urlified_name => @site_basket.urlified_name},
                                                                               :tabindex => '2' -%>
                        <% if @tech_admin -%>
                        |
                        <%= link_to_unless_current "reconfigure site", {:controller => '/configure',
                                                                        :action => :index,
                                                                        :urlified_name => @site_basket.urlified_name},
                                                                        :tabindex => '2' -%>
                        |
                        <%= link_to_unless_current "OAI PMH Sets", {:controller => '/oai_pmh_repository_sets',
                                                                        :action => :index,
                                                                        :urlified_name => @site_basket.urlified_name},
                                                                        :tabindex => '2' -%>
                        |
                        <%= link_to_unless_current "Z39.50 search databases", {:controller => '/zoom_dbs',
                                                                              :action => :list,
                                                                              :urlified_name => @site_basket.urlified_name},
                                                                              :tabindex => '2' -%>
 
                        |
                        <%= link_to_unless_current "Rebuild search databases", {:controller => '/search',
                                                                              :action => 'setup_rebuild',
                                                                              :urlified_name => @site_basket.urlified_name},
                                                                              :tabindex => '2' -%>
                        <% end -%>
                        </p>
                        <p>
                         Support:
                        <%= link_to_unless_current("documentation", basket_index_url(:urlified_name => @documentation_basket.urlified_name), :tabindex => '2') %>
                        </p>
                   </div>
                <% end %>
 
                <div id="footer_links">
                  <ul>
                    <% unless GOVERNMENT_WEBSITE.blank? -%>
                      <li><%= link_to GOVERNMENT_WEBSITE.first, GOVERNMENT_WEBSITE.last, :accesskey => '/', :tabindex => '2' -%></li>
                    <% end -%>
                    <% cache({:part => 'accessibility'}) do -%>
                      <% accessibility_topic = @help_basket.topics.find_by_title('Accessibility') -%>
                      <%= content_tag('li', link_to('Accessibility', { :urlified_name => 'help',
                                                                       :controller => 'topics',
                                                                       :action => 'show',
                                                                       :id => accessibility_topic },
                                                                     {:accesskey => '0',
                                                                     :tabindex => '2'})) if accessibility_topic -%>
                    <% end -%>
                    <li><%= link_to 'Sitemap', { :urlified_name => 'site',
                                                         :controller => 'baskets',
                                                         :action => 'list' },
                                                       :accesskey => '2',
                                                       :tabindex => '2' -%></li>
                    <li class="last"><%= link_to "Back to Content", '#content', :accesskey => '[', :tabindex => '2' -%></li>
                  </ul>
                </div>
        </div>
 
 </div> <!-- /body-outer-wrapper -->
</div> <!-- /body-inner-wrapper -->
 
 
<% else -%>
<div id="body-outer-wrapper">
  <div id="body-inner-wrapper">
 
 
 
    <div id="wrapper">
        <div id="header">
                <h1><%= PRETTY_SITE_NAME -%></h1>
        </div><!-- /header -->
 
        <div class="cleaner">&nbsp;</div>
 
        <% if flash[:notice] %>
           <!-- TODO: look up if there is a style sheet class for flash, add here -->
           <div id="notice"><div><%= flash[:notice] %></div></div>
        <% end %>
 
        <%= render(:partial => "topics/content_wrapper_start" , :locals => { :style_classes =>
"full-width notabs" }) %>
 
 
 
        <div id="container">
 
                        <%= @content_for_layout %>
 
        </div><!-- /container -->
        <div class="cleaner">&nbsp;</div>
        <div id="footer">
                <!--Footer-->
        </div>
</div><!-- /wrapper -->
 
</div>
</div>
<% end -%>
</body>
</html>