diff options
author | Kabir Kukreti <kabir@gnowledge.org> | 2012-04-20 19:33:14 +0530 |
---|---|---|
committer | Kabir Kukreti <kabir@gnowledge.org> | 2012-04-20 19:33:14 +0530 |
commit | d53feae4a818e412cdbbb0588a420f08c7a94eeb (patch) | |
tree | 3e3959afbef80b9fa53f716f195316ca72696efa /demo | |
parent | 4a120db766058797ea19313d0f691df150782bc1 (diff) | |
parent | 6457ff705ace1caef875dc4ad8bd9fbc62f30dfb (diff) | |
download | gnowsys-d53feae4a818e412cdbbb0588a420f08c7a94eeb.tar.gz |
Gstudio form with user registration form merged
Merge branch 'master' of https://github.com/gnowgi/gnowsys-studio
Diffstat (limited to 'demo')
-rw-r--r-- | demo/grappelli/templates/admin/change_form.html | 119 | ||||
-rw-r--r-- | demo/urls.py | 1 |
2 files changed, 119 insertions, 1 deletions
diff --git a/demo/grappelli/templates/admin/change_form.html b/demo/grappelli/templates/admin/change_form.html index 3670165..c5a2654 100644 --- a/demo/grappelli/templates/admin/change_form.html +++ b/demo/grappelli/templates/admin/change_form.html @@ -8,12 +8,128 @@ {{ block.super }} {% endblock %} + <!-- JAVASCRIPTS --> {% block javascripts %} {{ block.super }} {% url admin:jsi18n as jsi18nurl %} <script type="text/javascript" src="{{ jsi18nurl|default:'../../../jsi18n/' }}"></script> <script src="{% admin_media_prefix %}js/grappelli/jquery.grp_inline.js" type="text/javascript"></script> +{% if change %} + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/URI.js"></script> + <script type="text/javascript" charset="utf-8"> + (function($){ + $(document).ready(function() { + $("#id_relationtype").change(function() { + + p = $("#id_relationtype").val() + test="?id=" + p; + + var url = new URI("ajaxleft/?id=" )+ test; + var smpl_uri = new URI("/admin/gstudio/relation/ajaxleft/?id=11"); + + var blah = new URI(test); + var url = blah.resolve(smpl_uri); + + $.get(url, + function(data){ + + $("#id_left_subject").empty() + + for (var key in data) { + + + $('#id_left_subject').append( + $('<option></option>').val(key).html(data[key]) + ); + } + }); + + url = "ajaxright/?id=" + test + var some_uri = new URI("/admin/gstudio/relation/ajaxright/?id=11"); + + + var blah = new URI(test); + var url = blah.resolve(some_uri); + + $.get(url, + function(data){ + + $("#id_right_subject").empty() + + for (var key in data) { + + + $('#id_right_subject').append( + $('<option></option>').val(key).html(data[key]) + ); + } + }); + + + }); + }); + })(django.jQuery); + + </script> +{% else %} + <script type="text/javascript" src="{{STATIC_URL}}gstudio/js/URI.js"></script> + <script type="text/javascript" charset="utf-8"> + (function($){ + $(document).ready(function() { + $("#id_relationtype").change(function() { + + p = $("#id_relationtype").val() + test="?id=" + p; + var url = new URI("ajaxleft/?id=" )+ test; + var some_uri = new URI("/admin/gstudio/relation/add/ajaxleft/?id=11"); + + var blah = new URI(test); + var url = blah.resolve(some_uri); + + $.get(url, + function(data){ + + $("#id_left_subject").empty() + + for (var key in data) { + + + $('#id_left_subject').append( + $('<option></option>').val(key).html(data[key]) + ); + } + }); + + url = "ajaxright/?id=" + test + var some_uri = new URI("/admin/gstudio/relation/add/ajaxright/?id=11"); + + + var blah = new URI(test); + var url = blah.resolve(some_uri); + + $.get(url, + function(data){ + + $("#id_right_subject").empty() + + for (var key in data) { + + + $('#id_right_subject').append( + $('<option></option>').val(key).html(data[key]) + ); + } + }); + + + }); + }); + })(django.jQuery); + + </script> +{% endif %} + <script type="text/javascript" charset="utf-8"> (function($) { $(document).ready(function() { @@ -102,6 +218,7 @@ {% if has_absolute_url %}<li><a href="../../../r/{{ content_type_id }}/{{ object_id }}/" class="focus" target="_blank">{% trans "View on site" %}</a></li>{% endif%} {% endblock %} </ul> + {% endif %} {% endif %} {% endblock %} @@ -113,7 +230,7 @@ <form {% if has_file_field %}enctype="multipart/form-data" {% endif %}action="{{ form_url }}" method="post" id="{{ opts.module_name }}_form">{% csrf_token %}{% block form_top %}{% endblock %} <div> <!-- Popup Hidden Field --> - {% if is_popup %}<input type="hidden" name="_popup" value="1" />{% endif %} + {% if is_popup %}tretret<input type="hidden" name="_popup" value="1" />{% endif %} <!-- Submit-Row --> {% if save_on_top %}{% submit_row %}{% endif %} diff --git a/demo/urls.py b/demo/urls.py index e74f885..ee0bd7f 100644 --- a/demo/urls.py +++ b/demo/urls.py @@ -95,6 +95,7 @@ urlpatterns = patterns( url(r'^xmlrpc/$', 'django_xmlrpc.views.handle_xmlrpc'), url(r'^i18n/', include('django.conf.urls.i18n')), url(r'^admin/doc/', include('django.contrib.admindocs.urls')), + url(r'^admin/gstudio/', include('gstudio.urls.ajaxurls')), url(r'^admin/', include(admin.site.urls)), url(r'^objects/admin/', include(admin.site.urls)), url(r'^nodetypes/admin/', include(admin.site.urls)), |