use async piwik tracking
[opensuse:software-o-o.git] / app / views / layouts / application.rhtml
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3   <head>
4     <title><%= "software.opensuse.org: #{@page_title}" %></title>
5     <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
6     <meta http-equiv="Content-Script-Type" content="text/javascript"/>
7     <meta http-equiv="Content-Style-Type" content="text/css"/>
8
9     <link rel="search" type="application/opensearchdescription+xml" title="openSUSE Software" href="/search_software.xml" />
10
11     <%= stylesheet_link_tag "/css/ui.dialog.css", "/themes/bento/css/style.css", "/css/software.css" %>
12     <link href="http://static.opensuse.org/themes/bento/images/favicon.png" rel="shortcut icon" />
13     <%= javascript_include_tag "http://static.opensuse.org/themes/bento/js/jquery.js", "jquery-ui-1.7.2.js", "jrails.js", "application.js"  %>
14     <%= javascript_include_tag "/themes/bento/js/l10n/global-navigation-data-#{@lang}.js", "/themes/bento/js/global-navigation.js" %>
15
16     <%= yield :content_for_head %>
17
18     <script type="text/javascript">
19       /* <![CDATA[ */
20 <%= yield :head_javascript %>
21   $(function() {
22 <%= yield :ready_function %>
23          
24     var flip = 0;
25     $(".options_link").click(function () {
26       $("#search_options").toggle( flip++ % 2 == 0 );
27     });
28   });
29   /* ]]> */
30     </script>
31
32     <!-- Piwik -->
33     <script type="text/javascript">
34       var _paq = _paq || [];
35       (function(){
36         var u=(("https:" == document.location.protocol) ? "https://features.opensuse.org/piwik/" : "http://features.opensuse.org/piwik/");
37         _paq.push(['setSiteId', 3]);
38         _paq.push(['setTrackerUrl', u+'piwik.php']);
39         _paq.push(['trackPageView']);
40         _paq.push([ 'setDomains', ["*.opensuse.org"]]);
41         var d=document,
42         g=d.createElement('script'),
43         s=d.getElementsByTagName('script')[0];
44         g.type='text/javascript';
45         g.defer=true;
46         g.async=true;
47         g.src=u+'piwik.js';
48         s.parentNode.insertBefore(g,s);
49       })();
50     </script>
51     <!-- End Piwik Code -->
52
53   </head>
54   <body>
55
56     <div id="header">
57       <div id="header-content" class="container_12">
58         <a id="header-logo" href="/">
59           <%= image_tag '/themes/bento/images/header-logo.png', :width => 46, :height => 26, :alt => _("Header Logo") %>
60         </a>
61         <ul id="global-navigation">
62           <li id="item-downloads"><a href="http://en.opensuse.org/openSUSE:Browse#downloads"><%= _("Downloads") %></a></li>
63           <li id="item-support"><a href="http://en.opensuse.org/openSUSE:Browse#support"><%= _("Support") %></a></li>
64           <li id="item-community"><a href="http://en.opensuse.org/openSUSE:Browse#community"><%= _("Community") %></a></li>
65           <li id="item-development"><a href="http://en.opensuse.org/openSUSE:Browse#development"><%= _("Development") %></a></li>
66         </ul>
67       </div>
68     </div>
69
70     <% unless flash.blank? %>
71       <%= render(:partial => "layouts/flash", :object => flash) %>
72     <% end %>
73
74     <div id="content" class="container_12 content-wrapper">
75       <div class="grid_9 alpha">
76
77         <%= render :partial => 'search/search_box' %>
78
79         <div class="box box-shadow">
80           <h2 class="box-header">
81             <span class="alignleft"><%= @box_title || @page_title -%></span>
82             <% if @right_box == :search -%>
83               <span class="alignright" style="padding-right: 10px">
84                 <% if !@release.blank? and @release != "developer" -%>
85                   <%= _('switch to') -%> <%= link_to _('Development Version'), {:controller => "main", :action => "developer", :lang => @lang } -%>
86                 <% elsif !@release.blank? -%>
87                   <%= _('switch to') -%> <%= link_to _('Released Version'), {:controller => "main", :action => "index", :lang => @lang } -%>
88                 <% end -%>
89               </span>
90             <% end -%>
91           </h2>
92           <div>
93             <%= @content_for_layout %>
94           </div>
95         </div>
96
97       </div>
98       <div class="grid_3 omega">
99
100         <div class="box box-shadow">
101           <h2 class="box-header centered"><%= _("Popular Software") %></h2>
102           <p>
103             <% top = top_downloads
104             if !top.blank?
105               top1=top[0][:count]
106               top10=top[-1][:count]
107               top.each do |query| -%>
108                 <% queryclass=((Float(query[:count] - top10) / (top1 - top10)) * 5).round %>
109                 <a class='<%= "nowrap query query_#{queryclass}"%>'><%= query[:query] %></a>
110               <% end
111             end -%>
112           </p>
113         </div>
114
115
116         <div class="box box-shadow">
117           <h2 class="box-header centered"><%=_("Getting Help")%></h2>
118           <ul class="navigation">
119             <li><a href="http://en.opensuse.org/SDB:Download_help"><%=_("Download Help")%></a></li>
120             <li><a href="http://en.opensuse.org/SDB:Download_help#Burn_the_ISO_image.28s.29"><%=_("Burn CD/DVD Image(s)")%></a></li>
121             <li><a href="http://en.opensuse.org/SDB:Installation"><%=_("Installation Guides")%></a></li>
122             <li><a href="http://doc.opensuse.org/"><%=_("Official Manuals")%></a></li>
123             <li><a href="http://en.opensuse.org/Package_repositories"><%=_("Package Repositories")%></a></li>
124             <li><a href="http://en.opensuse.org/openSUSE:Submitting_bug_reports"><%=_("Reporting Bugs")%></a></li>
125           </ul>
126         </div>
127
128         <div class="box box-shadow">
129           <h2 class="box-header centered"><%=_("Countdown")%></h2>
130           <div class="centered">
131             <img src="http://counter.opensuse.org/11.4/small" title="<%=_("openSUSE 11.3 Counter")%>" alt="<%=_("openSUSE 11.3 Counter")%>"/>
132           </div>
133         </div>
134
135         <div class="box box-shadow">
136           <h2 class="box-header aligncenter"><%=_("Buy openSUSE")%></h2>
137           <div class="centered">
138             <a href="<%= _("http://en.opensuse.org/Buy_openSUSE") %>"><img src="http://en.opensuse.org/images/4/4c/OpenSUSE11.3_Box.png" title="<%=_("Buy openSUSE 11.3")%>" alt="<%=_("Buy openSUSE 11.3")%>"/></a>
139           </div>
140           <p class="centered">
141             <a href="<%= _("http://en.opensuse.org/Buy_openSUSE") %>" title="Buy openSUSE" style="text-decoration: none; font-weight: bold"><%=_("Buy openSUSE 11.3!")%></a>
142           </p>
143         </div>
144
145         <div class="box box-shadow">
146           <h2 class="box-header centered"><%=_("Sponsored by")%></h2>
147           <!--<p class="centered" style="color: #ccc; font-size: 0.8em"><%=_("Platinum Sponsor")%></p>-->
148           <p class="centered" style="color: #ccc; font-size: 0.8em;"><%=_("Gold Sponsor")%></p>
149           <p class="centered">
150             <a href="http://en.opensuse.org/Sponsors"><img title="<%=_("Sponsored by AMD")%>" alt="<%=_("Sponsored by AMD")%>" src="http://static.opensuse.org/c/images/common/Amd.png"/></a>
151             <a href="http://en.opensuse.org/Sponsors"><img title="<%=_("Sponsored by: IP Exchange")%>" alt="<%=_("Sponsored by: IP Exchange")%>" src="http://static.opensuse.org/c/images/common/Ip-exchange.gif"/></a>
152           </p>
153           <p class="centered" style="color: #ccc; font-size: 0.8em;"><%=_("Silver Sponsor")%></p>
154           <p class="centered">
155             <a href="http://en.opensuse.org/Sponsors"><img title="<%=_("Sponsored by: B1 Systems")%>" alt="<%=_("Sponsored by: B1 Systems")%>" src="http://static.opensuse.org/c/images/common/B1-systems-1.jpg"/></a>
156           </p>
157           <!--<p class="centered" style="color: #ccc; font-size: 0.8em"><%=_("Bronze Sponsor")%></p>-->
158         </div>
159
160         <div class="box box-shadow">
161           <h2 class="box-header centered"><%= _("Language") %></h2>
162           <% # flags are from: http://www.famfamfam.com/lab/icons/flags/ -%>
163           <p class="centered">
164             <% LANGUAGES.each do |lang| %>
165               <%= link_to(image_tag("/images/lang/lang_#{lang}.png", :alt => "#{lang}"), :controller => :main, :action => :index, :lang => "#{lang}") %>
166             <% end -%>
167           </p>
168         </div>
169
170       </div>
171
172     </div>
173
174     <div id="footer" class="container_12">
175       <div id="footer-content" class="grid_12">
176       </div>
177       <div id="footer-legal" class="border-top grid_12">
178         <a href="http://en.opensuse.org/Portal:Project">About openSUSE</a> |
179         <a href="http://en.opensuse.org/Terms_of_site">Legal information</a> |
180         <a href="mailto:admin@opensuse.org">Feedback</a>
181         <br/><br/>
182         <a href="http://www.novell.com/linux/"><img src="http://static.opensuse.org/c/images/common/founded_novell.gif" alt="Founded by Novell" /></a>
183       </div>
184     </div>
185
186     <% if @right_box == :search -%>
187       <!--[if lte IE 7]>
188           <script type="text/javascript">
189            alert("Please note that the Internet Explorer (all versions) is not capable of handling\nfiles larger than 4 GB.\n\nThis means that you will not be able to download the DVD images using IE.\n\nPlease use a different browser or a downloadmanager.")
190           </script>
191         <![endif]-->
192     <% end -%>
193     
194   </body>
195 </html>