diff options
author | Jayaram R Pai | 2014-09-11 00:02:57 +0530 |
---|---|---|
committer | Jayaram R Pai | 2014-09-11 00:02:57 +0530 |
commit | 961133f4a76fa5e56c74f3521a96109d23855e5a (patch) | |
tree | 4ffb9fbba127a8fb74e46be305ca32421803f5b4 /static/website | |
parent | 523bc7d9c6e6632f51ad98534806a937b3600557 (diff) | |
download | scilab-on-cloud-961133f4a76fa5e56c74f3521a96109d23855e5a.tar.gz scilab-on-cloud-961133f4a76fa5e56c74f3521a96109d23855e5a.tar.bz2 scilab-on-cloud-961133f4a76fa5e56c74f3521a96109d23855e5a.zip |
added report bug form
Diffstat (limited to 'static/website')
-rw-r--r-- | static/website/css/main.css | 27 | ||||
-rw-r--r-- | static/website/js/cloud.js | 19 | ||||
-rw-r--r-- | static/website/templates/bug-form.html | 27 | ||||
-rw-r--r-- | static/website/templates/index.html | 5 |
4 files changed, 76 insertions, 2 deletions
diff --git a/static/website/css/main.css b/static/website/css/main.css index aa27771..2447338 100644 --- a/static/website/css/main.css +++ b/static/website/css/main.css @@ -134,7 +134,8 @@ body, html { display: block; } #plotbox-wrapper, -#databox-wrapper { +#databox-wrapper, +#bug-form-wrapper { padding: 35px; background: #ffffff; -webkit-box-shadow: 0 0 10px #ffffff; @@ -170,3 +171,27 @@ table td { padding: 5px 10px; border: 1px solid #cccccc; } +.error { + border: 2px solid tomato !important; +} +#bug-form { + width: 400px; +} +#bug-form .wrapper { + margin-bottom: 15px; +} +#bug-form input[type=text], +#bug-form select, +#bug-form textarea{ + width: 80%; + max-width: none; + margin-bottom: 0; +} +#bug-form #id_email_wrapper { + display: none; +} +#bug-form #non-field-errors .error-message{ + border: 1px solid tomato; + width: 80%; + padding: 5px; +} diff --git a/static/website/js/cloud.js b/static/website/js/cloud.js index 6ec1ba5..33dd209 100644 --- a/static/website/js/cloud.js +++ b/static/website/js/cloud.js @@ -177,4 +177,23 @@ $(document).ready(function() { }, {key: $(this).data("key")}); e.preventDefault(); }); + + + /* Bug form handling */ + $(document).on("click", "#bug", function(e) { + Dajaxice.website.bug_form(function(data){ + Dajax.process(data); + $("#bug-form-wrapper").lightbox_me({centered: false}); + }); + e.preventDefault(); + }); + + $(document).on("click", "#bug-form-submit", function(e){ + Dajaxice.website.bug_form_submit(Dajax.process, {form: $("#bug-form").serialize(true)}); + e.preventDefault(); + }); + + $(document).on("click", "#bug-form #id_notify", function() { + $("#id_email_wrapper").toggle(this.checked); + }); }); diff --git a/static/website/templates/bug-form.html b/static/website/templates/bug-form.html new file mode 100644 index 0000000..d27911a --- /dev/null +++ b/static/website/templates/bug-form.html @@ -0,0 +1,27 @@ +<form id="bug-form" action="" method="POST" accept-charset="utf-8"> {% csrf_token %} + {{ form.example }} + <div id="non-field-errors"> + </div> + <div id="id_issue_wrapper" class="wrapper"> + <label>Type of issue:</label> + {{ form.issue }} + </div> + + <div id="id_description_wrapper" class="wrapper"> + <label>Description:</label> + {{ form.description }} + </div> + + <div id="id_notify_wrapper" class="wrapper"> + <label>{{ form.notify }} I want to be notified.</label> + </div> + + <div id="id_email_wrapper" class="wrapper"> + <span id="email-wrapper"> + {{ form.email.errors }} + <label>Email:</label> + {{ form.email }} + </span> + </div> + <input type="submit" id="bug-form-submit"> +</form> diff --git a/static/website/templates/index.html b/static/website/templates/index.html index bf15ea4..88abbf8 100644 --- a/static/website/templates/index.html +++ b/static/website/templates/index.html @@ -91,7 +91,7 @@ <textarea id="result"></textarea> </div> <!-- /#output --> <a id="bug" class="button">Report bug / Give Feedback</a> - + <div id="credits"> <small> Disclaimer: Scilab is a trademark of Inria @@ -113,6 +113,9 @@ <div id="databox"></div> </div> <!-- /#databox-wrapper --> + <div id="bug-form-wrapper"> + </div> <!-- /#databox-wrapper --> + <script src="{% static 'website/js/jquery-1.10.2.min.js' %}"></script> <script src="{% static '/static/dajax/jquery.dajax.core.js' %}"></script> <script src="{% static 'website/js/codemirror.js'%}"></script> |