added info box if e-mail sending is disabled in the system. that concerns this feature as well

This commit is contained in:
Emil Siverhall 2012-01-23 15:08:33 +01:00
parent 3e979cf478
commit ffe60623b9
2 changed files with 12 additions and 0 deletions
src/main/java/se/su/dsv/scipro/admin/panels

@ -10,6 +10,11 @@
</div>
<form wicket:id="mailForm">
<div class="span-10">
<wicket:enclosure child="disabledLabel">
<div class="rounded-box">
<span wicket:id="disabledLabel"></span>
</div>
</wicket:enclosure>
Subject:<br />
<div wicket:id="subjectErrors"></div>
<input type="text" wicket:id="mailSubjectField"><br />

@ -10,6 +10,7 @@ import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.ajax.form.AjaxFormChoiceComponentUpdatingBehavior;
import org.apache.wicket.behavior.SimpleAttributeModifier;
import org.apache.wicket.feedback.ComponentFeedbackMessageFilter;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.Button;
import org.apache.wicket.markup.html.form.Form;
import org.apache.wicket.markup.html.form.RadioChoice;
@ -83,7 +84,13 @@ public class AdminMailPanel extends Panel {
fromName = gsettings.getMailFromName();
fromEmail = gsettings.getSystemFromMail();
Label disabledLabel = new Label("disabledLabel",
"Sending of e-mail through SciPro is inactivated. Please activate it under Admin -> Settings, if you want to use this feature.");
disabledLabel.setVisible(!gsettings.isMailNotifications());
add(disabledLabel);
Button submitButton = new Button("submitButton");
//submitButton.setEnabled(gsettings.isMailNotifications()); <-- Commented out for testing purposes.
submitButton.add(new SimpleAttributeModifier(
"onclick",
"if (!confirm('Are you sure you want to send this e-mail to the selected recipients?')){ return false; }"));