simplify the code, use memcached for search result lists
[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</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     <%= stylesheet_link_tag "/css/ui.dialog.css", "/themes/bento/css/style.css", "/css/software.css" %>
10     <link href="http://static.opensuse.org/hosts/software.o.o/images/favicon.ico" rel="shortcut icon" />
11     <%= javascript_include_tag "http://static.opensuse.org/themes/bento/js/jquery.js", "jquery-ui-1.7.2.js", "jrails.js", "application.js"  %>
12     <%= javascript_include_tag "http://static.opensuse.org/c/javascript/common/langsel.js" %>
13     <%= javascript_include_tag "/themes/bento/js/l10n/global-navigation-data-" + @lang + ".js", "/themes/bento/js/global-navigation.js" %>
14     <%= javascript_include_tag "http://www.google-analytics.com/ga.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     /* ]]> */
25     </script>
26
27
28
29   </head>
30   <body>
31
32     <div id="header">
33       <div id="header-content" class="container_12">
34         <a id="header-logo" href="/">
35           <%= image_tag '/themes/bento/images/header-logo.png', :width => 46, :height => 26, :alt => _("Header Logo") %>
36         </a>
37         <ul id="global-navigation">
38           <li id="item-downloads"><a href="http://opensuse.org/sitemap#downloads"><%= _("Downloads") %></a></li>
39           <li id="item-support"><a href="http://opensuse.org/sitemap#support"><%= _("Support") %></a></li>
40           <li id="item-community"><a href="http://opensuse.org/sitemap#community"><%= _("Community") %></a></li>
41           <li id="item-development"><a href="http://opensuse.org/sitemap#development"><%= _("Development") %></a></li>
42         </ul>
43       </div>
44     </div>
45
46     <div id="content" class="container_12 content-wrapper">
47       <div class="grid_9 alpha">
48
49         <div class="box box-shadow grid_9 alpha">
50           <h2 class="box-header"><%=_("Package Search")%></h2>
51           <div id="get_software">
52             <p><%=_("Search and install software packages from the openSUSE Build Service:") %></p>
53             <div id="search_form">
54               <% form_tag( {:controller => 'search'}, :method => :get ) do %>
55                 <%= text_field_tag 'q', @query, :size => 40 %>
56                 <div id="form_control">
57                   <%= select_tag 'baseproject', options_for_select(baseproject_list_for_select, (@baseproject or default_baseproject)) %>
58                   <%= submit_tag _('Search'), :name => nil %>
59                 </div>
60               <% end -%>
61             </div>
62           </div>
63         </div>
64
65         <%= setup_baseproject %>
66
67         <div class="box box-shadow grid_9 alpha">
68           <h2 class="box-header">
69             <span class="alignleft"><%= @page_title -%></span>
70             <% if @right_box == :search -%>
71               <span class="alignright" style="padding-right: 10px">
72                 <% if @release != "developer" -%>
73                   <%= _('switch to') -%> <%= link_to _('Development Version'), {:controller => "main", :action => "developer", :lang => @lang } -%>
74                 <% else -%>
75                   <%= _('switch to') -%> <%= link_to _('Released Version'), {:controller => "main", :action => "index", :lang => @lang } -%>
76                 <% end -%>
77               </span>
78             <% end -%>
79           </h2>
80           <div>
81             <%= @content_for_layout %>
82           </div>
83         </div>
84
85       </div>
86       <div class="grid_3 omega">
87
88         <div class="box box-shadow grid_3 omega">
89           <h2 class="box-header centered"><%= _("Popular Software") %></h2>
90
91           <p>
92             <% top = top_downloads
93               top1=top[0][:count]
94               top10=top[-1][:count]
95               top.each do |query| -%>
96                 <% queryclass=((Float(query[:count] - top10) / (top1 - top10)) * 5).round %>
97               <a class='<%= "nowrap query query_#{queryclass}"%>'><%= query[:query] %></a>
98             <% end -%>
99           </p>
100         </div>
101
102         <div class="box box-shadow grid_3 omega">
103           <h2 class="box-header centered"><%=_("Getting Help")%></h2>
104           <ul class="navlist">
105             <li><a href="http://en.opensuse.org/Download_Help"><%=_("Download Help")%></a></li>
106             <li><a href="http://en.opensuse.org/Download_Help#Burn_the_ISO_Image.28s.29"><%=_("Burn CD/DVD Image(s)")%></a></li>
107             <li><a href="http://en.opensuse.org/Installation"><%=_("Installation Guides")%></a></li>
108             <li><a href="http://www.novell.com/documentation/opensuse112/"><%=_("Official Manuals")%></a></li>
109             <li><a href="http://en.opensuse.org/Additional_YaST_Package_Repositories"><%=_("Package Repositories")%></a></li>
110           </ul>
111         </div>
112
113         <div class="box box-shadow grid_3 omega">
114           <h2 class="box-header centered"><%=_("Sponsored by")%></h2>
115           <!--<p class="centered" style="color: #ccc; font-size: 0.8em"><%=_("Platinum Sponsor")%></p>-->
116           <p class="centered "style="color: #ccc; font-size: 0.8em;"><%=_("Gold Sponsor")%></p>
117           <p class="centered">
118             <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>
119             <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>
120           </p>
121           <p class="centered "style="color: #ccc; font-size: 0.8em;"><%=_("Silver Sponsor")%></p>
122           <p class="centered">
123             <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>
124           </p>
125           <!--<p class="centered" style="color: #ccc; font-size: 0.8em"><%=_("Bronze Sponsor")%></p>-->
126         </div>
127
128         <div class="box box-shadow grid_3 omega">
129           <h2 class="box-header"><%=_("Buy openSUSE")%></h2>
130           <div class="centered" style="padding-left: 16px;">
131             <a href="<%= _("http://en.opensuse.org/Buy_openSUSE") %>"><img src="http://static.opensuse.org/c/images/common/openSUSE11.2_Box.jpg" title="<%=_("Buy openSUSE 11.2")%>" alt="<%=_("Buy openSUSE 11.2")%>"/></a>
132           </div>
133           <p class="centered">
134             <a href="<%= _("http://en.opensuse.org/Buy_openSUSE") %>" title="Buy openSUSE" style="text-decoration: none; font-weight: bold"><%=_("Buy openSUSE 11.2!")%></a>
135           </p>
136         </div>
137
138       </div>
139
140     </div>
141
142     <div id="footer" class="container_12">
143       <div id="footer-content" class="grid_12">
144       </div>
145       <div id="footer-legal" class="border-top grid_12">
146         <a href="http://en.opensuse.org/openSUSE:About">About openSUSE</a> |
147         <a href="http://en.opensuse.org/openSUSE:General_disclaimer">Legal information</a> |
148         <a href="mailto:webmaster@opensuse.org">Feedback</a>
149         <br/><br/>
150         <a href="http://www.novell.com/linux/"><img src="http://static.opensuse.org/c/images/common/founded_novell.gif" alt="Founded by Novell" /></a>
151       </div>
152     </div>
153
154     <% if @right_box == :search -%>
155       <!--[if lte IE 7]>
156           <script type="text/javascript">
157            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.")
158           </script>
159         <![endif]-->
160       <% end -%>
161
162   </body>
163 </html>