diff options
Diffstat (limited to 'static')
-rw-r--r-- | static/website/css/main.css | 16 | ||||
-rw-r--r-- | static/website/js/cloud.js | 22 | ||||
-rw-r--r-- | static/website/templates/ajax-contributor.html | 21 | ||||
-rw-r--r-- | static/website/templates/index.html | 10 |
4 files changed, 60 insertions, 9 deletions
diff --git a/static/website/css/main.css b/static/website/css/main.css index d4938fe..7c545a9 100644 --- a/static/website/css/main.css +++ b/static/website/css/main.css @@ -133,14 +133,19 @@ body, html { font-size: .6em; display: block; } -#lightbox-me-wrapper { +#plotbox-wrapper, +#databox-wrapper { padding: 35px; background: #ffffff; - box-shadow: 0 0 10px #ffffff; + -webkit-box-shadow: 0 0 10px #ffffff; + -moz-box-shadow: 0 0 10px #ffffff; + -o-box-shadow: 0 0 10px #ffffff; + box-shadow: 0 0 10px #ffffff; } a.extra-link { float: right; color: #aaaaaa; + display: none; } .ajax-loader { position: relative; @@ -152,3 +157,10 @@ a.extra-link { background: url("../images/ajax-loader.gif"); background-size: cover; } +table { + border: 1px solid #cccccc; +} +table td { + padding: 5px 10px; + border: 1px solid #cccccc; +} diff --git a/static/website/js/cloud.js b/static/website/js/cloud.js index 50b9a07..162da73 100644 --- a/static/website/js/cloud.js +++ b/static/website/js/cloud.js @@ -71,6 +71,7 @@ $(document).ready(function() { $("#books-wrapper").html(""); $("#chapters-wrapper").html(""); $("#examples-wrapper").html(""); + $("#contributor").hide(); ajax_loader(this); Dajaxice.website.books(function(data) { Dajax.process(data); @@ -81,6 +82,8 @@ $(document).ready(function() { $(document).on("change", "#books", function() { $("#chapters-wrapper").html(""); $("#examples-wrapper").html(""); + $("#contributor").show(); + $("#download-book").show(); ajax_loader(this); Dajaxice.website.chapters(function(data) { Dajax.process(data); @@ -90,6 +93,7 @@ $(document).ready(function() { $(document).on("change", "#chapters", function() { $("#examples-wrapper").html(""); + $("#download-chapter").show(); ajax_loader(this); Dajaxice.website.examples(function(data) { Dajax.process(data); @@ -99,6 +103,7 @@ $(document).ready(function() { $(document).on("change", "#examples", function() { ajax_loader(this); + $("#download-example").show(); Dajaxice.website.code(function(data) { editor.setValue(data.code); ajax_loader("clear"); @@ -106,8 +111,8 @@ $(document).ready(function() { }); /* Execute the code */ - $lightbox_wrapper = $("#lightbox-me-wrapper"); - $lightbox = $("#lightbox-me"); + $plotbox_wrapper = $("#plotbox-wrapper"); + $plotbox = $("#plotbox"); $(document).on("click", "#execute", function() { $("#execute-inner").html("Executing..."); Dajaxice.website.execute(function(data) { @@ -119,8 +124,8 @@ $(document).ready(function() { src: data.plot_path, width: 400 }); - $lightbox.html($plot); - $lightbox_wrapper.lightbox_me({centered: true}); + $plotbox.html($plot); + $plotbox_wrapper.lightbox_me({centered: true}); } }, { token: $("[name='csrfmiddlewaretoken']").val(), @@ -155,4 +160,13 @@ $(document).ready(function() { $(key).after("<span class='ajax-loader'></span>"); } } + + /* Contributor details */ + $(document).on("click", "#contributor", function(e) { + Dajaxice.website.contributor(function(data) { + Dajax.process(data); + $("#databox-wrapper").lightbox_me({centered: true}); + }, {book_id: $("#books").val()}); + e.preventDefault(); + }); }); diff --git a/static/website/templates/ajax-contributor.html b/static/website/templates/ajax-contributor.html new file mode 100644 index 0000000..a3ab2dc --- /dev/null +++ b/static/website/templates/ajax-contributor.html @@ -0,0 +1,21 @@ +<h6><u>Contributor details</u></h6> +<table> + <tbody> + <tr> + <td>Contributor name</td> + <td>{{ proposal.full_name }}</td> + </tr> + <tr> + <td>Mentor</td> + <td>{{ proposal.faculty }}</td> + </tr> + <tr> + <td>Book Reviewer</td> + <td>{{ proposal.reviewer }}</td> + </tr> + <tr> + <td>College</td> + <td>{{ proposal.university }}</td> + </tr> + </tbody> +</table> diff --git a/static/website/templates/index.html b/static/website/templates/index.html index 31d028c..ee58a95 100644 --- a/static/website/templates/index.html +++ b/static/website/templates/index.html @@ -105,9 +105,13 @@ </div> <!-- /#content-inner --> </div> <!-- /#content-wrapper --> - <div id="lightbox-me-wrapper"> - <div id="lightbox-me"></div> - </div> <!-- /#lightbox-me-wrapper --> + <div id="plotbox-wrapper"> + <div id="plotbox"></div> + </div> <!-- /#plotbox-wrapper --> + + <div id="databox-wrapper"> + <div id="databox"></div> + </div> <!-- /#databox-wrapper --> <script src="http://code.jquery.com/jquery-1.10.2.min.js"></script> <script src="{% static '/static/dajax/jquery.dajax.core.js' %}"></script> |