Revision fa8b2f7d
b/accounts/admin.py | ||
---|---|---|
1 |
from django.contrib import admin |
|
2 |
from accounts.models import * |
|
3 |
from django.contrib.auth.models import User |
|
4 |
from django.conf import settings |
|
5 |
from edumanage.models import * |
|
6 |
|
|
7 |
class UserPrAdmin(admin.ModelAdmin): |
|
8 |
list_display = ('user', 'institution') |
|
9 |
|
|
10 |
admin.site.register(UserProfile, UserPrAdmin) |
b/accounts/migrations/0001_initial.py | ||
---|---|---|
1 |
# encoding: utf-8 |
|
2 |
import datetime |
|
3 |
from south.db import db |
|
4 |
from south.v2 import SchemaMigration |
|
5 |
from django.db import models |
|
6 |
|
|
7 |
class Migration(SchemaMigration): |
|
8 |
|
|
9 |
def forwards(self, orm): |
|
10 |
|
|
11 |
# Adding model 'UserProfile' |
|
12 |
db.create_table('accounts_userprofile', ( |
|
13 |
('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), |
|
14 |
('institution', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['edumanage.Institution'])), |
|
15 |
('user', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True)), |
|
16 |
)) |
|
17 |
db.send_create_signal('accounts', ['UserProfile']) |
|
18 |
|
|
19 |
|
|
20 |
def backwards(self, orm): |
|
21 |
|
|
22 |
# Deleting model 'UserProfile' |
|
23 |
db.delete_table('accounts_userprofile') |
|
24 |
|
|
25 |
|
|
26 |
models = { |
|
27 |
'accounts.userprofile': { |
|
28 |
'Meta': {'object_name': 'UserProfile'}, |
|
29 |
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
|
30 |
'institution': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['edumanage.Institution']"}), |
|
31 |
'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) |
|
32 |
}, |
|
33 |
'auth.group': { |
|
34 |
'Meta': {'object_name': 'Group'}, |
|
35 |
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
|
36 |
'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), |
|
37 |
'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) |
|
38 |
}, |
|
39 |
'auth.permission': { |
|
40 |
'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, |
|
41 |
'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), |
|
42 |
'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), |
|
43 |
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
|
44 |
'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) |
|
45 |
}, |
|
46 |
'auth.user': { |
|
47 |
'Meta': {'object_name': 'User'}, |
|
48 |
'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), |
|
49 |
'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), |
|
50 |
'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), |
|
51 |
'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), |
|
52 |
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
|
53 |
'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}), |
|
54 |
'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), |
|
55 |
'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), |
|
56 |
'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), |
|
57 |
'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), |
|
58 |
'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), |
|
59 |
'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), |
|
60 |
'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '30'}) |
|
61 |
}, |
|
62 |
'contenttypes.contenttype': { |
|
63 |
'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, |
|
64 |
'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), |
|
65 |
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
|
66 |
'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), |
|
67 |
'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) |
|
68 |
}, |
|
69 |
'edumanage.contact': { |
|
70 |
'Meta': {'object_name': 'Contact'}, |
|
71 |
'email': ('django.db.models.fields.CharField', [], {'max_length': '80', 'db_column': "'contact_email'"}), |
|
72 |
'firstname': ('django.db.models.fields.CharField', [], {'max_length': '80', 'db_column': "'contact_firstname'"}), |
|
73 |
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
|
74 |
'lastname': ('django.db.models.fields.CharField', [], {'max_length': '80', 'db_column': "'contact_lastname'"}), |
|
75 |
'phone': ('django.db.models.fields.CharField', [], {'max_length': '80', 'db_column': "'contact_phone'"}) |
|
76 |
}, |
|
77 |
'edumanage.institution': { |
|
78 |
'Meta': {'object_name': 'Institution'}, |
|
79 |
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
|
80 |
'org_name': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['edumanage.Name_i18n']", 'symmetrical': 'False'}), |
|
81 |
'realmid': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['edumanage.Realm']"}) |
|
82 |
}, |
|
83 |
'edumanage.name_i18n': { |
|
84 |
'Meta': {'object_name': 'Name_i18n'}, |
|
85 |
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
|
86 |
'lang': ('django.db.models.fields.CharField', [], {'max_length': '5'}), |
|
87 |
'name': ('django.db.models.fields.CharField', [], {'max_length': '80'}) |
|
88 |
}, |
|
89 |
'edumanage.realm': { |
|
90 |
'Meta': {'object_name': 'Realm'}, |
|
91 |
'address_city': ('django.db.models.fields.CharField', [], {'max_length': '24'}), |
|
92 |
'address_street': ('django.db.models.fields.CharField', [], {'max_length': '32'}), |
|
93 |
'contact': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['edumanage.Contact']", 'symmetrical': 'False'}), |
|
94 |
'country': ('django.db.models.fields.CharField', [], {'max_length': '2'}), |
|
95 |
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
|
96 |
'org_name': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['edumanage.Name_i18n']", 'symmetrical': 'False'}), |
|
97 |
'stype': ('django.db.models.fields.PositiveIntegerField', [], {'default': '0', 'max_length': '1'}), |
|
98 |
'ts': ('django.db.models.fields.DateTimeField', [], {'auto_now': 'True', 'blank': 'True'}), |
|
99 |
'url': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['edumanage.URL_i18n']", 'symmetrical': 'False'}) |
|
100 |
}, |
|
101 |
'edumanage.url_i18n': { |
|
102 |
'Meta': {'object_name': 'URL_i18n'}, |
|
103 |
'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), |
|
104 |
'lang': ('django.db.models.fields.CharField', [], {'max_length': '5'}), |
|
105 |
'url': ('django.db.models.fields.CharField', [], {'max_length': '180', 'db_column': "'URL'"}), |
|
106 |
'urltype': ('django.db.models.fields.CharField', [], {'max_length': '10', 'db_column': "'type'"}) |
|
107 |
} |
|
108 |
} |
|
109 |
|
|
110 |
complete_apps = ['accounts'] |
b/accounts/models.py | ||
---|---|---|
1 |
from django.db import models |
|
2 |
from django.contrib.auth.models import User |
|
3 |
from edumanage.models import * |
|
4 |
|
|
5 |
|
|
6 |
class UserProfile(models.Model): |
|
7 |
user = models.OneToOneField(User) |
|
8 |
institution = models.ForeignKey(Institution) |
|
9 |
|
|
10 |
def __unicode__(self): |
|
11 |
return "%s:%s" %(self.user.username, self.institution) |
|
12 |
|
b/edumanage/forms.py | ||
---|---|---|
1 |
from django import forms |
|
2 |
from django.utils.translation import ugettext as _ |
|
3 |
from django.utils.translation import ugettext_lazy |
|
4 |
from edumanage.models import * |
|
5 |
from django.conf import settings |
|
6 |
|
|
7 |
|
|
8 |
|
|
9 |
class InstDetailsForm(forms.ModelForm): |
|
10 |
|
|
11 |
class Meta: |
|
12 |
model = InstitutionDetails |
b/edumanage/models.py | ||
---|---|---|
13 | 13 |
('el', 'Ελληνικά'), |
14 | 14 |
) |
15 | 15 |
|
16 |
|
|
17 |
# FIXME: use idp, sp, idpsp as keys not in the velue part. Get rid of 1,2,3 |
|
16 | 18 |
ERTYPES = ( |
17 | 19 |
(1, 'idp: IdP only' ), |
18 | 20 |
(2, 'sp: SP only'), |
... | ... | |
37 | 39 |
|
38 | 40 |
def __unicode__(self): |
39 | 41 |
return self.name |
42 |
|
|
40 | 43 |
|
41 | 44 |
class Contact(models.Model): |
42 | 45 |
''' |
... | ... | |
120 | 123 |
'servername': self.name, |
121 | 124 |
# the human-readable name would be nice here |
122 | 125 |
'ertype': self.ertype, |
123 |
} |
|
124 |
|
|
126 |
} |
|
127 |
|
|
128 |
|
|
125 | 129 |
class InstRealmMon(models.Model): |
126 | 130 |
''' |
127 | 131 |
Realm of an IdP Institution to be monitored |
... | ... | |
252 | 256 |
''' |
253 | 257 |
Institution |
254 | 258 |
''' |
255 |
|
|
259 |
|
|
256 | 260 |
realmid = models.ForeignKey("Realm") |
257 | 261 |
org_name = models.ManyToManyField(Name_i18n) |
258 | 262 |
|
259 |
|
|
260 |
def __unicode__(self): |
|
261 |
return _('Institution: %(inst)s') % { |
|
262 |
# but name is many-to-many from institution |
|
263 |
'inst': ', '.join([i.name for i in self.org_name.all()]), |
|
264 |
} |
|
263 |
|
|
264 |
def __unicode__(self, lang=None): |
|
265 |
print "GOT ", lang, "DONE" |
|
266 |
return self.get_name(lang) |
|
267 |
|
|
268 |
|
|
269 |
def get_name(self, lang): |
|
270 |
print "GOT name", lang, "DONE" |
|
271 |
name = ', '.join([i.name for i in self.org_name.all()]) |
|
272 |
if not lang: |
|
273 |
return name |
|
274 |
else: |
|
275 |
try: |
|
276 |
name = self.org_name.get(lang=lang) |
|
277 |
return name |
|
278 |
except Exception as e: |
|
279 |
print e |
|
280 |
return name |
|
281 |
|
|
265 | 282 |
|
266 | 283 |
class InstitutionDetails(models.Model): |
267 | 284 |
''' |
b/edumanage/templatetags/tolocale.py | ||
---|---|---|
1 |
from django import template |
|
2 |
from edumanage.models import * |
|
3 |
|
|
4 |
register = template.Library() |
|
5 |
|
|
6 |
@register.filter |
|
7 |
def do_tolocale(parser, token): |
|
8 |
print token |
|
9 |
try: |
|
10 |
tag_name, inst, format_string = token.split_contents() |
|
11 |
print inst |
|
12 |
except ValueError: |
|
13 |
raise template.TemplateSyntaxError, "%r tag requires exactly two arguments" % token.contents.split()[0] |
|
14 |
return CurrentLocaleNode(inst, format_string) |
|
15 |
|
|
16 |
|
|
17 |
class CurrentLocaleNode(template.Node): |
|
18 |
def __init__(self, inst, format_string): |
|
19 |
self.format_string = format_string |
|
20 |
self.inst = template.Variable(inst) |
|
21 |
print self.format_string, "STING" |
|
22 |
def render(self, context): |
|
23 |
inst_pk = self.inst.resolve(context) |
|
24 |
return Institution.objects.get(pk=inst_pk).__unicode__(lang=str(self.format_string)) |
|
25 |
|
|
26 |
register.tag('tolocale', do_tolocale) |
b/edumanage/views.py | ||
---|---|---|
6 | 6 |
from django.template import RequestContext |
7 | 7 |
from django.contrib.auth.decorators import login_required |
8 | 8 |
from edumanage.models import * |
9 |
|
|
9 |
from edumanage.forms import * |
|
10 |
from django import forms |
|
10 | 11 |
|
11 | 12 |
def index(request): |
12 | 13 |
return render_to_response('base.html', context_instance=RequestContext(request)) |
... | ... | |
15 | 16 |
def manage(request): |
16 | 17 |
services_list = [] |
17 | 18 |
servers_list = [] |
18 |
inst_dets = Institution.objects.all() |
|
19 |
for inst in inst_dets: |
|
20 |
services = ServiceLoc.objects.filter(institutionid=inst) |
|
21 |
services_list.extend([s for s in services]) |
|
22 |
for inst in inst_dets: |
|
23 |
servers = InstServer.objects.filter(instid=inst) |
|
24 |
servers_list.extend([s for s in servers]) |
|
19 |
user = request.user |
|
20 |
try: |
|
21 |
profile = user.get_profile() |
|
22 |
inst = profile.institution |
|
23 |
except UserProfile.DoesNotExist: |
|
24 |
inst = False |
|
25 |
services = ServiceLoc.objects.filter(institutionid=inst) |
|
26 |
services_list.extend([s for s in services]) |
|
27 |
servers = InstServer.objects.filter(instid=inst) |
|
28 |
servers_list.extend([s for s in servers]) |
|
25 | 29 |
return render_to_response('edumanage/welcome.html', |
26 | 30 |
{ |
27 |
'institutions': inst_dets,
|
|
31 |
'institution': inst,
|
|
28 | 32 |
'services': services_list, |
29 | 33 |
'servers': servers_list |
30 | 34 |
}, |
... | ... | |
33 | 37 |
@login_required |
34 | 38 |
def institutions(request): |
35 | 39 |
user = request.user |
36 |
return render_to_response('edumanage/institutions.html', |
|
40 |
dict = {} |
|
41 |
|
|
42 |
try: |
|
43 |
profile = user.get_profile() |
|
44 |
inst = profile.institution |
|
45 |
inst.__unicode__ = inst.get_name(request.LANGUAGE_CODE) |
|
46 |
except UserProfile.DoesNotExist: |
|
47 |
inst = False |
|
48 |
dict['institution'] = inst.pk |
|
49 |
form = InstDetailsForm(initial=dict) |
|
50 |
form.fields['institution'].widget.attrs['readonly'] = True |
|
51 |
return render_to_response('edumanage/institution.html', |
|
37 | 52 |
{ |
38 |
'institutions': inst_dets, |
|
39 |
'services': services_list, |
|
40 |
'servers': servers_list |
|
53 |
'institution': inst, |
|
54 |
'form': form, |
|
41 | 55 |
}, |
42 |
context_instance=RequestContext(request)) |
|
56 |
context_instance=RequestContext(request)) |
|
57 |
|
|
58 |
|
|
59 |
|
|
60 |
@login_required |
|
61 |
def add_institution_details(request, institution_pk): |
|
62 |
user = request.user |
|
63 |
if request.method == "GET": |
|
64 |
try: |
|
65 |
profile = user.get_profile() |
|
66 |
inst = profile.institution |
|
67 |
except UserProfile.DoesNotExist: |
|
68 |
inst = False |
|
69 |
|
|
70 |
if (not inst) or (int(inst.pk) != int(institution_pk)): |
|
71 |
# messages.add_message(request, messages.WARNING, |
|
72 |
# _("Insufficient rights on Institution. Contact your administrator")) |
|
73 |
return HttpResponseRedirect(reverse("institution")) |
|
74 |
|
|
75 |
form = InstDetailsForm() |
|
76 |
form.fields['institution'] = forms.ModelChoiceField(queryset=Institution.objects.filter(pk=institution_pk), empty_label=None) |
|
77 |
return render_to_response('edumanage/institution_edit.html', { 'institution': inst, 'form': form}, |
|
78 |
context_instance=RequestContext(request)) |
|
79 |
elif request.method == 'POST': |
|
80 |
request_data = request.POST.copy() |
|
81 |
form = InstDetailsForm(request_data) |
|
82 |
if form.is_valid(): |
|
83 |
instdets = form.save(commit=False) |
|
84 |
instdets.save() |
|
85 |
form.save_m2m() |
|
86 |
return HttpResponseRedirect(reverse("institution")) |
|
87 |
else: |
|
88 |
try: |
|
89 |
profile = user.get_profile() |
|
90 |
inst = profile.institution |
|
91 |
except UserProfile.DoesNotExist: |
|
92 |
inst = False |
|
93 |
form.fields['institution'] = forms.ModelChoiceField(queryset=Institution.objects.filter(pk=institution_pk), empty_label=None) |
|
94 |
return render_to_response('edumanage/institution_edit.html', { 'institution': inst, 'form': form}, |
|
95 |
context_instance=RequestContext(request)) |
|
96 |
|
b/templates/edumanage/institution.html | ||
---|---|---|
1 |
{% extends "base.html"%} |
|
2 |
|
|
3 |
{% block content %} |
|
4 |
<div class="container-fluid"> |
|
5 |
<div class="row-fluid"> |
|
6 |
<div class="span3"> |
|
7 |
<div class="sidebar-nav"> |
|
8 |
<ul class="nav nav-tabs nav-stacked"> |
|
9 |
<li> |
|
10 |
<a href="{% url manage %}">Home</a> |
|
11 |
</li> |
|
12 |
<li class="active"> |
|
13 |
<a href="#">Institution</a> |
|
14 |
</li> |
|
15 |
<li> |
|
16 |
<a href="#">Services</a> |
|
17 |
</li> |
|
18 |
<li> |
|
19 |
<a href="#">Servers</a> |
|
20 |
</li> |
|
21 |
</ul> |
|
22 |
</div><!--/.well --> |
|
23 |
</div><!--/span--> |
|
24 |
|
|
25 |
<div class="span9"> |
|
26 |
<div class="row-fluid"> |
|
27 |
<!--/span--> |
|
28 |
<div class="span12"> |
|
29 |
<h4>Institution</h4> |
|
30 |
{% load tolocale %} |
|
31 |
{% if institution %} |
|
32 |
<h5>{% tolocale institution.pk 'el'%}</h5> |
|
33 |
{% if institution.institutiondetails %} |
|
34 |
ErType: {{institution.institutiondetails.get_ertype_display}} |
|
35 |
{% else %} |
|
36 |
<div>No institution details defined yet <a href="{% url edit-institution institution.pk %}">(edit)</a></div> |
|
37 |
{% endif %} |
|
38 |
{% else %} |
|
39 |
<p>No institution defined!</p> |
|
40 |
{% endif %} |
|
41 |
</div><!--/span--> |
|
42 |
</div><!--/row--> |
|
43 |
</div><!--/span--> |
|
44 |
</div><!--/row--> |
|
45 |
|
|
46 |
<hr> |
|
47 |
|
|
48 |
<footer> |
|
49 |
<p>© Company 2012</p> |
|
50 |
</footer> |
|
51 |
|
|
52 |
</div><!--/.fluid-container--> |
|
53 |
{% endblock %} |
b/templates/edumanage/institution_edit.html | ||
---|---|---|
1 |
{% extends "base.html"%} |
|
2 |
|
|
3 |
{% block content %} |
|
4 |
<div class="container-fluid"> |
|
5 |
<div class="row-fluid"> |
|
6 |
<div class="span3"> |
|
7 |
<div class="sidebar-nav"> |
|
8 |
<ul class="nav nav-tabs nav-stacked"> |
|
9 |
<li> |
|
10 |
<a href="{% url manage %}">Home</a> |
|
11 |
</li> |
|
12 |
<li class="active"> |
|
13 |
<a href="#">Institution</a> |
|
14 |
</li> |
|
15 |
<li> |
|
16 |
<a href="#">Services</a> |
|
17 |
</li> |
|
18 |
<li> |
|
19 |
<a href="#">Servers</a> |
|
20 |
</li> |
|
21 |
</ul> |
|
22 |
</div><!--/.well --> |
|
23 |
</div><!--/span--> |
|
24 |
|
|
25 |
<div class="span9"> |
|
26 |
<div class="row-fluid"> |
|
27 |
<!--/span--> |
|
28 |
<div class="span12"> |
|
29 |
<h4>Institution</h4> |
|
30 |
|
|
31 |
<h5>{{institution}}</h5> |
|
32 |
|
|
33 |
|
|
34 |
|
|
35 |
|
|
36 |
|
|
37 |
|
|
38 |
|
|
39 |
|
|
40 |
|
|
41 |
<form method="POST" class="form-horizontal"> |
|
42 |
|
|
43 |
{% csrf_token %} |
|
44 |
{% if form.non_field_errors %} |
|
45 |
<p class="error"> |
|
46 |
{{ form.non_field_errors}} |
|
47 |
</p> |
|
48 |
{% endif %} |
|
49 |
<div style="display: none"> |
|
50 |
{{form.institution}} |
|
51 |
</div> |
|
52 |
|
|
53 |
|
|
54 |
<div class="control-group {% if form.ertype.errors %} error {% endif %}"> |
|
55 |
<label class="control-label" for="id_ertype">ErType</label> |
|
56 |
<div class="controls">{{ form.ertype }} |
|
57 |
{% if form.ertype.errors %} |
|
58 |
<span class="help-inline"> |
|
59 |
{{ form.ertype.errors|join:", " }} |
|
60 |
</span> |
|
61 |
{% endif %} |
|
62 |
<span class="help-block"> {{ form.ertype.help_text }}</span> |
|
63 |
</div> |
|
64 |
</div> |
|
65 |
|
|
66 |
<div class="control-group {% if form.address_street.errors %} error {% endif %}"> |
|
67 |
<label class="control-label" for="id_address_street">Address Street</label> |
|
68 |
<div class="controls">{{ form.address_street }} |
|
69 |
{% if form.address_street.errors %} |
|
70 |
<span class="help-inline"> |
|
71 |
{{ form.address_street.errors|join:", " }} |
|
72 |
</span> |
|
73 |
{% endif %} |
|
74 |
<span class="help-block"> {{ form.address_street.help_text }}</span> |
|
75 |
</div> |
|
76 |
</div> |
|
77 |
|
|
78 |
<div class="control-group {% if form.address_city.errors %} error {% endif %}"> |
|
79 |
<label class="control-label" for="id_address_city">Address City</label> |
|
80 |
<div class="controls">{{ form.address_city }} |
|
81 |
{% if form.address_city.errors %} |
|
82 |
<span class="help-inline"> |
|
83 |
{{ form.address_city.errors|join:", " }} |
|
84 |
</span> |
|
85 |
{% endif %} |
|
86 |
<span class="help-block"> {{ form.address_city.help_text }}</span> |
|
87 |
</div> |
|
88 |
</div> |
|
89 |
|
|
90 |
<div class="control-group {% if form.contact.errors %} error {% endif %}"> |
|
91 |
<label class="control-label" for="id_contact">Contact(s)</label> |
|
92 |
<div class="controls">{{ form.contact }} |
|
93 |
{% if form.contact.errors %} |
|
94 |
<span class="help-inline"> |
|
95 |
{{ form.ertype.contact|join:", " }} |
|
96 |
</span> |
|
97 |
{% endif %} |
|
98 |
<span class="help-block"> {{ form.contact.help_text }}</span> |
|
99 |
</div> |
|
100 |
</div> |
|
101 |
|
|
102 |
<div class="control-group {% if form.url.errors %} error {% endif %}"> |
|
103 |
<label class="control-label" for="id_url">URL(s)</label> |
|
104 |
<div class="controls">{{ form.url }} |
|
105 |
{% if form.url.errors %} |
|
106 |
<span class="help-inline"> |
|
107 |
{{ form.url.errors|join:", " }} |
|
108 |
</span> |
|
109 |
{% endif %} |
|
110 |
<span class="help-block"> {{ form.url.help_text }}</span> |
|
111 |
</div> |
|
112 |
</div> |
|
113 |
|
|
114 |
<div class="control-group {% if form.oper_name.errors %} error {% endif %}"> |
|
115 |
<label class="control-label" for="id_oper_name">Oper Name</label> |
|
116 |
<div class="controls">{{ form.oper_name }} |
|
117 |
{% if form.oper_name.errors %} |
|
118 |
<span class="help-inline"> |
|
119 |
{{ form.oper_name.errors|join:", " }} |
|
120 |
</span> |
|
121 |
{% endif %} |
|
122 |
<span class="help-block"> {{ form.oper_name.help_text }}</span> |
|
123 |
</div> |
|
124 |
</div> |
|
125 |
|
|
126 |
<div class="control-group {% if form.number_user.errors %} error {% endif %}"> |
|
127 |
<label class="control-label" for="id_number_user">Number User</label> |
|
128 |
<div class="controls">{{ form.number_user }} |
|
129 |
{% if form.number_user.errors %} |
|
130 |
<span class="help-inline"> |
|
131 |
{{ form.number_user.errors|join:", " }} |
|
132 |
</span> |
|
133 |
{% endif %} |
|
134 |
<span class="help-block"> {{ form.number_user.help_text }}</span> |
|
135 |
</div> |
|
136 |
</div> |
|
137 |
|
|
138 |
<div class="control-group {% if form.number_id.errors %} error {% endif %}"> |
|
139 |
<label class="control-label" for="id_number_id">Number Id</label> |
|
140 |
<div class="controls">{{ form.number_id }} |
|
141 |
{% if form.number_id.errors %} |
|
142 |
<span class="help-inline"> |
|
143 |
{{ form.number_id.errors|join:", " }} |
|
144 |
</span> |
|
145 |
{% endif %} |
|
146 |
<span class="help-block"> {{ form.number_id.help_text }}</span> |
|
147 |
</div> |
|
148 |
</div> |
|
149 |
|
|
150 |
|
|
151 |
<div class="control-group"> |
|
152 |
<div class="controls"> |
|
153 |
<button type="submit" id="applybutton" value="Apply" class="btn btn-large btn-primary"/>Apply</button> |
|
154 |
</div> |
|
155 |
</div> |
|
156 |
</form> |
|
157 |
|
|
158 |
|
|
159 |
|
|
160 |
|
|
161 |
|
|
162 |
|
|
163 |
|
|
164 |
|
|
165 |
|
|
166 |
|
|
167 |
|
|
168 |
|
|
169 |
|
|
170 |
|
|
171 |
|
|
172 |
|
|
173 |
</div><!--/span--> |
|
174 |
</div><!--/row--> |
|
175 |
</div><!--/span--> |
|
176 |
</div><!--/row--> |
|
177 |
|
|
178 |
<hr> |
|
179 |
|
|
180 |
<footer> |
|
181 |
<p>© Company 2012</p> |
|
182 |
</footer> |
|
183 |
|
|
184 |
</div><!--/.fluid-container--> |
|
185 |
{% endblock %} |
/dev/null | ||
---|---|---|
1 |
{% extends "base.html"%} |
|
2 |
|
|
3 |
{% block content %} |
|
4 |
<div class="container-fluid"> |
|
5 |
<div class="row-fluid"> |
|
6 |
<div class="span3"> |
|
7 |
<div class="sidebar-nav"> |
|
8 |
<ul class="nav nav-tabs nav-stacked"> |
|
9 |
<li> |
|
10 |
<a href="{% url manage %}">Home</a> |
|
11 |
</li> |
|
12 |
<li class="active"> |
|
13 |
<a href="#">Institution</a> |
|
14 |
</li> |
|
15 |
<li> |
|
16 |
<a href="#">Services</a> |
|
17 |
</li> |
|
18 |
<li> |
|
19 |
<a href="#">Servers</a> |
|
20 |
</li> |
|
21 |
</ul> |
|
22 |
</div><!--/.well --> |
|
23 |
</div><!--/span--> |
|
24 |
|
|
25 |
<div class="span9"> |
|
26 |
<div class="row-fluid"> |
|
27 |
<!--/span--> |
|
28 |
<div class="span12"> |
|
29 |
<h4>Institution</h4> |
|
30 |
{% if services %} |
|
31 |
{% for service in services %}<p>{{service}}</p>{% endfor %} |
|
32 |
{% else %} |
|
33 |
<p>No services defined!</p> |
|
34 |
{% endif %} |
|
35 |
<p><a class="btn" href="#">View details »</a></p> |
|
36 |
</div><!--/span--> |
|
37 |
</div><!--/row--> |
|
38 |
</div><!--/span--> |
|
39 |
</div><!--/row--> |
|
40 |
|
|
41 |
<hr> |
|
42 |
|
|
43 |
<footer> |
|
44 |
<p>© Company 2012</p> |
|
45 |
</footer> |
|
46 |
|
|
47 |
</div><!--/.fluid-container--> |
|
48 |
{% endblock %} |
b/templates/edumanage/welcome.html | ||
---|---|---|
36 | 36 |
</div><!--/span--> |
37 | 37 |
<div class="span6"> |
38 | 38 |
<h4>Institution</h4> |
39 |
{% if institutions %} |
|
40 |
{% for inst in institutions %} |
|
41 |
<p>{{inst}}</p> |
|
42 |
{% endfor %} |
|
39 |
{% if institution %} |
|
40 |
<p>{{institution}}</p> |
|
43 | 41 |
{% else %} |
44 | 42 |
<p>No institution defined!</p> |
45 | 43 |
{% endif %} |
Also available in: Unified diff