Skip to content

Commit

Permalink
Merge pull request #195 from CatalysmsServerManager/niekcandaele/issue60
Browse files Browse the repository at this point in the history
Sort the custom commands
  • Loading branch information
niekcandaele committed Jul 16, 2020
2 parents 8e69743 + 659f751 commit 16d38ec
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
30 changes: 24 additions & 6 deletions views/sdtdServer/partials/settings/commandSettings.ejs
Expand Up @@ -131,12 +131,28 @@

<h3>Custom commands</h3>

<% customCommands.forEach(command => { %>
<%- include('./editCommandModal.ejs', { command: command}) %>
<% }) %>
<table id="commands-table" class="table table-striped table-bordered">
<thead>
<tr>
<th>Name</th>
<th>Description</th>
<th>Commands</th>
<th></th>
</tr>
</thead>
<tbody>
<% customCommands.forEach(command => { %>
<tr>
<td scope="row"><%= command.name %></td>
<td><%= command.description %></td>
<td><%= command.commandsToExecute %></td>
<td><%- include('./editCommandModal.ejs', { command: command}) %></td>
</tr>
<% }) %>

</tbody>
</table>

<hr>

Expand Down Expand Up @@ -199,6 +215,8 @@
<script>
$(document).ready(function () {
$('#commands-table').DataTable();
$("#custom-commands-import-btn").click(e => {
let json = $("#custom-commands-import-json").val();
Expand Down
2 changes: 1 addition & 1 deletion views/sdtdServer/partials/settings/editCommandModal.ejs
Expand Up @@ -2,7 +2,7 @@

<!-- Button trigger modal -->
<button type="button" class="btn btn-secondary btn-sm" data-toggle="modal" data-target="#custom-command-<%= command.id %>-modal">
<%= command.name %>
Edit
</button>

<!-- Modal -->
Expand Down

0 comments on commit 16d38ec

Please sign in to comment.