add dashboard app
- add new dashboard app providing dashboards for anonymous and logged in users - cleanup gnuviechadmin.urls: - import dashboard.urls and include dashboard_urls at URL root - import authentication urls and include them below /auth - remove generated commented code
This commit is contained in:
		
							parent
							
								
									8884b8b042
								
							
						
					
					
						commit
						8a29e4001c
					
				
					 7 changed files with 64 additions and 16 deletions
				
			
		
							
								
								
									
										4
									
								
								gnuviechadmin/dashboard/__init__.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										4
									
								
								gnuviechadmin/dashboard/__init__.py
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,4 @@ | |||
| """ | ||||
| This app contains the customer dashboard implementation for gnuviechadmin. | ||||
| 
 | ||||
| """ | ||||
							
								
								
									
										0
									
								
								gnuviechadmin/dashboard/migrations/__init__.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								gnuviechadmin/dashboard/migrations/__init__.py
									
										
									
									
									
										Normal file
									
								
							
							
								
								
									
										0
									
								
								gnuviechadmin/dashboard/models.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										0
									
								
								gnuviechadmin/dashboard/models.py
									
										
									
									
									
										Normal file
									
								
							
							
								
								
									
										16
									
								
								gnuviechadmin/dashboard/urls.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										16
									
								
								gnuviechadmin/dashboard/urls.py
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,16 @@ | |||
| from __future__ import absolute_import, unicode_literals | ||||
| 
 | ||||
| from django.conf.urls import patterns, url | ||||
| 
 | ||||
| from .views import ( | ||||
|     IndexView, | ||||
|     UserDashboardView, | ||||
| ) | ||||
| 
 | ||||
| 
 | ||||
| urlpatterns = patterns( | ||||
|     '', | ||||
|     url(r'^$', IndexView.as_view(), name='dashboard'), | ||||
|     url(r'^user/(?P<slug>[\w0-9@.+-_]+)/$', | ||||
|         UserDashboardView.as_view(), name='customer_dashboard'), | ||||
| ) | ||||
							
								
								
									
										31
									
								
								gnuviechadmin/dashboard/views.py
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								gnuviechadmin/dashboard/views.py
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,31 @@ | |||
| """ | ||||
| This module defines the views for the gnuviechadmin customer dashboard. | ||||
| 
 | ||||
| """ | ||||
| from __future__ import unicode_literals | ||||
| 
 | ||||
| from django.views.generic import ( | ||||
|     DetailView, | ||||
|     TemplateView, | ||||
| ) | ||||
| from django.contrib.auth import get_user_model | ||||
| 
 | ||||
| from braces.views import LoginRequiredMixin | ||||
| 
 | ||||
| 
 | ||||
| class IndexView(TemplateView): | ||||
|     """ | ||||
|     This is the dashboard view. | ||||
| 
 | ||||
|     """ | ||||
|     template_name = 'dashboard/index.html' | ||||
| 
 | ||||
| 
 | ||||
| class UserDashboardView(DetailView, LoginRequiredMixin): | ||||
|     """ | ||||
|     This is the user dashboard view. | ||||
| 
 | ||||
|     """ | ||||
|     model = get_user_model() | ||||
|     slug_field = 'username' | ||||
|     template_name = 'dashboard/user_dashboard.html' | ||||
|  | @ -226,6 +226,7 @@ DJANGO_APPS = ( | |||
| 
 | ||||
| # Apps specific for this project go here. | ||||
| LOCAL_APPS = ( | ||||
|     'dashboard', | ||||
|     'taskresults', | ||||
|     'mysqltasks', | ||||
|     'pgsqltasks', | ||||
|  |  | |||
|  | @ -1,23 +1,19 @@ | |||
| from django.conf.urls import patterns, include, url | ||||
| from django.conf.urls.static import static | ||||
| from django.conf import settings | ||||
| from django.views.generic import TemplateView | ||||
| from __future__ import absolute_import | ||||
| 
 | ||||
| from django.conf.urls import patterns, include, url | ||||
| from django.conf import settings | ||||
| 
 | ||||
| import dashboard.urls | ||||
| 
 | ||||
| from django.contrib.auth import urls as auth_urls | ||||
| 
 | ||||
| # Uncomment the next two lines to enable the admin: | ||||
| from django.contrib import admin | ||||
| admin.autodiscover() | ||||
| 
 | ||||
| urlpatterns = patterns('', | ||||
|     url(r'^$', TemplateView.as_view(template_name='base.html')), | ||||
| 
 | ||||
|     # Examples: | ||||
|     # url(r'^$', 'gnuviechadmin.views.home', name='home'), | ||||
|     # url(r'^gnuviechadmin/', include('gnuviechadmin.foo.urls')), | ||||
| 
 | ||||
|     # Uncomment the admin/doc line below to enable admin documentation: | ||||
|     # url(r'^admin/doc/', include('django.contrib.admindocs.urls')), | ||||
| 
 | ||||
|     # Uncomment the next line to enable the admin: | ||||
| urlpatterns = patterns( | ||||
|     '', | ||||
|     url(r'', include(dashboard.urls)), | ||||
|     url(r'^auth/', include(auth_urls)), | ||||
|     url(r'^admin/', include(admin.site.urls)), | ||||
| ) | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue