Edit/Create text for the subscription modal
Text changes based on editing existing subscription, or creating a new one. Title and submit button label is the only text currently changed with this commit.
This commit is contained in:
parent
cba99c17f3
commit
31093a38de
@ -136,12 +136,16 @@ async function showEditSubModal(guildId) {
|
||||
|
||||
if (guildId === -1) {
|
||||
$("#subFormModal input, #subFormModal textarea").val("");
|
||||
$("#subFormModal .form-create").show();
|
||||
$("#subFormModal .form-edit").hide();
|
||||
}
|
||||
else {
|
||||
const subscription = subTable.row({id:guildId}).data()
|
||||
$("#subName").val(subscription.name);
|
||||
$("#subUrl").val(subscription.url);
|
||||
$("#subExtraNotes").val(subscription.extra_notes);
|
||||
$("#subFormModal .form-create").hide();
|
||||
$("#subFormModal .form-edit").show();
|
||||
}
|
||||
|
||||
$("#subId").val(guildId);
|
||||
|
@ -5,7 +5,9 @@
|
||||
<form id="subForm" class="mb-0" novalidate>
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title">
|
||||
Add Subscription
|
||||
<span class="form-create">Add</span>
|
||||
<span class="form-edit">Edit</span>
|
||||
Subscription
|
||||
</h5>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@ -19,13 +21,25 @@
|
||||
<input type="text" id="subUrl" name="subUrl" class="form-control" placeholder="http://feeds.bbci.co.uk/news/rss.xml">
|
||||
<div class="form-text">Must point to a valid <a href="https://en.wikipedia.org/wiki/RSS" class="text-decoration-none">RSS</a> feed.</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="mb-3">
|
||||
<label for="subExtraNotes" class="form-label">Extra Notes</label>
|
||||
<textarea id="subExtraNotes" name="subExtraNotes" class="form-control" placeholder="Articles from the front page of the BBC."></textarea>
|
||||
</div>
|
||||
<div>
|
||||
<label for="subChannels" class="form-label">Channels</label>
|
||||
<select name="subChannels" id="subChannels" class="select-2" multiple data-dropdownparent="#subFormModal">
|
||||
<option value="2123123">General</option>
|
||||
<option value="212312342312">News</option>
|
||||
<option value="212423123">Admin</option>
|
||||
</select>
|
||||
<div class="form-text">Subscription content will be sent to these channels.</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
<button type="submit" class="btn btn-primary">
|
||||
<span class="form-create">Create</span>
|
||||
<span class="form-edit">Save Changes</span>
|
||||
</button>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Cancel</button>
|
||||
</div>
|
||||
</form>
|
||||
|
Loading…
x
Reference in New Issue
Block a user