diff --git a/InvenTree/InvenTree/urls.py b/InvenTree/InvenTree/urls.py index 07fbf9bca8..edfc1a6750 100644 --- a/InvenTree/InvenTree/urls.py +++ b/InvenTree/InvenTree/urls.py @@ -21,6 +21,8 @@ from django.conf.urls.static import static from django.views.generic.base import RedirectView from rest_framework.documentation import include_docs_urls +from .views import IndexView, SearchView + from users.urls import user_urls admin.site.site_header = "InvenTree Admin" @@ -50,6 +52,9 @@ urlpatterns = [ url(r'^logout/', auth_views.logout, {'template_name': 'registration/logout.html'}, name='logout'), url(r'^admin/', admin.site.urls, name='inventree-admin'), + url(r'^index/', IndexView.as_view(), name='index'), + url(r'^search/', SearchView.as_view(), name='search'), + url(r'^api/', include(apipatterns)), url(r'^api-doc/', include_docs_urls(title='InvenTree API')), ] @@ -62,4 +67,4 @@ if settings.DEBUG: urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) # Send any unknown URLs to the parts page -urlpatterns += [url(r'^.*$', RedirectView.as_view(url='/part/', permanent=False), name='part-index')] +urlpatterns += [url(r'^.*$', RedirectView.as_view(url='/index/', permanent=False), name='index')] diff --git a/InvenTree/InvenTree/views.py b/InvenTree/InvenTree/views.py index 7c5d900d42..bee9274370 100644 --- a/InvenTree/InvenTree/views.py +++ b/InvenTree/InvenTree/views.py @@ -6,6 +6,8 @@ from django.http import JsonResponse from django.views import View from django.views.generic import UpdateView, CreateView, DeleteView +from django.views.generic.base import TemplateView + from rest_framework import views from django.http import JsonResponse @@ -207,3 +209,19 @@ class AjaxDeleteView(AjaxMixin, DeleteView): else: return response + + +class IndexView(TemplateView): + + template_name = 'InvenTree/index.html' + + +class SearchView(TemplateView): + + template_name = 'InvenTree/search.html' + + def post(self, request, *args, **kwargs): + + context = self.get_context_data() + + return super(TemplateView, self).render_to_response(context) diff --git a/InvenTree/templates/InvenTree/index.html b/InvenTree/templates/InvenTree/index.html index cae3564216..4150313bf9 100644 --- a/InvenTree/templates/InvenTree/index.html +++ b/InvenTree/templates/InvenTree/index.html @@ -1,10 +1,11 @@ {% extends "base.html" %} {% block content %} +

InvenTree

+ +

Index!

{% endblock %} - {% block js_load %} -{{ block.super }} {% endblock %} \ No newline at end of file diff --git a/InvenTree/templates/InvenTree/search.html b/InvenTree/templates/InvenTree/search.html index ab6532afb2..2e8c755d3c 100644 --- a/InvenTree/templates/InvenTree/search.html +++ b/InvenTree/templates/InvenTree/search.html @@ -1,10 +1,15 @@ -{% extends "base.html"% } +{% extends "base.html" %} {% block content %} +

InvenTree Search

+ +

+ Search stuff goes here. +

+ {% endblock %} {% block js_load %} -{{ block.super }} {% endblock %} \ No newline at end of file diff --git a/InvenTree/templates/navbar.html b/InvenTree/templates/navbar.html index 702cfbd075..707f6a7f9f 100644 --- a/InvenTree/templates/navbar.html +++ b/InvenTree/templates/navbar.html @@ -12,11 +12,12 @@
  • Companies