use new opensuse piwik
[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 "/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://beans.opensuse.org/piwik/" : "http://beans.opensuse.org/piwik/");
37         _paq.push(['setSiteId', 7]);
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' unless @hide_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               if top1 - top10 > 0
108                 top.each do |query| -%>
109                   <% queryclass=((Float(query[:count] - top10) / (top1 - top10)) * 5).round %>
110                   <a class='<%= "nowrap query query_#{queryclass}"%>'><%= query[:query] %></a>
111                 <% end
112               end
113             end -%>
114           </p>
115         </div>
116
117
118         <div class="box box-shadow">
119           <h2 class="box-header centered"><%=_("Getting Help")%></h2>
120           <ul class="navigation">
121             <li><a href="http://en.opensuse.org/SDB:Download_help"><%=_("Download Help")%></a></li>
122             <li><a href="http://en.opensuse.org/SDB:Download_help#Burn_the_ISO_image.28s.29"><%=_("Burn CD/DVD Image(s)")%></a></li>
123             <li><a href="http://en.opensuse.org/Portal:Installation"><%=_("Installation Guides")%></a></li>
124             <li><a href="http://doc.opensuse.org/"><%=_("Official Manuals")%></a></li>
125             <li><a href="http://en.opensuse.org/Package_repositories"><%=_("Package Repositories")%></a></li>
126             <li><a href="http://en.opensuse.org/openSUSE:Submitting_bug_reports"><%=_("Reporting Bugs")%></a></li>
127           </ul>
128         </div>
129
130         <!--
131         <div class="box box-shadow">
132           <h2 class="box-header centered"><%=_("Countdown")%></h2>
133           <div class="centered">
134             <img src="http://counter.opensuse.org/11.4/small" title="<%=_("openSUSE Countdown")%>" alt="<%=_("openSUSE Countdown")%>" width="130" height="130"/>
135           </div>
136         </div>
137         -->
138
139         <div class="box box-shadow">
140           <h2 class="box-header aligncenter"><%=_("Buy openSUSE")%></h2>
141           <div class="centered">
142             <a href="<%= _("http://en.opensuse.org/Buy_openSUSE") %>"><%= image_tag "114_Boxshot_GB_3D.jpg", :title => _("Buy openSUSE"), :alt => _("Buy openSUSE"), :width => 90, :height => 114 %></a>
143           </div>
144           <p class="centered">
145             <a href="<%= _("http://en.opensuse.org/Buy_openSUSE") %>" title="Buy openSUSE" style="text-decoration: none; font-weight: bold"><%=_("Buy openSUSE")%></a>
146           </p>
147         </div>
148
149         <div class="box box-shadow">
150           <h2 class="box-header centered"><%=_("Sponsored by")%></h2>
151           <!--<p class="centered" style="color: #ccc; font-size: 0.8em"><%=_("Platinum Sponsor")%></p>-->
152           <p class="centered" style="color: #ccc; font-size: 0.8em;"><%=_("Gold Sponsor")%></p>
153           <p class="centered">
154             <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" width="136" height="66"/></a>
155             <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" width="180" height="85"/></a>
156           </p>
157           <p class="centered" style="color: #ccc; font-size: 0.8em;"><%=_("Silver Sponsor")%></p>
158           <p class="centered">
159             <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" width="100" height="100"/></a>
160           </p>
161           <!--<p class="centered" style="color: #ccc; font-size: 0.8em"><%=_("Bronze Sponsor")%></p>-->
162         </div>
163
164         <div class="box box-shadow">
165           <h2 class="box-header centered"><%= _("Language") %></h2>
166           <form action="<%= url_for :controller => :main, :action => :index %>" method="get" class="centered">
167           <select name="lang" onChange="this.form.submit();">
168             <option value="<%= @lang %>" selected="true"><%= link_to(LANGUAGE_NAMES[@lang] || @lang, :controller => :main, :action => :index, :lang => "#{@lang}") %></option>
169             <% LANGUAGES.each do |lang| %>
170             <option value="<%= lang %>"><%= link_to(LANGUAGE_NAMES[lang] || lang, :controller => :main, :action => :index, :lang => "#{lang}") %></option>
171             <% end -%>
172           </select>
173             </form>
174         </div>
175
176       </div>
177
178     </div>
179
180     <div id="footer" class="container_12">
181       <div id="footer-content" class="grid_12">
182       </div>
183       <div id="footer-legal" class="border-top grid_12">
184         <a href="http://en.opensuse.org/Portal:Project">About openSUSE</a> |
185         <a href="http://en.opensuse.org/Terms_of_site">Legal information</a> |
186         <a href="mailto:admin@opensuse.org">Feedback</a>
187         <br/><br/>
188         <a href="http://www.novell.com/linux/"><img src="http://static.opensuse.org/c/images/common/founded_novell.gif" alt="Founded by Novell" width="139" height="18" /></a>
189       </div>
190     </div>
191
192     <% if @right_box == :search -%>
193       <!--[if lte IE 7]>
194           <script type="text/javascript">
195            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.")
196           </script>
197         <![endif]-->
198     <% end -%>
199
200   </body>
201 </html>