diff options
author | Kabir Kukreti <kabir@gnowledge.org> | 2012-03-21 15:13:37 +0530 |
---|---|---|
committer | Kabir Kukreti <kabir@gnowledge.org> | 2012-03-21 15:13:37 +0530 |
commit | a65ec2f214c96cb537a101f96998d87a9e681991 (patch) | |
tree | c87e050c53dbf143eef75edda1b990c258c3c8eb | |
parent | 7264ef6355baa26d72c6127e5fe8d1e623837204 (diff) | |
download | gnowsys-a65ec2f214c96cb537a101f96998d87a9e681991.tar.gz |
Authentication bug in forms fixed.User dashboard fixed to include my dashboard for admin
16 files changed, 117 insertions, 18 deletions
diff --git a/gstudio/templates/gstudio/_header.html b/gstudio/templates/gstudio/_header.html index 5106179..f1f21d1 100644 --- a/gstudio/templates/gstudio/_header.html +++ b/gstudio/templates/gstudio/_header.html @@ -9,11 +9,12 @@ grappelli_admin_title }}{% else %}{% get_admin_title %}{% endif %} | <a href="/">Home</a> | <a href="{{ get_absolute_url }}/objects">objects</a> + {% if user.is_authenticated %} - {% if user.is_staff%} + | <a href="{{ get_absolute_url }}/gstudio/userdashboard">My Dashboard</a> + {% if user.is_staff %} | <a href="{{ get_absolute_url }}/admin">Admin Dashboard</a> - {% else %} - | <a href="{{ get_absolute_url }}/gstudio/userdashboard">My Dashboard</a> + {% endif %} {% endif %} diff --git a/gstudio/templates/gstudiodashboard/dashboard.html b/gstudio/templates/gstudiodashboard/dashboard.html index d70c451..43ea1ed 100644 --- a/gstudio/templates/gstudiodashboard/dashboard.html +++ b/gstudio/templates/gstudiodashboard/dashboard.html @@ -6,18 +6,18 @@ <h1>Welcome {% firstof user.first_name user.username %}</h1> <h2>Gstudio</h2> <ul> - <li><a href="{{get_absoulute_url}}/gstudio/add/metatype">{% trans 'Add Metatype' %}</a></li> - <li><a href="{{get_absoulute_url}}/gstudio/add/metatype">{% trans 'Add Metatype' %}</a></li> - <li><a href="{{get_absoulute_url}}/gstudio/add/objecttype">{% trans 'Add Object type' %}</a></li> - <li><a href="{{get_absoulute_url}}/gstudio/add/relationtype">{% trans 'Add Relation type' %}</a></li> - <li><a href="{{get_absoulute_url}}/gstudio/add/attributetype">{% trans 'Add Attribute Type' %}</a></li> - <li><a href="{{get_absoulute_url}}/gstudio/add/systemtype">{% trans 'Add System Type' %}</li> - <li><a href="{{get_absoulute_url}}/gstudio/add/processtype">{% trans 'Add Process Type' %}</li> - <li><a href="{{get_absoulute_url}}/gstudio/add/attribute">{% trans 'Add Attribute' %}</li> - <li><a href="{{get_absoulute_url}}/gstudio/add/relation">{% trans 'Add Relation' %}</li> - <li><a href="{{get_absoulute_url}}/gstudio/add/complement">{% trans 'Add Complement' %}</li> - <li><a href="{{get_absoulute_url}}/gstudio/add/intersection">{% trans 'Add Intersection' %}</li> - <li><a href="{{get_absoulute_url}}/gstudio/add/union">{% trans 'Add Union' %}</li> + <li><a href="{{get_absoulute_url}}/nodetypes/add/metatype">{% trans 'Add Metatype' %}</a></li> + <li><a href="{{get_absoulute_url}}/nodetypes/add/metatype">{% trans 'Add Metatype' %}</a></li> + <li><a href="{{get_absoulute_url}}/nodetypes/add/objecttype">{% trans 'Add Object type' %}</a></li> + <li><a href="{{get_absoulute_url}}/nodetypes/add/relationtype">{% trans 'Add Relation type' %}</a></li> + <li><a href="{{get_absoulute_url}}/nodetypes/add/attributetype">{% trans 'Add Attribute Type' %}</a></li> + <li><a href="{{get_absoulute_url}}/nodetypes/add/systemtype">{% trans 'Add System Type' %}</li> + <li><a href="{{get_absoulute_url}}/nodetypes/add/processtype">{% trans 'Add Process Type' %}</li> + <li><a href="{{get_absoulute_url}}/nodetypes/add/attribute">{% trans 'Add Attribute' %}</li> + <li><a href="{{get_absoulute_url}}/nodetypes/add/relation">{% trans 'Add Relation' %}</li> + <li><a href="{{get_absoulute_url}}/nodetypes/add/complement">{% trans 'Add Complement' %}</li> + <li><a href="{{get_absoulute_url}}/nodetypes/add/intersection">{% trans 'Add Intersection' %}</li> + <li><a href="{{get_absoulute_url}}/nodetypes/add/union">{% trans 'Add Union' %}</li> </ul> <h2>Objects</h2> <ul> diff --git a/gstudio/templates/gstudioforms/gstudioattributeform.html b/gstudio/templates/gstudioforms/gstudioattributeform.html index 6779ab5..38e85fa 100644 --- a/gstudio/templates/gstudioforms/gstudioattributeform.html +++ b/gstudio/templates/gstudioforms/gstudioattributeform.html @@ -4,6 +4,7 @@ {% block content %} <form method="post" action="."> {% csrf_token %} +{% if user.is_authenticated %} <h2>Form to add attributes</h2> {% for field in formset %} @@ -12,10 +13,18 @@ {{ field.errors }}<br> + {% endfor %} + + <input type="Submit" value="{% trans 'ADD' %}" /> <input type="hidden" name="next" value="{{ next }}" /> + {% else %} + <h2>Sorry either you are not logged in or dont have permission to view this content</h2> + <a href="{{get_absoulute_url}}/accounts/login">{% trans 'Login' %}</a><br> + <a href="{{get_absoulute_url}}/accounts/register">{% trans 'Register' %}</a><br> + {% endif %} </form> {% endblock %} diff --git a/gstudio/templates/gstudioforms/gstudioattributetypeform.html b/gstudio/templates/gstudioforms/gstudioattributetypeform.html index 7b5529f..2a04811 100644 --- a/gstudio/templates/gstudioforms/gstudioattributetypeform.html +++ b/gstudio/templates/gstudioforms/gstudioattributetypeform.html @@ -4,6 +4,7 @@ {% block content %} <form method="post" action="."> {% csrf_token %} +{% if user.is_authenticated %} <h2>Form to add Attributetypes</h2> {% for field in formset %} @@ -17,5 +18,11 @@ <input type="Submit" value="{% trans 'ADD' %}" /> <input type="hidden" name="next" value="{{ next }}" /> </form> + {% else %} + <h2>Sorry either you are not logged in or dont have permission to view this content</h2> + <a href="{{get_absoulute_url}}/accounts/login">{% trans 'Login' %}</a><br> + <a href="{{get_absoulute_url}}/accounts/register">{% trans 'Register' %}</a><br> + {% endif %} + {% endblock %} diff --git a/gstudio/templates/gstudioforms/gstudiocomplementform.html b/gstudio/templates/gstudioforms/gstudiocomplementform.html index 4304d24..7066541 100644 --- a/gstudio/templates/gstudioforms/gstudiocomplementform.html +++ b/gstudio/templates/gstudioforms/gstudiocomplementform.html @@ -4,6 +4,7 @@ {% block content %} <form method="post" action="."> {% csrf_token %} +{% if user.is_authenticated %} <h2>Form to add Complements</h2> {% for field in formset %} @@ -17,5 +18,11 @@ <input type="Submit" value="{% trans 'ADD' %}" /> <input type="hidden" name="next" value="{{ next }}" /> </form> + {% else %} + <h2>Sorry either you are not logged in or dont have permission to view this content</h2> + <a href="{{get_absoulute_url}}/accounts/login">{% trans 'Login' %}</a><br> + <a href="{{get_absoulute_url}}/accounts/register">{% trans 'Register' %}</a><br> + {% endif %} + {% endblock %} diff --git a/gstudio/templates/gstudioforms/gstudiointersectionform.html b/gstudio/templates/gstudioforms/gstudiointersectionform.html index 71533ff..13cbecc 100644 --- a/gstudio/templates/gstudioforms/gstudiointersectionform.html +++ b/gstudio/templates/gstudioforms/gstudiointersectionform.html @@ -3,7 +3,8 @@ {% block content %} <form method="post" action="."> -{% csrf_token %} +{% csrf_token %} +{% if user.is_authenticated %} <h2>Form to add Intersection</h2> {% for field in formset %} @@ -17,5 +18,11 @@ <input type="Submit" value="{% trans 'ADD' %}" /> <input type="hidden" name="next" value="{{ next }}" /> </form> + {% else %} + <h2>Sorry either you are not logged in or dont have permission to view this content</h2> + <a href="{{get_absoulute_url}}/accounts/login">{% trans 'Login' %}</a><br> + <a href="{{get_absoulute_url}}/accounts/register">{% trans 'Register' %}</a><br> + {% endif %} + {% endblock %} diff --git a/gstudio/templates/gstudioforms/gstudiometatypeform.html b/gstudio/templates/gstudioforms/gstudiometatypeform.html index b86b50e..bdb9116 100644 --- a/gstudio/templates/gstudioforms/gstudiometatypeform.html +++ b/gstudio/templates/gstudioforms/gstudiometatypeform.html @@ -4,6 +4,7 @@ {% block content %} <form method="post" action="."> {% csrf_token %} +{% if user.is_authenticated %} <h2>Form to add Metatypes</h2> {% for field in formset %} @@ -18,5 +19,11 @@ <input type="Submit" value="{% trans 'ADD' %}" /> <input type="hidden" name="next" value="{{ next }}" /> </form> + {% else %} + <h2>Sorry either you are not logged in or dont have permission to view this content</h2> + <a href="{{get_absoulute_url}}/accounts/login">{% trans 'Login' %}</a><br> + <a href="{{get_absoulute_url}}/accounts/register">{% trans 'Register' %}</a><br> + {% endif %} + {% endblock %} diff --git a/gstudio/templates/gstudioforms/gstudioobjecttypeform.html b/gstudio/templates/gstudioforms/gstudioobjecttypeform.html index c4d8bcb..2fc2fba 100644 --- a/gstudio/templates/gstudioforms/gstudioobjecttypeform.html +++ b/gstudio/templates/gstudioforms/gstudioobjecttypeform.html @@ -4,6 +4,7 @@ {% block content %} <form method="post" action="."> {% csrf_token %} +{% if user.is_authenticated %} <h2>Form to add Objecttypes</h2> {% for field in formset %} @@ -17,5 +18,11 @@ <input type="Submit" value="{% trans 'ADD' %}" /> <input type="hidden" name="next" value="{{ next }}" /> </form> + {% else %} + <h2>Sorry either you are not logged in or dont have permission to view this content</h2> + <a href="{{get_absoulute_url}}/accounts/login">{% trans 'Login' %}</a><br> + <a href="{{get_absoulute_url}}/accounts/register">{% trans 'Register' %}</a><br> + {% endif %} + {% endblock %} diff --git a/gstudio/templates/gstudioforms/gstudioprocesstypeform.html b/gstudio/templates/gstudioforms/gstudioprocesstypeform.html index 0093959..0ecfbc0 100644 --- a/gstudio/templates/gstudioforms/gstudioprocesstypeform.html +++ b/gstudio/templates/gstudioforms/gstudioprocesstypeform.html @@ -4,6 +4,7 @@ {% block content %} <form method="post" action="."> {% csrf_token %} +{% if user.is_authenticated %} <h2>Form to add Processtypes</h2> {% for field in formset %} @@ -16,5 +17,10 @@ <input type="Submit" value="{% trans 'ADD' %}" /> <input type="hidden" name="next" value="{{ next }}" /> </form> + {% else %} + <h2>Sorry either you are not logged in or dont have permission to view this content</h2> + <a href="{{get_absoulute_url}}/accounts/login">{% trans 'Login' %}</a><br> + <a href="{{get_absoulute_url}}/accounts/register">{% trans 'Register' %}</a><br> + {% endif %} {% endblock %} diff --git a/gstudio/templates/gstudioforms/gstudiorelationform.html b/gstudio/templates/gstudioforms/gstudiorelationform.html index b87d6a0..79c5ba7 100644 --- a/gstudio/templates/gstudioforms/gstudiorelationform.html +++ b/gstudio/templates/gstudioforms/gstudiorelationform.html @@ -3,6 +3,7 @@ {% block content %} <form method="post" action="."> +{% if user.is_authenticated %} {% csrf_token %} <h2>Form to add Relations</h2> {% for field in formset %} @@ -17,5 +18,10 @@ <input type="Submit" value="{% trans 'ADD' %}" /> <input type="hidden" name="next" value="{{ next }}" /> </form> + {% else %} + <h2>Sorry either you are not logged in or dont have permission to view this content</h2> + <a href="{{get_absoulute_url}}/accounts/login">{% trans 'Login' %}</a><br> + <a href="{{get_absoulute_url}}/accounts/register">{% trans 'Register' %}</a><br> + {% endif %} {% endblock %} diff --git a/gstudio/templates/gstudioforms/gstudiorelationtypeform.html b/gstudio/templates/gstudioforms/gstudiorelationtypeform.html index 947e0e0..48531b9 100644 --- a/gstudio/templates/gstudioforms/gstudiorelationtypeform.html +++ b/gstudio/templates/gstudioforms/gstudiorelationtypeform.html @@ -3,6 +3,8 @@ {% block content %} <form method="post" action="."> +{% if user.is_authenticated %} + {% csrf_token %} <h2>Form to add Relationtypes</h2> {% for field in formset %} @@ -16,5 +18,11 @@ <input type="Submit" value="{% trans 'ADD' %}" /> <input type="hidden" name="next" value="{{ next }}" /> </form> + {% else %} + <h2>Sorry either you are not logged in or dont have permission to view this content</h2> + <a href="{{get_absoulute_url}}/accounts/login">{% trans 'Login' %}</a><br> + <a href="{{get_absoulute_url}}/accounts/register">{% trans 'Register' %}</a><br> + {% endif %} + {% endblock %} diff --git a/gstudio/templates/gstudioforms/gstudiosystemtypeform.html b/gstudio/templates/gstudioforms/gstudiosystemtypeform.html index c2238f1..780a38e 100644 --- a/gstudio/templates/gstudioforms/gstudiosystemtypeform.html +++ b/gstudio/templates/gstudioforms/gstudiosystemtypeform.html @@ -3,6 +3,7 @@ {% block content %} <form method="post" action="."> +{% if user.is_authenticated %} {% csrf_token %} <h2>Form to add Systemtypes</h2> {% for field in formset %} @@ -17,5 +18,11 @@ <input type="Submit" value="{% trans 'ADD' %}" /> <input type="hidden" name="next" value="{{ next }}" /> </form> + {% else %} + <h2>Sorry either you are not logged in or dont have permission to view this content</h2> + <a href="{{get_absoulute_url}}/accounts/login">{% trans 'Login' %}</a><br> + <a href="{{get_absoulute_url}}/accounts/register">{% trans 'Register' %}</a><br> + {% endif %} + {% endblock %} diff --git a/gstudio/templates/gstudioforms/gstudiounionform.html b/gstudio/templates/gstudioforms/gstudiounionform.html index 7d7ec4d..e931013 100644 --- a/gstudio/templates/gstudioforms/gstudiounionform.html +++ b/gstudio/templates/gstudioforms/gstudiounionform.html @@ -3,6 +3,7 @@ {% block content %} <form method="post" action="."> +{% if user.is_authenticated %} {% csrf_token %} <h2>Form to add unions</h2> {% for field in formset %} @@ -17,5 +18,10 @@ <input type="Submit" value="{% trans 'ADD' %}" /> <input type="hidden" name="next" value="{{ next }}" /> </form> - + {% else %} + <h2>Sorry either you are not logged in or dont have permission to view this content</h2> + <a href="{{get_absoulute_url}}/accounts/login">{% trans 'Login' %}</a><br> + <a href="{{get_absoulute_url}}/accounts/register">{% trans 'Register' %}</a><br> + {% endif %} +x {% endblock %} diff --git a/objectapp/templates/objectappforms/gbobjectform.html b/objectapp/templates/objectappforms/gbobjectform.html index 02e3bb5..8322277 100644 --- a/objectapp/templates/objectappforms/gbobjectform.html +++ b/objectapp/templates/objectappforms/gbobjectform.html @@ -5,7 +5,7 @@ <form method="post" action="."> {% csrf_token %} <h2>Form to add Objects</h2> - +{% if user.is_authenticated %} {% for field in formset %} {{ field.label_tag }}:{{ field }}<br> @@ -17,6 +17,13 @@ <input type="Submit" value="{% trans 'ADD' %}" /> <input type="hidden" name="next" value="{{ next }}" /> + </form> + {% else %} + <h2>Sorry either you are not logged in or dont have permission to view this content</h2> + <a href="{{get_absoulute_url}}/accounts/login">{% trans 'Login' %}</a><br> + <a href="{{get_absoulute_url}}/accounts/register">{% trans 'Register' %}</a><br> + {% endif %} + {% endblock %} diff --git a/objectapp/templates/objectappforms/processform.html b/objectapp/templates/objectappforms/processform.html index 3a99bff..e8fd6ae 100644 --- a/objectapp/templates/objectappforms/processform.html +++ b/objectapp/templates/objectappforms/processform.html @@ -4,6 +4,7 @@ {% block content %} <form method="post" action="."> {% csrf_token %} +{% if user.is_authenticated %} <h2>Form to add Processes</h2> {% for field in formset %} @@ -18,5 +19,11 @@ <input type="Submit" value="{% trans 'ADD' %}" /> <input type="hidden" name="next" value="{{ next }}" /> </form> + {% else %} + <h2>Sorry either you are not logged in or dont have permission to view this content</h2> + <a href="{{get_absoulute_url}}/accounts/login">{% trans 'Login' %}</a><br> + <a href="{{get_absoulute_url}}/accounts/register">{% trans 'Register' %}</a><br> + {% endif %} + {% endblock %} diff --git a/objectapp/templates/objectappforms/systemform.html b/objectapp/templates/objectappforms/systemform.html index 9635940..6697897 100644 --- a/objectapp/templates/objectappforms/systemform.html +++ b/objectapp/templates/objectappforms/systemform.html @@ -4,6 +4,7 @@ {% block content %} <form method="post" action="."> {% csrf_token %} +{% if user.is_authenticated %} <h2>Form to add Systems</h2> {% for field in formset %} @@ -18,5 +19,11 @@ <input type="Submit" value="{% trans 'ADD' %}" /> <input type="hidden" name="next" value="{{ next }}" /> </form> + {% else %} + <h2>Sorry either you are not logged in or dont have permission to view this content</h2> + <a href="{{get_absoulute_url}}/accounts/login">{% trans 'Login' %}</a><br> + <a href="{{get_absoulute_url}}/accounts/register">{% trans 'Register' %}</a><br> + {% endif %} + {% endblock %} |