Skip to content

Commit

Permalink
SAK-39986: Prevent double-click-induced unique constraint violations …
Browse files Browse the repository at this point in the history
…in Postem (sakaiproject#5585)
  • Loading branch information
plukasew authored and jonespm committed May 11, 2018
1 parent 6203f88 commit f6d41fa
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 72 deletions.
56 changes: 8 additions & 48 deletions postem/postem-app/src/webapp/postem/create_gradebook.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

<f:view>
<sakai:view title="#{msgs.title_new}">
<script src="/library/js/spinner.js" type="text/javascript"></script>
<h:form enctype="multipart/form-data">

<div class="page-header">
Expand Down Expand Up @@ -44,9 +45,7 @@
<h:inputText id="title" value="#{PostemTool.currentGradebook.title}"/>
</div>
</div>
<%--
<corejsf:upload value="#{PostemTool.csv}" />
--%>

<div class="form-group row">
<h:outputLabel for="choosefile" value="#{msgs.feedback_title}" styleClass="form-group-label col-xs-2" />
<div class="col-xs-4">
Expand All @@ -61,12 +60,6 @@
</div>
</div>

<%--<h:outputText value="#{msgs.delimiter}" style="font-weight: bold;" />
<h:selectOneRadio styleClass="checkbox" value="#{PostemTool.delimiter}" layout="pageDirection">
<f:selectItem itemValue="comma" itemLabel="#{msgs.comma_delim}"/>
<f:selectItem itemValue="tab" itemLabel="#{msgs.tab_delim}"/>
</h:selectOneRadio>--%>

<div class="form-group row">
<h:outputLabel value="#{msgs.gradebook_feedbackavail}" styleClass="form-group-label col-xs-2" />
<div class="col-xs-4">
Expand All @@ -76,52 +69,19 @@

</div>
</sakai:panel_titled>


<%-- <sakai:hideDivision title="#{msgs.notification}">
<sakai:panel_edit>
<h:outputText style="font-size: 13px; font-weight:bold;" value="#{msgs.description}"/><h:inputTextarea/>
<h:outputText style="font-size: 13px; font-weight:bold; margin-right: 50px;" value="#{msgs.email_notification}"/><h:inputText/>
</sakai:panel_edit>
</sakai:hideDivision> --%>

<%-- <sakai:script contextBase="/jsf-resource" path="/hideDivision/hideDivision.js"/> --%>

<%--<sakai:script contextBase="/jsf-resource" path="/hideDivision/hideDivision.js"/>
<sakai:hideDivision title="#{msgs.advanced}">--%>
<%--<sakai:panel_edit>
<h:outputText value="#{msgs.with_header}"/>
<h:selectBooleanCheckbox value="#{PostemTool.withHeader}"/>
<h:outputText value="#{msgs.release_statistics}"/>
<h:selectBooleanCheckbox value="#{PostemTool.currentGradebook.releaseStats}"/>
</sakai:panel_edit>--%>

<%--<sakai:panel_titled>
<h4><h:outputText value="#{msgs.template_file}" /></h4>
<h:outputText value="#{msgs.feedback_instructions}" style="font-weight: bold;" />
<f:verbatim><br /></f:verbatim>
<h:outputText value="#{msgs.template_instructions}"/>
<f:verbatim><br /></f:verbatim>
<h:panelGrid styleClass="jsfFormTable" columns="2" width="80%">
<h:outputText style="font-weight: bold;" value="#{msgs.choose_template}" />
<corejsf:upload value="#{PostemTool.newTemplate}"/>
</h:panelGrid>
</sakai:panel_titled>
</sakai:hideDivision>
<script type="text/javascript">showHideDiv(<h:outputText value="#{msgs.divid}"/>, '/jsf-resource');</script>--%>


<br />

<sakai:button_bar>
<sakai:button_bar_item
action="#{PostemTool.processCreate}"
value="#{msgs.bar_post}"
value="#{msgs.bar_post}"
onclick="SPNR.disableControlsAndSpin(this, null);"
rendered="#{PostemTool.editable}"/>
<sakai:button_bar_item
action="#{PostemTool.processCancelNew}"
value="#{msgs.cancel}"
value="#{msgs.cancel}"
onclick="SPNR.disableControlsAndSpin(this, null);"
rendered="#{PostemTool.editable}"/>
</sakai:button_bar>

Expand Down
43 changes: 21 additions & 22 deletions postem/postem-app/src/webapp/postem/delete_confirm.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -10,31 +10,30 @@
response.addHeader("Pragma", "no-cache");
%>

<jsp:useBean id="msgs" class="org.sakaiproject.util.ResourceLoader" scope="session">
<jsp:setProperty name="msgs" property="baseName" value="org.sakaiproject.tool.postem.bundle.Messages"/>
<jsp:useBean id="msgs" class="org.sakaiproject.util.ResourceLoader" scope="session">
<jsp:setProperty name="msgs" property="baseName" value="org.sakaiproject.tool.postem.bundle.Messages"/>
</jsp:useBean>
<f:view>
<sakai:view title="#{msgs.title_list}">
<h:form>
<h:outputText styleClass="alertMessage" value="#{msgs.delete_confirm}" />

<br />

<table styleClass="itemSummary">
<tr>
<th scope="row"><h:outputText value="#{msgs.title_label}" /></th>
<td><h:outputText value="#{PostemTool.currentGradebook.title}"/></td>
</tr>
</table>
<script src="/library/js/spinner.js" type="text/javascript"></script>
<h:form>
<h:outputText styleClass="alertMessage" value="#{msgs.delete_confirm}" />
<br />
<table styleClass="itemSummary">
<tr>
<th scope="row"><h:outputText value="#{msgs.title_label}" /></th>
<td><h:outputText value="#{PostemTool.currentGradebook.title}"/></td>
</tr>
</table>

<sakai:button_bar>
<sakai:button_bar_item action="#{PostemTool.processDelete}"
value="#{msgs.bar_delete}" />
<sakai:button_bar_item action="#{PostemTool.processCancelView}"
value="#{msgs.cancel}" />
</sakai:button_bar>

</h:form>
<sakai:button_bar>
<sakai:button_bar_item action="#{PostemTool.processDelete}"
onclick="SPNR.disableControlsAndSpin(this, null);"
value="#{msgs.bar_delete}" />
<sakai:button_bar_item action="#{PostemTool.processCancelView}"
onclick="SPNR.disableControlsAndSpin(this, null);"
value="#{msgs.cancel}" />
</sakai:button_bar>
</h:form>
</sakai:view>
</f:view>

7 changes: 5 additions & 2 deletions postem/postem-app/src/webapp/postem/verify.jsp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
</jsp:useBean>
<f:view>
<sakai:view title="#{msgs.title_verify}">
<script src="/library/js/spinner.js" type="text/javascript"></script>
<sakai:view_content>
<h:form>

Expand All @@ -38,10 +39,12 @@
<sakai:button_bar>
<sakai:button_bar_item
action="#{PostemTool.processCreateOk}"
value="#{msgs.bar_save}" />
value="#{msgs.bar_save}"
onclick="SPNR.disableControlsAndSpin(this, null);" />
<sakai:button_bar_item
action="#{PostemTool.processCreateBack}"
value="#{msgs.back}" />
value="#{msgs.back}"
onclick="SPNR.disableControlsAndSpin(this, null);" />
</sakai:button_bar>

</h:form>
Expand Down

0 comments on commit f6d41fa

Please sign in to comment.