Commit 78a3efde authored by Athina Bekakou's avatar Athina Bekakou Committed by Giorgos Korfiatis

admin-ui: Add modal for action 'modify e-mail'

parent cf57b1c6
......@@ -189,9 +189,11 @@ snf = {
notifyErrorIDs: '<dt>IDs:</dt><dd><%= ids %></dd>',
notifyRefreshPage: '<p class="warning">The data of the page maybe out of date. Refresh it, to update them.</p>',
notifyReloadTable: '<p class="warning">You may need to reload the table before making any new selections.<span class="wrap"><a class="clear-reload warning-btn">Clear selected and reload</a></span></p>',
warningDuplicates: '<p class="warning-duplicate">Duplicate accounts have been detected</p>',
warningDuplicates: '<p class="warning-duplicate">Duplicate accounts have been detected.</p>',
commonRow: '<tr data-itemid=<%= itemID %> <% if(hidden) { %> class="hidden-row" <% } %> ><td class="item-name"><%= itemName %></td><td class="item-id"><%= itemID %></td><td class="owner-name"><%= ownerName %></td><td class="owner-email"><div class="wrap"><a class="remove" title="Remove item from selection">X</a><%= ownerEmail %></div></td></tr>',
contactRow: '<tr <% if(showAssociations) { %> title="related with: <%= associations %>" <% } %> data-itemid=<%= itemID %> <% if(hidden) { %> class="hidden-row" <% } %> ><td class="full-name"><%= fullName %></td><td class="email"><div class="wrap"><a class="remove" title="Remove item from selection">X</a><%= email %></div></td></tr>'
contactRow: '<tr <% if(showAssociations) { %> title="related with: <%= associations %>" <% } %> data-itemid=<%= itemID %> <% if(hidden) { %> class="hidden-row" <% } %> ><td class="full-name"><%= fullName %></td><td class="email"><div class="wrap"><a class="remove" title="Remove item from selection">X</a><%= email %></div></td></tr>',
modifyEmailRow: '<tr data-itemid=<%= itemID %> <% if(hidden) { %> class="hidden-row" <% } %> ><td class="full-name"><%= fullName %></td><td class="item-id"><%= itemID %></td><td class="email"><div class="wrap"><%= email %></div></td><td class="wrap td-with-input"><input placeholder="new e-mail"><a class="remove" title="Remove item from selection">X</a></td></tr>',
}
},
tables: {
......
......@@ -819,6 +819,24 @@ $(document).ready(function() {
}
}
else if(modalType === "modify-email") {
console.log('%c modaltype modify email')
uniqueProp = 'id';
for(var i=0; i<rowsNum; i++) {
idsArray.push(selected.items[i][uniqueProp]);
currentRow = _.template(
snf.modals.html.modifyEmailRow,
{
itemID: selected.items[i].contact_id,
fullName: selected.items[i].contact_name,
email: selected.items[i].contact_email,
hidden: (i > maxVisible)
}
);
htmlRows += currentRow;
}
}
else {
uniqueProp = 'id';
for(var i=0; i<rowsNum; i++) {
......
......@@ -13,7 +13,7 @@ p.progress-area {
.modal {
&[data-item="user"] {
&:not([data-type="contact"]) .table-selected td:nth-child(3){
&:not([data-type="contact"]) .table-selected .owner-name {
display: none;
}
}
......@@ -214,7 +214,10 @@ p.progress-area {
.modal {
.table-selected {
th,td {
word-break: break-word;
word-break: break-word;
&.td-with-input {
width: 250px;
}
}
td:last-child {
.wrap {
......
{% load admin_tags %}
<!--<div class="modal fade" id="{{type}}-{{ op }}" data-type="{{ op }}" data-backdrop="static" data-keyboard="false">-->
<div class="modal fade" data-item ={{ action.target }} id="{{action.target}}-{{ op }}" data-backdrop="static" data-keyboard="true" tabindex="-1" data-karma={{ action.karma }} data-caution={{ action.caution_level }} data-type={{ op }}>
<div class="modal-dialog modal-md">
<div class="modal-dialog {% if op == 'modifyEmail' %} modal-lg {% else %} modal-md {% endif %}">
<div class="modal-content area">
<div class="modal-header">
<a class="close cancel" data-dismiss="modal">×</a>
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment