Index: lams_tool_nb/conf/language/lams/ApplicationResources.properties =================================================================== diff -u -r5b5e0e132cfecce0e21294be6108750a6c4a4f37 -rf9b66c238ae9c7cd34c559cc80bc7ad8f8c51f5b --- lams_tool_nb/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision 5b5e0e132cfecce0e21294be6108750a6c4a4f37) +++ lams_tool_nb/conf/language/lams/ApplicationResources.properties (.../ApplicationResources.properties) (revision f9b66c238ae9c7cd34c559cc80bc7ad8f8c51f5b) @@ -59,5 +59,7 @@ message.no.reflection.available =No notebook entry has been added. advanced.allow.comments=Allow learner comments label.view.comments=View Comments +advanced.comments.like.only=Like Button Only +advanced.comments.like.and.dislike=Like and Dislike Buttons #======= End labels: Exported 51 labels for en AU ===== Index: lams_tool_nb/conf/language/lams/ApplicationResources_en_AU.properties =================================================================== diff -u -r5b5e0e132cfecce0e21294be6108750a6c4a4f37 -rf9b66c238ae9c7cd34c559cc80bc7ad8f8c51f5b --- lams_tool_nb/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision 5b5e0e132cfecce0e21294be6108750a6c4a4f37) +++ lams_tool_nb/conf/language/lams/ApplicationResources_en_AU.properties (.../ApplicationResources_en_AU.properties) (revision f9b66c238ae9c7cd34c559cc80bc7ad8f8c51f5b) @@ -59,6 +59,8 @@ message.no.reflection.available =No notebook entry has been added. advanced.allow.comments=Allow learner comments label.view.comments=View Comments +advanced.comments.like.only=Like Button Only +advanced.comments.like.and.dislike=Like and Dislike Buttons #======= End labels: Exported 51 labels for en AU ===== Index: lams_tool_nb/db/sql/tool_insert.sql =================================================================== diff -u -r279ab8b6c6d02f80bb949e44011343f6c7150f6e -rf9b66c238ae9c7cd34c559cc80bc7ad8f8c51f5b --- lams_tool_nb/db/sql/tool_insert.sql (.../tool_insert.sql) (revision 279ab8b6c6d02f80bb949e44011343f6c7150f6e) +++ lams_tool_nb/db/sql/tool_insert.sql (.../tool_insert.sql) (revision f9b66c238ae9c7cd34c559cc80bc7ad8f8c51f5b) @@ -25,7 +25,9 @@ help_url, language_file, create_date_time, -modified_date_time +modified_date_time, +allow_comments, +comments_like_dislike ) VALUES ( @@ -52,5 +54,7 @@ 'http://wiki.lamsfoundation.org/display/lamsdocs/lanb11', 'org.lamsfoundation.lams.tool.noticeboard.ApplicationResources', NOW(), -NOW() +NOW(), +0, +0 ); Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/NoticeboardContent.java =================================================================== diff -u -r5b5e0e132cfecce0e21294be6108750a6c4a4f37 -rf9b66c238ae9c7cd34c559cc80bc7ad8f8c51f5b --- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/NoticeboardContent.java (.../NoticeboardContent.java) (revision 5b5e0e132cfecce0e21294be6108750a6c4a4f37) +++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/NoticeboardContent.java (.../NoticeboardContent.java) (revision f9b66c238ae9c7cd34c559cc80bc7ad8f8c51f5b) @@ -76,7 +76,10 @@ /** nullable persistent field */ private boolean allowComments; - + + /** nullable persistent field */ + private boolean commentsLikeAndDislike; + /** persistent field */ private Set nbSessions = new HashSet(); @@ -87,7 +90,7 @@ /** full constructor */ public NoticeboardContent(Long nbContentId, String title, String content, boolean defineLater, boolean reflectOnActivity, String reflectInstructions, boolean contentInUse, Long creatorUserId, - Date dateCreated, Date dateUpdated, boolean allowComments) { + Date dateCreated, Date dateUpdated, boolean allowComments, boolean commentsLikeAndDislike) { this.nbContentId = nbContentId; this.title = title; this.content = content; @@ -99,6 +102,7 @@ this.dateCreated = dateCreated; this.dateUpdated = dateUpdated; this.allowComments = allowComments; + this.commentsLikeAndDislike = commentsLikeAndDislike; } /** @@ -118,6 +122,7 @@ this.dateCreated = dateCreated; this.dateUpdated = null; this.allowComments = false; + this.commentsLikeAndDislike = false; } /** @@ -218,6 +223,22 @@ } /** + * @hibernate.property column="comments_like_dislike" length="1" + */ + + public boolean isCommentsLikeAndDislike() { + return commentsLikeAndDislike; + } + + /** + * @param commentsLikeAndDislike + * The commentsLikeAndDislike to set. + */ + public void setCommentsLikeAndDislike(boolean commentsLikeAndDislike) { + this.commentsLikeAndDislike = commentsLikeAndDislike; + } + + /** * @hibernate.property column="nb_content_id" length="20" not-null="true" */ @@ -298,7 +319,7 @@ RepositoryCheckedException { NoticeboardContent newContent = new NoticeboardContent(toContentId, nb.getTitle(), nb.getContent(), nb.isDefineLater(), nb.getReflectOnActivity(), nb.getReflectInstructions(), nb.isContentInUse(), - nb.getCreatorUserId(), nb.getDateCreated(), nb.getDateUpdated(), nb.isAllowComments()); + nb.getCreatorUserId(), nb.getDateCreated(), nb.getDateUpdated(), nb.isAllowComments(), nb.isCommentsLikeAndDislike()); return newContent; } Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/dbupdates/patch20160105.sql =================================================================== diff -u --- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/dbupdates/patch20160105.sql (revision 0) +++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/dbupdates/patch20160105.sql (revision f9b66c238ae9c7cd34c559cc80bc7ad8f8c51f5b) @@ -0,0 +1,16 @@ +-- Turn off autocommit, so nothing is committed if there is an error +SET AUTOCOMMIT = 0; +SET FOREIGN_KEY_CHECKS=0; +----------------------Put all sql statements below here------------------------- + +-- LDEV-3631 Use simple commenting widget +ALTER TABLE tl_lanb11_content ADD COLUMN comments_like_dislike TINYINT(1) DEFAULT 0; + +UPDATE lams_tool SET tool_version='20160105' WHERE tool_signature='lanb11'; + +----------------------Put all sql statements above here------------------------- + +-- If there were no errors, commit and restore autocommit to on +COMMIT; +SET AUTOCOMMIT = 1; +SET FOREIGN_KEY_CHECKS=1; \ No newline at end of file Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringForm.java =================================================================== diff -u -r5b5e0e132cfecce0e21294be6108750a6c4a4f37 -rf9b66c238ae9c7cd34c559cc80bc7ad8f8c51f5b --- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringForm.java (.../NbAuthoringForm.java) (revision 5b5e0e132cfecce0e21294be6108750a6c4a4f37) +++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbAuthoringForm.java (.../NbAuthoringForm.java) (revision f9b66c238ae9c7cd34c559cc80bc7ad8f8c51f5b) @@ -78,6 +78,7 @@ private String defineLater; private boolean allowComments; + private boolean commentsLikeAndDislike; private boolean reflectOnActivity; private String reflectInstructions; @@ -102,6 +103,12 @@ public void setAllowComments(boolean allowComments) { this.allowComments = allowComments; } + public boolean isCommentsLikeAndDislike() { + return commentsLikeAndDislike; + } + public void setCommentsLikeAndDislike(boolean commentsLikeAndDislike) { + this.commentsLikeAndDislike = commentsLikeAndDislike; + } public boolean getReflectOnActivity() { return reflectOnActivity; } @@ -202,6 +209,7 @@ setTitle(nbContent.getTitle()); setBasicContent(nbContent.getContent()); setAllowComments(nbContent.isAllowComments()); + setCommentsLikeAndDislike(nbContent.isCommentsLikeAndDislike()); setReflectOnActivity(nbContent.getReflectOnActivity()); setReflectInstructions(nbContent.getReflectInstructions()); } @@ -211,6 +219,7 @@ nbContent.setTitle(getTitle()); nbContent.setContent(getBasicContent()); nbContent.setAllowComments(isAllowComments()); + nbContent.setCommentsLikeAndDislike(isCommentsLikeAndDislike()); if (defineLater == null || defineLater.length() == 0) { // ie. If defineLater is null or empty, this means we are in authoring nbContent.setReflectOnActivity(getReflectOnActivity()); Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbLearnerAction.java =================================================================== diff -u -r8aded0b18a5a7712622ae56f38923fa297449977 -rf9b66c238ae9c7cd34c559cc80bc7ad8f8c51f5b --- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbLearnerAction.java (.../NbLearnerAction.java) (revision 8aded0b18a5a7712622ae56f38923fa297449977) +++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbLearnerAction.java (.../NbLearnerAction.java) (revision f9b66c238ae9c7cd34c559cc80bc7ad8f8c51f5b) @@ -204,6 +204,8 @@ NoticeboardContent nbContent = nbService.retrieveNoticeboardBySessionID(toolSessionID); request.setAttribute("reflectInstructions", nbContent.getReflectInstructions()); request.setAttribute("title", nbContent.getTitle()); + request.setAttribute("allowComments", nbContent.isAllowComments()); + request.setAttribute("likeAndDislike", nbContent.isCommentsLikeAndDislike()); // get the existing reflection entry NotebookEntry entry = nbService.getEntry(toolSessionID, CoreNotebookConstants.NOTEBOOK_TOOL, NoticeboardConstants.TOOL_SIGNATURE, getUserID(request).intValue()); Index: lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbLearnerStarterAction.java =================================================================== diff -u -r5b5e0e132cfecce0e21294be6108750a6c4a4f37 -rf9b66c238ae9c7cd34c559cc80bc7ad8f8c51f5b --- lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbLearnerStarterAction.java (.../NbLearnerStarterAction.java) (revision 5b5e0e132cfecce0e21294be6108750a6c4a4f37) +++ lams_tool_nb/src/java/org/lamsfoundation/lams/tool/noticeboard/web/NbLearnerStarterAction.java (.../NbLearnerStarterAction.java) (revision f9b66c238ae9c7cd34c559cc80bc7ad8f8c51f5b) @@ -185,10 +185,11 @@ request.setAttribute("reflectEntry", notebookEntry.getEntry()); } request.setAttribute("reflectInstructions", nbContent.getReflectInstructions()); - request.setAttribute("reflectOnActivity", nbContent.getReflectOnActivity()); - request.setAttribute("allowComments", nbContent.isAllowComments()); + request.setAttribute("reflectOnActivity", nbContent.getReflectOnActivity()); + request.setAttribute("allowComments", nbContent.isAllowComments()); + request.setAttribute("likeAndDislike", nbContent.isCommentsLikeAndDislike()); - Boolean userFinished = (nbUser!=null && NoticeboardUser.COMPLETED.equals(nbUser.getUserStatus())); + Boolean userFinished = (nbUser!=null && NoticeboardUser.COMPLETED.equals(nbUser.getUserStatus())); request.setAttribute("userFinished", userFinished); LearningWebUtil.putActivityPositionInRequestByToolSessionId(toolSessionID, request, getServlet() Index: lams_tool_nb/web/WEB-INF/tags/Comments.tag =================================================================== diff -u -rf65bf8d775c89d19993d672813a4af9f95266267 -rf9b66c238ae9c7cd34c559cc80bc7ad8f8c51f5b --- lams_tool_nb/web/WEB-INF/tags/Comments.tag (.../Comments.tag) (revision f65bf8d775c89d19993d672813a4af9f95266267) +++ lams_tool_nb/web/WEB-INF/tags/Comments.tag (.../Comments.tag) (revision f9b66c238ae9c7cd34c559cc80bc7ad8f8c51f5b) @@ -7,7 +7,10 @@ <%@ attribute name="height" required="false" rtexprvalue="true"%> <%@ attribute name="width" required="false" rtexprvalue="true"%> <%@ attribute name="mode" required="false" rtexprvalue="true"%> +<%@ attribute name="likeAndDislike" required="false" rtexprvalue="true"%> +<%@ attribute name="readOnly" required="false" rtexprvalue="true"%> + @@ -21,8 +24,16 @@ &mode=${mode} - + + + + + + + + + + + Index: lams_tool_nb/web/WEB-INF/tlds/lams/lams.tld =================================================================== diff -u -r5b5e0e132cfecce0e21294be6108750a6c4a4f37 -rf9b66c238ae9c7cd34c559cc80bc7ad8f8c51f5b --- lams_tool_nb/web/WEB-INF/tlds/lams/lams.tld (.../lams.tld) (revision 5b5e0e132cfecce0e21294be6108750a6c4a4f37) +++ lams_tool_nb/web/WEB-INF/tlds/lams/lams.tld (.../lams.tld) (revision f9b66c238ae9c7cd34c559cc80bc7ad8f8c51f5b) @@ -485,5 +485,9 @@ Comments /WEB-INF/tags/Comments.tag + + CommentsAuthor + /WEB-INF/tags/CommentsAuthor.tag + Index: lams_tool_nb/web/authoring/advance.jsp =================================================================== diff -u -r5b5e0e132cfecce0e21294be6108750a6c4a4f37 -rf9b66c238ae9c7cd34c559cc80bc7ad8f8c51f5b --- lams_tool_nb/web/authoring/advance.jsp (.../advance.jsp) (revision 5b5e0e132cfecce0e21294be6108750a6c4a4f37) +++ lams_tool_nb/web/authoring/advance.jsp (.../advance.jsp) (revision f9b66c238ae9c7cd34c559cc80bc7ad8f8c51f5b) @@ -2,15 +2,8 @@ -

- - + -

-

Index: lams_tool_nb/web/authoring/authoring.jsp =================================================================== diff -u -rbe07c35c372d904a65581d98660e73f3b13b69db -rf9b66c238ae9c7cd34c559cc80bc7ad8f8c51f5b --- lams_tool_nb/web/authoring/authoring.jsp (.../authoring.jsp) (revision be07c35c372d904a65581d98660e73f3b13b69db) +++ lams_tool_nb/web/authoring/authoring.jsp (.../authoring.jsp) (revision f9b66c238ae9c7cd34c559cc80bc7ad8f8c51f5b) @@ -3,14 +3,19 @@ <%@ include file="/includes/taglibs.jsp"%> -<%@ page - import="org.lamsfoundation.lams.tool.noticeboard.NoticeboardConstants"%> +<%@ page import="org.lamsfoundation.lams.tool.noticeboard.NoticeboardConstants"%> + + + <fmt:message key="activity.title" /> + + +