summaryrefslogtreecommitdiff
path: root/src/com/p4square/grow/frontend/TrainingPageResource.java
diff options
context:
space:
mode:
authorJesse Morgan <jesse@jesterpm.net>2014-02-20 21:14:34 -0800
committerJesse Morgan <jesse@jesterpm.net>2014-02-20 21:14:34 -0800
commita2a1d7a67b1458cc342c0eb8d5a2732c806ddacf (patch)
tree3278235acde130e2abbf0ed61dfbe1a795c095b6 /src/com/p4square/grow/frontend/TrainingPageResource.java
parent9d2016bd2320f9b252e91057a36455d31457236d (diff)
Added support for displaying message on Feed.
Changed MessageThread so that a thread always contains one original message. Added support in JsonEncodedProvider for JavaTypes in addition to classes. Updated communityfeed.ftl to actually display questions and answers.
Diffstat (limited to 'src/com/p4square/grow/frontend/TrainingPageResource.java')
-rw-r--r--src/com/p4square/grow/frontend/TrainingPageResource.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/com/p4square/grow/frontend/TrainingPageResource.java b/src/com/p4square/grow/frontend/TrainingPageResource.java
index ef8515a..7b36538 100644
--- a/src/com/p4square/grow/frontend/TrainingPageResource.java
+++ b/src/com/p4square/grow/frontend/TrainingPageResource.java
@@ -70,6 +70,7 @@ public class TrainingPageResource extends FreeMarkerPageResource {
private JsonRequestClient mJsonClient;
private Provider<String, TrainingRecord> mTrainingRecordProvider;
+ private FeedData mFeedData;
// Fields pertaining to this request.
protected String mChapter;
@@ -95,6 +96,8 @@ public class TrainingPageResource extends FreeMarkerPageResource {
}
};
+ mFeedData = new FeedData(getContext(), mConfig);
+
mChapter = getAttribute("chapter");
mUserId = getRequest().getClientInfo().getUser().getIdentifier();
}
@@ -209,7 +212,12 @@ public class TrainingPageResource extends FreeMarkerPageResource {
root.put("overallProgress", overallProgress);
root.put("videos", videos);
root.put("allowUserToSkip", allowUserToSkip);
- root.put("showfeed", getQueryValue("showfeed") != null);
+
+ boolean showfeed = getQueryValue("showfeed") != null;
+ root.put("showfeed", showfeed);
+ if (showfeed) {
+ root.put("feeddata", mFeedData);
+ }
return new TemplateRepresentation(mTrainingTemplate, root, MediaType.TEXT_HTML);