Projet

Général

Profil

0002-add-combo-services-6461.patch

Frédéric Péters, 10 février 2015 11:30

Télécharger (11 ko)

Voir les différences:

Subject: [PATCH 2/4] add combo services (#6461)

 hobo/environment/forms.py             |   8 +++++++-
 hobo/environment/models.py            |  16 +++++++++++++++-
 hobo/environment/views.py             |   5 +++--
 hobo/static/css/style.css             |   5 ++++-
 hobo/static/img/icon-portal-hover.png | Bin 0 -> 2597 bytes
 hobo/static/img/icon-portal.png       | Bin 0 -> 2571 bytes
 6 files changed, 29 insertions(+), 5 deletions(-)
 create mode 100644 hobo/static/img/icon-portal-hover.png
 create mode 100644 hobo/static/img/icon-portal.png
hobo/environment/forms.py
4 4
from django.utils.crypto import get_random_string
5 5
from django.utils.translation import ugettext_lazy as _
6 6

  
7
from .models import Authentic, Wcs, Passerelle, Variable
7
from .models import Authentic, Wcs, Passerelle, Variable, Combo
8 8

  
9 9
SECRET_CHARS = 'abcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*(-_=+)'
10 10
EXCLUDED_FIELDS = ('slug', 'last_operational_check_timestamp',
......
74 74
        exclude = EXCLUDED_FIELDS
75 75

  
76 76

  
77
class ComboForm(BaseForm):
78
    class Meta:
79
        model = Combo
80
        exclude = EXCLUDED_FIELDS
81

  
82

  
77 83
class VariableForm(forms.ModelForm):
78 84
    class Meta:
79 85
        model = Variable
hobo/environment/models.py
167 167
                Zone(self.title, 'webservices', self.base_url + '/manage/')
168 168
                ]
169 169

  
170
AVAILABLE_SERVICES = [Authentic, Wcs, Passerelle]
170

  
171
class Combo(ServiceBase):
172
    class Meta:
173
        verbose_name = _('Combo Portal')
174
        verbose_name_plural = _('Combo Portals')
175

  
176
    class Extra:
177
        service_id = 'combo'
178

  
179
    def get_admin_zones(self):
180
        return [
181
                Zone(self.title, 'portal', self.base_url + '/manage/')
182
                ]
183

  
184
AVAILABLE_SERVICES = [Authentic, Wcs, Passerelle, Combo]
171 185

  
172 186

  
173 187
@receiver(post_save)
hobo/environment/views.py
8 8
from django.views.generic.base import TemplateView
9 9
from django.views.generic.edit import CreateView, UpdateView, DeleteView
10 10

  
11
from .models import Variable, Authentic, Wcs, Passerelle, AVAILABLE_SERVICES
11
from .models import Variable, Authentic, Wcs, Passerelle, Combo, AVAILABLE_SERVICES
12 12
from . import forms, utils
13 13

  
14 14

  
......
140 140
    klass = {
141 141
            'wcs': Wcs,
142 142
            'authentic': Authentic,
143
            'passerelle': Passerelle
143
            'passerelle': Passerelle,
144
            'combo': Combo,
144 145
    }.get(service)
145 146

  
146 147
    if klass is None:
hobo/static/css/style.css
13 13
li.zone-webservices a { background-image: url(../img/icon-webservices.png); }
14 14
li.zone-webservices a:hover { background-image: url(../img/icon-webservices-hover.png); }
15 15

  
16
li.zone-portal a { background-image: url(../img/icon-portal.png); }
17
li.zone-portal a:hover { background-image: url(../img/icon-portal-hover.png); }
18

  
16 19
p.being-deployed {
17 20
  background: url(indicator.gif) no-repeat;
18 21
  padding-left: 2em;
......
55 58
ul.login label {
56 59
    float: left;
57 60
    width: 10em;
58
}
61
}