refactoring urls
Change-Id: If7c9bbfec35f733b3154fd74d83794764f4dad44
Signed-off-by: lombardofr <lombardo@everyup.it>
diff --git a/vimhandler/template/vim_create.html b/vimhandler/template/vim_create.html
index 187dc87..f7f91a2 100644
--- a/vimhandler/template/vim_create.html
+++ b/vimhandler/template/vim_create.html
@@ -19,7 +19,7 @@
{% block breadcrumb_body %}
{{ block.super }}
- <li><a href="{% url 'projects:vims:list' %}">VIMS</a></li>
+ <li><a href="{% url 'vims:list' %}">VIMS</a></li>
{% endblock %}
{% block content_body %}
@@ -27,7 +27,7 @@
<div class="row">
<div class="col-md-12">
- <form action='{% url "projects:vims:create" %}' method="post">
+ <form action='{% url "vims:create" %}' method="post">
{% csrf_token %}
<div class="box">
<div class="box-header with-border">
@@ -175,7 +175,7 @@
</div>
<div class="box-footer">
- <button onclick="location.href='{% url 'projects:vims:list' %}'" class="btn btn-default pull-left">Back to
+ <button onclick="location.href='{% url 'vims:list' %}'" class="btn btn-default pull-left">Back to
VIM Accounts
</button>
<button class="btn btn-primary pull-right">Create</button>
diff --git a/vimhandler/template/vim_list.html b/vimhandler/template/vim_list.html
index 535f4db..d1b9545 100644
--- a/vimhandler/template/vim_list.html
+++ b/vimhandler/template/vim_list.html
@@ -19,7 +19,7 @@
{% block breadcrumb_body %}
{{ block.super }}
- <li><a href="{% url "projects:vims:list" %}">VIMS</a></li>
+ <li><a href="{% url "vims:list" %}">VIMS</a></li>
{% endblock %}
{% block content_body %}
@@ -33,7 +33,7 @@
<div class="box-header with-border">
<h3 class="box-title">Registered VIM</h3>
<div class="box-tools">
- <a href='{% url "projects:vims:create" %}' class="btn btn-block btn-primary btn-sm"><i
+ <a href='{% url "vims:create" %}' class="btn btn-block btn-primary btn-sm"><i
class="fa fa-plus"></i><span> New VIM</span></a>
</div>
</div>
@@ -64,10 +64,10 @@
<td>
<div class="btn-group">
<button type="button" class="btn btn-default"
- onclick="location.href='{% url "projects:vims:show" vim_id=p|get:"_id" %}'" data-toggle="tooltip" data-placement="top" data-container="body" title="Show Info"><i
+ onclick="location.href='{% url "vims:show" vim_id=p|get:"_id" %}'" data-toggle="tooltip" data-placement="top" data-container="body" title="Show Info"><i
class="fa fa-info"></i></button>
<button type="button" class="btn btn-default"
- onclick="javascript:deleteVim('{% url "projects:vims:delete" vim_id=p|get:"_id" %}')" data-toggle="tooltip" data-placement="top" data-container="body" title="Delete"><i
+ onclick="javascript:deleteVim('{% url "vims:delete" vim_id=p|get:"_id" %}')" data-toggle="tooltip" data-placement="top" data-container="body" title="Delete"><i
class="far fa-trash-alt" ></i></button>
</div>
</td>
diff --git a/vimhandler/template/vim_show.html b/vimhandler/template/vim_show.html
index 13613de..38f2700 100644
--- a/vimhandler/template/vim_show.html
+++ b/vimhandler/template/vim_show.html
@@ -18,7 +18,7 @@
{% block breadcrumb_body %}
{{ block.super }}
- <li><a href="{% url 'projects:vims:list' %}">VIMS</a></li>
+ <li><a href="{% url 'vims:list' %}">VIMS</a></li>
{% endblock %}
{% block content_body %}
@@ -121,7 +121,7 @@
</div>
<div class="box-footer">
<div class="">
- <button onclick="location.href='{% url 'projects:vims:list' %}'" class="btn btn-primary">Back to VIM Accounts</button>
+ <button onclick="location.href='{% url 'vims:list' %}'" class="btn btn-primary">Back to VIM Accounts</button>
</div>
</div>
</div>
diff --git a/vimhandler/views.py b/vimhandler/views.py
index bf88c11..d41ff82 100644
--- a/vimhandler/views.py
+++ b/vimhandler/views.py
@@ -76,7 +76,7 @@
print e
result = client.vim_create(user.get_token(), vim_data)
# TODO 'vim:show', to_redirect=True, vim_id=vim_id
- return __response_handler(request, result, 'projects:vims:list', to_redirect=True, )
+ return __response_handler(request, result, 'vims:list', to_redirect=True, )
@login_required
def delete(request, vim_id=None):
@@ -86,7 +86,7 @@
del_res = client.vim_delete(user.get_token(), vim_id)
except Exception as e:
log.exception(e)
- return __response_handler(request, {}, 'projects:vims:list', to_redirect=True, )
+ return __response_handler(request, {}, 'vims:list', to_redirect=True, )
@login_required
def show(request, vim_id=None):