summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2013-06-03 17:53:53 -0700
committerJesse Morgan <jesse@jesterpm.net>2013-06-03 17:53:53 -0700
commit2689b2e69e77677522bc75cb7d790bc30ff644ab (patch)
tree736fba7d0d168d81e805b22c5d48105cb980e156 /src
parent39d697b619c5b836da38d3ae457fee8999055c45 (diff)
Adding Initial Survey Templates
Adding the base survey template and the image and text question types. Moved the hero section to the index.html template to make common-page more common. Also adding jquery and some initial grow.js code.
Diffstat (limited to 'src')
-rw-r--r--src/templates/macros/common-page.ftl2
-rw-r--r--src/templates/pages/index.html.ftl2
-rw-r--r--src/templates/templates/question-image.ftl16
-rw-r--r--src/templates/templates/question-text.ftl17
-rw-r--r--src/templates/templates/survey.ftl42
5 files changed, 77 insertions, 2 deletions
diff --git a/src/templates/macros/common-page.ftl b/src/templates/macros/common-page.ftl
index 560fa48..1a5c3d3 100644
--- a/src/templates/macros/common-page.ftl
+++ b/src/templates/macros/common-page.ftl
@@ -12,8 +12,6 @@
<div id="notfooter">
<#include "/templates/nav.ftl">
- <#include "/templates/index-hero.ftl">
-
<#nested>
<div id="push"></div>
diff --git a/src/templates/pages/index.html.ftl b/src/templates/pages/index.html.ftl
index 1505289..44f9dce 100644
--- a/src/templates/pages/index.html.ftl
+++ b/src/templates/pages/index.html.ftl
@@ -2,6 +2,8 @@
<#include "/macros/common-page.ftl">
<@commonpage>
+ <#include "/templates/index-hero.ftl">
+
<@noticebox>
The Grow Process focuses on the topic that you want to learn
about. Out 'Assessment' test will give you the right courses
diff --git a/src/templates/templates/question-image.ftl b/src/templates/templates/question-image.ftl
new file mode 100644
index 0000000..63f0616
--- /dev/null
+++ b/src/templates/templates/question-image.ftl
@@ -0,0 +1,16 @@
+<div class="imageQuestion question">
+ <#list question.answers?keys as answerid>
+ <#if selectedAnswerId?? && answerid == selectedAnswerId>
+ <a href="#" class="answer" id="${answerid}" onclick="selectAnswer(this)" class="selected"><img src="images/${question.id}-${answerid}.png" alt="${question.answers[answerid]!}" /></a>
+ <#else>
+ <a href="#" class="answer" id="${answerid}" onclick="selectAnswer(this)" class="answer"><img src="images/${question.id}-${answerid}.png" alt="${question.answers[answerid]!}" /></a>
+ </#if>
+ </#list>
+</div>
+
+<h1>${question.question}</h1>
+<#if question.description??>
+<p>
+ ${question.description}
+</p>
+</#if>
diff --git a/src/templates/templates/question-text.ftl b/src/templates/templates/question-text.ftl
new file mode 100644
index 0000000..ac5b846
--- /dev/null
+++ b/src/templates/templates/question-text.ftl
@@ -0,0 +1,17 @@
+<h1>${question.question}</h1>
+<#if question.description??>
+<p>
+ ${question.description}
+</p>
+</#if>
+
+<div class="textQuestion question">
+ <#list question.answers?keys as answerid>
+ <#if selectedAnswerId?? && answerid == selectedAnswerId>
+ <div id="${answerid}" onclick="selectAnswer(this)" class="answer selected">${question.answers[answerid].text}</div>
+ <#else>
+ <div id="${answerid}" onclick="selectAnswer(this)" class="answer">${question.answers[answerid].text}</div>
+ </#if>
+ </#list>
+</div>
+
diff --git a/src/templates/templates/survey.ftl b/src/templates/templates/survey.ftl
new file mode 100644
index 0000000..5e3722d
--- /dev/null
+++ b/src/templates/templates/survey.ftl
@@ -0,0 +1,42 @@
+<#include "/macros/common.ftl">
+<#include "/macros/common-page.ftl">
+<#include "/macros/surveycontent.ftl">
+
+<@commonpage>
+ <@noticebox>
+ The Grow Process focuses on the topic that you want to learn
+ about. Our 'Assessment' test will give you the right courses
+ fit for your level.
+ </@noticebox>
+
+ <div id="progressbar">
+ <div id="progress"></div>
+ </div>
+
+ <div id="content">
+ <form id="questionForm" action="/account/assessment/question/${question.id}" method="post">
+ <input id="answerField" type="hidden" name="answer" value="${selectedAnswerId!}" />
+ <div id="previous">
+ <a href="#" onclick="previousQuestion();return false;">
+ <img src="${contentroot}/images/previous.png" alt="Previous Question" />
+ </a>
+ </div>
+ <div id="next">
+ <a href="#" onclick="nextQuestion();return false;">
+ <img src="${contentroot}/images/next.png" alt="Next Question" />
+ </a>
+ </div>
+ <article>
+ <#switch question.type>
+ <#case "text">
+ <#include "/templates/question-text.ftl">
+ <#break>
+ <#case "image">
+ <#include "/templates/question-image.ftl">
+ <#break>
+ </#switch>
+ </article>
+ </form>
+ </div>
+</@commonpage>
+