Commit d2b99583 authored by Stauros Kroustouris's avatar Stauros Kroustouris

branding

parent 73db776c
from rest_framework import serializers
from flowspec.models import (
MatchProtocol,
FragmentType,
ThenAction,
Route,
MatchPort
)
class MatchProtocolSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = MatchProtocol
fields = ('protocol',)
class FragmentTypeSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = FragmentType
fields = ('fragmenttype',)
class ThenActionSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = ThenAction
fields = ('action', 'action_value')
class RouteSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = Route
fields = ('name', 'applier', 'source', 'sourceport', 'destination', 'destinationport', 'port', 'dscp', 'fragmenttype', 'protocol', 'then', 'status', 'comments', 'expires')
class PortSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = MatchPort
fields = ('port',)
from rest_framework import viewsets
from flowspec.serializers import (
MatchProtocolSerializer,
FragmentTypeSerializer,
ThenActionSerializer,
RouteSerializer,
PortSerializer
)
from flowspec.models import (
MatchProtocol,
FragmentType,
ThenAction,
Route,
MatchPort
)
class MatchProtocolViewSet(viewsets.ModelViewSet):
queryset = MatchProtocol.objects.all()
serializer_class = MatchProtocolSerializer
class FragmentTypeViewSet(viewsets.ModelViewSet):
queryset = FragmentType.objects.all()
serializer_class = FragmentTypeSerializer
class ThenActionViewSet(viewsets.ModelViewSet):
queryset = ThenAction.objects.all()
serializer_class = ThenActionSerializer
class RouteViewSet(viewsets.ModelViewSet):
queryset = Route.objects.all()
serializer_class = RouteSerializer
def pre_save(self, obj):
obj.requesters_address = self.request.META['HTTP_X_FORWARDED_FOR']
class PortViewSet(viewsets.ModelViewSet):
queryset = MatchPort.objects.all()
serializer_class = PortSerializer
This diff is collapsed.
......@@ -17,7 +17,6 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
from gevent.pool import Pool
import gevent
import json
......
{% load i18n %}
{% load staticfiles %}
<footer class="footer">
<div id="footcontainer" class="container">
{% if user.is_authenticated %}
<p>
{% blocktrans %}
If you have any questions or need help, contact {{ BRANDING.name }} Helpdesk at <a href='mailto:{{ BRANDING.email }}'>{{ BRANDING.email }}</a> or {{ BRANDING.phone }}.
{% endblocktrans %}
</p>
{% endif %}
<div style="padding-top: 10px;"><a href="https://code.grnet.gr/projects/flowspy">Version: <strong>{{ VERSION }}</strong></a> - {% blocktrans %} Designed and developed by {{ BRANDING.name }}" {% endblocktrans %}
<a href="{{ BRANDING.facebook }}" target="_blank"><img src="{{STATIC_URL}}img/facebook_img.png" alt="{{ BRANDING.name }} on Facebook" title="{{ BRANDING.name }} on Facebook"/></a> <a href="{{ BRANDING.twitter }}" target="_blank"><img src="{{STATIC_URL}}img/twitter_img.png" alt="{{ BRANDING.name }} on Twitter" title="{{ BRANDING.name }} on Twitter"/></a>
<p>
{% with BRANDING.name as name %}
{% with BRANDING.email as email %}
{% with BRANDING.phone as phone %}
{% blocktrans %}
If you have any questions or need help, contact {{ name }} Helpdesk at <a href='mailto:{{ email }}'>{{ email }}</a> or {{ phone }}.
{% endblocktrans %}
{% endwith %}
{% endwith %}
{% endwith %}
</p>
<div style="padding-top: 10px;"><a href="https://github.com/grnet/flowspy">Version: <strong>{{ VERSION }}</strong></a> - {% blocktrans %} Designed and developed by {{ BRANDING.name }}" {% endblocktrans %}
<a href="{{ BRANDING.facebook }}" target="_blank"><img src="{% static 'img/facebook_img.png' %}" alt="{{ BRANDING.name }} on Facebook" title="{{ BRANDING.name }} on Facebook"/></a> <a href="{{ BRANDING.twitter }}" target="_blank"><img src="{% static 'img/twitter_img.png' %}" alt="{{ BRANDING.name }} on Twitter" title="{{ BRANDING.name }} on Twitter"/></a>
</div>
<div class="row"><a href="{{ BRANDING.url }}">{{ BRANDING.name }}</a> | <a href="/info/{{LANGUAGE_CODE}}/">{% trans "Info" %}</a> | <a href="/tos/{{LANGUAGE_CODE}}/">{% trans "Service Terms" %}</a></div>
<div class="row">
<a href="{{ BRANDING.url }}">{{ BRANDING.name }}</a> | <a href="/info/{{ LANGUAGE_CODE }}/">{% trans "Info" %}</a> | <a href="/tos/{{ LANGUAGE_CODE }}/">{% trans "Service Terms" %}</a></div>
<div style="padding-top: 10px;">
</div>
<div style="padding-top: 10px;">
{% if BRANDING.footer_iframe %}
<iframe width="500" scrolling="no" height="50" frameborder="0" align="middle" src="{{ BRANDING.footer_iframe }}" marginwidth="0" marginheight="0"></iframe>
{% endif %}
</div>
<div style="padding-top: 10px;">
{% if BRANDING.footer_iframe %}
<iframe width="500" scrolling="no" height="50" frameborder="0" align="middle" src="{{ BRANDING.footer_iframe }}" marginwidth="0" marginheight="0"></iframe>
{% endif %}
</div>
</div>
</footer>
......@@ -60,10 +60,10 @@
<div class="well">
<h3>{% trans "What" %}?</h3><hr>
<p>
{% blocktrans %}If you are new to the service, take some time to read the{% endblocktrans %} <a href="/info/{{LANGUAGE_CODE}}/">{% trans "Service Description" %}</a>
{% blocktrans %}If you are new to the service, take some time to read the{% endblocktrans %} <a href="/info/{{ LANGUAGE_CODE }}/">{% trans "Service Description" %}</a>
</p>
<p>
{% blocktrans %}Before asking why? take some time to look at the{% endblocktrans %} <a href="/tos/{{LANGUAGE_CODE}}/">{% trans "Service Terms" %}</a>
{% blocktrans %}Before asking why? take some time to look at the{% endblocktrans %} <a href="/tos/{{ LANGUAGE_CODE }}/">{% trans "Service Terms" %}</a>
</p>
</div>
</div>
......@@ -84,7 +84,9 @@
<div class="col-lg-4">
<div class="well">
<h3>{% trans "Help" %}?</h3><hr>
<p>{% blocktrans %}For troubleshooting info and remarks do not hesitate to contact {{ BRANDING.name }}'s Helpdesk.{% endblocktrans %}</p>
{% with BRANDING.name as name %}
<p>{% blocktrans %}For troubleshooting info and remarks do not hesitate to contact {{ name }}'s Helpdesk.{% endblocktrans %}</p>
{% endwith %}
</div>
</div>
</div>
......
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