Skip to content

Commit

Permalink
Layout for distribution download pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Guo Yunhe committed Jul 2, 2017
1 parent 1f80f50 commit 8b53b3f
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 59 deletions.
14 changes: 7 additions & 7 deletions app/controllers/distributions_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,36 @@ class DistributionsController < ApplicationController

# GET /distributions
def index
render layout: 'jekyll'
render layout: 'download'
end

# GET /distributions/leap
def leap
render layout: 'jekyll'
render layout: 'download'
end

# GET /distributions/leap/ports
def leap_ports
render layout: 'jekyll'
render layout: 'download'
end

# GET /distributions/tumbleweed
def tumbleweed
render layout: 'jekyll'
render layout: 'download'
end

# GET /distributions/tumbleweed/ports
def tumbleweed_ports
render layout: 'jekyll'
render layout: 'download'
end

# GET /distributions/tumbleweed/unsupported
def tumbleweed_unsupported
render layout: 'jekyll'
render layout: 'download'
end

# GET /distributions/testing
def testing
render layout: 'jekyll'
render layout: 'download'
end
end
16 changes: 6 additions & 10 deletions app/views/distributions/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
<header class="header-section ">
<div class="intro-header no-img">
<div class="container">
<div class="row">
<div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
<div class="page-heading">
<h1><%= _('Get openSUSE') %></h1>
<hr class="small">
<span class="page-subheading">
<%= _('openSUSE is completely free to download, use and share.') %>
</span>
</div>
</div>
<div class="page-heading">
<h1><%= _('Get openSUSE') %></h1>
<hr class="small">
<span class="page-subheading">
<%= _('openSUSE is completely free to download, use and share.') %>
</span>
</div>
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/views/layouts/_navbar.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@

<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<li class="nav-item <%= 'active' if defined?(activenav) && (activenav == 'download') %>">
<a class="nav-link" href="/"><%= _("Download") %></a>
</li>
<li class="nav-item active">
<li class="nav-item <%= 'active' unless defined?(activenav) && (activenav == 'download') %>">
<a class="nav-link" href="/search"><%= _("Software") %></a>
</li>
<li class="nav-item">
Expand Down
5 changes: 3 additions & 2 deletions app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><%= "software.opensuse.org: #{@page_title}" %></title>
<title><%= @page_title || _('openSUSE Software') %></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Content-Script-Type" content="text/javascript"/>
<meta http-equiv="Content-Style-Type" content="text/css"/>
Expand Down Expand Up @@ -59,7 +59,8 @@
</head>
<body>

<%= render :partial => "layouts/navbar" %>
<% activenav ||= 'software' %>
<%= render :partial => "layouts/navbar", :locals => {:activenav => 'software' } %>
<% unless flash.blank? %>
<%= render(:partial => "layouts/flash", :object => flash) %>
Expand Down
67 changes: 29 additions & 38 deletions app/views/layouts/download.html.erb
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title><%= "software.opensuse.org: #{@page_title}" %></title>
<meta charset="utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title><%= @page_title || _('Get openSUSE') %></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="Content-Script-Type" content="text/javascript"/>
<meta http-equiv="Content-Style-Type" content="text/css"/>

<link rel="search" type="application/opensearchdescription+xml" title="openSUSE Software" href="/search_software.xml" />

<%= stylesheet_link_tag "application" %>
<%= stylesheet_link_tag "/chameleon/css/app.css" %>
<%= stylesheet_link_tag "app" %>
<%= javascript_include_tag "/chameleon/js/app.js" %>
<link href="//static.opensuse.org/themes/bento/images/favicon.png" rel="shortcut icon" />
<%= javascript_include_tag "application" %>
<%= javascript_include_tag "/themes/bento/js/l10n/global-navigation-data-#{@lang || "en"}.js" %>
Expand All @@ -29,7 +34,7 @@
var _paq = _paq || [];
(function(){
var u=(("https:" == document.location.protocol) ? "https://beans.opensuse.org/piwik/" : "http://beans.opensuse.org/piwik/");
_paq.push(['setSiteId', 19]);
_paq.push(['setSiteId', 7]);
_paq.push(['setTrackerUrl', u+'piwik.php']);
_paq.push(['trackPageView']);
_paq.push([ 'setDomains', ["*.opensuse.org"]]);
Expand All @@ -45,54 +50,40 @@
</script>
<!-- End Piwik Code -->

<% if @lang == "ar" %>
<style type="text/css">
body {direction:rtl}
</style>
<% end %>

</head>
<body>

<div id="header">
<div id="header-content" class="container_12">
<a id="header-logo" href="/">
<%= image_tag '/themes/bento/images/header-logo.png', :width => 46, :height => 26, :alt => _("Header Logo") %>
</a>
<ul id="global-navigation">
<li id="item-downloads"><a href="http://en.opensuse.org/openSUSE:Browse#downloads"><%= _("Downloads") %></a></li>
<li id="item-support"><a href="http://en.opensuse.org/openSUSE:Browse#support"><%= _("Support") %></a></li>
<li id="item-community"><a href="http://en.opensuse.org/openSUSE:Browse#community"><%= _("Community") %></a></li>
<li id="item-development"><a href="http://en.opensuse.org/openSUSE:Browse#development"><%= _("Development") %></a></li>
</ul>
</div>
</div>
<%= render :partial => "layouts/navbar", :locals => {:activenav => 'download' } %>
<% unless flash.blank? %>
<%= render(:partial => "layouts/flash", :object => flash) %>
<% end %>

<div id="content" class="container_12 content-wrapper">
<div class="grid_12 alpha">

<% unless @hide_search_box %>
<%# Caching is really crucial in the front page (at release date, at least) %>
<% if controller.controller_name == "main" && controller.action_name == "release" %>
<% cache :locale => @lang, :baseproject => (@baseproject || default_baseproject) do %>
<%= render :partial => 'search/find_form' %>
<% end %>
<% else %>
<%= render :partial => 'search/find_form' %>
<% end %>
<% end %>

<div class="box box-shadow">
<h2 class="box-header">
<span class="alignleft"><%= @box_title || @page_title -%></span>
</h2>
<div>
<%= yield %>
</div>
</div>

<div id="search_result_container">
<%= yield %>
</div>
</div>

<div id="footer" class="container_12">
<div id="footer-content" class="grid_12">
</div>
<div id="footer-legal" class="border-top grid_12">
<%= link_to 'Create your own download page', :controller => :download, :action => :doc %> |
<a href="http://en.opensuse.org/Portal:Project">About openSUSE</a> |
<a href="http://en.opensuse.org/Terms_of_site">Legal information</a> |
<a href="mailto:admin@opensuse.org">Feedback</a> |
<a href="https://github.com/openSUSE/software-o-o/">Fork me on GitHub</a>
</div>
</div>
<%= render :partial => "layouts/footer" %>

</body>
</html>

0 comments on commit 8b53b3f

Please sign in to comment.