From bd7345a7f9fe0818071133c6ce752a163a60b9e8 Mon Sep 17 00:00:00 2001
From: Jayaram R Pai
Date: Tue, 9 Sep 2014 20:13:03 +0530
Subject: made node/data functional
---
static/website/css/main.css | 6 ++++++
static/website/js/cloud.js | 8 ++++++++
static/website/templates/index.html | 6 +++---
static/website/templates/node-about.html | 9 +++++++++
static/website/templates/node-contact.html | 9 +++++++++
static/website/templates/node-invitation.html | 8 ++++++++
website/ajax.py | 7 +++++++
7 files changed, 50 insertions(+), 3 deletions(-)
create mode 100644 static/website/templates/node-about.html
create mode 100644 static/website/templates/node-contact.html
create mode 100644 static/website/templates/node-invitation.html
diff --git a/static/website/css/main.css b/static/website/css/main.css
index 7c545a9..aa27771 100644
--- a/static/website/css/main.css
+++ b/static/website/css/main.css
@@ -142,6 +142,12 @@ body, html {
-o-box-shadow: 0 0 10px #ffffff;
box-shadow: 0 0 10px #ffffff;
}
+#databox-wrapper {
+ max-width: 400px;
+}
+#databox-wrapper p {
+ text-align: justify;
+}
a.extra-link {
float: right;
color: #aaaaaa;
diff --git a/static/website/js/cloud.js b/static/website/js/cloud.js
index 162da73..6ec1ba5 100644
--- a/static/website/js/cloud.js
+++ b/static/website/js/cloud.js
@@ -169,4 +169,12 @@ $(document).ready(function() {
}, {book_id: $("#books").val()});
e.preventDefault();
});
+
+ $(document).on("click", ".node", function(e){
+ Dajaxice.website.node(function(data) {
+ Dajax.process(data);
+ $("#databox-wrapper").lightbox_me({centered: true});
+ }, {key: $(this).data("key")});
+ e.preventDefault();
+ });
});
diff --git a/static/website/templates/index.html b/static/website/templates/index.html
index ee58a95..cb99367 100644
--- a/static/website/templates/index.html
+++ b/static/website/templates/index.html
@@ -20,9 +20,9 @@
diff --git a/static/website/templates/node-about.html b/static/website/templates/node-about.html
new file mode 100644
index 0000000..eff52c9
--- /dev/null
+++ b/static/website/templates/node-about.html
@@ -0,0 +1,9 @@
+
About Scilab on GARUDA Cloud.
+
+ Scilab on Cloud facilitates execution of the codes for particular example(s)
+ online. The results can then be verified with the solved example(s) from the
+ textbook. It is also possible to change the values of the variables and in fact,
+ the code itself, and execute it. In addition to the given examples, one can also
+ copy and paste (or) write a new code in the input box provided and execute the
+ same. Read more..
+
diff --git a/static/website/templates/node-contact.html b/static/website/templates/node-contact.html
new file mode 100644
index 0000000..a938b25
--- /dev/null
+++ b/static/website/templates/node-contact.html
@@ -0,0 +1,9 @@
+
Send us your valuable suggestions and feedback that shall enable us to enhance our work.
+
+ If you wish to contribute to our activities such as Lab Migration, Textbook
+ Companion, SciLinks, Scilab on Cloud, Scilab on Aakash, please write to
+ contact@scilab.in.
+ For feedback on Lab Migration (or) Textbook Companion,
+ click here.
+
+
diff --git a/static/website/templates/node-invitation.html b/static/website/templates/node-invitation.html
new file mode 100644
index 0000000..65ed8f5
--- /dev/null
+++ b/static/website/templates/node-invitation.html
@@ -0,0 +1,8 @@
+
Contribute to Scilab Textbook Companion Project / Scilab on GARUDA Cloud.
+
+ The FOSSEE team has created a submission portal that allows the code for
+ each example to be uploaded individually. The Textbook Companion Project aims
+ to port solved examples from standard textbooks using an open source software
+ system, such as Scilab.
+ Read more..
+
diff --git a/website/ajax.py b/website/ajax.py
index 6b6f998..0e8fd9a 100644
--- a/website/ajax.py
+++ b/website/ajax.py
@@ -95,3 +95,10 @@ def contributor(request, book_id):
contributor = render_to_string('website/templates/ajax-contributor.html', context)
dajax.assign('#databox', 'innerHTML', contributor)
return dajax.json()
+
+@dajaxice_register
+def node(request, key):
+ dajax = Dajax()
+ data = render_to_string("website/templates/node-{0}.html".format(key))
+ dajax.assign('#databox', 'innerHTML', data)
+ return dajax.json()
--
cgit