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