Add introductory front page

Give the user a friendly introduction instead of plunging them straight
into the layers list. (Of course if people want to link directly to the
layers list they still can.)

Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
This commit is contained in:
Paul Eggleton 2013-03-06 18:31:49 +00:00
parent a643aeba33
commit 4faeab6595
7 changed files with 99 additions and 5 deletions

7
README
View File

@ -65,8 +65,11 @@ Setup instructions:
"Submit Layer" feature within the interface itself (easiest) or the
admin interface to do this.
5. You may wish to customise templates/layerindex/about.html to suit
your installation.
5. You may wish to customise some of the page templates to suit your
installation, in particular:
* templates/base.html
* templates/layerindex/frontpage.html
* templates/layerindex/about.html
Usage

View File

@ -130,3 +130,29 @@ padding: 8px;
padding-top: 1em;
border-top: 1px solid rgb(238, 238, 238);
}
.hero-evenlyspaced {
padding: 35px;
}
.hero-evenlyspaced h1 {
padding-bottom: 0.25em;
}
.frontpage-button-group {
text-align:center !important;
padding: 10px;
}
.frontpage-button-group a {
margin: 5px;
}
.branch {
font-weight: bold;
}
.well-frontpage {
background-color: white;
height: 100%;
}

View File

@ -11,8 +11,12 @@ from layerindex.views import LayerListView, LayerReviewListView, LayerReviewDeta
urlpatterns = patterns('',
url(r'^$',
TemplateView.as_view(
template_name='layerindex/frontpage.html'),
name='frontpage'),
url(r'^layers/$',
LayerListView.as_view(
template_name='layerindex/index.html'),
template_name='layerindex/layers.html'),
name='layer_list'),
url(r'^submit/$', edit_layer_view, {'template_name': 'layerindex/submitlayer.html'}, name="submit_layer"),
url(r'^edit/(?P<slug>[-\w]+)/$', edit_layer_view, {'template_name': 'layerindex/editlayer.html'}, name="edit_layer"),

View File

@ -18,9 +18,11 @@
{% block content %}
{% autoescape on %}
<h1>Page not found</h1>
<p>The page you requested was not found.</p>
<p><a href="{% url layer_list %}">Return to the index</a></p>
<p><a href="{% url frontpage %}">Return to the front page</a></p>
{% endautoescape %}
{% endblock %}

View File

@ -28,7 +28,7 @@
<div class="navbar navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<a class="brand" href="{% url layer_list %}">OpenEmbedded metadata index</a>
<a class="brand" href="{% url frontpage %}">OpenEmbedded metadata index</a>
<ul class="nav">
{% block branch_selector %}

View File

@ -0,0 +1,59 @@
{% extends "base.html" %}
{% load i18n %}
{% load static %}
{% comment %}
layerindex-web - front page template
Copyright (C) 2013 Intel Corporation
Licensed under the MIT license, see COPYING.MIT for details
{% endcomment %}
<!--
{% block title_append %}{% endblock %}
-->
{% block content %}
{% autoescape on %}
<div class="hero-unit hero-evenlyspaced">
<h1>Welcome!</h1>
<p>Welcome to the OpenEmbedded metadata index. Here you can find metadata (layers, recipes and machines)
provided by members of the OpenEmbedded / Yocto Project community for use on top of OpenEmbedded-Core
and compatible systems.</p>
</div>
<div class="row">
<div class="span8">
<div class="well well-frontpage">
<h2>Finding what you need</h2>
<p>You can browse or search by layer, by recipe or by machine.</p>
<div class="frontpage-button-group">
<a href="{% url layer_list %}" class="btn btn-large btn-primary">Layers</a>
<a href="{% url recipe_search %}" class="btn btn-large btn-primary">Recipes</a>
<a href="{% url machine_search %}" class="btn btn-large btn-primary">Machines</a>
</div>
<p><small>Note that you are currently viewing
{% if current_branch = 'master' %}
the <span class="branch">master</span> branch - the latest development version of the code.
{% else %}
the <span class="branch">{{ current_branch }}</span> branch.
{% endif %}
You can change between master and release branches at any time using the branch selector on the bar at the top of the page.</small></p>
</div>
</div>
<div class="span4">
<div class="well well-frontpage">
<h2>Questions?</h2>
<p>Got some questions about layers or this website? See the <a href="http://www.openembedded.org/Layers_FAQ">FAQ</a>.</p>
</div>
</div>
</div>
{% endautoescape %}
{% endblock %}