File size: 3,929 Bytes
8549507
 
2406314
 
 
 
 
 
 
 
 
 
 
 
 
8549507
1434f10
e4a03b0
 
 
1434f10
17c6f13
 
8549507
17c6f13
4fa59bf
8549507
17c6f13
2406314
 
4fa59bf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
8549507
 
 
 
 
 
 
 
 
2406314
8549507
e4a03b0
 
 
 
 
 
2406314
8549507
 
 
 
 
2406314
8549507
 
2406314
 
 
59e06b1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
{% extends "base.html" %}
{% block title %}Browse Responses - Explorer{% endblock %}
{% block nav_browse %}active{% endblock %}

{% block head %}
<script>
  const SERVICES_MAP   = {{ services_json | safe }};
  const ALL_ROWS       = {{ rows_json | safe }};
  const CAN_EDIT       = {{ 'true' if can_edit else 'false' }};
  const GROUP_INTERNAL = {"VISA - KHMER":"VISA - KH","VISA - FOREIGNER":"VISA-FOR"};
</script>
{% endblock %}

{% block content %}

<div class="page-header browse-header">
  <div class="page-header-text">
    <div class="page-eyebrow">Browse Matrix</div>
    <h1 class="page-title">Build the <em>response</em> library.</h1>
    <p class="page-subtitle"><span id="browse-count">{{ response_count }}</span> service-objection rows from the active visa matrix. Responses are intentionally blank until your team fills them in.</p>
  </div>
  <div class="page-header-actions browse-actions">
    <a class="btn btn-outline btn-sm" href="/browse/export.csv">Export CSV</a>
  {% if can_edit %}
    <button class="btn btn-primary btn-sm browse-new-btn" type="button" onclick="openNewResponseModal()">+ New response</button>
    <button class="btn btn-outline btn-sm browse-delete-toggle" type="button" onclick="toggleBrowseDeletePanel()">Delete matrix item</button>
  {% endif %}
  </div>
</div>

{% if can_edit %}
<section id="browse-delete-panel" class="browse-delete-panel" hidden aria-label="Delete Browse matrix item">
  <div>
    <div class="card-label">Delete From Browse</div>
    <p class="text-muted">Remove every row for one service, objection type, or cluster. Deleted items will not be re-created from the CSV seed.</p>
  </div>
  <div class="browse-delete-grid">
    <div class="field">
      <label class="field-label" for="browse-delete-scope">Delete</label>
      <select class="select" id="browse-delete-scope" onchange="updateBrowseDeleteOptions()">
        <option value="service">Service</option>
        <option value="objection_type">Objection Type</option>
        <option value="cluster">Cluster</option>
      </select>
    </div>
    <div class="field">
      <label class="field-label" for="browse-delete-value">Value</label>
      <select class="select" id="browse-delete-value"></select>
    </div>
    <button class="btn btn-outline browse-delete-btn" type="button" onclick="deleteBrowseMatrixItem()">Delete</button>
  </div>
  <div id="browse-delete-message" class="browse-delete-message" hidden></div>
</section>
{% endif %}

<section class="browse-filter-panel" aria-label="Browse filters">
  <div class="field browse-filter-group">
    <label class="field-label" for="browse-group">Group</label>
    <select class="select" id="browse-group" onchange="browseFilter()">
      <option value="">-- All groups --</option>
      {% for g in group_labels %}
      <option value="{{ g }}">{{ g }}</option>
      {% endfor %}
    </select>
  </div>
  <div class="field browse-filter-service">
    <label class="field-label" for="browse-service-search">Service</label>
    <div class="service-combobox browse-service-combobox" id="browse-service-combobox">
      <input type="hidden" id="browse-service" value="" />
      <input class="input" type="text" id="browse-service-search" placeholder="All services" autocomplete="off" oninput="filterBrowseServiceOptions()" onfocus="openBrowseServiceOptions()" />
      <div id="browse-service-options" class="service-options" hidden></div>
    </div>
  </div>
  <div class="field browse-filter-search">
    <label class="field-label" for="browse-search">Search</label>
    <input class="input" type="text" id="browse-search" placeholder="Search by type, cluster, or response text..." oninput="browseFilter()" />
  </div>
</section>

<section id="browse-results" class="browse-library" aria-label="Response library"></section>
<div id="browse-empty" class="browse-empty-state" hidden>
  No responses match the current filters.
</div>

{% endblock %}