-
-
Notifications
You must be signed in to change notification settings - Fork 967
/
Copy pathdfCompose.jsp
173 lines (160 loc) · 9.41 KB
/
dfCompose.jsp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<%@ taglib uri="http://java.sun.com/jsf/html" prefix="h" %>
<%@ taglib uri="http://java.sun.com/jsf/core" prefix="f" %>
<%@ taglib uri="http://sakaiproject.org/jsf2/sakai" prefix="sakai" %>
<%@ taglib uri="http://sakaiproject.org/jsf/messageforums" prefix="mf" %>
<jsp:useBean id="msgs" class="org.sakaiproject.util.ResourceLoader" scope="session">
<jsp:setProperty name="msgs" property="baseName" value="org.sakaiproject.api.app.messagecenter.bundle.Messages"/>
</jsp:useBean>
<f:view>
<sakai:view title="#{msgs.cdfm_container_title}" toolCssHref="/messageforums-tool/css/msgcntr.css">
<!--jsp/dfCompose.jsp-->
<h:form id="dfCompose">
<f:verbatim><input type="hidden" id="ckeditor-autosave-context" name="ckeditor-autosave-context" value="forums_dfCompose" /></f:verbatim>
<h:panelGroup rendered="#{ForumTool.selectedTopic.topic.id!=null}"><f:verbatim><input type="hidden" id="ckeditor-autosave-entity-id" name="ckeditor-autosave-entity-id" value="</f:verbatim><h:outputText value="#{ForumTool.selectedTopic.topic.id}"/><f:verbatim>"/></f:verbatim></h:panelGroup>
<f:verbatim><input type="hidden" id="currentTopicId" name="currentTopicId" value="</f:verbatim><h:outputText value="#{ForumTool.selectedTopic.topic.id}"/><f:verbatim>"/></f:verbatim>
<f:verbatim><input type="hidden" id="currentForumId" name="currentForumId" value="</f:verbatim><h:outputText value="#{ForumTool.selectedForum.forum.id}"/><f:verbatim>"/></f:verbatim>
<script>includeLatestJQuery("msgcntr");</script>
<script src="/messageforums-tool/js/sak-10625.js"></script>
<script src="/messageforums-tool/js/forum.js"></script>
<script src="/messageforums-tool/js/messages.js"></script>
<script>
$(document).ready(function(){
var menuLink = $('#forumsMainMenuLink');
var menuLinkSpan = menuLink.closest('span');
menuLinkSpan.addClass('current');
menuLinkSpan.html(menuLink.text());
});
</script>
<%@ include file="/jsp/discussionForum/menu/forumsMenu.jsp" %>
<h3><h:outputText value="#{msgs.cdfm_tool_bar_message}" /></h3>
<table class="topicBloc topicBlocLone specialLink">
<tr>
<td>
<h:outputText value="#{ForumTool.selectedForum.forum.title} / #{ForumTool.selectedTopic.topic.title}" styleClass="title"/>
<div class="textPanel">
<h:outputText value="#{ForumTool.selectedTopic.topic.shortDescription}" />
</div>
<div>
<p id="openLinkBlock" class="toggleParent openLinkBlock display-none">
<a href="#" id="showMessage" class="toggle show">
<h:graphicImage url="/images/collapse.gif" alt=""/>
<h:outputText value=" #{msgs.cdfm_read_full_description}" />
</a>
</p>
<p id="hideLinkBlock" class="toggleParent hideLinkBlock">
<a href="#" id="hideMessage" class="toggle show">
<h:graphicImage url="/images/expand.gif" alt="" />
<h:outputText value=" #{msgs.cdfm_hide_full_description}"/>
</a>
</p>
<%-- //designNote: am assuming that the thinking is that once the user is here
there is no longer need for the long description context (or as much), so do not put it in
the response by default - same goes for attachment list if any --%>
<div id="fullTopicDescription" class="textPanel">
<h:outputText escape="false" value="#{ForumTool.selectedTopic.topic.extendedDescription}" />
</div>
</div>
</td>
</tr>
</table>
<div>
<h:outputText value="#{ForumTool.selectedTopic.topic.revealIDsToRoles ? msgs.cdfm_revealIDsToRoles_blurb : msgs.cdfm_anonymous_blurb}" rendered="#{ForumTool.anonymousEnabled && ForumTool.selectedTopic.topic.postAnonymous}"/>
</div>
<div class="instruction">
<h:outputText value="#{msgs.cdfm_required}"/>
<h:outputText value="#{msgs.cdfm_info_required_sign}" styleClass="reqStarInline" />
</div>
<h:message for="df_compose_title" warnStyle="WARN" styleClass="messageAlert"/>
<h:panelGrid styleClass="jsfFormTable" columns="1" width="100%" border="0" cellpadding="0">
<h:panelGroup>
<h:outputLabel for="df_compose_title" style="padding-bottom:.3em;display:block;clear:both;float:none">
<h:outputText value="#{msgs.cdfm_info_required_sign}" styleClass="reqStar"/>
<h:outputText value="#{msgs.cdfm_title}"/>
</h:outputLabel>
<h:inputText value="#{ForumTool.composeTitle}" style="width:100%;" maxlength="250" required="true" id="df_compose_title" requiredMessage="#{msgs.cdfm_invalidMessageTitleString}">
<f:validator validatorId="MessageTitle" />
<f:validateLength minimum="1" maximum="255"/>
</h:inputText>
</h:panelGroup>
</h:panelGrid>
<p><h:message for="df_compose_body" styleClass="messageAlert" id="bodyErrorMessages" /></p>
<h:outputText value="#{msgs.cdfm_message}" />
<sakai:inputRichText textareaOnly="#{PrivateMessagesTool.mobileSession}" value="#{ForumTool.composeBody}" id="df_compose_body" rows="#{ForumTool.editorRows}" cols="132">
</sakai:inputRichText>
<%--********************* Attachment *********************--%>
<h4>
<h:outputText value="#{msgs.cdfm_att}" />
</h4>
<p>
<h:outputText value="#{msgs.cdfm_no_attachments}" rendered="#{empty ForumTool.attachments}" styleClass="instruction" style="display:block"/>
</p>
<h:dataTable styleClass="attachPanel" id="attmsg" width="100%" value="#{ForumTool.attachments}" rendered="#{!empty ForumTool.attachments}" var="eachAttach" columnClasses=",itemAction specialLink,," cellpadding="0" cellspacing="0" style="width:auto">
<h:column rendered="#{!empty ForumTool.attachments}">
<f:facet name="header">
<h:outputText value="#{msgs.cdfm_title}"/>
</f:facet>
<sakai:contentTypeMap fileType="#{eachAttach.attachment.attachmentType}" mapType="image" var="imagePath" pathPrefix="/library/image/"/>
<h:graphicImage id="exampleFileIcon" value="#{imagePath}" />
<h:outputText value=" "/>
<h:outputText value="#{eachAttach.attachment.attachmentName}"/>
</h:column>
<h:column>
<h:commandLink action="#{ForumTool.processDeleteAttach}"
immediate="true"
onfocus="document.forms[0].onsubmit();"
title="#{msgs.cdfm_remove}">
<h:outputText value="#{msgs.cdfm_remove}"/>
<%-- <f:param value="#{eachAttach.attachmentId}" name="dfmsg_current_attach"/>--%>
<f:param value="#{eachAttach.attachment.attachmentId}" name="dfmsg_current_attach"/>
</h:commandLink>
</h:column>
<h:column rendered="#{!empty ForumTool.attachments}">
<f:facet name="header">
<h:outputText value="#{msgs.cdfm_attsize}" />
</f:facet>
<h:outputText value="#{ForumTool.getAttachmentReadableSize(eachAttach.attachment.attachmentSize)}"/>
</h:column>
<h:column rendered="#{!empty ForumTool.attachments}">
<f:facet name="header">
<h:outputText value="#{msgs.cdfm_atttype}" />
</f:facet>
<h:outputText value="#{eachAttach.attachment.attachmentType}"/>
</h:column>
</h:dataTable>
<p style="padding:0" class="act">
<h:commandButton action="#{ForumTool.processAddAttachmentRedirect}" value="#{msgs.cdfm_button_bar_add_attachment_redirect}" accesskey="a"
style="font-size:96%" rendered="#{empty ForumTool.attachments}"/>
<h:commandButton action="#{ForumTool.processAddAttachmentRedirect}" value="#{msgs.cdfm_button_bar_add_attachment_more_redirect}" accesskey="a"
style="font-size:96%" rendered="#{!empty ForumTool.attachments}"/>
</p>
<%--********************* Label *********************
<sakai:panel_titled>
<table width="80%" align="left">
<tr>
<td align="left" width="20%">
<h:outputText value="Label"/>
</td>
<td align="left">
<h:selectOneListbox size="1" id="viewlist">
<f:selectItem itemLabel="Normal" itemValue="none"/>
</h:selectOneListbox>
</td>
</tr>
</table>
</sakai:panel_titled>
--%>
<h:outputText value="#{msgs.cdfm_reply_message_note}" styleClass="highlight" rendered="#{ForumTool.selectedTopic.moderated == 'true' }" /><h:outputText value="#{msgs.cdfm_reply_message_mod_inst}" styleClass="instruction" rendered="#{ForumTool.selectedTopic.moderated == 'true' }" />
<p style="padding:0" class="act">
<h:commandButton id="post" action="#{ForumTool.processDfMsgPost}" value="#{msgs.cdfm_button_bar_post_message}" accesskey="s" styleClass="active blockMeOnClick"/>
<h:commandButton action="#{ForumTool.processDfMsgCancel}" value="#{msgs.cdfm_button_bar_cancel}" immediate="true" accesskey="x" />
<h:outputText styleClass="sak-banner-info" style="display:none" value="#{msgs.cdfm_processing_submit_message}" />
</p>
<%--
<sakai:button_bar>
<h:commandButton action="#{ForumTool.processDfMsgPost}" value="#{msgs.cdfm_button_bar_post_message}" accesskey="s" styleClass="active"/>
<h:commandButton action="#{ForumTool.processDfMsgCancel}" value="#{msgs.cdfm_button_bar_cancel}" immediate="true" accesskey="x" />
</sakai:button_bar>
--%>
</h:form>
</sakai:view>
</f:view>