PR Conflict resolution

This commit is contained in:
Tyler Todd 2023-02-17 22:53:08 +00:00
parent d0961ca5e7
commit 9b696a42a4

View File

@ -102,6 +102,28 @@
{% endfor %} {% endfor %}
</select> </select>
</div> </div>
</div>
<div class="card-body">
<p>Domains on the right are associated with the account. Red marked domain names are already associated with other accounts.
Moving already associated domains to this account will overwrite the previous associated account.
</p>
<p>Hover over the red domain names to show the associated account. Click on domains to move between columns.</p>
<div class="form-group col-2">
<select multiple="multiple" class="form-control" id="account_domains"
name="account_domains">
{% for domain in domains %}
{% if account != None and domain.account_id != None and account.id != domain.account_id %}
{% with account_id=domain.account_id %}
<option style="color: red" data-toggle="tooltip" title="Associated with: {{ accounts[account_id].name }}"
value="{{ domain.name }}">{{ domain.name }}</option>
{% endwith %}
{% else %}
<option {% if account.id == domain.account_id %}selected{% endif %}
value="{{ domain.name }}">{{ domain.name }}</option>
{% endif %}
{% endfor %}
</select>
</div>
</div> </div>
<div class="card-footer"> <div class="card-footer">
<button type="button" class="btn btn-secondary float-left" onclick="window.location.href='{{ url_for('admin.manage_account') }}'"> <button type="button" class="btn btn-secondary float-left" onclick="window.location.href='{{ url_for('admin.manage_account') }}'">
@ -145,9 +167,10 @@
{% endblock %} {% endblock %}
{% block extrascripts %} {% block extrascripts %}
<script> <script>
$("#account_multi_user").multiSelect({ function addMultiSelect(id, placeholder) {
selectableHeader: "<input type='text' class='search-input' autocomplete='off' placeholder='Username'>", $(id).multiSelect({
selectionHeader: "<input type='text' class='search-input' autocomplete='off' placeholder='Username'>", selectableHeader: `<input type='text' class='search-input' autocomplete='off' placeholder='${placeholder}'>`,
selectionHeader: `<input type='text' class='search-input' autocomplete='off' placeholder='${placeholder}'>`,
afterInit: function (ms) { afterInit: function (ms) {
var that = this, var that = this,
$selectableSearch = that.$selectableUl.prev(), $selectableSearch = that.$selectableUl.prev(),
@ -180,5 +203,8 @@
this.qs2.cache(); this.qs2.cache();
} }
}); });
}
addMultiSelect("#account_multi_user", "Username")
addMultiSelect("#account_domains", "Domain")
</script> </script>
{% endblock %} {% endblock %}