diff --git a/openid_provider/templates/openid_provider/base.html b/openid_provider/templates/openid_provider/base.html index 55184e7..3c92587 100644 --- a/openid_provider/templates/openid_provider/base.html +++ b/openid_provider/templates/openid_provider/base.html @@ -41,7 +41,18 @@ {% if user.is_authenticated %} {% endif %} diff --git a/openid_provider/templates/openid_provider/client_detail.html b/openid_provider/templates/openid_provider/client_detail.html new file mode 100644 index 0000000..c8c728f --- /dev/null +++ b/openid_provider/templates/openid_provider/client_detail.html @@ -0,0 +1,51 @@ +{% extends "openid_provider/base.html" %} + +{% load i18n %} + +{% block content %} + +
+
+
+
+

{{ object.name }}

+
+
+

ID

+
{{ object.client_id }}
+

SECRET

+
{{ object.client_secret }}
+ + + + + + + + + + + + + + + + + + + + + + +
User{{ object.user.email }}
Client Type{{ object.client_type }}
Response Type{{ object.response_type }}
Redirect URIs{{ object.redirect_uris|join:', ' }}
Scopes{{ object.scope|join:', ' }}
+ +
+
+
+
+ +{% endblock %} \ No newline at end of file diff --git a/openid_provider/templates/openid_provider/clients.html b/openid_provider/templates/openid_provider/client_list.html similarity index 63% rename from openid_provider/templates/openid_provider/clients.html rename to openid_provider/templates/openid_provider/client_list.html index 7b53a06..bb39220 100644 --- a/openid_provider/templates/openid_provider/clients.html +++ b/openid_provider/templates/openid_provider/client_list.html @@ -8,6 +8,12 @@
+
    +
  • + {{ object_list.count }} + Total +
  • +
New Client
@@ -18,9 +24,10 @@

Clients

+

{% trans 'Click on the client you want to see.' %}

{% for client in object_list %} - {{ client.name }} + {{ client.name }}{{ client.default_redirect_uri }} {% empty %}
No clients yet.
{% endfor %} diff --git a/openid_provider/templates/registration/login.html b/openid_provider/templates/openid_provider/login.html similarity index 84% rename from openid_provider/templates/registration/login.html rename to openid_provider/templates/openid_provider/login.html index 171f0ab..72e9d8d 100644 --- a/openid_provider/templates/registration/login.html +++ b/openid_provider/templates/openid_provider/login.html @@ -27,8 +27,9 @@ Remember Me
- - + + +
diff --git a/openid_provider/templates/openid_provider/logout.html b/openid_provider/templates/openid_provider/logout.html new file mode 100644 index 0000000..4201674 --- /dev/null +++ b/openid_provider/templates/openid_provider/logout.html @@ -0,0 +1,19 @@ +{% extends "openid_provider/base.html" %} + +{% load i18n %} + +{% block content %} + +
+
+
+
+

{{ title }}

+

{% trans "Thanks for spending some quality time with the Web site today." %}

+

{% trans 'Log in again' %}

+
+
+
+
+ +{% endblock %} \ No newline at end of file diff --git a/openid_provider/templates/registration/logout.html b/openid_provider/templates/registration/logout.html deleted file mode 100644 index bd9de8a..0000000 --- a/openid_provider/templates/registration/logout.html +++ /dev/null @@ -1,19 +0,0 @@ -{% extends "openid_provider/base.html" %} - -{% load i18n %} - -{% block content %} - -
-
-
-
-

Logged out

-
-

See you next time.

-
-
-
-
- -{% endblock %} \ No newline at end of file diff --git a/openid_provider/urls.py b/openid_provider/urls.py index 9d8f58e..906a1c6 100644 --- a/openid_provider/urls.py +++ b/openid_provider/urls.py @@ -10,9 +10,10 @@ urlpatterns = patterns('', url(r'^token/$', csrf_exempt(endpoints.TokenView.as_view()), name='token'), url(r'^userinfo/$', csrf_exempt(endpoints.userinfo), name='userinfo'), - url(r'^login/$', 'django.contrib.auth.views.login', name='login'), - url(r'^logout/$', 'django.contrib.auth.views.logout', name='logout'), + url(r'^login/$', 'django.contrib.auth.views.login', { 'template_name': 'openid_provider/login.html' }, name='login'), + url(r'^logout/$', 'django.contrib.auth.views.logout', { 'template_name': 'openid_provider/logout.html' }, name='logout'), - url(r'^clients/$', clients.ClientListView.as_view(), name='clients'), + url(r'^clients/$', clients.ClientListView.as_view(), name='client_list'), + url(r'^clients/(?P[\d]+)/$', clients.ClientDetailView.as_view(), name='client_detail'), ) \ No newline at end of file diff --git a/openid_provider/views/clients.py b/openid_provider/views/clients.py index ce3f2e2..5114888 100644 --- a/openid_provider/views/clients.py +++ b/openid_provider/views/clients.py @@ -1,4 +1,5 @@ from django.utils.decorators import method_decorator +from django.views.generic.detail import DetailView from django.views.generic.list import ListView from openid_provider.lib.utils.decorators import staff_required from openid_provider.models import Client @@ -7,8 +8,11 @@ from openid_provider.models import Client class ClientListView(ListView): model = Client - template_name = "openid_provider/clients.html" @method_decorator(staff_required) def dispatch(self, *args, **kwargs): - return super(ClientListView, self).dispatch(*args, **kwargs) \ No newline at end of file + return super(ClientListView, self).dispatch(*args, **kwargs) + +class ClientDetailView(DetailView): + + model = Client \ No newline at end of file