Commit 49340e34 authored by Kostas Papadimitriou's avatar Kostas Papadimitriou
Browse files

Added okeanos_site news section

- Configurable news content url (retrieve html news content from
  external location specified by OKEANOS_NEWS_CONTENT_URL)
parent 71a8367f
......@@ -28,6 +28,11 @@
color: #4085A5;
}
a.ext {
background: url("../images/external-link-ltr-icon.png") center right no-repeat;
padding-right: 13px;
}
body {
background-image: url("../images/bg.png");
background-repeat: repeat-x;
......@@ -308,3 +313,61 @@ body.style2 .page.text p, body.style2 .page.text h2 {
box-shadow: 4px 4px 50px #477589 !important;
background: #4085A5 !important;
}
.news-list {
padding: 15px;
margin: 10px 0;
background-color: #CBE1EB;
}
h2 {
color: #4085A5;
font-size: 2em;
margin-bottom: 15px;
}
.news-item .news-content a:hover {
color: #fff;
background-color: #4085A5;
}
.news-item .news-content a {
color: #5E595C;
background-color: #fff;
padding: 2px;
text-decoration: none;
border-bottom: 1px solid #4085A5;
}
.news-item .news-content em {
font-weight: bold;
}
.news-item .news-content {
margin-top: 5px;
margin-bottom: 20px;
color: #213D4A;
text-align: justify;
line-height: 1.4em;
}
.news-item .news-content p {
margin-bottom: 10px;
}
.news-item .news-title {
font-size: 1.2em;
margin: 5px;
padding: 6px;
}
.news-item .news-date {
float: left;
background-color: #ffffff;
color: #FF7F2A;
padding: 11px 5px;
margin: 5px;
margin-right: 15px;
}
......@@ -59,8 +59,16 @@
<div class="testuser"><div class=""><a class="gotoapp" href="{{ OKEANOS_APP_URL }}" title="{% trans "Enter ~okeanos" %}">{% trans "Enter" %}</a></div></div>
</div>
</div>
{% if news_content %}
<div class="news-list">
{{ news_content|safe }}
</div>
{% else %}
{% include "okeanos/news_list.html" %}
{% endif %}
</div>
<div class="footer">
{% comment %}
<ul class="links clearfix">
......
......@@ -4,7 +4,11 @@
<h2>{% trans "Hmm, getting interesting, who is it for?" %}</h2>
<p>
<em>~okeanos</em> will be soon delivering production-quality IaaS to the Greek Academic and Research Community. Students, professors and researchers can dive into the 'ocean' and get the full power of virtual infrastructures (computing, network, storage). We run the service from our datacenters, VMs and storage (soon) over our dark fiber network.
<em>~okeanos</em> will be soon delivering production-quality IaaS to the Greek
Academic and Research Community. Students, professors and researchers can dive
into the 'ocean' and get the full power of virtual infrastructures (computing,
network, storage). We run the service from our <a href="."
class="ext">datacenters</a>, VMs and storage (soon) over our dark fiber network.
</p>
<p>
......
import urllib2
from django.views.generic.simple import direct_to_template
from django.conf import settings
OKEANOS_NEWS_CONTENT_URL = getattr(settings, 'OKEANOS_NEWS_CONTENT_URL', False)
OKEANOS_STATIC = getattr(settings, 'OKEANOS_STATIC_URL', '/okeanos_static/')
OKEANOS_SITE_URL = getattr(settings, 'OKEANOS_SITE_URL', '/okeanos')
OKEANOS_VIDEO_URL = getattr(settings, 'OKEANOS_VIDEO_URL', '')
......@@ -21,9 +25,27 @@ context = {
'VIDEO_HEIGHT': 360
}
def _load_news_content():
"""
Import news html content from external location
"""
data = ""
if not OKEANOS_NEWS_CONTENT_URL:
return data
try:
response = urllib2.urlopen(OKEANOS_NEWS_CONTENT_URL, '', 5)
data = response.read()
except:
pass
return data
def intro(request):
return direct_to_template(request, "okeanos/intro.html", context)
def index(request):
news_context = {'news_content':_load_news_content()}
context.update(news_context)
return direct_to_template(request, "okeanos/index.html", context)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment