Skip to content
Snippets Groups Projects
Commit 05cc8739 authored by Tor-Einar Skog's avatar Tor-Einar Skog
Browse files

More layout implementation

parent 40285de5
No related branches found
No related tags found
No related merge requests found
......@@ -93,7 +93,7 @@
/*color: #f7f6f2 !important;*/
font-weight: bold !important;
height: 65px;
border-bottom: 4px solid #222222;
border-bottom: 4px solid #008136;
}
.navbar-nav .dropdown a .caret{
......@@ -185,7 +185,7 @@ div.messages_illustration{
@media (min-width: 992px)
{
#mapContainer{
border-left: 15px solid rgba(0, 87, 77, 0.15);
border-left: 15px solid #d9e6e4;
padding-left: 0px;
padding-right: 0px;
......@@ -201,7 +201,7 @@ div.messages_illustration{
@media (max-width: 992px)
{
#mapContainer{
background-color: rgba(0, 87, 77, 0.15);
background-color: #d9e6e4;
padding-bottom: 15px;
}
......@@ -411,11 +411,12 @@ p.byline {
margin: 0px 0px 8px 0px;
}
a {
a, a:hover {
color: #008136;
text-decoration: underline;
}
p.lead {
font-size: 20px;
line-height: 30px;
......@@ -734,10 +735,77 @@ table.messageTable tr, table.messageTable td
cursor:pointer;
}
.vipsMessageContainer {
.singleBlockContainer {
margin-bottom: 15px;
margin-top: 15px;
padding: 15px;
background-color: white !important;
}
div.tab-content {
background-color: white;
padding: 30px;
margin-bottom: 15px;
}
ul.nav-tabs>li>a, ul.nav-tabs>li.active a{
border: 1px solid white;
border-radius: 0;
margin: 0px;
}
ul.nav-tabs li a {
background-color: #ddd;
color: black;
}
ul.nav-tabs {
border-bottom: 0px none;
}
.nav-tabs>li.active>a, .nav-tabs>li.active>a:hover, .nav-tabs>li.active>a:focus{
border: 1px solid white !important;
background-color: #008136;
color: white;
}
div.input-group-addon {
background-color: #008136;
color: white;
}
button.btn-primary {
background-color: #008136;
color: white;
}
table.table {
border-collapse: collapse;
}
table.table > tbody > tr > td {
background-color: white;
border-bottom: 3px solid #d9e6e4;
}
.table thead>tr>th {
border-bottom: 3px solid #d9e6e4;
}
ol.breadcrumb {
background-color: transparent;
}
ul.nav > li > ul.nav{
margin-left: 10px;
}
.nav>li>span.active {
position: relative;
display: block;
padding: 10px 15px;
}
......@@ -105,7 +105,7 @@
</div>
</nav>
</div>
<div style="background-color: rgba(0, 87, 77, 0.15)">
<div style="background-color: #d9e6e4;">
<div class="container" id="contentContainer" >
<div class="row">
<!-- Start contents container -->
......
......@@ -26,7 +26,7 @@
{% block content %}
<h1>{% trans "Forecasts" %}</h1>
<div class="table-responsive">
<table id="resultTable" class="table table-striped">
<table id="resultTable" class="table">
<thead>
<tr>
<th>
......
......@@ -21,8 +21,10 @@
{% load i18n %}
{% block title%}{{model.local_name}} - {% trans "Models" %}{%endblock%}
{% block content %}
<h1>{{model.local_name}}</h1>
<ul class="nav nav-tabs">
<div class="col-md-3">&nbsp;</div>
<div class="col-md-9">
<h1>{{model.local_name}}</h1>
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#modelDescription">{% trans "Description" %}</a></li>
<li><a data-toggle="tab" href="#warningStatusInterpretation">{% trans "Interpretation of warning status" %}</a></li>
<li><a data-toggle="tab" href="#modelUsage">{% trans "Technical usage" %}</a></li>
......@@ -44,5 +46,5 @@
</pre>
</div>
</div>
</div>
{% endblock %}
\ No newline at end of file
......@@ -2,36 +2,37 @@
{% load i18n staticfiles %}
{% block title%}{{information_locale.headline}}{%endblock%}
{% block content %}
<ol class="breadcrumb">
{% for crumb in breadcrumb reversed %}
<div class="col-md-3">
<nav>
<ul class="nav">
{{ menu_html | safe }}
</ul>
</nav>
</div>
<div class="col-md-9">
{% if crumb.children_locales %}
<li class="dropdown">
{% if crumb.active %}
<span class="active">{{ crumb.title }}</span>
<ol class="breadcrumb">
{% for crumb in breadcrumb reversed %}
{% if crumb.children_locales %}
<li class="dropdown">
{% if crumb.active %}
<span class="active">{{ crumb.title }}</span>
{% else %}
<a href="{% url 'information:detail' crumb.id %}">{{ crumb.title }}</a>
{% endif %}
</li>
{% else %}
<a href="{% url 'information:detail' crumb.id %}">{{ crumb.title }}</a>
<li class="active">{{ crumb.title }}</li>
{% endif %}
<a class="dropdown-toggle" role="button" id="crumbDropdown" data-toggle="dropdown" aria-expanded="true">
<span class="caret"></span>
</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="crumbDropdown">
{% for child in crumb.children_locales %}
<li role="presentation"><a role="menuitem" tabindex="-1" href="{% url 'information:detail' child.information.pk %}">{{ child.headline }}</a></li>
{% endfor %}
</ul>
</li>
{% else %}
<li class="active">{{ crumb.title }}</li>
{% endfor %}
</ol>
<div class="singleBlockContainer">
{% if information_locale.information.main_illustration %}
<div class="messages_illustration"><img src="{{settings.MEDIA_URL}}{{information_locale.information.main_illustration}}" class="img-responsive"/></div>
{% endif %}
{% endfor %}
</ol>
{% if information_locale.information.main_illustration %}
<div class="messages_illustration"><img src="{{settings.MEDIA_URL}}{{information_locale.information.main_illustration}}" class="img-responsive"/></div>
{% endif %}
<h1>{{information_locale.headline}}</h1>
<p class="lead">{{information_locale.lead_paragraph}}</p>
{{information_locale.body | safe }}
<h1>{{information_locale.headline}}</h1>
<p class="lead">{{information_locale.lead_paragraph}}</p>
{{information_locale.body | safe }}
</div>
</div>
{% endblock %}
\ No newline at end of file
......@@ -18,6 +18,7 @@
from django.shortcuts import render
from information.models import InformationLocale, Information
from django.core.urlresolvers import reverse
def index(request):
......@@ -43,7 +44,8 @@ def detail(request, information_id):
'information_locale' : information_locale,
#'parent_information' : parent_information,
#'children_locales':children_locales,
'breadcrumb': get_breadcrumb(information_locale.information)
'breadcrumb': get_breadcrumb(information_locale.information),
'menu_html': get_menu_html(None, information_id)
}
return render(request, 'information/detail.html', context)
......@@ -63,4 +65,52 @@ def get_breadcrumb(information):
})
information = information.parent_information
return breadcrumb
\ No newline at end of file
menu_template = """
<nav>
<ul class="nav">
%s
</ul>
</nav>
"""
link_title = """<a href="%s">%s</a>"""
toggleable_item_template="""
<li class="%s">
%s
<ul class="nav">
%s
</ul>
</li>
"""
simple_item_template = """<li class="%s">%s</li>"""
## Recursive method
def get_menu_html(parent_information, active_information_pk):
# We start with backtracking from the active information object
if(parent_information == None):
items = Information.objects.filter(parent_information__isnull=True)
else:
items = Information.objects.filter(parent_information=parent_information)
items_html = []
for info in items:
info_locale = InformationLocale.get_information_locale_with_fallback(info.pk)
if info.pk == int(active_information_pk):
active_class = "active"
title = """<span class="active">%s</span>""" % info_locale.headline
else:
active_class = ""
title = link_title % (reverse('information:detail', kwargs={"information_id":info.pk}), info_locale.headline)
child_menu_html = get_menu_html(info, active_information_pk)
# If item has no child items, create simple item
if child_menu_html == "":
items_html.append(simple_item_template % (active_class, title))
# Else create complex item
else:
items_html.append(toggleable_item_template % (active_class, title, child_menu_html))
return "".join(items_html)
\ No newline at end of file
......@@ -145,7 +145,7 @@ class Message:
message_locale["createdBy"].get("firstName",""),
message_locale["createdBy"].get("lastName","")
)
print the_dict["datePub"]
#print the_dict["datePub"]
return Message(
the_dict["messageId"],
the_dict["organizationId"],
......
......@@ -4,7 +4,7 @@
{% block content %}
<div class="row">
<div class="col-md-3">&nbsp;</div>
<div class="col-md-9 vipsMessageContainer">
<div class="col-md-9 singleBlockContainer">
{% if message.illustration_file_name %}
<div class="messages_illustration"><img src="{{message.get_illustration_url}}" class="img-responsive"/></div>
{% endif %}
......
......@@ -10,7 +10,7 @@
<div class="row">
<div class="col-xs-3">
<div class="input-group">
<div class="input-group-addon"><img src="{% static "css/icons/ic_action_search.png" %}" alt="Search icon"/></div>
<div class="input-group-addon"><span class="fa fa-search"></span><!--img src="{% static "css/icons/ic_action_search.png" %}" alt="Search icon"/--></div>
<input class="form-control" type="text" id="textSearchField" placeholder="{% trans "Text search" %}" oninput="search(this);"/>
</div>
</div>
......@@ -35,13 +35,13 @@
{{form.publishedTo.errors}}
<input class="form-control" type="date" name="{{form.publishedTo.html_name}}" value="{{form.publishedTo.value | default_if_none:""}}" placeholder="{% trans "To" %}"/>
</div>
<button type="submit" class="btn btn-default">{% trans "Date search" %}</button>
<button type="submit" class="btn btn-primary">{% trans "Date search" %}</button>
</form>
</div>
</div>
<div class="table-responsive">
<table id="resultTable" class="table table-striped">
<table id="resultTable" class="table">
<thead>
<tr>
<th>{% trans "Publish date" %}</th>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment