Revision 9d889386

b/snf-astakos-app/astakos/im/settings.py
84 84
GLOBAL_MESSAGES = getattr(settings, 'ASTAKOS_GLOBAL_MESSAGES', [])
85 85

  
86 86
# messages to display as extra actions in account forms
87
# e.g. {'https://cms.okeanos.grnet.gr/': 'Back to ~okeanos'}
87
# e.g. {'https://www.myhomepage.com': 'Back to <service_name>'}
88 88
PROFILE_EXTRA_LINKS = getattr(settings, 'ASTAKOS_PROFILE_EXTRA_LINKS', {})
89 89

  
90 90
# The number of unsuccessful login requests per minute allowed for a specific user
......
363 363
# Where to redirect the user after successful login when no next parameter is
364 364
# set
365 365
LOGIN_SUCCESS_URL = getattr(settings, 'ASTAKOS_LOGIN_SUCCESS_URL',
366
                            '/im/landing')
366
                            '/im/landing')
b/snf-astakos-app/astakos/im/static/im/css/modules.css
41 41
/* container */
42 42
.container .wrapper                             { padding-bottom:100px;}
43 43
.mainlogo h1									{ line-height:100%; font-size:1em; }
44
.mainlogo img 									{ max-width:100%; max-height:300px; }
44 45
.container .navigation                          { margin:20px 0 0; font-size:1.154em; height:95px;}
45 46
.container .navigation ul                       { margin:5px 0; padding:0;}
46 47
.container .navigation ul + ul					{ font-size:0.933em; }
b/snf-astakos-app/astakos/im/synnefo_settings.py
44 44
    'django.contrib.sessions',
45 45
    'django.contrib.messages',
46 46
    'django_tables2',
47
    'synnefo_branding',
47 48
#    'debug_toolbar',
48 49
]
49 50

  
......
60 61
    'astakos.im.context_processors.menu',
61 62
    'astakos.im.context_processors.custom_messages',
62 63
    'astakos.im.context_processors.last_login_method',
63
    'astakos.im.context_processors.membership_policies',
64
    'astakos.im.context_processors.membership_policies', 
64 65
    'synnefo.lib.context_processors.cloudbar'
65 66
]
66 67

  
b/snf-astakos-app/astakos/im/templates/im/account_base.html
2 2

  
3 3
{% load filters %}
4 4

  
5
{% block page.title %}Profile{% endblock %}
5
{% block page.title %}Overview{% endblock %}
6 6
{% block page.nav.classes %}{% endblock %}
7 7

  
8 8
{% block page.quicknav.items %}
b/snf-astakos-app/astakos/im/templates/im/base.html
1
{% load astakos_tags %}<!doctype html>
1
{% load astakos_tags branding_tags %}<!doctype html>
2
<html>
2 3
<head>
3 4
  {% block starthead %}{% endblock starthead %}
4 5
  <meta charset="UTF-8">
......
6 7
  <meta http-equiv="X-UA-Compatible" content="{{ resource.meta.compatibility }}">
7 8
  
8 9
  <title>
9
     {% block page.title %}Accounts{% endblock %} / GRNET Cloud Accounts 
10
    {{ BRANDING_SERVICE_NAME }} Dashboard | {% block page.title %}Overview{% endblock %}
10 11
  </title>
11 12
  
12 13
  <meta name="description" content="">
......
21 22
  {% endblock %}
22 23
  
23 24
  {% block page.favicons %}
24
  <link rel="shortcut icon" href="">
25
  <link rel="shortcut icon" href="{{ BRANDING_FAVICON_URL }}" />
25 26
  <link rel="apple-touch-icon" href="">
26 27
  {% endblock page.favicons %}
27 28

  
......
78 79

  
79 80
<body>
80 81
    <div class="container">
81
        <div class="wrapper">       
82
            
82
        <div class="wrapper">     
83 83
            {% display_messages %}
84 84

  
85 85
	        <div class="mainlogo">
86
                <a href="{% url astakos.im.views.index %}">
87
	        		<img src="{{ IM_STATIC_URL }}images/accounts-logo.png" alt="accounts" />
86
            <a href="{% url index %}">
87
	        		<img src="{{ BRANDING_DASHBOARD_LOGO_URL }}" alt="{{ BRANDING_SERVICE_NAME }} Dashboard" />
88 88
	        	</a>
89 89
	        </div>
90 90
            {% block page.nav %}
b/snf-astakos-app/astakos/im/templates/im/feedback.html
1 1
{% extends "im/account_base.html" %}
2
{% load astakos_tags i18n %}
3

  
4
{% block page.title %}Contact{% endblock %}
2 5

  
3 6
{% block body %}
4
<h2>CONTACT US </h2>
5
<p>If you would like to contact us for any reason, please feel free to 
7

  
8
<h2>{% trans "CONTACT US" %} </h2>
9
<p>
10
If you would like to contact us for any reason, please feel free to 
6 11
write <br>your message in the following form. Feedback and suggestions are<br>
7
also highly appreciated. </p>
12
also highly appreciated.</p>
8 13
<form action="{% url feedback %}" method="post"
9 14
    class="withlabels">{% csrf_token %}
10 15
    
b/snf-astakos-app/astakos/im/templates/im/footer.html
1 1
{% block footer_content %}
2 2
 
3 3
<p class="termslink" style="float:right"><a href="{% url latest_terms %}">Terms of service</a></p>
4
<p>Copyright 2011-2012 <a href="http://www.grnet.gr" target="_blank" title="GRNET S.A.">GRNET S.A.</a> All rights reserved.</p>
4
<p>Copyright {{ BRANDING_COPYRIGHT_PERIOD }} <a href="{{  BRANDING_COMPANY_URL }}" target="_blank" title="{{  BRANDING_COMPANY_NAME }}">{{  BRANDING_COMPANY_NAME_FORMAL }}</a> All rights reserved.</p>
5 5
 
6 6
{% endblock %}
7 7
 
b/snf-astakos-app/astakos/im/templates/im/how_it_works.html
3 3
{% load filters %}
4 4

  
5 5
{% block page.body %}
6

  
7 6
	<h2>HOW IT WORKS</h2>
8 7
 	<div class="centered how-it-works">
9 8
 		<div class="wrap">
b/snf-astakos-app/astakos/im/templates/im/landing.html
1 1
{% extends "im/account_base.html" %}
2 2

  
3 3
{% load filters %}
4
{% block page.title %}Overview{% endblock %}
4 5

  
5 6
{% block page.body %}
6 7
<div class="landing-page">
b/snf-astakos-app/astakos/im/templates/im/login_base.html
1 1
{% extends 'im/base_two_cols.html'%}
2 2

  
3 3
{% block signup_class %}hidden{% endblock %}
4
{% block page.title %}Login{% endblock %}
4 5

  
5 6
{% block body.left %}
6 7
	<img class="pic" src="{{ IM_STATIC_URL }}images/porta.png" />
7
	{% comment %}{% include "im/services_description.html" %}{% endcomment %}
8 8
{% endblock body.left %}
9 9
    
10 10
{% block body.right %} 
b/snf-astakos-app/astakos/im/templates/im/profile.html
1 1
{% extends "im/account_base.html" %}
2 2

  
3
{% block page.title %}Profile{% endblock %}
4

  
3 5
{% block headjs %}
4 6
	{{ block.super }}	 
5 7
	<script src="{{ IM_STATIC_URL }}js/auth_methods.js"></script>	
/dev/null
1
{% extends "im/account_base.html" %}
2

  
3
{% block body %}
4

  
5
<form action={%url edit_profile %} method="post" class="withlabels hidden-submit">{% csrf_token %}
6
    
7
    {% with profile_form as form %}
8
    {% include "im/form_render.html" %}
9
    {% endwith %}
10

  
11
    <div class="form-row submit">
12
        <input type="hidden" name="next" value="{{ next }}">
13
        <input type="hidden" name="auth" value="{{ user.auth_token }}">
14
        <input type="submit" class="submit altcol" value="UPDATE" />
15
    </div>
16

  
17

  
18
    <div class="auth_methods">
19
      <br /><br />
20
        <div class="assigned">
21
          <h2><a href="#">Available authentication methods</a></h2>
22
          <p>You can login to your account using the following methods</p>
23
          <ul class="auth_providers">
24
            {% for provider in user_providers %}
25
            <li>
26
            <h2>
27
                {{ provider.settings.title }}
28
                <span class="actions" style="margin-left: 40px">
29
                  {% for name, url in provider.settings.extra_actions %}
30
                  <a href="{{ url }}" title="{{ name }}">{{ name }}</a>
31
                  {% endfor %}
32
                  {% if provider.can_remove %}
33
                      <a href="{% url remove_auth_provider provider.pk %}" title="disble">Remove</a>
34
                  {% endif %}
35
                </span>
36
            </h2>
37
            <p>{{ provider.details_display }}</p>
38
            <br />
39
            </li>
40
            {% empty %}
41
            <li>No available authentication methods</li>
42
            {% endfor %}
43
          </ul>
44
        </div>
45
        <div class="notassigned">
46
          <p>You can add the following authentication methods to your account </p>
47
          <ul class="auth_providers">
48
            {% for provider in user_available_providers %}
49
            <li>
50
            <h2><a href="{{ provider.add_url }}">{{ provider.title }}</a></h2>
51
            <p>{{ provider.add_description }}</p>
52
            <br />
53
            </li>
54
            {% empty %}
55
            No available providers.
56
            {% endfor %}
57
          </ul>
58
        </div>
59
    </div>
60

  
61
</form>
62

  
63
<div class="two-cols-links">
64
	<p><a href="{% url password_change %}">Change Password</a></p>
65
	<p>
66
		<a href="https://okeanos.grnet.gr/home/">Back to ~okeanos</a>
67
		<a href="https://cyclades.okeanos.grnet.gr/ui/">Take me to cyclades</a>
68
		<a href="https://pithos.okeanos.grnet.gr/ui/">Take me to pithos+</a>
69
	</p>
70
</div>
71
{% endblock body %}
b/snf-astakos-app/astakos/im/templates/im/projects/intro.html
1
{% extends "im/projects/intro_base.html" %}
1 2
{% load i18n %}
3
{% block intro_top %}
2 4
<div class="two-cols clearfix">
3 5
  <div class="rt">
4 6
    &nbsp;
......
6 8
  <div class="lt">
7 9
    <p>
8 10
    {% blocktrans %}
9
    ~okeanos gives the opportunity to
11
    {{ BRANDING_SERVICE_NAME }} gives the opportunity to
10 12
    Greek Academic or Research Organizations/Institutions/Faculty
11 13
    to run their own projects remotely on virtual infrastructure.
12 14
    Simple, fast, and with minimal to no cost at all.
13
    {% endblocktrans %}
15
    {% endblocktrans %} 
14 16
    </p>
15
    <p><a href="{% url how_it_works %}" style="font-size:1.154em;">How it works ></a></p>
16 17
  </div>
17 18
</div>
18

  
19

  
20
<div class="widjets"> 
21
  <!--<a href="#" class="widjet-x" title="remove boxes">X</a>-->
22
  <ul class="clearfix">	
23
    <li class="create">
24
    <div>
25
      <div class="wrap">
26
        <p class="centered"><a href="{% url project_add %}"><img alt="THINK ABOUT IT" src="/static/im/images/create.png"></a></p>
27
        <p class="txt">
28
        {% blocktrans %}
29
	Create a new Project. Name it, describe its purpose,
30
	choose virtual resources to be granted to members, and submit.
31
	Your application will be reviewed, and if accepted,
32
	you and your colleagues are ready to deploy!<br/><br/>
33
        {% endblocktrans %}
34
	</p>
35
        <p><a href="{% url project_add %}">create a project ></a></p>
36
      </div>
37
    </div>
38
    </li>
39
    <li class="join">
40
    <div>
41
      <div class="wrap">
42
        <p class="centered"><a href="{% url project_search %}"><img alt="THINK ABOUT IT" src="/static/im/images/join.png"></a></p>
43
        <p class="txt">
44
        {% blocktrans %}
45
	Request to be a member of an existing Project
46
	and instantly gain access to the resources it has to offer you.
47
	Search for public Projects, or submit a join request to a private Project,
48
	if you think its administrators will accept you.
49
	In short: try to Join now.
50
        {% endblocktrans %}
51
	</p>
52
        <p><a href="{% url project_search %}">join a project ></a></p>
53
      </div>
54
    </div>
55
    </li>
56
  </ul>
57
</div>
19
{% endblock %}
b/snf-astakos-app/astakos/im/templates/im/projects/intro_base.html
1
{% load i18n %}
2

  
3
{% block intro_top %}{% endblock intro_top %}
4

  
5
<div class="widjets"> 
6
  <!--<a href="#" class="widjet-x" title="remove boxes">X</a>-->
7
  <ul class="clearfix"> 
8
    <li class="create">
9
    <div>
10
      <div class="wrap">
11
        <p class="centered"><a href="{% url project_add %}"><img alt="THINK ABOUT IT" src="/static/im/images/create.png"></a></p>
12
        <p class="txt">
13
        {% blocktrans %}
14
  Create a new Project. Name it, describe its purpose,
15
  choose virtual resources to be granted to members, and submit.
16
  Your application will be reviewed, and if accepted,
17
  you and your colleagues are ready to deploy!<br/><br/>
18
        {% endblocktrans %}
19
  </p>
20
        <p><a href="{% url project_add %}">create a project ></a></p>
21
      </div>
22
    </div>
23
    </li>
24
    <li class="join">
25
    <div>
26
      <div class="wrap">
27
        <p class="centered"><a href="{% url project_search %}"><img alt="THINK ABOUT IT" src="/static/im/images/join.png"></a></p>
28
        <p class="txt">
29
        {% blocktrans %}
30
  Request to be a member of an existing Project
31
  and instantly gain access to the resources it has to offer you.
32
  Search for public Projects, or submit a join request to a private Project,
33
  if you think its administrators will accept you.
34
  In short: try to Join now.
35
        {% endblocktrans %}
36
  </p>
37
        <p><a href="{% url project_search %}">join a project ></a></p>
38
      </div>
39
    </div>
40
    </li>
41
  </ul>
42
</div>
/dev/null
1
{% extends "im/account_base.html" %}
2
{% block page.subnav %}
3

  
4
	<li><a href="../">Overview</a></li>
5
	<li class="active"><a href="#">Create</a></li>
6
	<li><a href="../join/">Join</a></li>
7

  
8
{%endblock %}
9
{% block body %}
10
<div class="projects">
11
	<div class="clearfix">
12
		<p>You can create the followind type of projects:</p>
13
	</div>
14
	
15
	<div class="two-cols clearfix dotted">
16
		<div class="rt centered">
17
			<img alt="THINK ABOUT IT" src="/static/medialibrary/2012/04/proffessor.png">
18
		</div>
19
		<div class="lt">
20
			<h2 style="color:#B66D00;">COURSE</h2>
21
	    	<div>
22
	    		<p>You wake up one morning and you need a new computer with a specific operating system and hardware requirements (or 10 new computers). You also need 10GB of storage space to store some new content you just got your hands on (or 50GB ;-)).</p>
23
	    		<a href="course/" class="submit">CREATE COURSE</a>
24
	    	</div>
25
		</div>
26
	</div>
27
	<div class="two-cols clearfix dotted">
28
		<div class="rt centered">
29
			<img alt="THINK ABOUT IT" src="/static/medialibrary/2012/06/behind_okeanos.png">
30
		</div>
31
		<div class="lt">
32
			<h2 style="color:#4085A6;">PROJECT</h2>
33
	    	<div>
34
	    		<p>You wake up one morning and you need a new computer with a specific operating system and hardware requirements (or 10 new computers). You also need 10GB of storage space to store some new content you just got your hands on (or 50GB ;-)).</p>
35
	    		<a href="#" class="submit">CREATE PROJECT</a>
36
	    	</div>
37
		</div>
38
	</div>
39
	<div class="two-cols clearfix dotted">
40
		<div class="rt centered">
41
			<img alt="THINK ABOUT IT" src="/static/medialibrary/2012/06/from_athens.png">
42
		</div>
43
		<div class="lt">
44
			<h2 style="color:#EF4F54;">ORGANISATION</h2>
45
	    	<div>
46
	    		<p>You wake up one morning and you need a new computer with a specific operating system and hardware requirements (or 10 new computers). You also need 10GB of storage space to store some new content you just got your hands on (or 50GB ;-)).</p>
47
	    		<a href="#" class="submit">CREATE ORGANISATION</a>
48
	    	</div>
49
		</div>
50
	</div>
51
	<div class="two-cols clearfix dotted">
52
		<div class="rt centered">
53
			<img alt="THINK ABOUT IT" src="/static/medialibrary/2012/04/researcher.png">
54
		</div>
55
		<div class="lt">
56
			<h2 style="color:#FF7CA4;">LAB</h2>
57
	    	<div>
58
	    		<p>You wake up one morning and you need a new computer with a specific operating system and hardware requirements (or 10 new computers). You also need 10GB of storage space to store some new content you just got your hands on (or 50GB ;-)).</p>
59
	    		<a href="{% url group_add 'laboratory' %}" class="submit">CREATE LAB</a>
60
	    	</div>
61
		</div>
62
	</div>
63
</div>
64

  
65
{% endblock body %}
b/snf-astakos-app/astakos/im/templates/im/projects/project_list.html
1 1
{% extends "im/account_base.html" %}
2 2
{% load astakos_tags filters django_tables2 %}
3 3

  
4
{% block page.title %}Projects{% endblock %}
5

  
4 6
{% block page.body %} 
5 7
<div class="maincol {% block innerpage.class %}{% endblock %}">
6 8
    <div class="projects">
b/snf-astakos-app/astakos/im/templates/im/projects/projectapplication_form.html
15 15

  
16 16
{% if not show_form %}
17 17
<p>These are the specifications of the Project you want to create. If you hit the "Submit" button
18
this form will be officially sent to GRNET for review. Please make sure the following reflect
18
this form will be officially sent to {{ BRANDING_COMPANY_NAME }} for review. Please make sure the following reflect
19 19
exactly your request.</p>
20 20
{% endif %}
21 21

  
......
29 29
		    	<em>more info</em>
30 30
                <span> To create a new Project, first enter the following
31 31
                    required fields.  The information you enter, except
32
                    <i>Comments for review</i>, will be visible to all ~okeanos
32
                    <i>Comments for review</i>, will be visible to all {{ BRANDING_SERVICE_NAME }}
33 33
                    users. </span>
34 34
	    	</span>    		
35 35
    	</legend>
b/snf-astakos-app/astakos/im/templates/im/resource_usage.html
7 7
<script src="{{ IM_STATIC_URL }}js/usage.js"></script>	
8 8
{% endblock %}
9 9

  
10
{% block page.title %}Usage{% endblock %}
11

  
10 12
{% block page.body %}
11 13
<div class="maincol {% block innerpage.class %}{% endblock %}"> 
12 14
	<h2>RESOURCE USAGE</h2>
/dev/null
1
<div class="section">
2
    <h2>GRNET SERVICES</h2>
3
    <!--<p>
4
    There will be some text here explaining about what i am signing up for
5
    right? There will be some text here explaining about what i am signing up for
6
    right? There will be some text here explaining about what i am signing up for
7
    right? 
8
    </p>-->
9
</div>
10
<div class="section service-desc okeanos">
11
    <h2>
12
        <img class="pic" src="{{ IM_STATIC_URL }}images/service_okeanos_logo.png" />
13
    </h2>
14
    <!--<p>
15
    There will be some text here explaining about what i am signing up for
16
    right? There will be some text here explaining about what i am signing up for
17
    right? There will be some text here explaining about what i am signing up for
18
    right? 
19
    </p>-->
20
</div>
21
<div class="section service-desc">
22
    <h2>
23
        <img class="pic" src="{{ IM_STATIC_URL }}images/service_pithos_logo.png" />
24
    </h2>
25
    <!--<p>
26
    There will be some text here explaining about what i am signing up for
27
    right? There will be some text here explaining about what i am signing up for
28
    right? There will be some text here explaining about what i am signing up for
29
    right? 
30
    </p>-->
31
</div>
32

  
b/snf-astakos-app/astakos/im/templates/im/signup.html
13 13
	<img class="pic" src="{{ IM_STATIC_URL }}images/ringer1.png" />
14 14
{% endif %}
15 15
</div> 
16
{% comment %}{% include "im/services_description.html" %}{% endcomment %}
17 16
{% endblock body.left %}
18 17

  
19 18
{% block body.right %}
b/snf-astakos-app/astakos/im/templates/im/third_party_check_local.html
6 6

  
7 7
{% block body.left %}
8 8
    <img class="pic" src="{{ IM_STATIC_URL }}images/pictures/accounts_3.png" />
9
{% comment %}{% include "im/services_description.html" %}{% endcomment %}
10 9
{% endblock body.left %}
11 10

  
12 11
{% block body.right %}
b/snf-astakos-app/astakos/im/templates/registration/password_reset_form.html
8 8
<div class="section">
9 9
    <img class="pic" src="{{ IM_STATIC_URL }}images/break_glass.jpeg" />
10 10
</div>
11
{% comment %}{% include "im/services_description.html" %}{% endcomment %}
12 11
{% endblock body.left %}
13 12
    
14 13
{% block body.right %}
b/snf-astakos-app/astakos/im/templatetags/astakos_tags.py
205 205
    if "?" in url:
206 206
        joinchar = "&"
207 207

  
208
    return "%s%s%s" % (provider.add_url, joinchar, urllib.urlencode(attrs))
209

  
208
    return "%s%s%s" % (provider.add_url, joinchar, urllib.urlencode(attrs))
b/snf-astakos-app/conf/terms-sample.html
1
<h1>Okeanos terms</h1>
1
<h1>Synnefo terms</h1>
2 2
<div class="date">Last modified: 22 Feb 2012</div>
3 3
<p>
4 4
You must follow any policies made available to you within the Services.
......
42 42
of some of those communications.
43 43
</p>
44 44

  
45
<h3>1.1.1 Terms heading</h1>
45
<h3>1.1.1 Terms heading</h3>
46 46
<p>
47 47
Our Services display some content that is not Google’s. This content is the
48 48
sole responsibility of the entity that makes it available. We may review
b/snf-branding/COPYRIGHT
1
Copyright 2013 GRNET S.A. All rights reserved.
2

  
3
Redistribution and use in source and binary forms, with or
4
without modification, are permitted provided that the following
5
conditions are met:
6

  
7
  1. Redistributions of source code must retain the above
8
     copyright notice, this list of conditions and the following
9
     disclaimer.
10

  
11
  2. Redistributions in binary form must reproduce the above
12
     copyright notice, this list of conditions and the following
13
     disclaimer in the documentation and/or other materials
14
     provided with the distribution.
15

  
16
THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
17
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
20
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24
AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
POSSIBILITY OF SUCH DAMAGE.
28

  
29
The views and conclusions contained in the software and
30
documentation are those of the authors and should not be
31
interpreted as representing official policies, either expressed
32
or implied, of GRNET S.A.
b/snf-branding/Changelog
1
Changelog
2
---------
3

  
4
v0.1.0
5
*******
6
	* Initial release
b/snf-branding/MANIFEST.in
1
include README Changelog
2
include distribute_setup.py
b/snf-branding/README
1
README
2
=======
3

  
4
synnefo_branding app
b/snf-branding/distribute_setup.py
1
#!python
2
"""Bootstrap distribute installation
3

  
4
If you want to use setuptools in your package's setup.py, just include this
5
file in the same directory with it, and add this to the top of your setup.py::
6

  
7
    from distribute_setup import use_setuptools
8
    use_setuptools()
9

  
10
If you want to require a specific version of setuptools, set a download
11
mirror, or use an alternate download directory, you can do so by supplying
12
the appropriate options to ``use_setuptools()``.
13

  
14
This file can also be run as a script to install or upgrade setuptools.
15
"""
16
import os
17
import sys
18
import time
19
import fnmatch
20
import tempfile
21
import tarfile
22
from distutils import log
23

  
24
try:
25
    from site import USER_SITE
26
except ImportError:
27
    USER_SITE = None
28

  
29
try:
30
    import subprocess
31

  
32
    def _python_cmd(*args):
33
        args = (sys.executable,) + args
34
        return subprocess.call(args) == 0
35

  
36
except ImportError:
37
    # will be used for python 2.3
38
    def _python_cmd(*args):
39
        args = (sys.executable,) + args
40
        # quoting arguments if windows
41
        if sys.platform == 'win32':
42
            def quote(arg):
43
                if ' ' in arg:
44
                    return '"%s"' % arg
45
                return arg
46
            args = [quote(arg) for arg in args]
47
        return os.spawnl(os.P_WAIT, sys.executable, *args) == 0
48

  
49
DEFAULT_VERSION = "0.6.10"
50
DEFAULT_URL = "http://pypi.python.org/packages/source/d/distribute/"
51
SETUPTOOLS_FAKED_VERSION = "0.6c11"
52

  
53
SETUPTOOLS_PKG_INFO = """\
54
Metadata-Version: 1.0
55
Name: setuptools
56
Version: %s
57
Summary: xxxx
58
Home-page: xxx
59
Author: xxx
60
Author-email: xxx
61
License: xxx
62
Description: xxx
63
""" % SETUPTOOLS_FAKED_VERSION
64

  
65

  
66
def _install(tarball):
67
    # extracting the tarball
68
    tmpdir = tempfile.mkdtemp()
69
    log.warn('Extracting in %s', tmpdir)
70
    old_wd = os.getcwd()
71
    try:
72
        os.chdir(tmpdir)
73
        tar = tarfile.open(tarball)
74
        _extractall(tar)
75
        tar.close()
76

  
77
        # going in the directory
78
        subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
79
        os.chdir(subdir)
80
        log.warn('Now working in %s', subdir)
81

  
82
        # installing
83
        log.warn('Installing Distribute')
84
        if not _python_cmd('setup.py', 'install'):
85
            log.warn('Something went wrong during the installation.')
86
            log.warn('See the error message above.')
87
    finally:
88
        os.chdir(old_wd)
89

  
90

  
91
def _build_egg(egg, tarball, to_dir):
92
    # extracting the tarball
93
    tmpdir = tempfile.mkdtemp()
94
    log.warn('Extracting in %s', tmpdir)
95
    old_wd = os.getcwd()
96
    try:
97
        os.chdir(tmpdir)
98
        tar = tarfile.open(tarball)
99
        _extractall(tar)
100
        tar.close()
101

  
102
        # going in the directory
103
        subdir = os.path.join(tmpdir, os.listdir(tmpdir)[0])
104
        os.chdir(subdir)
105
        log.warn('Now working in %s', subdir)
106

  
107
        # building an egg
108
        log.warn('Building a Distribute egg in %s', to_dir)
109
        _python_cmd('setup.py', '-q', 'bdist_egg', '--dist-dir', to_dir)
110

  
111
    finally:
112
        os.chdir(old_wd)
113
    # returning the result
114
    log.warn(egg)
115
    if not os.path.exists(egg):
116
        raise IOError('Could not build the egg.')
117

  
118

  
119
def _do_download(version, download_base, to_dir, download_delay):
120
    egg = os.path.join(to_dir, 'distribute-%s-py%d.%d.egg'
121
                       % (version, sys.version_info[0], sys.version_info[1]))
122
    if not os.path.exists(egg):
123
        tarball = download_setuptools(version, download_base,
124
                                      to_dir, download_delay)
125
        _build_egg(egg, tarball, to_dir)
126
    sys.path.insert(0, egg)
127
    import setuptools
128
    setuptools.bootstrap_install_from = egg
129

  
130

  
131
def use_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
132
                   to_dir=os.curdir, download_delay=15, no_fake=True):
133
    # making sure we use the absolute path
134
    to_dir = os.path.abspath(to_dir)
135
    was_imported = 'pkg_resources' in sys.modules or \
136
        'setuptools' in sys.modules
137
    try:
138
        try:
139
            import pkg_resources
140
            if not hasattr(pkg_resources, '_distribute'):
141
                if not no_fake:
142
                    _fake_setuptools()
143
                raise ImportError
144
        except ImportError:
145
            return _do_download(version, download_base, to_dir, download_delay)
146
        try:
147
            pkg_resources.require("distribute>="+version)
148
            return
149
        except pkg_resources.VersionConflict:
150
            e = sys.exc_info()[1]
151
            if was_imported:
152
                sys.stderr.write(
153
                "The required version of distribute (>=%s) is not available,\n"
154
                "and can't be installed while this script is running. Please\n"
155
                "install a more recent version first, using\n"
156
                "'easy_install -U distribute'."
157
                "\n\n(Currently using %r)\n" % (version, e.args[0]))
158
                sys.exit(2)
159
            else:
160
                del pkg_resources, sys.modules['pkg_resources']    # reload ok
161
                return _do_download(version, download_base, to_dir,
162
                                    download_delay)
163
        except pkg_resources.DistributionNotFound:
164
            return _do_download(version, download_base, to_dir,
165
                                download_delay)
166
    finally:
167
        if not no_fake:
168
            _create_fake_setuptools_pkg_info(to_dir)
169

  
170
def download_setuptools(version=DEFAULT_VERSION, download_base=DEFAULT_URL,
171
                        to_dir=os.curdir, delay=15):
172
    """Download distribute from a specified location and return its filename
173

  
174
    `version` should be a valid distribute version number that is available
175
    as an egg for download under the `download_base` URL (which should end
176
    with a '/'). `to_dir` is the directory where the egg will be downloaded.
177
    `delay` is the number of seconds to pause before an actual download
178
    attempt.
179
    """
180
    # making sure we use the absolute path
181
    to_dir = os.path.abspath(to_dir)
182
    try:
183
        from urllib.request import urlopen
184
    except ImportError:
185
        from urllib2 import urlopen
186
    tgz_name = "distribute-%s.tar.gz" % version
187
    url = download_base + tgz_name
188
    saveto = os.path.join(to_dir, tgz_name)
189
    src = dst = None
190
    if not os.path.exists(saveto):  # Avoid repeated downloads
191
        try:
192
            log.warn("Downloading %s", url)
193
            src = urlopen(url)
194
            # Read/write all in one block, so we don't create a corrupt file
195
            # if the download is interrupted.
196
            data = src.read()
197
            dst = open(saveto, "wb")
198
            dst.write(data)
199
        finally:
200
            if src:
201
                src.close()
202
            if dst:
203
                dst.close()
204
    return os.path.realpath(saveto)
205

  
206
def _no_sandbox(function):
207
    def __no_sandbox(*args, **kw):
208
        try:
209
            from setuptools.sandbox import DirectorySandbox
210
            if not hasattr(DirectorySandbox, '_old'):
211
                def violation(*args):
212
                    pass
213
                DirectorySandbox._old = DirectorySandbox._violation
214
                DirectorySandbox._violation = violation
215
                patched = True
216
            else:
217
                patched = False
218
        except ImportError:
219
            patched = False
220

  
221
        try:
222
            return function(*args, **kw)
223
        finally:
224
            if patched:
225
                DirectorySandbox._violation = DirectorySandbox._old
226
                del DirectorySandbox._old
227

  
228
    return __no_sandbox
229

  
230
def _patch_file(path, content):
231
    """Will backup the file then patch it"""
232
    existing_content = open(path).read()
233
    if existing_content == content:
234
        # already patched
235
        log.warn('Already patched.')
236
        return False
237
    log.warn('Patching...')
238
    _rename_path(path)
239
    f = open(path, 'w')
240
    try:
241
        f.write(content)
242
    finally:
243
        f.close()
244
    return True
245

  
246
_patch_file = _no_sandbox(_patch_file)
247

  
248
def _same_content(path, content):
249
    return open(path).read() == content
250

  
251
def _rename_path(path):
252
    new_name = path + '.OLD.%s' % time.time()
253
    log.warn('Renaming %s into %s', path, new_name)
254
    os.rename(path, new_name)
255
    return new_name
256

  
257
def _remove_flat_installation(placeholder):
258
    if not os.path.isdir(placeholder):
259
        log.warn('Unkown installation at %s', placeholder)
260
        return False
261
    found = False
262
    for file in os.listdir(placeholder):
263
        if fnmatch.fnmatch(file, 'setuptools*.egg-info'):
264
            found = True
265
            break
266
    if not found:
267
        log.warn('Could not locate setuptools*.egg-info')
268
        return
269

  
270
    log.warn('Removing elements out of the way...')
271
    pkg_info = os.path.join(placeholder, file)
272
    if os.path.isdir(pkg_info):
273
        patched = _patch_egg_dir(pkg_info)
274
    else:
275
        patched = _patch_file(pkg_info, SETUPTOOLS_PKG_INFO)
276

  
277
    if not patched:
278
        log.warn('%s already patched.', pkg_info)
279
        return False
280
    # now let's move the files out of the way
281
    for element in ('setuptools', 'pkg_resources.py', 'site.py'):
282
        element = os.path.join(placeholder, element)
283
        if os.path.exists(element):
284
            _rename_path(element)
285
        else:
286
            log.warn('Could not find the %s element of the '
287
                     'Setuptools distribution', element)
288
    return True
289

  
290
_remove_flat_installation = _no_sandbox(_remove_flat_installation)
291

  
292
def _after_install(dist):
293
    log.warn('After install bootstrap.')
294
    placeholder = dist.get_command_obj('install').install_purelib
295
    _create_fake_setuptools_pkg_info(placeholder)
296

  
297
def _create_fake_setuptools_pkg_info(placeholder):
298
    if not placeholder or not os.path.exists(placeholder):
299
        log.warn('Could not find the install location')
300
        return
301
    pyver = '%s.%s' % (sys.version_info[0], sys.version_info[1])
302
    setuptools_file = 'setuptools-%s-py%s.egg-info' % \
303
            (SETUPTOOLS_FAKED_VERSION, pyver)
304
    pkg_info = os.path.join(placeholder, setuptools_file)
305
    if os.path.exists(pkg_info):
306
        log.warn('%s already exists', pkg_info)
307
        return
308

  
309
    log.warn('Creating %s', pkg_info)
310
    f = open(pkg_info, 'w')
311
    try:
312
        f.write(SETUPTOOLS_PKG_INFO)
313
    finally:
314
        f.close()
315

  
316
    pth_file = os.path.join(placeholder, 'setuptools.pth')
317
    log.warn('Creating %s', pth_file)
318
    f = open(pth_file, 'w')
319
    try:
320
        f.write(os.path.join(os.curdir, setuptools_file))
321
    finally:
322
        f.close()
323

  
324
_create_fake_setuptools_pkg_info = _no_sandbox(_create_fake_setuptools_pkg_info)
325

  
326
def _patch_egg_dir(path):
327
    # let's check if it's already patched
328
    pkg_info = os.path.join(path, 'EGG-INFO', 'PKG-INFO')
329
    if os.path.exists(pkg_info):
330
        if _same_content(pkg_info, SETUPTOOLS_PKG_INFO):
331
            log.warn('%s already patched.', pkg_info)
332
            return False
333
    _rename_path(path)
334
    os.mkdir(path)
335
    os.mkdir(os.path.join(path, 'EGG-INFO'))
336
    pkg_info = os.path.join(path, 'EGG-INFO', 'PKG-INFO')
337
    f = open(pkg_info, 'w')
338
    try:
339
        f.write(SETUPTOOLS_PKG_INFO)
340
    finally:
341
        f.close()
342
    return True
343

  
344
_patch_egg_dir = _no_sandbox(_patch_egg_dir)
345

  
346
def _before_install():
347
    log.warn('Before install bootstrap.')
348
    _fake_setuptools()
349

  
350

  
351
def _under_prefix(location):
352
    if 'install' not in sys.argv:
353
        return True
354
    args = sys.argv[sys.argv.index('install')+1:]
355
    for index, arg in enumerate(args):
356
        for option in ('--root', '--prefix'):
357
            if arg.startswith('%s=' % option):
358
                top_dir = arg.split('root=')[-1]
359
                return location.startswith(top_dir)
360
            elif arg == option:
361
                if len(args) > index:
362
                    top_dir = args[index+1]
363
                    return location.startswith(top_dir)
364
        if arg == '--user' and USER_SITE is not None:
365
            return location.startswith(USER_SITE)
366
    return True
367

  
368

  
369
def _fake_setuptools():
370
    log.warn('Scanning installed packages')
371
    try:
372
        import pkg_resources
373
    except ImportError:
374
        # we're cool
375
        log.warn('Setuptools or Distribute does not seem to be installed.')
376
        return
377
    ws = pkg_resources.working_set
378
    try:
379
        setuptools_dist = ws.find(pkg_resources.Requirement.parse('setuptools',
380
                                  replacement=False))
381
    except TypeError:
382
        # old distribute API
383
        setuptools_dist = ws.find(pkg_resources.Requirement.parse('setuptools'))
384

  
385
    if setuptools_dist is None:
386
        log.warn('No setuptools distribution found')
387
        return
388
    # detecting if it was already faked
389
    setuptools_location = setuptools_dist.location
390
    log.warn('Setuptools installation detected at %s', setuptools_location)
391

  
392
    # if --root or --preix was provided, and if
393
    # setuptools is not located in them, we don't patch it
394
    if not _under_prefix(setuptools_location):
395
        log.warn('Not patching, --root or --prefix is installing Distribute'
396
                 ' in another location')
397
        return
398

  
399
    # let's see if its an egg
400
    if not setuptools_location.endswith('.egg'):
401
        log.warn('Non-egg installation')
402
        res = _remove_flat_installation(setuptools_location)
403
        if not res:
404
            return
405
    else:
406
        log.warn('Egg installation')
407
        pkg_info = os.path.join(setuptools_location, 'EGG-INFO', 'PKG-INFO')
408
        if (os.path.exists(pkg_info) and
409
            _same_content(pkg_info, SETUPTOOLS_PKG_INFO)):
410
            log.warn('Already patched.')
411
            return
412
        log.warn('Patching...')
413
        # let's create a fake egg replacing setuptools one
414
        res = _patch_egg_dir(setuptools_location)
415
        if not res:
416
            return
417
    log.warn('Patched done.')
418
    _relaunch()
419

  
420

  
421
def _relaunch():
422
    log.warn('Relaunching...')
423
    # we have to relaunch the process
424
    # pip marker to avoid a relaunch bug
425
    if sys.argv[:3] == ['-c', 'install', '--single-version-externally-managed']:
426
        sys.argv[0] = 'setup.py'
427
    args = [sys.executable] + sys.argv
428
    sys.exit(subprocess.call(args))
429

  
430

  
431
def _extractall(self, path=".", members=None):
432
    """Extract all members from the archive to the current working
433
       directory and set owner, modification time and permissions on
434
       directories afterwards. `path' specifies a different directory
435
       to extract to. `members' is optional and must be a subset of the
436
       list returned by getmembers().
437
    """
438
    import copy
439
    import operator
440
    from tarfile import ExtractError
441
    directories = []
442

  
443
    if members is None:
444
        members = self
445

  
446
    for tarinfo in members:
447
        if tarinfo.isdir():
448
            # Extract directories with a safe mode.
449
            directories.append(tarinfo)
450
            tarinfo = copy.copy(tarinfo)
451
            tarinfo.mode = 448 # decimal for oct 0700
452
        self.extract(tarinfo, path)
453

  
454
    # Reverse sort directories.
455
    if sys.version_info < (2, 4):
456
        def sorter(dir1, dir2):
457
            return cmp(dir1.name, dir2.name)
458
        directories.sort(sorter)
459
        directories.reverse()
460
    else:
461
        directories.sort(key=operator.attrgetter('name'), reverse=True)
462

  
463
    # Set correct owner, mtime and filemode on directories.
464
    for tarinfo in directories:
465
        dirpath = os.path.join(path, tarinfo.name)
466
        try:
467
            self.chown(tarinfo, dirpath)
468
            self.utime(tarinfo, dirpath)
469
            self.chmod(tarinfo, dirpath)
470
        except ExtractError:
471
            e = sys.exc_info()[1]
472
            if self.errorlevel > 1:
473
                raise
474
            else:
475
                self._dbg(1, "tarfile: %s" % e)
476

  
477

  
478
def main(argv, version=DEFAULT_VERSION):
479
    """Install or upgrade setuptools and EasyInstall"""
480
    tarball = download_setuptools()
481
    _install(tarball)
482

  
483

  
484
if __name__ == '__main__':
485
    main(sys.argv[1:])
b/snf-branding/setup.py
1
# Copyright 2011 GRNET S.A. All rights reserved.
2
#
3
# Redistribution and use in source and binary forms, with or
4
# without modification, are permitted provided that the following
5
# conditions are met:
6
#
7
#   1. Redistributions of source code must retain the above
8
#      copyright notice, this list of conditions and the following
9
#      disclaimer.
10
#
11
#   2. Redistributions in binary form must reproduce the above
12
#      copyright notice, this list of conditions and the following
13
#      disclaimer in the documentation and/or other materials
14
#      provided with the distribution.
15
#
16
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
17
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
20
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
# POSSIBILITY OF SUCH DAMAGE.
28
#
29
# The views and conclusions contained in the software and
30
# documentation are those of the authors and should not be
31
# interpreted as representing official policies, either expressed
32
# or implied, of GRNET S.A.
33
#
34

  
35
import distribute_setup
36
distribute_setup.use_setuptools()
37

  
38
import os
39

  
40
from setuptools import setup, find_packages
41

  
42
HERE = os.path.abspath(os.path.normpath(os.path.dirname(__file__)))
43

  
44
from synnefo_branding.version import __version__
45

  
46
# Package info
47
VERSION = __version__
48
README = open(os.path.join(HERE, 'README')).read()
49
CHANGES = open(os.path.join(HERE, 'Changelog')).read()
50
SHORT_DESCRIPTION = 'Synnefo stats grapher'
51

  
52
PACKAGES_ROOT = '.'
53
PACKAGES = find_packages(PACKAGES_ROOT)
54

  
55
# Package meta
56
CLASSIFIERS = []
57

  
58
# Package requirements
59
INSTALL_REQUIRES = [
60
]
61

  
62
setup(
63
    name='snf-branding-app',
64
    version=VERSION,
65
    license='BSD',
66
    url='http://www.synnefo.org/',
67
    description=SHORT_DESCRIPTION,
68
    long_description=README + '\n\n' + CHANGES,
69
    classifiers=CLASSIFIERS,
70

  
71
    author='Synnefo development team',
72
    author_email='synnefo-devel@googlegroups.com',
73
    maintainer='Synnefo development team',
74
    maintainer_email='synnefo-devel@googlegroups.com',
75

  
76
    packages=PACKAGES,
77
    package_dir={'': PACKAGES_ROOT},
78
    include_package_data=True,
79
    zip_safe=False,
80

  
81
    install_requires=INSTALL_REQUIRES,
82

  
83
    dependency_links=['http://docs.dev.grnet.gr/pypi'],
84
    entry_points={
85
        'synnefo': [ 
86
             'web_apps = synnefo_branding.synnefo_settings:installed_apps',  
87
             'web_context_processors = synnefo_branding.synnefo_settings:context_processors',
88
             'web_static = synnefo_branding.synnefo_settings:static_files',
89
        ]
90
    }
91
)
b/snf-branding/synnefo_branding/context_processors.py
1
# Copyright 2013 GRNET S.A. All rights reserved.
2
#
3
# Redistribution and use in source and binary forms, with or
4
# without modification, are permitted provided that the following
5
# conditions are met:
6
#
7
#   1. Redistributions of source code must retain the above
8
#      copyright notice, this list of conditions and the following
9
#      disclaimer.
10
#
11
#   2. Redistributions in binary form must reproduce the above
12
#      copyright notice, this list of conditions and the following
13
#      disclaimer in the documentation and/or other materials
14
#      provided with the distribution.
15
#
16
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
17
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
20
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
# POSSIBILITY OF SUCH DAMAGE.
28
#
29
# The views and conclusions contained in the software and
30
# documentation are those of the authors and should not be
31
# interpreted as representing official policies, either expressed
32
# or implied, of GRNET S.A.
33

  
34
from synnefo_branding import utils
35

  
36
def branding(request):
37
	dct = {}
38
	for key, value in utils.get_branding_dict().iteritems():
39
		dct['BRANDING_%s' % key.upper()] = value
40
	return dct
b/snf-branding/synnefo_branding/settings.py
1
from django.conf import settings
2
import datetime
3

  
4
IMAGE_MEDIA_URL = settings.MEDIA_URL+'branding/images/'
5
COMPANY_NAME = getattr(settings, 'BRANDING_COMPANY_NAME', 'cool company')
6
COMPANY_NAME_FORMAL = getattr(settings, 'BRANDING_COMPANY_NAME_FORMAL',
7
	                          'Cool company SARL')
8
period_default = '2011-%s' % (datetime.datetime.now().year)
9

  
10
# Defaults to 2011-<current_year>
11
COPYRIGHT_PERIOD = getattr(settings, 'BRANDING_COPYRIGHT_PERIOD', 
12
						   period_default)
13

  
14
copyright_message = 'Copyright (c) %s %s' % (COPYRIGHT_PERIOD, 
15
											 COMPANY_NAME_FORMAL)
16
COPYRIGHT_MESSAGE = getattr(settings, 'BRANDING_COPYRIGHT_MESSAGE', 
17
						    copyright_message)
18

  
19
COMPANY_URL = getattr(settings, 'BRANDING_COMPANY_URL', 
20
						    'http://www.coolcompany.com')
21
SERVICE_NAME = getattr(settings, 'BRANDING_SERVICE_NAME', 'Synnefo')
22
SERVICE_URL = getattr(settings, 'BRANDING_SERVICE_URL', 'www.Synnefo.org')
23

  
24

  
25
FAVICON_URL = getattr(settings, 'BRANDING_FAVICON_URL', 
26
			settings.MEDIA_URL+'branding/images/favicon.ico')
27

  
28
# Used in Dashboard pages (Astakos)
29
DASHBOARD_LOGO_URL = getattr(settings, 'BRANDING_DASHBOARD_LOGO_URL', 
30
					 settings.MEDIA_URL+'branding/images/dashboard_logo.png')
31
# Used in Compute pages (Cyclades)
32
COMPUTE_LOGO_URL = getattr(settings, 'BRANDING_COMPUTE_LOGO_URL',
33
					settings.MEDIA_URL+'branding/images/compute_logo.png')
34
# Used in Console page for VM (Cyclades)
35
CONSOLE_LOGO_URL = getattr(settings, 'BRANDING_CONSOLE_LOGO_URL',
36
					settings.MEDIA_URL+'branding/images/console_logo.png')
37

  
38

  
39
SERVICE_ABOUT_URL = getattr(settings, 'BRANDING_SERVICE_ABOUT_URL', 
40
							 'https://okeanos.grnet.gr/about/what/ ')
41
SERVICE_CONTACT_URL = getattr(settings, 'BRANDING_SERVICE_CONTACT_URL', 
42
							 'https://accounts.okeanos.grnet.gr/im/feedback ')
43
SERVICE_SUPPORT_URL = getattr(settings, 'BRANDING_SERVICE_SUPPORT_URL', 
44
							 'https://okeanos.grnet.gr/support/general/ ')
b/snf-branding/synnefo_branding/synnefo_settings.py
1
# Copyright 2011-2013 GRNET S.A. All rights reserved.
2
#
3
# Redistribution and use in source and binary forms, with or
4
# without modification, are permitted provided that the following
5
# conditions are met:
6
#
7
#   1. Redistributions of source code must retain the above
8
#      copyright notice, this list of conditions and the following
9
#      disclaimer.
10
#
11
#   2. Redistributions in binary form must reproduce the above
12
#      copyright notice, this list of conditions and the following
13
#      disclaimer in the documentation and/or other materials
14
#      provided with the distribution.
15
#
16
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
17
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
20
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
# POSSIBILITY OF SUCH DAMAGE.
28
#
29
# The views and conclusions contained in the software and
30
# documentation are those of the authors and should not be
31
# interpreted as representing official policies, either expressed
32
# or implied, of GRNET S.A.
33
#
34

  
35

  
36
"""
37
Django settings metadata. To be used in setup.py snf-webproject entry points.
38
"""
39

  
40
installed_apps = ['synnefo_branding'] 
41
context_processors = ['synnefo_branding.context_processors.branding']
42
static_files = {'synnefo_branding': ''}
b/snf-branding/synnefo_branding/templatetags/branding_tags.py
1
# Copyright 2011 GRNET S.A. All rights reserved.
2
#
3
# Redistribution and use in source and binary forms, with or
4
# without modification, are permitted provided that the following
5
# conditions are met:
6
#
7
#   1. Redistributions of source code must retain the above
8
#      copyright notice, this list of conditions and the following
9
#      disclaimer.
10
#
11
#   2. Redistributions in binary form must reproduce the above
12
#      copyright notice, this list of conditions and the following
13
#      disclaimer in the documentation and/or other materials
14
#      provided with the distribution.
15
#
16
# THIS SOFTWARE IS PROVIDED BY GRNET S.A. ``AS IS'' AND ANY EXPRESS
17
# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL GRNET S.A OR
20
# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
21
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
22
# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
23
# USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
24
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
26
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27
# POSSIBILITY OF SUCH DAMAGE.
28
#
29
# The views and conclusions contained in the software and
30
# documentation are those of the authors and should not be
31
# interpreted as representing official policies, either expressed
32
# or implied, of GRNET S.A.
33

  
34
 
35
from django import template
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff