Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[IMP] New tool bar for registrants

  • Loading branch information...
commit 434abf27de60a5d63dc32167fd89bb09a30f12a9 1 parent 48c5d8b
Christophe Wachter authored jbenito3 committed
View
2  doc/guides/UserGuide/Conferences.rst
@@ -704,7 +704,7 @@ From this list you can perform several actions on the registrants, as for exampl
* **Add new**: It will open the registration form `(see Registration Form) <#registration-form>`_.
* **Remove**: It will remove the selected registrants.
-* **Email**: It will allow to send an email to the selected registrants. Indico will send one email per participant. Also, you can profit from the Available tags to make it personal; Indico will replace the tag with the real value of the registrant, e.g. %(registrant_family_name)s will be Smith.
+* **Email**: It will allow to send an email to the selected registrants. Indico will send one email per participant. Also, you can profit from the Available tags to make it personal; Indico will replace the tag with the real value of the registrant, e.g. {registrant_family_name} will be Smith.
|image102|
View
BIN  doc/guides/UserGuide/UserGuidePics/confreg12.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN  doc/guides/UserGuide/UserGuidePics/confreg14.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
14 indico/MaKaC/webinterface/common/registrantNotificator.py
@@ -148,9 +148,9 @@ def _getVars(self,registrant):
class EmailNotificator(Notificator):
def apply(self,registrant,params):
- vars=self._getVars(registrant)
- subj=params.get("subject","")%vars
- b=params.get("body","")%vars
+ v=self._getVars(registrant)
+ subj=params.get("subject","").format(**v)
+ b=params.get("body","").format(**v)
fa=params.get("from","")
tl=params.get("to",[])
cc = params.get("cc",[])
@@ -158,9 +158,9 @@ def apply(self,registrant,params):
def notify(self,registrant,params):
if params.has_key("conf"):
- sm=GenericMailer.sendAndLog(self.apply(registrant,params),params["conf"])
+ GenericMailer.sendAndLog(self.apply(registrant,params),params["conf"])
else:
- sm=GenericMailer.send(self.apply(registrant,params))
+ GenericMailer.send(self.apply(registrant,params))
def notifyAll(self,params):
subj=params.get("subject","")
@@ -170,7 +170,7 @@ def notifyAll(self,params):
cc = params.get("cc",[])
notification = Notification(subject=subj,body=b,fromAddr=fa,toList=tl,ccList=cc)
if params.has_key("conf"):
- sm = GenericMailer.sendAndLog(notification, params["conf"])
+ GenericMailer.sendAndLog(notification, params["conf"])
else:
- sm = GenericMailer.send(notification)
+ GenericMailer.send(notification)
View
379 indico/MaKaC/webinterface/tpls/ConfModifRegistrants.tpl
@@ -1,102 +1,45 @@
-<script type="text/javascript">
-<!--
- var newUser = false;
-
- <%include file="ListJSHelpers.tpl"/>
-
- window.onload = function(){
- isSelected("registrantsItems")
- }
-
- function selectDisplay()
- {
- for (i = 0; i < document.displayOptionForm.disp.length; i++)
- {
- document.displayOptionForm.disp[i].checked=true
- }
- }
-
- function unselectDisplay()
- {
- for (i = 0; i < document.displayOptionForm.disp.length; i++)
- {
- document.displayOptionForm.disp[i].checked=false
- }
- }
-
- function selectAll()
- {
- if (!document.registrantsForm.registrant.length)
- {
- document.registrantsForm.registrant.checked=true
- }else{
- for (i = 0; i < document.registrantsForm.registrant.length; i++)
- {
- document.registrantsForm.registrant[i].checked=true;
- }
- }
- isSelected("registrantsItems")
- }
-
- function deselectAll()
- {
- if (!document.registrantsForm.registrant.length)
- {
- document.registrantsForm.registrant.checked=false
- }else{
- for (i = 0; i < document.registrantsForm.registrant.length; i++)
- {
- document.registrantsForm.registrant[i].checked=false;
- }
- }
- isSelected("registrantsItems")
- }
-
-//-->
-</script>
-
-
<a href="" name="results"></a>
<table width="100%" cellspacing="0" align="center" border="0">
<tr>
<td nowrap colspan="10">
<div class="CRLgroupTitleNoBorder">${ _("Displaying")}<strong> ${ filteredNumberRegistrants } </strong>
- % if filteredNumberRegistrants == "1":
- ${ _("registrant")}
- % else:
- ${ _("registrants")}
- % endif
- % if filterUsed:
- (${ _("Total")}: <strong>${ totalNumberRegistrants }</strong>)
- % endif
- </div>
- <form action=${ filterPostURL } method="post" name="optionForm">
- <div class="CRLIndexList" >
- % if filterUsed:
- <input type="submit" class="btnRemove" name="resetFilters" value="Reset filters">
+ % if filteredNumberRegistrants == "1":
+ ${ _("registrant")}
+ % else:
+ ${ _("registrants")}
+ % endif
+ % if filterUsed:
+ (${ _("Total")}: <strong>${ totalNumberRegistrants }</strong>)
+ % endif
+ </div>
+ <form action=${ filterPostURL } method="post" name="optionForm">
+ <div class="CRLIndexList" >
+ <br>
+ % if filterUsed:
+ <input type="submit" class="btnRemove" name="resetFilters" value="Reset filters">
+ <span style="padding: 0px 6px 0px 6px">|</span>
+ % endif
+ <a id="index_filter" onclick="showFilters()" class="CAIndexUnselected" font-size="16" font-weight="bold" font-family="Verdana">
+ % if filterUsed:
+ ${ _("Show filters")}
+ % else:
+ ${ _("Apply filters")}
+ % endif
+ </a>
+ <span style="padding: 0px 6px 0px 6px">|</span>
+ <a id="index_display" onclick="showDisplay()" class="CAIndexUnselected" font-size="16">
+ ${ _("Columns to display")}
+ </a>
<span style="padding: 0px 6px 0px 6px">|</span>
- % endif
- <a id="index_filter" onclick="showFilters()" class="CAIndexUnselected" font-size="16" font-weight="bold" font-family="Verdana">
- % if filterUsed:
- ${ _("Show filters")}
- % else:
- ${ _("Apply filters")}
- % endif
- </a>
- <span style="padding: 0px 6px 0px 6px">|</span>
- <a id="index_display" onclick="showDisplay()" class="CAIndexUnselected" font-size="16">
- ${ _("Columns to display")}
- </a>
- <span style="padding: 0px 6px 0px 6px">|</span>
- <a id="index_display" onclick="staticURLSwitch()" class="CAIndexUnselected" font-size="16">
- ${ _("Static URL for this result")}
- </a>
- </div>
- </form>
+ <a id="index_display" onclick="staticURLSwitch()" class="CAIndexUnselected" font-size="16">
+ ${ _("Static URL for this result")}
+ </a>
+ </div>
+ </form>
</td>
</tr>
- <tr>
- <td colspan="1000" align="left" width="100%">
+ <tr nowrap colspan="10">
+ <td colspan="1000" valign="bottom" align="left">
<form action=${ filterPostURL } method="post" name="displayOptionForm">
<input type="hidden" name="operationType" value="display" />
${ displayMenu }
@@ -110,17 +53,17 @@
</td>
</tr>
- <tr>
- <td colspan="1000" align="left" width="100%">
+ <tr>
+ <td colspan="1000" valign="bottom" align="left">
<input type="text" id="staticURL" size="74" style="display: none;" readonly="readonly" value="${ filterUrl }" />
<a id="staticURLLink" style="display: none; margin-left: 5px;" href="${ filterUrl }">${ _("Go to URL")}</a>
</td>
- </tr>
+ </tr>
<tr>
- <td colspan="40" style="border-bottom:2px solid #777777;padding-top:5px" valign="bottom" align="left">
- <form id="registrantsForm" action=${ actionPostURL } method="post" name="registrantsForm" onsubmit="return atLeastOneSelected($E('registrantsItems'), $T('No registrant selected! Please select at least one.'));">
- <table>
+ <td colspan="40" valign="bottom" align="left">
+ <form id="registrantsForm" action=${ actionPostURL } method="post" name="registrantsForm" onsubmit="return atLeastOneRegistrantSelected();">
+ <table width="100%" cellspacing="0" align="center" border="0">
<tr>
<td colspan="10">
<div>
@@ -129,90 +72,118 @@
</div>
</td>
</tr>
+ <tr id="headPanel" class="follow-scroll" style="box-shadow: 0 4px 2px -2px rgba(0, 0, 0, 0.1);">
+ <td valign="bottom" width="100%" align="left" colspan="1000">
+ <table style="margin-left: -8px" >
+ <tr >
+ <td valign="bottom" align="left">
+ <ul id="button-menu" class="ui-list-menu">
+ <li class="left" id="addRegistrant">
+ <a href="#" id="add_new_user">${_("Add new")}</a>
+ </li>
+ <li class="middle">
+ <a href="#" id="remove_users">${_("Remove")}</a>
+ </li>
+ <li class="middle">
+ <a href="#" id="send_email">${_("Email")}</a>
+ </li>
+ <li class="middle">
+ <a href="#" id="print_badges">${_("Print Badges")}</a>
+ </li>
+ <li class="middle">
+ <a href="#" id="attachments">${_("Attachments")}</a>
+ </li>
+ <li class="right">
+ <a href="#" id="show_stats">${_("Show stats")}</a>
+ </li>
+ </ul>
+ </td>
- <tr>
- <td valign="bottom" align="left" class="eventModifButtonBar">
- <input type="submit" class="btn" name="newRegistrant" onclick="newUser = true;" value="${ _("Add new")}">
- </td>
- <td valign="bottom" align="left">
- <input type="submit" class="btn" name="removeRegistrants" value="${ _("Remove")}">
- </td>
- <td valign="bottom" align="left">
- <input type="submit" class="btn" name="emailSelected" value="${ _("Email")}">
- </td>
- <td valign="bottom" align="left">
- <input type="submit" class="btn" name="printBadgesSelected" value="${ _("Print badges")}">
- </td>
- <td valign="bottom" align="left">
- <input type="submit" class="btn" name="PKG" value="${ _("Attachments")}">
- </td>
- <td valign="bottom" align="left">
- <input type="submit" class="btn" name="info.x" value="${ _("Show stats")}">
- </td>
- <td valign="middle" align="left">
- Export to:
- </td>
- <td valign="bottom" align="left">
- <a href="#" id="exportPDFSelectorLink1" name="pdf" class="iconDropDownMenu"> <img src=${ pdfIconURL} border="0"></a>
- <input id="pdfExportInputHidden" type="hidden" name="pdf">
- <span class="iconSeparator"> | </span>
- </td>
- <td valign="middle" align="left">
- <input type="image" style="margin-top:3px;" name="excel" src=${ excelIconURL } border="0">
- </td>
+ <td>
+ Export to:
+ </td>
+ <td>
+ <a href="#" id="exportPDFSelectorLink1" name="pdf" class="iconDropDownMenu"> <img src=${ pdfIconURL} border="0"></a>
+ <input id="pdfExportInputHidden" type="hidden" name="pdf">
+ <span class="iconSeparator"> | </span>
+ <input type="image" style="margin-top:3px;" name="excel" src=${ excelIconURL } border="0">
+ </td>
+ </tr>
+ </table>
+ </td>
</tr>
</table>
</td>
</tr>
- <tr>
- ${ columns }
- <tbody id="registrantsItems">
- ${ registrants }
- </tbody>
- </tr>
- <tr>
- <td colspan="40" style="border-top: 2px solid #777777; padding-top: 3px;" valign="bottom" align="left">
- <table>
- <tbody>
-
- <td valign="bottom" align="left" class="eventModifButtonBar">
- <input type="submit" class="btn" name="newRegistrant" onclick="newUser = true;" value="${ _("Add new")}">
- </td>
- <td valign="bottom" align="left">
- <input type="submit" class="btn" name="removeRegistrants" value="${ _("Remove")}">
- </td>
- <td valign="bottom" align="left">
- <input type="submit" class="btn" name="emailSelected" value="${ _("Email")}">
- </td>
- <td valign="bottom" align="left">
- <input type="submit" class="btn" name="printBadgesSelected" value="${ _("Print badges")}">
- </td>
- <td valign="bottom" align="left">
- <input type="submit" class="btn" name="PKG" value="${ _("Attachments")}">
- </td>
- <td valign="bottom" align="left">
- <input type="submit" class="btn" name="info.x" value="${ _("Show stats")}">
- </td>
- <td valign="middle" align="left">
- Export to:
- </td>
- <td valign="bottom" align="left">
- <a href="#" id="exportPDFSelectorLink2" name="pdf" class="iconDropDownMenu"> <img src=${ pdfIconURL} border="0"></a>
- <input id="pdfExportInputHidden" type="hidden" name="pdf">
- <span class="iconSeparator"> | </span>
- </td>
- <td valign="middle" align="left">
- <input type="image" style="margin-top:3px;" name="excel" src=${ excelIconURL } border="0">
+ <tr nowrap colspan="10">
+ % if filteredNumberRegistrants == "0":
+ <tr id="noRegistrantInfo">
+ <td colspan=10 style="font-style: italic; padding:15px 0px 15px 15px; border-bottom: 1px solid #DDDDDD;" nowrap>
+ <span class="collShowBookingsText">${ _("There are no registrants yet") }</span>
</td>
+ </tr>
+ % else:
+ ${ columns }
+ <tbody id="registrantsItems">
+ ${ registrants }
</tbody>
- </table>
- </td>
- </tr>
+ % endif
+ </tr>
</table>
</form>
<script type="text/javascript">
+var newUser = false;
+
+<%include file="ListJSHelpers.tpl"/>
+
+
+function selectDisplay()
+{
+ for (i = 0; i < document.displayOptionForm.disp.length; i++)
+ {
+ document.displayOptionForm.disp[i].checked=true;
+ }
+}
+
+function unselectDisplay()
+{
+ for (i = 0; i < document.displayOptionForm.disp.length; i++)
+ {
+ document.displayOptionForm.disp[i].checked=false;
+ }
+}
+
+function selectAll()
+{
+ if (!document.registrantsForm.registrant.length)
+ {
+ document.registrantsForm.registrant.checked=true;
+ }else{
+ for (i = 0; i < document.registrantsForm.registrant.length; i++)
+ {
+ document.registrantsForm.registrant[i].checked=true;
+ }
+ }
+ isSelected("registrantsItems");
+}
+
+function deselectAll()
+{
+ if (!document.registrantsForm.registrant.length)
+ {
+ document.registrantsForm.registrant.checked=false;
+ }else{
+ for (i = 0; i < document.registrantsForm.registrant.length; i++)
+ {
+ document.registrantsForm.registrant[i].checked=false;
+ }
+ }
+ isSelected("registrantsItems");
+}
+
+
function showFilters() {
if ($E("displayMenu").dom.style.display == "") {
$E("index_display").set('${ _("Select columns to display")}');
@@ -236,7 +207,7 @@
function showDisplay() {
if ($E("filterMenu").dom.style.display == "") {
% if filterUsed:
- $E("index_filter").set('${ _("Show filters")}')
+ $E("index_filter").set('${ _("Show filters")}');
% else:
$E("index_filter").set('${ _("Apply filters")}');
% endif
@@ -255,7 +226,6 @@
}
var pdfLink1 = $E('exportPDFSelectorLink1');
-var pdfLink2 = $E('exportPDFSelectorLink2');
var pdfMenu = null;
function createMenu(pdfLink) {
@@ -283,7 +253,7 @@ function submitForm(style) {
var inputHidden = $E('pdfExportInputHidden');
inputHidden.dom.name = style;
if(form.dom.onsubmit())
- form.dom.submit(); pdfMenu.close()
+ form.dom.submit(); pdfMenu.close();
}
pdfLink1.observeClick(function(e) {
@@ -291,8 +261,69 @@ pdfLink1.observeClick(function(e) {
return false;
});
-pdfLink2.observeClick(function(e) {
- createMenu(pdfLink2);
+var atLeastOneRegistrantSelected = function(){
+ if (newUser || $("input:checkbox:checked[name^=registrant]").length>0){
+ return true;
+ } else{
+ var dialog = new WarningPopup($T("Warning"), $T("No registrant selected! Please select at least one."));
+ dialog.open();
return false;
+ }
+};
+
+IndicoUI.executeOnLoad(function(){
+
+% if filteredNumberRegistrants != "0":
+ isSelected("registrantsItems");
+% endif
+ $('#button-menu').dropdown();
+
+ $(window).scroll(function(){
+ IndicoUI.Effect.followScroll();
+ });
+
+
+ // Insert hidden field to the form
+ var InsertHiddenField = function (name, value, cleanup){
+ if (cleanup) {
+ $("#registrantsForm input[type=hidden]").remove(); // clean previous actions
+ }
+ $('#registrantsForm').append($("<input>").attr("type", "hidden").attr("name", name).val(value));
+ }
+
+ $("#print_badges").bind('menu_select',function(event) {
+ InsertHiddenField("printBadgesSelected", "printBadges", false);
+ $('#registrantsForm').submit();
+ });
+
+ $("#send_email").bind('menu_select',function(event) {
+ InsertHiddenField("emailSelected", "True", false);
+ $('#registrantsForm').submit();
+ });
+
+ $("#attachments").bind('menu_select',function(event) {
+ InsertHiddenField("PKG", "attachments", false);
+ $('#registrantsForm').submit();
+ });
+
+ $("#show_stats").bind('menu_select',function(event) {
+ InsertHiddenField("info.x", "Show+stats", false);
+ $('#registrantsForm').submit();
+ });
+
+ $("#remove_users").bind('menu_select',function(){
+ InsertHiddenField("removeRegistrants", "remove", false);
+ $('#registrantsForm').submit();
+ });
+
+ $("#add_new_user").bind('menu_select',function(){
+ newUser = true;
+ InsertHiddenField("newRegistrant", "Add", false);
+ $('#registrantsForm').submit();
+ });
+
});
+
</script>
+
+
View
93 indico/MaKaC/webinterface/tpls/EmailToRegistrants.tpl
@@ -1,48 +1,67 @@
-<form action=${ postURL } method="POST" onSubmit="if (!wasCanceled) return parameterManager.check();">
+<% from MaKaC.webinterface.common.registrantNotificator import EmailNotificator %>
+
+<form name="sendMailForm" action=${ postURL } method="POST" onSubmit="if (!wasCanceled) return parameterManager.check();">
${ toIds }
- <table width="80%" align="center" border="0" style="border-left: 1px solid #777777">
+ <table width="90%" align="center" border="0">
<tr>
- <td colspan="3" class="groupTitle"> ${ _("Send Email")}</font></b>
- </td>
- </tr>
- <tr>
- <td>${ _("From")}: </td>
- <td colspan="2"><input type="text" id="from" name="from" size="50" value="${ From }"></text></td>
+ <td colspan="3" style="padding-top:10px;">
+ <span class="groupTitle" style="border:0px;">${ _("Compose the email")}</span>
+ </td>
</tr>
+
<tr>
- <td>
- ${ _("To")}:
+ <td nowrap class="titleCellTD" style="padding-top:10px;"><span class="titleCellFormat"> ${ _("From address")}</span></td>
+ <td colspan="2" bgcolor="white" width="100%" style="padding-top:10px;">
+ <input id="notificationTplAddress" type="text" name="from" style="width: 61%;" value=${ From } onfocus="selected('notificationTplAddress')">
</td>
- <td colspan="2" style="padding-top:5px; padding-bottom:5px">${ toEmails }</td>
</tr>
+
<tr>
- <td valign="top">${ _("Cc")}: </td>
- <td colspan="2"><input type="text" id="cc" name="cc" size="50" value="${ cc }"></text> <font color="red">${ _("Beware, addresses in this field will receive one mail per registrant")}</font></td>
+ <td nowrap class="titleCellTD" style="padding-top:10px;"><span class="titleCellFormat"> ${ _("To address")}</span></td>
+ <td colspan="2" bgcolor="white" width="100%" style="padding-top:10px;">
+ <textarea id="notificationTplAddress" disabled="disabled" type="text" name="to" style="width: 61%;" row=3 onfocus="selected('notificationTplAddress')">${ toEmails }</textarea>
+ </td>
</tr>
+
+
<tr>
- <td>${ _("Subject")}:</td>
- <td><input type="text" id="subject" name="subject" size="64" value="${ subject }"></text></td>
- <td align="center" valign="middle" rowspan="2">
- <table width="75%" class="legend" cellspacing="1" cellpadding="1">
- <tr><td>&nbsp;</td></tr>
- <tr>
- <td style="padding-left:5px;padding-right:5px;color:#5294CC"><b> ${ _("Available tags")}:</b></td>
- </tr>
- ${ vars }
- <tr><td>&nbsp;</td></tr>
- <tr>
- <td style="padding-left:5px;padding-right:5px;">
- <font color="red">Important</font>: ${ _("The character '%' is reserved. To write this character, use '%%'")}.
- </td>
- </tr>
- <tr><td>&nbsp;</td></tr>
- </table>
- </td>
+ <td nowrap class="titleCellTD" style="padding-top:10px;"><span class="titleCellFormat"> ${ _("CC addresses")}</span></td>
+ <td colspan="2" bgcolor="white" width="100%" style="padding-top:10px;">
+ <input id="notificationTplAddress" type="text" name="cc" style="width: 61%;" value="${ cc }" onfocus="selected('notificationTplAddress')">
+ </td>
</tr>
<tr>
- <td valign="top">${ _("Body")}:</td>
- <td colspan="2"><textarea id="body" name="body" rows="26" cols="50">${ body }</textarea></td>
+ <td nowrap class="titleCellTD"></td>
+ <td colspan="2" bgcolor="white" width="100%" style="padding-bottom:15px;">
+ <font color="red">Beware, addresses in this field will receive one mail per registrant</font>
+ </td>
</tr>
+
+ <tr>
+ <td nowrap class="titleCellTD"><span class="titleCellFormat"> ${ _("Subject")}</span></td>
+ <td bgcolor="white" width="100%">
+ <input id="notificationTplSubject" type="text" name="subject" style="width: 98%;" value="${ subject }" onfocus="selected('notificationTplSubject')">
+ </td>
+ <td align="center" valign="top" rowspan="2" style="padding-top:3px;">
+ <table width="75%" class="legend" cellspacing="0" cellpadding="2">
+ <tr>
+ <td class="titleTd"><b> ${ _("Available tags")}:</b></td>
+ </tr>
+ % for var in EmailNotificator.getVarList():
+ <tr class="legendTr">
+ <td width="100%" nowrap class="blacktext" style="padding-left:10px;padding-right:5px; text-align:left;">{${ var.getName() }}</td>
+ <td class="legendTd" onClick="insertTag('{${ var.getName() }}')">${ _("Insert")}</td>
+ </tr>
+ % endfor
+ </table>
+ </td>
+ </tr>
+ <tr>
+ <td nowrap class="titleCellTD"><span class="titleCellFormat"> ${ _("Body")}</span></td>
+ <td bgcolor="white">
+ <textarea id="notificationTplBody" name="body" rows="26" style="width: 98%;" onfocus="selected('notificationTplBody')">${ body }</textarea>
+ </td>
+ </tr>
<tr><td>&nbsp;</td></tr>
<tr>
<td colspan="3" align="center">
@@ -54,10 +73,10 @@
</table>
</form>
-<<script type="text/javascript">
+<script type="text/javascript">
var parameterManager = new IndicoUtil.parameterManager();
var wasCanceled = false;
- parameterManager.add($E('from'), 'text', false);
- parameterManager.add($E('subject'), 'text', false);
- parameterManager.add($E('body'), 'text', false);
+ parameterManager.add($E('notificationTplAddress'), 'text', false);
+ parameterManager.add($E('notificationTplSubject'), 'text', false);
+ parameterManager.add($E('notificationTplBody'), 'text', false);
</script>
View
7 indico/htdocs/css/Default.css
@@ -4493,7 +4493,7 @@ div.actionButton {
font-size: 19px;
color: #4E4C46;
letter-spacing: 1px;
- padding: 3px;
+ padding: 0;
}
.CRLabstractLeftDataCell {
@@ -4552,9 +4552,12 @@ ul.CRLIndexList {
display: block;
list-style-type: none;
margin: 0;
- padding: 0;
+ padding: 3px;
padding-top: 10px;
padding-bottom: 5px;
+ padding-left: 15px;
+ padding-right: 15px;
+
}
ul.CRLIndexList li {
Please sign in to comment.
Something went wrong with that request. Please try again.