diff --git a/PyRIGS/settings.py b/PyRIGS/settings.py index 31ec83b8..5877ad74 100644 --- a/PyRIGS/settings.py +++ b/PyRIGS/settings.py @@ -58,7 +58,7 @@ INSTALLED_APPS = ( 'django.contrib.messages', 'django.contrib.staticfiles', 'RIGS', - 'assets' + 'assets', 'debug_toolbar', 'registration', diff --git a/PyRIGS/urls.py b/PyRIGS/urls.py index 061139df..cb78130c 100644 --- a/PyRIGS/urls.py +++ b/PyRIGS/urls.py @@ -12,7 +12,7 @@ urlpatterns = [ # url(r'^blog/', include('blog.urls')), url(r'^', include('RIGS.urls')), - url('assets', include('assets.urls')), + url('^assets/', include('assets.urls')), url('^user/register/$', RegistrationView.as_view(form_class=RIGS.forms.ProfileRegistrationFormUniqueEmail), name="registration_register"), url('^user/', include('django.contrib.auth.urls')), diff --git a/assets/static/js/ajax_form.js b/assets/static/js/ajax_form.js index d90363a3..b9b06e25 100644 --- a/assets/static/js/ajax_form.js +++ b/assets/static/js/ajax_form.js @@ -16,23 +16,7 @@ function filterAssetTable() { }); } -function updateAsset() { - $.ajax({ - url : "/asset/update/", // the endpoint - type : "POST", // http method - data : { - form: $('#asset_update_form').serialize() - }, - traditional: true, - success : function(data) { - // console.log(data); - window.location.href = data['url']; - }, - - error : function(xhr) {console.log(xhr.status + ": " + xhr.responseText)} - }); -} function formAssetSearch() { $.ajax({ diff --git a/assets/templates/asset_list.html b/assets/templates/asset_list.html index 655cdac8..4e8efda0 100644 --- a/assets/templates/asset_list.html +++ b/assets/templates/asset_list.html @@ -1,7 +1,7 @@ {% extends 'base.html' %} {% block title %}List{% endblock %} -{% block main %} +{% block content %}

Asset List

diff --git a/assets/templates/asset_update.html b/assets/templates/asset_update.html index 14716fd4..9cbc1860 100644 --- a/assets/templates/asset_update.html +++ b/assets/templates/asset_update.html @@ -4,7 +4,7 @@ {% block title %}Asset {{ object.asset_id }}{% endblock %} -{% block main %} +{% block content %}

{% if edit and object %} @@ -294,7 +294,26 @@ {% endblock %} -{% block script %} +{% block js %} + {# - {% endblock %} \ No newline at end of file diff --git a/assets/templates/confirm_delete.html b/assets/templates/confirm_delete.html new file mode 100644 index 00000000..39b19b35 --- /dev/null +++ b/assets/templates/confirm_delete.html @@ -0,0 +1,16 @@ + \ No newline at end of file diff --git a/assets/templates/helpers/paginator.html b/assets/templates/helpers/paginator.html new file mode 100644 index 00000000..9854a039 --- /dev/null +++ b/assets/templates/helpers/paginator.html @@ -0,0 +1,17 @@ +{% if is_paginated %} + +{% endif %} \ No newline at end of file diff --git a/assets/templates/helpers/render_field.html b/assets/templates/helpers/render_field.html new file mode 100644 index 00000000..6397415d --- /dev/null +++ b/assets/templates/helpers/render_field.html @@ -0,0 +1,15 @@ +{% load widget_tweaks %} + +
+ {% if css %} + {% render_field field|add_class:css %} + {% elif disable_if_filled and field.value %} + {% render_field field|attr:'disabled' %} + {% elif css and disable_if_filled %} + {% render_field field|add_class:css|attr:'disabled' %} + {% else %} + {{ field }} + {% endif %} + + +
\ No newline at end of file diff --git a/assets/templates/supplier_detail.html b/assets/templates/supplier_detail.html index 135fdeba..12684669 100644 --- a/assets/templates/supplier_detail.html +++ b/assets/templates/supplier_detail.html @@ -1,6 +1,6 @@ {% extends 'base.html' %} {% block title %}Detail{% endblock %} -{% block main %} +{% block content %} {{ object }} {% endblock %} \ No newline at end of file diff --git a/assets/templates/supplier_list.html b/assets/templates/supplier_list.html index bcfd8e09..83d725c5 100644 --- a/assets/templates/supplier_list.html +++ b/assets/templates/supplier_list.html @@ -1,7 +1,7 @@ {% extends 'base.html' %} {% block title %}List{% endblock %} -{% block main %} +{% block content %}

Supplier List

diff --git a/assets/templates/supplier_update.html b/assets/templates/supplier_update.html index 92ea3787..b21afc7a 100644 --- a/assets/templates/supplier_update.html +++ b/assets/templates/supplier_update.html @@ -1,7 +1,7 @@ {% extends 'base.html' %} {% block title %}Edit{% endblock %} -{% block main %} +{% block content %}

Supplier diff --git a/assets/views.py b/assets/views.py index 2f557574..bebb6482 100644 --- a/assets/views.py +++ b/assets/views.py @@ -28,11 +28,6 @@ class PasswordChange(auth_views.PasswordChangeView): def get_success_url(self): return reverse_lazy('profile_detail', kwargs={'pk': self.request.user.id}) - -class Index(LoginRequiredMixin, generic.TemplateView): - template_name = 'index.html' - - class AssetList(LoginRequiredMixin, generic.ListView): model = models.Asset template_name = 'asset_list.html' diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 00000000..95b8798b --- /dev/null +++ b/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +DJANGO_SETTINGS_MODULE = myproject.settings \ No newline at end of file