Commit 568de8f2 authored by Mike Koch's avatar Mike Koch 🗺

#7 Give users the power to change the icon if it helps

parent d2d66b29
......@@ -166,11 +166,11 @@ $klein->respond('GET', '/games/[:game]/[:location]/[:missionSlug]/[:difficulty]'
/* @var $icon \DataAccess\Models\Icon */
foreach ($icons as $icon) {
if (!key_exists($predeterminedItem->getGroup(), $sortedIcons)) {
$sortedIcons[$predeterminedItem->getGroup()] = [];
if (!key_exists($icon->getGroup(), $sortedIcons)) {
$sortedIcons[$icon->getGroup()] = [];
}
$sortedIcons[$predeterminedItem->getGroup()][] = $icon;
$sortedIcons[$icon->getGroup()][] = $icon;
}
$viewModel->predeterminedItems = $sortedPredeterminedItems;
......
......@@ -318,7 +318,7 @@
</small>
</div>
</div>
<div class="form-group row" style="display: none">
<div class="form-group row" id="icon-form-group">
<label for="icon" class="col-sm-2 col-form-label">Icon</label>
<div class="col-sm-10">
<select name="icon" class="form-control selectpicker" data-live-search="true">
......@@ -976,7 +976,7 @@
$('select[name="subgroup"]').change(function() {
var $selectedItem = $('select[name="subgroup"] option:selected');
$('input[name="group"]').val($selectedItem.text());
$('input[name="group"]').val($selectedItem.text().trim());
$('input[name="searchable"]').val($selectedItem.attr('data-searchable'));
var icon = $selectedItem.attr('data-icon');
......@@ -994,6 +994,13 @@
} else {
$('#note-help-text').text('');
}
if (['Navigation|agency-pickup', 'Navigation|exit-location', 'Navigation|ledge', 'Navigation|up-stair',
'Navigation|starting-location', 'Navigation|up-pipe'].indexOf($selectedItem.val()) > -1) {
$('#icon-form-group').hide();
} else {
$('#icon-form-group').show();
}
});
function toggleEditorFieldDisplay($selectedItem, attribute) {
......
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