diff --git a/README.txt b/README.txt index 9ac2197dfa25ea33c9f297c613057480745b77c7..8cec0e049cc6e2e28d42aedcc86ace2f1b65b520 100644 --- a/README.txt +++ b/README.txt @@ -100,3 +100,7 @@ Under the templates folder (templates), you can alter the footer.html file to in * Modify flatpages to suit your needs * Once Apache proxying and shibboleth modules are properly setup, login to the tool. If shibboleth SP is properly setup you should see a user pending activation message and an activation email should arrive at the NOTIFY_ADMIN_MAILS accounts. +5. UPDATING: +* from 0.9.1 to 0.9.2: + - Check diff between urls + - run ./manage.py migrate accounts (data migration for perms) diff --git a/accounts/migrations/0001_initial.py b/accounts/migrations/0001_initial.py new file mode 100644 index 0000000000000000000000000000000000000000..b67885be8bc49563d13807c5650635cbd5f13564 --- /dev/null +++ b/accounts/migrations/0001_initial.py @@ -0,0 +1,91 @@ +# encoding: utf-8 +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + +class Migration(SchemaMigration): + + def forwards(self, orm): + + # Adding model 'UserProfile' + db.create_table('accounts_userprofile', ( + ('peer', self.gf('django.db.models.fields.related.ForeignKey')(to=orm['peers.Peer'])), + ('id', self.gf('django.db.models.fields.AutoField')(primary_key=True)), + ('user', self.gf('django.db.models.fields.related.OneToOneField')(to=orm['auth.User'], unique=True)), + )) + db.send_create_signal('accounts', ['UserProfile']) + + + def backwards(self, orm): + + # Deleting model 'UserProfile' + db.delete_table('accounts_userprofile') + + + models = { + 'accounts.userprofile': { + 'Meta': {'object_name': 'UserProfile'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'peer': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['peers.Peer']"}), + 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) + }, + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) + }, + 'contenttypes.contenttype': { + 'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + 'peers.peer': { + 'Meta': {'object_name': 'Peer', 'db_table': "u'peer'"}, + 'domain_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}), + 'networks': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['peers.PeerRange']", 'null': 'True', 'blank': 'True'}), + 'peer_as': ('django.db.models.fields.IntegerField', [], {}), + 'peer_id': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'}), + 'peer_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'peer_tag': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'techc_emails': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['peers.TechcEmail']", 'null': 'True', 'blank': 'True'}) + }, + 'peers.peerrange': { + 'Meta': {'object_name': 'PeerRange', 'db_table': "u'peer_range'"}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'network': ('django.db.models.fields.CharField', [], {'max_length': '128'}) + }, + 'peers.techcemail': { + 'Meta': {'object_name': 'TechcEmail', 'db_table': "'techc_email'"}, + 'email': ('django.db.models.fields.CharField', [], {'max_length': '352', 'db_column': "'email'"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) + } + } + + complete_apps = ['accounts'] diff --git a/accounts/migrations/0002_add_overview.py b/accounts/migrations/0002_add_overview.py new file mode 100644 index 0000000000000000000000000000000000000000..6d4312708fcd8e9eff0f5c30a6bb2496e103b7b9 --- /dev/null +++ b/accounts/migrations/0002_add_overview.py @@ -0,0 +1,89 @@ +# encoding: utf-8 +import datetime +from south.db import db +from south.v2 import DataMigration +from django.db import models + +class Migration(DataMigration): + + def forwards(self, orm): + "Write your forwards methods here." + ct, created = orm['contenttypes.ContentType'].objects.get_or_create( + model='userprofile', app_label='accounts') # model must be lowercase! + perm, created = orm['auth.permission'].objects.get_or_create( + content_type=ct, codename='overview', defaults=dict(name=u'Can see registered users and rules')) + + def backwards(self, orm): + "Write your backwards methods here." + ct, created = orm['contenttypes.ContentType'].objects.get_or_create( + model='userprofile', app_label='accounts') # model must be lowercase! + perm, created = orm['auth.permission'].objects.get_or_create( + content_type=ct, codename='overview') + perm.delete() + + models = { + 'accounts.userprofile': { + 'Meta': {'object_name': 'UserProfile'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'peer': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['peers.Peer']"}), + 'user': ('django.db.models.fields.related.OneToOneField', [], {'to': "orm['auth.User']", 'unique': 'True'}) + }, + 'auth.group': { + 'Meta': {'object_name': 'Group'}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '80'}), + 'permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}) + }, + 'auth.permission': { + 'Meta': {'unique_together': "(('content_type', 'codename'),)", 'object_name': 'Permission'}, + 'codename': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'content_type': ('django.db.models.fields.related.ForeignKey', [], {'to': "orm['contenttypes.ContentType']"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '50'}) + }, + 'auth.user': { + 'Meta': {'object_name': 'User'}, + 'date_joined': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'email': ('django.db.models.fields.EmailField', [], {'max_length': '75', 'blank': 'True'}), + 'first_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'groups': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Group']", 'symmetrical': 'False', 'blank': 'True'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'is_active': ('django.db.models.fields.BooleanField', [], {'default': 'True', 'blank': 'True'}), + 'is_staff': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'is_superuser': ('django.db.models.fields.BooleanField', [], {'default': 'False', 'blank': 'True'}), + 'last_login': ('django.db.models.fields.DateTimeField', [], {'default': 'datetime.datetime.now'}), + 'last_name': ('django.db.models.fields.CharField', [], {'max_length': '30', 'blank': 'True'}), + 'password': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'user_permissions': ('django.db.models.fields.related.ManyToManyField', [], {'to': "orm['auth.Permission']", 'symmetrical': 'False', 'blank': 'True'}), + 'username': ('django.db.models.fields.CharField', [], {'unique': 'True', 'max_length': '255'}) + }, + 'contenttypes.contenttype': { + 'Meta': {'unique_together': "(('app_label', 'model'),)", 'object_name': 'ContentType', 'db_table': "'django_content_type'"}, + 'app_label': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'model': ('django.db.models.fields.CharField', [], {'max_length': '100'}), + 'name': ('django.db.models.fields.CharField', [], {'max_length': '100'}) + }, + 'peers.peer': { + 'Meta': {'object_name': 'Peer', 'db_table': "u'peer'"}, + 'domain_name': ('django.db.models.fields.CharField', [], {'max_length': '128', 'null': 'True', 'blank': 'True'}), + 'networks': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['peers.PeerRange']", 'null': 'True', 'blank': 'True'}), + 'peer_as': ('django.db.models.fields.IntegerField', [], {}), + 'peer_id': ('django.db.models.fields.IntegerField', [], {'primary_key': 'True'}), + 'peer_name': ('django.db.models.fields.CharField', [], {'max_length': '128'}), + 'peer_tag': ('django.db.models.fields.CharField', [], {'max_length': '64'}), + 'techc_emails': ('django.db.models.fields.related.ManyToManyField', [], {'symmetrical': 'False', 'to': "orm['peers.TechcEmail']", 'null': 'True', 'blank': 'True'}) + }, + 'peers.peerrange': { + 'Meta': {'object_name': 'PeerRange', 'db_table': "u'peer_range'"}, + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}), + 'network': ('django.db.models.fields.CharField', [], {'max_length': '128'}) + }, + 'peers.techcemail': { + 'Meta': {'object_name': 'TechcEmail', 'db_table': "'techc_email'"}, + 'email': ('django.db.models.fields.CharField', [], {'max_length': '352', 'db_column': "'email'"}), + 'id': ('django.db.models.fields.AutoField', [], {'primary_key': 'True'}) + } + } + + complete_apps = ['accounts'] diff --git a/accounts/migrations/__init__.py b/accounts/migrations/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/accounts/models.py b/accounts/models.py index cb3fb474b6ef2c6f9365cee4988475b21a02a9b5..5ecce5cd4c8913df06d6845194a0c11372b4f347 100644 --- a/accounts/models.py +++ b/accounts/models.py @@ -7,6 +7,12 @@ class UserProfile(models.Model): user = models.OneToOneField(User) peer = models.ForeignKey(Peer) + class Meta: + permissions = ( + ("overview", "Can see registered users and rules"), + ) + + def __unicode__(self): return "%s:%s" %(self.user.username, self.peer.peer_name) diff --git a/flowspec/views.py b/flowspec/views.py index ad8111d29714572ce6be36fc01c225bf629510e2..0f14b6e5b48be1c72a89f874177bd45d951b143a 100644 --- a/flowspec/views.py +++ b/flowspec/views.py @@ -436,6 +436,22 @@ def selectinst(request): form.fields['institution'] = forms.ModelChoiceField(queryset=Peer.objects.all(), empty_label=None) return render_to_response('registration/select_institution.html', {'form': form}, context_instance=RequestContext(request)) +@never_cache +def overview(request): + user = request.user + if user.is_authenticated(): + if user.has_perm('accounts.overview'): + users = User.objects.all() + group_routes = Route.objects.all() + return render_to_response('overview/index.html', {'users': users, 'routes': group_routes}, + context_instance=RequestContext(request)) + else: + violation=True + return render_to_response('overview/index.html', {'violation': violation}, + context_instance=RequestContext(request)) + else: + return HttpResponseRedirect(reverse("altlogin")) + @login_required @never_cache def user_logout(request): @@ -471,6 +487,7 @@ def send_new_mail(subject, message, from_email, recipient_list, bcc_list): def lookupShibAttr(attrmap, requestMeta): for attr in attrmap: - if (attr in requestMeta) & (len(requestMeta[attr]) > 0): - return requestMeta[attr] - return '' \ No newline at end of file + if (attr in requestMeta.keys()): + if len(requestMeta[attr]) > 0: + return requestMeta[attr] + return '' diff --git a/locale/el/LC_MESSAGES/django.mo b/locale/el/LC_MESSAGES/django.mo index c99c9ba8392461dd226ad6cdca96af387863f7a2..aa57ba519b837f3e9da936925ecfd7e3c8aabfda 100644 Binary files a/locale/el/LC_MESSAGES/django.mo and b/locale/el/LC_MESSAGES/django.mo differ diff --git a/locale/el/LC_MESSAGES/django.po b/locale/el/LC_MESSAGES/django.po index d3c555b962d458fab8576ef503f06f603a3660a7..dc30937180d45a2c210d2065df24ac66dd8bc775 100644 --- a/locale/el/LC_MESSAGES/django.po +++ b/locale/el/LC_MESSAGES/django.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2013-01-25 18:20+0200\n" +"POT-Creation-Date: 2013-01-30 02:39+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: Leonidas Poulopoulos <leopoul@grnet.gr>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -123,8 +123,9 @@ msgstr "" msgid "Port should be an integer" msgstr "Ξ port ΞΈΞ± ΟΟΞΟΡι Ξ½Ξ± Ρίναι ΞΞ½Ξ±Ο Ξ±ΞΊΞΟΞ±ΞΉΞΏΟ Ξ±ΟΞΉΞΈΞΌΟΟ" -#: flowspec/models.py:107 templates/apply.html:201 -#: templates/user_routes.html:250 +#: flowspec/models.py:107 templates/apply.html:207 +#: templates/user_routes.html:250 templates/overview/index.html:158 +#: templates/overview/index.html.py:183 msgid "Name" msgstr "ΞΞ½ΞΏΞΌΞ±" @@ -132,50 +133,52 @@ msgstr "ΞΞ½ΞΏΞΌΞ±" msgid "Network address. Use address/CIDR notation" msgstr "ΞΞΉΞ΅ΟΞΈΟ Ξ½ΟΞ· δικΟΟΞΏΟ /Ο ΟοδικΟΟΞΏΟ . Ξ§ΟΞ·ΟΞΉΞΌΞΏΟΞΏΞΉΞ�ΟΟΞ΅ ΟΟΞ½ΟΞ±ΞΎΞ· διΡΟΞΈΟ Ξ½ΟΞ·Ο/CIDR" -#: flowspec/models.py:109 templates/apply.html:237 +#: flowspec/models.py:109 templates/apply.html:243 msgid "Source Address" msgstr "ΞΞΉΞ΅ΟΞΈΟ Ξ½ΟΞ· Ξ Ξ·Ξ³Ξ�Ο" -#: flowspec/models.py:110 templates/apply.html:287 +#: flowspec/models.py:110 templates/apply.html:293 msgid "Source Port" msgstr "Port Ξ Ξ·Ξ³Ξ�Ο" -#: flowspec/models.py:111 templates/apply.html:250 +#: flowspec/models.py:111 templates/apply.html:256 msgid "Destination Address" msgstr "ΞΞΉΞ΅ΟΞΈΟ Ξ½ΟΞ· Ξ ΟΞΏΞΏΟΞΉΟΞΌΞΏΟ" -#: flowspec/models.py:112 templates/apply.html:302 +#: flowspec/models.py:112 templates/apply.html:308 msgid "Destination Port" msgstr "Port Ξ ΟΞΏΞΏΟΞΉΟΞΌΞΏΟ" -#: flowspec/models.py:113 templates/apply.html:292 templates/apply.html.py:307 -#: templates/apply.html:317 templates/apply.html.py:322 +#: flowspec/models.py:113 templates/apply.html:298 templates/apply.html.py:313 +#: templates/apply.html:323 templates/apply.html.py:328 msgid "Port" msgstr "" -#: flowspec/models.py:119 templates/apply.html:263 +#: flowspec/models.py:119 templates/apply.html:269 msgid "Protocol" msgstr "Ξ ΟΟΟΟκολλο" -#: flowspec/models.py:121 templates/apply.html:345 -#: templates/user_routes.html:252 +#: flowspec/models.py:121 templates/apply.html:351 +#: templates/user_routes.html:252 templates/overview/index.html:185 msgid "Then" msgstr "ΞΞ½ΞΟγΡιΡΟ" #: flowspec/models.py:124 templates/user_routes.html:253 +#: templates/overview/index.html:159 templates/overview/index.html.py:186 msgid "Status" msgstr "ΞΞ±ΟΞ¬ΟΟΞ±ΟΞ·" -#: flowspec/models.py:127 templates/apply.html:366 -#: templates/user_routes.html:256 +#: flowspec/models.py:127 templates/apply.html:372 +#: templates/user_routes.html:256 templates/overview/index.html:189 msgid "Expires" msgstr "ΞΞ�γΡι" #: flowspec/models.py:128 templates/user_routes.html:257 +#: templates/overview/index.html:190 msgid "Response" msgstr "ΞΟΟΞΊΟΞΉΟΞ· ΞΞΉΞΊΟΟΞΏΟ " -#: flowspec/models.py:129 templates/apply.html:382 +#: flowspec/models.py:129 templates/apply.html:388 msgid "Comments" msgstr "Ξ£ΟΟλια" @@ -281,7 +284,7 @@ msgstr "ΞΟΡξΡΟΞ³Ξ±ΟΞ―Ξ± ΟΞ―Ξ»ΟΟΞΏΟ " msgid "Create new Rule" msgstr "ΞΞ·ΞΌΞΉΞΏΟ ΟΞ³Ξ―Ξ± Ξ½ΞΞΏΟ Ξ¦Ξ―Ξ»ΟΟΞΏΟ " -#: templates/apply.html:15 templates/apply.html.py:182 +#: templates/apply.html:15 templates/apply.html.py:188 msgid "Edit rule" msgstr "ΞΟΡξΡΟΞ³Ξ±ΟΞ―Ξ± ΟΞ―Ξ»ΟΟΞΏΟ " @@ -289,93 +292,94 @@ msgstr "ΞΟΡξΡΟΞ³Ξ±ΟΞ―Ξ± ΟΞ―Ξ»ΟΟΞΏΟ " msgid "Create rule" msgstr "ΞΞ·ΞΌΞΉΞΏΟ ΟΞ³Ξ―Ξ± ΟΞ―Ξ»ΟΟΞΏΟ " -#: templates/apply.html:35 templates/apply.html.py:67 +#: templates/apply.html:41 templates/apply.html.py:73 msgid "Add" msgstr "Ξ ΟΞΏΟΞΈΞ�ΞΊΞ·" -#: templates/apply.html:55 templates/apply.html.py:95 +#: templates/apply.html:61 templates/apply.html.py:101 #: templates/user_routes.html:34 msgid "Cancel" msgstr "ΞΞΊΟ ΟΞΏ" -#: templates/apply.html:183 +#: templates/apply.html:189 msgid "Apply for a new rule" msgstr "ΞΞ―ΟΞ·ΟΞ· Ξ΄Ξ·ΞΌΞΉΞΏΟ ΟΞ³Ξ―Ξ±Ο Ξ½ΞΞΏΟ ΟΞ―Ξ»ΟΟΞΏΟ " -#: templates/apply.html:198 +#: templates/apply.html:204 msgid "Rule Basic Info" msgstr "ΞΞ±ΟΞΉΞΊΞΟ Ξ Ξ»Ξ·ΟΞΏΟΞΏΟΞ―Ξ΅Ο Ξ¦Ξ―Ξ»ΟΟΞΏΟ " -#: templates/apply.html:216 +#: templates/apply.html:222 msgid "Admin Options" msgstr "ΞΟιλογΞΟ ΞΞΉΞ±ΟΡίΟΞΉΟΞ·Ο" -#: templates/apply.html:219 templates/user_routes.html:255 +#: templates/apply.html:225 templates/user_routes.html:255 +#: templates/overview/index.html:188 msgid "Applier" msgstr "Ξ§ΟΞ�ΟΟΞ·Ο" -#: templates/apply.html:234 +#: templates/apply.html:240 msgid "Rule Match Conditions" msgstr "ΞΟΞΏΞΉ ΟΞ±ΟΟΞΉΟΞ·Ο ΟΞ―Ξ»ΟΟΞΏΟ " -#: templates/apply.html:275 +#: templates/apply.html:281 msgid "Ports" msgstr "" -#: templates/apply.html:281 +#: templates/apply.html:287 msgid "Advanced Settings (Ports)" msgstr "Ξ ΟΞΏΞ·Ξ³ΞΌΞΞ½Ξ΅Ο Ξ‘Ο ΞΈΞΌΞ―ΟΞ΅ΞΉΟ (Ports)" -#: templates/apply.html:285 +#: templates/apply.html:291 msgid "" "Select source/destination port(s), or select common port(s) for both source/" "destination" msgstr "" -#: templates/apply.html:342 +#: templates/apply.html:348 msgid "Rule Actions" msgstr "ΞΞ½ΞΟΞ³Ξ΅ΞΉΞ΅Ο Ξ¦Ξ―Ξ»ΟΟΞΏΟ " -#: templates/apply.html:363 +#: templates/apply.html:369 msgid "Expiration" msgstr "ΞΞ�ΞΎΞ·" -#: templates/apply.html:379 +#: templates/apply.html:385 msgid "Use/Comments" msgstr "Ξ§ΟΞ�ΟΞ·/Ξ£ΟΟλια" -#: templates/apply.html:384 +#: templates/apply.html:390 msgid "" "Give a short description of the intended use of this rule, that justifies " "the parameter selection above. Feel free to include any additional comments." msgstr "" -#: templates/apply.html:398 templates/registration/select_institution.html:37 +#: templates/apply.html:404 templates/registration/select_institution.html:37 msgid "Apply" msgstr "ΞΟΞ±ΟΞΌΞΏΞ³Ξ�" -#: templates/apply.html:407 +#: templates/apply.html:413 msgid "Add new port" msgstr "ΞΞΞ± port" -#: templates/base.html:59 templates/base.html.py:158 +#: templates/base.html:59 templates/base.html.py:164 msgid "Welcome" msgstr "ΞΞ±Ξ»ΟΟΞ�ΟΞΈΞ±ΟΞ΅" -#: templates/base.html:73 templates/base.html.py:102 templates/profile.html:4 +#: templates/base.html:73 templates/base.html.py:103 templates/profile.html:4 #: templates/profile.html.py:5 templates/profile.html:7 msgid "My profile" msgstr "΀ο ΟΟΞΏΟΞ―Ξ» ΞΌΞΏΟ " -#: templates/base.html:75 templates/base.html.py:106 +#: templates/base.html:75 templates/base.html.py:112 msgid "Admin" msgstr "ΞΞΉΞ±ΟΡιΟΞΉΟΟΞ�Ο" -#: templates/base.html:77 templates/base.html.py:136 +#: templates/base.html:77 templates/base.html.py:142 msgid "Logout" msgstr "ΞξοδοΟ" -#: templates/base.html:80 templates/base.html.py:144 +#: templates/base.html:80 templates/base.html.py:150 msgid "" "After clicking Retry Login, it is strongly suggested to close your browser " "and visit the page again" @@ -383,20 +387,24 @@ msgstr "" "ΞΟΞΏΟ Ξ΅ΟΞΉΞ»ΞΞΎΞ΅ΟΞ΅ ΞΟανάληΟΞ· ΞΞΉΟΟΞ΄ΞΏΟ ΞΊΞ»Ξ΅Ξ―ΟΟΞ΅ ΟΞΏΞ½ browser ΟΞ±Ο ΞΊΞ±ΞΉ Ξ΅ΟΞΉΟΞΊΞ΅ΟθΡίΟΞ΅ " "ΞΎΞ±Ξ½Ξ¬ ΟΞ· ΟΡλίδα" -#: templates/base.html:80 templates/base.html.py:144 +#: templates/base.html:80 templates/base.html.py:150 msgid "Retry Login" msgstr "ΞΟανάληΟΞ· ΞΞΉΟΟΞ΄ΞΏΟ " -#: templates/base.html:82 templates/base.html.py:141 templates/base.html:147 +#: templates/base.html:82 templates/base.html.py:147 templates/base.html:153 #: templates/welcome.html:21 msgid "Shibboleth Login" msgstr "ΞΞ―ΟΞΏΞ΄ΞΏΟ ΞΌΞ΅ Shibboleth" -#: templates/base.html:115 +#: templates/base.html:108 templates/overview/index.html:121 +msgid "Overview" +msgstr "ΞΟΞΉΟΞΊΟΟΞ·ΟΞ·" + +#: templates/base.html:121 msgid "Language" msgstr "ΞΞ»ΟΟΟΞ±" -#: templates/base.html:158 templates/user_routes.html:214 +#: templates/base.html:164 templates/user_routes.html:214 #: templates/user_routes.html.py:220 msgid "My rules" msgstr "΀α ΟΞ―Ξ»ΟΟΞ± ΞΌΞΏΟ " @@ -448,7 +456,7 @@ msgstr "ΠληΟΞΏΟΞΏΟΞ―Ξ΅Ο" msgid "Service Terms" msgstr "ΞΟΞΏΞΉ Ξ§ΟΞ�ΟΞ·Ο" -#: templates/profile.html:11 +#: templates/profile.html:11 templates/overview/index.html:156 msgid "Username" msgstr "" @@ -460,7 +468,7 @@ msgstr "ΞΞ½ΞΏΞΌΞ±" msgid "Last name" msgstr "ΞΟΟΞ½Ο ΞΌΞΏ" -#: templates/profile.html:23 +#: templates/profile.html:23 templates/overview/index.html:157 msgid "Email" msgstr "" @@ -486,43 +494,52 @@ msgstr "" msgid "Suspend" msgstr "ΞΞ±ΟΞ¬ΟΞ³Ξ·ΟΞ·" -#: templates/user_routes.html:124 +#: templates/user_routes.html:124 templates/overview/index.html:43 +#: templates/overview/index.html.py:97 msgid "Display" msgstr "Ξ ΟΞΏΞ²ΞΏΞ»Ξ�" -#: templates/user_routes.html:124 +#: templates/user_routes.html:124 templates/overview/index.html:43 +#: templates/overview/index.html.py:97 msgid "All" msgstr "ΟΞ»ΟΞ½ ΟΟΞ½" -#: templates/user_routes.html:124 +#: templates/user_routes.html:124 templates/overview/index.html:97 msgid "rules" msgstr "ΟΞ―Ξ»ΟΟΟΞ½" -#: templates/user_routes.html:126 +#: templates/user_routes.html:126 templates/overview/index.html:45 +#: templates/overview/index.html.py:99 msgid "No records to display" msgstr "ΞΡν Ξ²ΟΞΞΈΞ·ΞΊΞ±Ξ½ ΡγγΟΞ±ΟΞΟ" -#: templates/user_routes.html:128 +#: templates/user_routes.html:128 templates/overview/index.html:47 +#: templates/overview/index.html.py:101 msgid "Showing 0 to 0 of 0 entries" msgstr "ΞΡίΟΞ½ΞΏΞ½ΟΞ±Ο 0 Ξ΅ΟΟ 0 Ξ±ΟΟ 0 ΡγγΟΞ±ΟΞΟ" -#: templates/user_routes.html:131 +#: templates/user_routes.html:131 templates/overview/index.html:50 +#: templates/overview/index.html.py:104 msgid "Search:" msgstr "ΞΞ½Ξ±ΞΆΞ�ΟΞ·ΟΞ·:" -#: templates/user_routes.html:134 +#: templates/user_routes.html:134 templates/overview/index.html:53 +#: templates/overview/index.html.py:107 msgid "First" msgstr "Ξ ΟΟΟΞ·" -#: templates/user_routes.html:135 +#: templates/user_routes.html:135 templates/overview/index.html:54 +#: templates/overview/index.html.py:108 msgid "Previous" msgstr "Ξ ΟΞΏΞ·Ξ³ΞΏΟμΡνη" -#: templates/user_routes.html:136 +#: templates/user_routes.html:136 templates/overview/index.html:55 +#: templates/overview/index.html.py:109 msgid "Next" msgstr "ΞΟΟμΡνη" -#: templates/user_routes.html:137 +#: templates/user_routes.html:137 templates/overview/index.html:56 +#: templates/overview/index.html.py:110 msgid "Last" msgstr "Ξ€Ξ΅Ξ»Ξ΅Ο ΟΞ±Ξ―Ξ±" @@ -534,11 +551,11 @@ msgstr "ΞΞΏΞ½ΟΟλα" msgid "Add Rule" msgstr "ΞΞ·ΞΌΞΉΞΏΟ ΟΞ³Ξ―Ξ± ΟΞ―Ξ»ΟΟΞΏΟ " -#: templates/user_routes.html:251 +#: templates/user_routes.html:251 templates/overview/index.html:184 msgid "Match" msgstr "ΞΟΞΏΞΉ" -#: templates/user_routes.html:254 +#: templates/user_routes.html:254 templates/overview/index.html:187 msgid "Details" msgstr "ΞΞ΅ΟΟΞΏΞΌΞΟΡιΡΟ" @@ -547,22 +564,24 @@ msgid "Actions" msgstr "ΞΞ½ΞΟγΡιΡΟ" #: templates/user_routes.html:295 templates/user_routes.html.py:309 +#: templates/overview/index.html:226 templates/overview/index.html.py:240 msgid "Suspended by user" msgstr "ΞΟΡνΡΟΞ³ΞΏΟΞΏΞΉΞ�ΞΈΞ·ΞΊΞ΅ Ξ±ΟΟ ΟΞΏ ΟΟΞ�ΟΟΞ·" #: templates/user_routes.html:298 templates/user_routes.html.py:309 +#: templates/overview/index.html:229 templates/overview/index.html.py:240 msgid "Suspended by administrator" msgstr "ΞΟΡνΡΟΞ³ΞΏΟΞΏΞΉΞ�ΞΈΞ·ΞΊΞ΅ Ξ±ΟΟ ΟΞΏ διαΟΡιΟΞΉΟΟΞ�" -#: templates/user_routes.html:301 +#: templates/user_routes.html:301 templates/overview/index.html:232 msgid "Suspended due to expiration" msgstr "ΞΟΡνΡΟΞ³ΞΏΟΞΏΞΉΞ�ΞΈΞ·ΞΊΞ΅ Ξ»ΟΞ³Ο Ξ»Ξ�ΞΎΞ·Ο" -#: templates/user_routes.html:304 +#: templates/user_routes.html:304 templates/overview/index.html:235 msgid "Syncronization error. Configuration in device deffers from rule" msgstr "Ξ£Οάλμα ΟΟ Ξ³ΟΟΞΏΞ½ΞΉΟΞΌΞΏΟ. ΞΞΉΞ±ΟΞΏΟΞ¬ διαμΟΟΟΟΟΞ·Ο Ξ±ΟΟ ΟΟ ΟΞΊΞ΅Ο Ξ�" -#: templates/user_routes.html:309 +#: templates/user_routes.html:309 templates/overview/index.html:240 msgid "Rule expired" msgstr "ΞΞ�ΞΎΞ· ΦίλΟΟΞΏΟ " @@ -648,6 +667,42 @@ msgstr "" "ΞΞΉΞ± Ξ±Ξ½ΟΞΉΞΌΞ΅ΟΟΟΞΉΟΞ· ΟΟαλμάΟΟΞ½ ΞΊΞ±ΞΉ ΟληΟΞΏΟΞΏΟΞ―Ξ΅Ο, Ξ΅ΟΞΉΞΊΞΏΞΉΞ½ΟΞ½Ξ�ΟΟΞ΅ ΞΌΞ΅ ΟΞΏ Helpdesk ΟΞΏΟ " "ΞΞΞΞ€" +#: templates/overview/index.html:43 +msgid "users" +msgstr "ΟΟΞ�ΟΟΞ΅Ο" + +#: templates/overview/index.html:140 +msgid "Users - Rules" +msgstr "Ξ§ΟΞ�ΟΟΞ΅Ο - ΦίλΟΟΞ±" + +#: templates/overview/index.html:145 +msgid "Users" +msgstr "Ξ§ΟΞ�ΟΟΞ΅Ο" + +#: templates/overview/index.html:146 +msgid "Rules" +msgstr "ΦίλΟΟΞ±" + +#: templates/overview/index.html:160 +msgid "Peer" +msgstr "ΦοΟΞΞ±Ο" + +#: templates/overview/index.html:169 +msgid "Active" +msgstr "" + +#: templates/overview/index.html:169 +msgid "Inactive" +msgstr "" + +#: templates/overview/index.html:169 +msgid "Key Expired" +msgstr "" + +#: templates/overview/login.html:3 templates/overview/login.html.py:14 +msgid "Overview Login" +msgstr "ΞΞΉΟΟΞ΄ΞΏΟ ΟΟΞ·Ξ½ ΞΟΞΉΟΞΊΟΟΞ·ΟΞ·" + #: templates/registration/activate.html:3 #: templates/registration/activation_complete.html:3 #: templates/registration/activation_complete.html:7 diff --git a/templates/base.html b/templates/base.html index bb0f83a66faabbbfa2aee79887abfce31f4b85bc..a70104e8539ba596d74029f1a5a360af7c572918 100644 --- a/templates/base.html +++ b/templates/base.html @@ -98,9 +98,15 @@ body { <ul class="nav"> {% if user.is_authenticated %} + {% if user.get_profile.peer %} <li> <a href="{% url user-profile %}">{% trans "My profile" %}</a> </li> + {% endif %} + + {% if perms.accounts.overview %}<li> + <a href="{% url overview %}">{% trans "Overview" %}</a> + </li>{% endif %} {% if user.is_superuser %} <li {% block hometop %}{% endblock %}> <a href="{% url admin:index %}">{% trans "Admin" %}</a> diff --git a/templates/footer.html b/templates/footer.html index 0a84b9650346b0c909952e05f6e0776e9f51802a..daffe3a0b9fdab94d2087b5110f370d2d5ee6ab6 100644 --- a/templates/footer.html +++ b/templates/footer.html @@ -2,14 +2,15 @@ <footer class="footer"> <div id="footcontainer" class="container"> - {% if user.is_authenticated %} <p>{% trans "If you have any questions or need help, contact GRNET Helpdesk at <a href='mailto:helpdesk@grnet.gr'>helpdesk@grnet.gr</a> or 800-11-47638." %}</p> {% endif %} - <div style="padding-top: 10px;">{% trans "Designed and developed by GRNET NOC" %}</div> + <div style="padding-top: 10px;">{% trans "Designed and developed by GRNET NOC" %} + <a href="//facebook.com/noc.grnet.gr" target="_blank"><img src="/fodstatic/img/facebook_img.png" alt="GRNET NOC on Facebook" title="GRNET NOC on Facebook"/></a> <a href="//twitter.com/grnetnoc" target="_blank"><img src="/fodstatic/img/twitter_img.png" alt="GRNET NOC on Twitter" title="GRNET NOC on Twitter"/></a> + </div> <div class="row"><a href="http://noc.grnet.gr">{% trans "GRNET" %} NOC</a> | <a href="/fod/info/{{LANGUAGE_CODE}}/">{% trans "Info" %}</a> | <a href="/fod/tos/{{LANGUAGE_CODE}}/">{% trans "Service Terms" %}</a></div> <div style="padding-top: 10px;"> - <a href="//facebook.com/noc.grnet.gr" target="_blank"><img src="/fodstatic/img/facebook_img.png" alt="GRNET NOC on Facebook" title="GRNET NOC on Facebook"/></a> <a href="//twitter.com/grnetnoc" target="_blank"><img src="/fodstatic/img/twitter_img.png" alt="GRNET NOC on Twitter" title="GRNET NOC on Twitter"/></a> + </div> <div style="padding-top: 10px;"> <p style="text-align: center;"><img width="46" height="40" border="0" class="image image-img_assist_custom-46x40 " src="//noc.grnet.gr/sites/default/files/images/image_PSSYGK.img_assist_custom-46x40.png" alt="Flag ΨΣ" title="Flag ΨΣ"> <img width="49" height="40" border="0" class="image image-img_assist_custom-49x40 " src="//noc.grnet.gr/sites/default/files/images/image_EEflag.img_assist_custom-49x40.png" alt="EU flag" title="EU flag"> <img width="90" height="40" border="0" class="image image-img_assist_custom-90x40 " src="//noc.grnet.gr/sites/default/files/images/image_YPDBMTH.img_assist_custom-90x40.png" alt="Flag Ξ₯Ξ ΞΞΞΞ" title="Flag Ξ₯Ξ ΞΞΞΞ"><img width="67" height="40" border="0" class="image image-img_assist_custom-67x40 " src="//noc.grnet.gr/sites/default/files/images/image_ESPA.img_assist_custom-67x40.png" alt="ESPA" title="ESPA"></p> diff --git a/templates/overview/index.html b/templates/overview/index.html new file mode 100644 index 0000000000000000000000000000000000000000..41e262da414dc9695f24c3d78eddf102a627715f --- /dev/null +++ b/templates/overview/index.html @@ -0,0 +1,264 @@ +{% extends "base.html"%} +{% load i18n %} + +{% load i18n %} +{% block extrahead %} + + + +<script type="text/javascript" src="/fodstatic/js/jquery.dataTables.js"></script> +<script type="text/javascript" src="/fodstatic/js/datatables_bootstrap.js"></script> + +<style> +.tab-content { + overflow: visible; +} +</style> +<script type="text/javascript"> +$(document).ready(function(){ +{% if users %} +var oTableU = $('#usertable').dataTable({ + "sPaginationType": "bootstrap", + "sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>", + "aoColumns": [{ + "bSearchable": true, + "bSortable": true + }, { + "bSearchable": true, + "bSortable": true + }, { + "bSearchable": true, + "bSortable": true + }, { + "bSearchable": true, + "bSortable": true + }, { + "bSearchable": true, + "bSortable": true + }], + "aaSorting": [[0, 'desc']], + "iDisplayLength": 25, + "oSearch": {"bSmart": false, "bRegex":true}, + "oLanguage": { + "sLengthMenu": '{% trans "Display" %} <select><option value="25">25</option><option value="50">50</option><option value="-1">{% trans "All" %}</option></select> {% trans "users" %}', + "sProcessing": "Processing...", + "sZeroRecords": '{% trans "No records to display" %}', + "sInfo": "Showing _START_ to _END_ of _TOTAL_ entries", + "sInfoEmpty": "{% trans "Showing 0 to 0 of 0 entries" %}", + "sInfoFiltered": "(filtered from _MAX_ total entries)", + "sInfoPostFix": "", + "sSearch": '{% trans "Search:" %}', + "sUrl": "", + "oPaginate": { + "sFirst": '{% trans "First" %}', + "sPrevious": '{% trans "Previous" %}', + "sNext": '{% trans "Next" %}', + "sLast": '{% trans "Last" %}' + } + } +}); + +oTableU.fnDraw(); +{% endif %} +{% if routes %} +var oTableI = $('#routes_table').dataTable({ + "sPaginationType": "bootstrap", + "sDom": "<'row-fluid'<'span6'l><'span6'f>r>t<'row-fluid'<'span6'i><'span6'p>>", + "aoColumns": [{ + "bVisible": false, + "bSearchable": false, + "bSortable": false + }, { + "bSearchable": true, + "bSortable": true + }, { + "bSearchable": true, + "bSortable": true + }, { + "bSearchable": true, + "bSortable": true + }, { + "bSearchable": true, + "bSortable": true + }, { + "bSearchable": true, + "bSortable": true + }, { + "bSearchable": true, + "bSortable": true + }, { + "bSearchable": true, + "bSortable": true + }], + "aaSorting": [[0, 'desc']], + "iDisplayLength": 25, + "oSearch": {"bSmart": false, "bRegex":true}, + "oLanguage": { + "sLengthMenu": '{% trans "Display" %} <select><option value="25">25</option><option value="50">50</option><option value="-1">{% trans "All" %}</option></select> {% trans "rules" %}', + "sProcessing": "Processing...", + "sZeroRecords": '{% trans "No records to display" %}', + "sInfo": "Showing _START_ to _END_ of _TOTAL_ entries", + "sInfoEmpty": "{% trans "Showing 0 to 0 of 0 entries" %}", + "sInfoFiltered": "(filtered from _MAX_ total entries)", + "sInfoPostFix": "", + "sSearch": '{% trans "Search:" %}', + "sUrl": "", + "oPaginate": { + "sFirst": '{% trans "First" %}', + "sPrevious": '{% trans "Previous" %}', + "sNext": '{% trans "Next" %}', + "sLast": '{% trans "Last" %}' + } + } + }); + +oTableI.fnDraw(); +{% endif %} +}); +</script> +{% endblock %} +{% block brcrmb_container %} +<ul class="breadcrumb"><li><a href="{% url overview %}">{% trans "Overview" %}</a></li> + </ul> +{% endblock %} +{% block content %} +<div class="container-fluid"> + <div class="row-fluid"> + + </div> + <div class="row-fluid"> + <div class="span12"> + <div class="row-fluid"> + <!--/span--> + <div class="span12"> + {% if violation %} + <table class="table table-condensed"> + <tr class="error"><td>You have no rights to access this area. Please contact your administrator<td></tr> + </table> + {% else %} + {% block subcontent %} + <h4>{% trans "Users - Rules" %}</h4> + <hr> + + + <ul class="nav nav-tabs"> + <li class="active"><a href="#users" data-toggle="tab">{% trans "Users" %}</a></li> + <li><a href="#routes" data-toggle="tab">{% trans "Rules" %}</a></li> + </ul> + + <div class="tab-content"> + + <div class="tab-pane active" id="users"> + {% if users %} + <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" width="100%" id="usertable"> + <thead> + <tr> + <th>{% trans "Username" %}</th> + <th>{% trans "Email" %}</th> + <th>{% trans "Name" %}</th> + <th>{% trans "Status" %}</th> + <th>{% trans "Peer" %}</th> + </tr> + </thead> + <tbody> + {% for user in users %} + <tr class="GradeC"> + <td>{{user.username}}</td> + <td>{{user.email}}</td> + <td>{{user.first_name}} {{user.last_name}}</td> + <td>{% if user.registrationprofile_set.all %}{% if user.registrationprofile_set.all.0.activation_key == "ALREADY_ACTIVATED" %}{% trans "Active" %}{% else %}{% trans "Inactive" %} or {% trans "Key Expired" %}{% endif %}{% else %}-{% endif %}</td> + <td>{% if user.get_profile.peer %}{{user.get_profile.peer}}{% endif %}</td> + </tr> + {% endfor %} + </tbody> + </table> + {% endif %} + </div> + <div class="tab-pane" id="routes"> + {% if routes %} + <table cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered" width="100%" id="routes_table"> + <thead> +<tr> + <th>Id</th> + <th>{% trans "Name" %}</th> + <th>{% trans "Match" %}</th> + <th style="text-align: center;">{% trans "Then" %}</th> + <th style="text-align: center; ">{% trans "Status" %}</th> + {% comment %}<th style="text-align: center;">{% trans "Details" %}</th>{% endcomment %} + <th style="text-align: center;">{% trans "Applier" %}</th> + <th style="text-align: center;">{% trans "Expires" %}</th> + <th style="text-align: center;">{% trans "Response" %}</th> +</tr> +</thead> + +<tbody> +{% for route in routes %} + +<tr class="GradeC" > + <td>{{ route.pk }}</td> + + <td {% if route.comments %}style="color: #0088CC;"{% endif %}>{% if route.comments %}<span rel="tooltip" data-placement="top" title="{{route.comments}}">{{ route.name }}</span>{% else %}{{ route.name }}{% endif %}</td> + + <td>{{ route.get_match|safe|escape }}</td> + + <td style="text-align: center;">{{route.get_then|safe|escape}}</td> + + <td style="text-align: center; ">{% if route.status == 'EXPIRED' or route.status == 'ADMININACTIVE' or route.status == 'INACTIVE' or route.status == 'OUTOFSYNC'%} + {% if route.status == 'EXPIRED' or route.status == 'ADMININACTIVE' or route.status == 'INACTIVE' %}SUSPENDED{% else %}{% if route.status == 'OUTOFSYNC' %}ERROR{% else %}{{route.status}}{% endif %}{% endif %}{% else %}{{route.status}}{% endif %}</td> + + {% comment %}<td style="text-align: center;">{{ route.response }}</td>{% endcomment %} + + <td style="text-align: center;">{{ route.applier }}</td> + + <td style="text-align: center;" nowrap> + <span {% if route.status == 'EXPIRED' or route.status == 'ADMININACTIVE' or route.status == 'INACTIVE' or route.status == 'OUTOFSYNC'%}{% else %}{% if route.days_to_expire %} + data-placement="top" + rel = 'tooltip' + style="border-bottom:1px dashed red;" + title="Expires {% ifequal route.days_to_expire '0' %}today{% else%}in {{route.days_to_expire}} day{{ route.days_to_expire|pluralize }}{% endifequal %}" + {% endif %}{% endif %}>{{ route.expires|date:"d M y" }}</span></td> + + <td style="text-align: center; {% if route.status == 'EXPIRED' %} color: #0088CC; {% endif %}"> + {% if route.status == 'EXPIRED' %} + <span rel="tooltip" {% if route.status == 'EXPIRED' or route.status == 'ADMININACTIVE' or route.status == 'INACTIVE' or route.status == 'OUTOFSYNC'%} + data-placement="top" + title = "{% ifequal route.status 'INACTIVE' %} + {% trans 'Suspended by user' %} + {% else %} + {% ifequal route.status 'ADMININACTIVE' %} + {% trans 'Suspended by administrator' %} + {% else %} + {% ifequal route.status 'EXPIRED' %} + {% trans 'Suspended due to expiration' %} + {% else %} + {% ifequal route.status 'OUTOFSYNC' %} + {% trans 'Syncronization error. Configuration in device deffers from rule' %} + {% endifequal %} + {% endifequal %} + {% endifequal %} + {% endifequal %}" + {% endif %}>{% trans "Rule expired" %}</span>{% else %}{% if route.status == 'ADMININACTIVE' %}{% trans "Suspended by administrator" %}{% else %}{% if route.status == 'INACTIVE' %}{% trans "Suspended by user" %}{% else %}{{ route.response }}{% if route.status == 'PENDING' %}<img src="/fodstatic/dots.gif">{% endif %}{% endif %}{% endif %}{% endif %} + </td> + +</tr> + +{% endfor %} +</tbody> + </table> + {% endif %} + </div> + </div> + + {% endblock %} + {% endif %} + + </div><!--/span--> + <!--/span--> + </div><!--/row--> + </div><!--/span--> + </div><!--/row--> +</div><!--/.fluid-container--> +{% endblock %} + + + \ No newline at end of file diff --git a/templates/overview/login.html b/templates/overview/login.html new file mode 100644 index 0000000000000000000000000000000000000000..4f6046e14e6cc2f2716d993f2b1bcec256a77be2 --- /dev/null +++ b/templates/overview/login.html @@ -0,0 +1,54 @@ +{% extends "base.html" %} +{% load i18n %} +{% block title %}{% trans "Overview Login" %}{% endblock %} + + {% block content %} + <div class="container-fluid"> + <div class="row-fluid"> + <div class="span2"> + </div><!--/span--> + + <div class="span10"> + <div class="row-fluid"> + <!--/span--> + <h3 class="muted">{% trans "Overview Login" %}</h3> + <hr> + + <form class="form-horizontal" method="post" + action="{% url altlogin %}"> + + {% if form.non_field_errors %} {% for err in form.non_field_errors %} + <div class="control-group error "> + <div class="controls error"> + <span style="color: #B94A48;">{{err}}</span> + </div> + </div> + {% endfor %} {% endif %} {% csrf_token %} + <div class="control-group {% if form.username.errors %} error {% endif %}"> + <label class="control-label" for="id_username">Username</label> + <div class="controls"> + {{ form.username }} {% if form.username.errors %} <span class="help-inline"> {{ form.username.errors|join:", "}} </span> {% endif %} + </div> + </div> + <div class="control-group {% if form.password.errors %} error {% endif %}"> + <label class="control-label" for="id_password">Password</label> + <div class="controls"> + {{ form.password }} {% if form.password.errors %} <span + class="help-inline"> {{ form.password.errors|join:", "}} </span> {% endif %} + </div> + </div> + <div class="control-group"> + <div class="controls"> + <button type="submit" class="btn">Sign in</button> + <input type="hidden" name="next" value="{% url overview %}" /> + </div> + </div> + </form> + <!--/span--> + </div><!--/row--> + </div><!--/span--> + + </div><!--/span--> + </div><!--/.fluid-container--> + {% endblock %} + diff --git a/templates/welcome.html b/templates/welcome.html index 95298fcccce958e86fc28af928a97e9112e9c4ea..75b0b67da4c473eae23d3467f48206802af66eee 100644 --- a/templates/welcome.html +++ b/templates/welcome.html @@ -5,13 +5,17 @@ {% block contentplaceholder %} <div id="content" class="container"> <div class="hero-unit" style="text-align:center"><h2>GRNET - Firewall on Demand</h2> - <p><img src="/fodstatic/img/fod_footer_logo.png" /></p> + <p> + <iframe width="640" height="360" src="https://www.youtube.com/embed/VZy7DG8sjSk?rel=0" frameborder="0" allowfullscreen></iframe> + </p> + <p>{% blocktrans %}Welcome to GRNET's FoD service.{% endblocktrans %}</p> </div> <div class="row-fluid"> <div class="span4 well"><h3>{% trans "What" %}?</h3><hr> <p>{% blocktrans %}If you are new to the service, take some time to read the{% endblocktrans %} <a href="/fod/info/{{LANGUAGE_CODE}}/">{% trans "Service Description" %}</a></p> <p>{% blocktrans %}Before asking why? take some time to look at the{% endblocktrans %} <a href="/fod/tos/{{LANGUAGE_CODE}}/">{% trans "Service Terms" %}</a></p> + </div> <div class="span4 well"><h3>{% trans "How" %}?</h3><hr> <p>{% blocktrans %}If you have properly set your Shibboleth attributes, you may proceed{% endblocktrans %}</p> @@ -24,7 +28,10 @@ </div> </div> <div class="span4 well"><h3>{% trans "Help" %}?</h3><hr> - {% blocktrans %}For troubleshooting info and remarks do not hesitate to contact GRNET's Helpdesk.{% endblocktrans %}</div> + <p> + <p>{% blocktrans %}For troubleshooting info and remarks do not hesitate to contact GRNET's Helpdesk.{% endblocktrans %}</p> + </p> + </div> </div> </div> diff --git a/urls.py.dist b/urls.py.dist index a41cff02d4c4359bd4676b00cf4c2a92021a50d7..da6668200832a05e31e385d43978cf2e86fe3924 100644 --- a/urls.py.dist +++ b/urls.py.dist @@ -34,6 +34,10 @@ urlpatterns = patterns('', # Uncomment the next line to enable the admin: (r'^fod/admin/', include(admin.site.urls)), (r'^tinymce/', include('tinymce.urls')), + + + url(r'^fod/altlogin/?', 'django.contrib.auth.views.login', {'template_name': 'overview/login.html'}, name="altlogin"), + url(r'^fod/overview/?$', 'flowspy.flowspec.views.overview', name="overview"), )