Subversion Repositories SmartDukaan

Rev

Rev 37120 | Rev 37178 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 37120 Rev 37175
Line 224... Line 224...
224
    function agendaSelectHtml(p) {
224
    function agendaSelectHtml(p) {
225
        var preset = {};
225
        var preset = {};
226
        (p.existingAgendas || []).forEach(function (a) {
226
        (p.existingAgendas || []).forEach(function (a) {
227
            preset[a] = true;
227
            preset[a] = true;
228
        });
228
        });
-
 
229
        // Open agenda instances: pre-select them too; AUTO ones get a gear
-
 
230
        // suffix so the planner can tell system-raised agendas from manual picks.
-
 
231
        var autoBadge = {};
-
 
232
        (p.openAgendas || []).forEach(function (oa) {
-
 
233
            preset[oa.label] = true;
-
 
234
            if (oa.source === 'AUTO') autoBadge[oa.label] = true;
-
 
235
        });
229
        var html = '<select multiple class="av-party-agenda"'
236
        var html = '<select multiple class="av-party-agenda"'
230
                + ' data-fofoid="' + p.fofoStoreId + '">';
237
                + ' data-fofoid="' + p.fofoStoreId + '">';
231
        avContext.agendaOptions.forEach(function (opt) {
238
        avContext.agendaOptions.forEach(function (opt) {
232
            html += '<option value="' + opt + '"' + (preset[opt] ? ' selected' : '') + '>' + opt + '</option>';
239
            html += '<option value="' + opt + '"' + (preset[opt] ? ' selected' : '') + '>'
-
 
240
                    + opt + (autoBadge[opt] ? ' ⚙' : '') + '</option>';
233
        });
241
        });
234
        html += '</select>';
242
        html += '</select>';
235
        return html;
243
        return html;
236
    }
244
    }
237
 
245