Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
37526 amit 1
<section class="wrapper">
2
<div class="ocr-root">
3
 
4
  <style>
5
  /* Scoped to .ocr-root. Colours use rgb() and selectors use classes, never id-hashes -
6
     Velocity parses a leading "#" as a directive. Namespaced away from .oc-root so the
7
     review screen's delegated handlers can never bind to this screen's controls. */
8
  .ocr-root {
9
    --ocr-bg: rgb(248, 250, 252);
10
    --ocr-surface: rgb(255, 255, 255);
11
    --ocr-border: rgb(226, 232, 240);
12
    --ocr-line: rgb(241, 245, 249);
13
    --ocr-text: rgb(15, 23, 42);
14
    --ocr-muted: rgb(100, 116, 139);
15
    --ocr-accent: rgb(79, 70, 229);
16
    --ocr-accent-soft: rgb(238, 242, 255);
17
    --ocr-ok: rgb(22, 163, 74);
18
    --ocr-ok-soft: rgb(240, 253, 244);
19
    --ocr-warn: rgb(180, 83, 9);
20
    --ocr-warn-soft: rgb(255, 251, 235);
21
    --ocr-danger: rgb(190, 18, 60);
22
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
23
    color: var(--ocr-text);
24
    font-size: 13px;
25
    line-height: 1.5;
26
    padding: 18px 22px 32px;
27
    box-sizing: border-box;
28
  }
29
  .ocr-root *, .ocr-root *::before, .ocr-root *::after { box-sizing: border-box; }
30
  .ocr-mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
31
  .ocr-num { color: var(--ocr-muted); font-size: 12px; }
32
 
33
  /* ---- header ---- */
34
  .ocr-head { display: flex; align-items: flex-start; justify-content: space-between;
35
              gap: 16px; flex-wrap: wrap; margin-bottom: 6px; }
36
  .ocr-title { font-size: 20px; font-weight: 650; letter-spacing: -0.01em; margin: 0; }
37
  .ocr-sub { color: var(--ocr-muted); margin: 4px 0 0; font-size: 12.5px; max-width: 74ch; }
38
  .ocr-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
39
 
40
  .ocr-btn { border: 1px solid var(--ocr-border); background: var(--ocr-surface);
41
             color: var(--ocr-text); border-radius: 7px; padding: 0 13px; height: 32px;
42
             font-size: 12.5px; cursor: pointer; white-space: nowrap; }
43
  .ocr-btn:hover { border-color: var(--ocr-accent); color: var(--ocr-accent); }
44
  .ocr-btn:disabled { opacity: 0.55; cursor: default; }
45
  .ocr-btn-primary { background: var(--ocr-accent); border-color: var(--ocr-accent);
46
                     color: rgb(255, 255, 255); }
47
  .ocr-btn-primary:hover { color: rgb(255, 255, 255); opacity: 0.92; }
48
  .ocr-btn-sm { height: 26px; padding: 0 10px; font-size: 12px; }
49
  .ocr-input { border: 1px solid var(--ocr-border); border-radius: 7px; padding: 0 9px;
50
               height: 32px; font-size: 13px; width: 100%; background: var(--ocr-surface);
51
               color: var(--ocr-text); }
52
  .ocr-input:focus, .ocr-btn:focus-visible { outline: 2px solid var(--ocr-accent);
53
                                             outline-offset: 1px; }
54
 
55
  /* ---- status strip ---- */
56
  .ocr-strip { display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
57
               margin: 14px 0 16px; }
58
  .ocr-chip { display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 11px;
59
              border: 1px solid var(--ocr-border); border-radius: 999px;
60
              background: var(--ocr-surface); font-size: 12.5px; }
61
  .ocr-chip b { font-weight: 650; font-variant-numeric: tabular-nums; }
62
  .ocr-chip-pending { background: var(--ocr-warn-soft); border-color: rgb(253, 230, 138);
63
                      color: var(--ocr-warn); }
64
 
65
  /* ---- two-pane: queue left, one decision right ---- */
66
  .ocr-split { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 16px;
67
               align-items: start; }
68
  @media (max-width: 1180px) { .ocr-split { grid-template-columns: minmax(0, 1fr); } }
69
 
70
  .ocr-card { background: var(--ocr-surface); border: 1px solid var(--ocr-border);
71
              border-radius: 10px; overflow: hidden; }
72
  .ocr-card-head { display: flex; align-items: center; justify-content: space-between;
73
                   gap: 10px; padding: 11px 14px; border-bottom: 1px solid var(--ocr-border);
74
                   background: var(--ocr-bg); }
75
  .ocr-card-title { font-weight: 650; font-size: 13px; }
76
 
77
  /* tabs encode a real split: coverage rows cannot be answered with an alias at all */
78
  .ocr-tabs { display: flex; gap: 4px; }
79
  .ocr-tab { border: 1px solid transparent; background: none; border-radius: 7px;
80
             padding: 4px 11px; font-size: 12.5px; color: var(--ocr-muted); cursor: pointer; }
81
  .ocr-tab.is-on { background: var(--ocr-surface); border-color: var(--ocr-border);
82
                   color: var(--ocr-text); font-weight: 600; }
83
 
84
  /* fixed layout so the columns do not reflow as the text length changes */
85
  table.ocr-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
86
  table.ocr-table th { text-align: left; font-weight: 600; color: var(--ocr-muted);
87
                       font-size: 11px; text-transform: uppercase; letter-spacing: 0.05em;
88
                       padding: 9px 14px; border-bottom: 1px solid var(--ocr-border);
89
                       white-space: nowrap; }
90
  table.ocr-table td { padding: 10px 14px; border-bottom: 1px solid var(--ocr-line);
91
                       vertical-align: middle; font-size: 12.5px; }
92
  table.ocr-table tr:last-child td { border-bottom: 0; }
93
  .ocr-col-product { width: auto; }
94
  .ocr-col-oem     { width: 130px; }
95
  .ocr-col-affects { width: 132px; }
96
  .ocr-col-state   { width: 190px; }
97
  .ocr-col-act     { width: 96px; text-align: right; }
98
  .ocr-row-on td { background: var(--ocr-accent-soft); }
99
  .ocr-rowlink { cursor: pointer; }
100
  .ocr-rowlink:hover td { background: var(--ocr-bg); }
101
 
102
  /* product text is the thing being judged, so it gets room and never truncates away */
103
  .ocr-product { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
104
                 font-size: 12.5px; word-break: break-word; }
105
  .ocr-affects { font-variant-numeric: tabular-nums; color: var(--ocr-muted);
106
                 white-space: nowrap; }
107
 
108
  .ocr-pill { display: inline-block; border-radius: 999px; padding: 1px 8px;
109
              font-size: 11.5px; font-weight: 600; white-space: nowrap; }
110
  .ocr-pill-todo { background: var(--ocr-warn-soft); color: var(--ocr-warn); }
111
  .ocr-pill-done { background: var(--ocr-ok-soft); color: var(--ocr-ok); }
112
  .ocr-pill-muted { background: rgb(241, 245, 249); color: var(--ocr-muted); }
113
 
114
  .ocr-empty { text-align: center; color: var(--ocr-muted); padding: 34px 14px; }
115
  .ocr-scroll { max-height: 64vh; overflow-y: auto; }
116
 
117
  /* ---- decision panel ---- */
118
  .ocr-panel { position: sticky; top: 12px; }
119
  @media (max-width: 1180px) { .ocr-panel { position: static; } }
120
  .ocr-panel-body { padding: 14px; }
121
  .ocr-panel-empty { padding: 40px 18px; text-align: center; color: var(--ocr-muted);
122
                     font-size: 12.5px; }
123
 
124
  .ocr-subject { font-family: ui-monospace, Menlo, monospace; font-size: 13.5px;
125
                 font-weight: 600; word-break: break-word; margin-bottom: 3px; }
126
  .ocr-context { color: var(--ocr-muted); font-size: 12px; margin-bottom: 14px; }
127
 
128
  /* one radio per line - three across wrapped mid-word at panel width */
129
  .ocr-choices { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; }
130
  .ocr-choice { display: flex; gap: 8px; align-items: flex-start; padding: 7px 9px;
131
                border: 1px solid var(--ocr-border); border-radius: 8px; cursor: pointer; }
132
  .ocr-choice + .ocr-choice { margin-top: 4px; }
133
  .ocr-choice.is-on { border-color: var(--ocr-accent); background: var(--ocr-accent-soft); }
134
  .ocr-choice input { margin: 2px 0 0; }
135
  .ocr-choice-text { display: flex; flex-direction: column; }
136
  .ocr-choice-text b { font-weight: 600; font-size: 12.5px; }
137
  .ocr-choice-text span { color: var(--ocr-muted); font-size: 11.5px; }
138
 
139
  .ocr-field { margin-bottom: 12px; }
140
  .ocr-field label { display: block; font-size: 11px; color: var(--ocr-muted);
141
                     text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 5px; }
142
  .ocr-help { color: var(--ocr-muted); font-size: 11.5px; margin: 5px 0 0; }
143
 
144
  .ocr-hits { border: 1px solid var(--ocr-border); border-radius: 8px; margin-top: 8px;
145
              max-height: 210px; overflow-y: auto; }
146
  .ocr-hit { display: block; width: 100%; text-align: left; border: 0;
147
             border-bottom: 1px solid var(--ocr-line); background: none; padding: 8px 10px;
148
             font-size: 12.5px; cursor: pointer; color: var(--ocr-text); }
149
  .ocr-hit:last-child { border-bottom: 0; }
150
  .ocr-hit:hover { background: var(--ocr-accent-soft); }
151
  .ocr-hit[data-picked="1"] { background: var(--ocr-accent-soft); font-weight: 600; }
152
  .ocr-hint { padding: 10px; color: var(--ocr-muted); font-size: 12px; }
153
 
154
  .ocr-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap;
155
                 padding-top: 12px; border-top: 1px solid var(--ocr-line); }
156
  .ocr-msg { font-size: 12px; margin-top: 10px; min-height: 16px; }
157
  .ocr-msg-bad { color: var(--ocr-danger); }
158
  .ocr-msg-ok { color: var(--ocr-ok); }
159
 
160
  .ocr-note { background: var(--ocr-warn-soft); border: 1px solid rgb(253, 230, 138);
161
              color: var(--ocr-warn); border-radius: 8px; padding: 10px 12px;
162
              font-size: 12.5px; }
163
  </style>
164
 
165
  <div class="ocr-head">
166
    <div>
167
      <h2 class="ocr-title">Resolve products</h2>
168
      <p class="ocr-sub">Each entry is one product name the matcher could not place. Answer
169
         it once and every row carrying that text is resolved &mdash; on this circular and
170
         on every later one.</p>
171
    </div>
172
    <div class="ocr-tools">
173
      <select class="ocr-input" data-ocr-doc style="width:auto;min-width:230px;"></select>
174
      <select class="ocr-input" data-ocr-brand style="width:auto;min-width:150px;"
175
              title="Show only one OEM's decisions"></select>
176
      <button class="ocr-btn" type="button" data-ocr-export
177
              title="Emit every saved decision as SQL so it can be replayed on another environment">Export as SQL</button>
178
      <button class="ocr-btn ocr-btn-primary" type="button" data-ocr-reingest
179
              title="Decisions are read when the circular is parsed, so they need a re-parse to take effect">Re-ingest to apply</button>
180
    </div>
181
  </div>
182
 
183
  <div class="ocr-strip">
184
    <span class="ocr-chip">Naming <b data-ocr-count-naming>&ndash;</b></span>
185
    <span class="ocr-chip">Coverage <b data-ocr-count-coverage>&ndash;</b></span>
186
    <span class="ocr-chip ocr-chip-pending" data-ocr-pending style="display:none;"></span>
187
  </div>
188
 
189
  <div class="ocr-split">
190
 
191
    <div class="ocr-card">
192
      <div class="ocr-card-head">
193
        <div class="ocr-tabs">
194
          <button class="ocr-tab is-on" type="button" data-ocr-tab="NAMING">Naming</button>
195
          <button class="ocr-tab" type="button" data-ocr-tab="COVERAGE">Coverage</button>
196
        </div>
197
        <span class="ocr-num" data-ocr-listnote></span>
198
      </div>
199
      <div class="ocr-scroll">
200
        <table class="ocr-table">
201
          <thead>
202
            <tr>
203
              <th class="ocr-col-product">Product as printed</th>
204
              <th class="ocr-col-oem">OEM</th>
205
              <th class="ocr-col-affects">Affects</th>
206
              <th class="ocr-col-state">Decision</th>
207
              <th class="ocr-col-act"></th>
208
            </tr>
209
          </thead>
210
          <tbody data-ocr-body>
211
            <tr><td colspan="5" class="ocr-empty">Loading&hellip;</td></tr>
212
          </tbody>
213
        </table>
214
      </div>
215
    </div>
216
 
217
    <div class="ocr-panel">
218
      <div class="ocr-card">
219
        <div class="ocr-card-head">
220
          <span class="ocr-card-title">Decision</span>
221
          <span class="ocr-num" data-ocr-panel-state></span>
222
        </div>
223
        <div data-ocr-panel-body>
224
          <div class="ocr-panel-empty">Pick a product on the left to resolve it.</div>
225
        </div>
226
      </div>
227
    </div>
228
 
229
  </div>
230
 
231
</div>
232
 
233
<script type="text/javascript">
234
    window.ocrContext = "${rc.contextPath}";
235
 
236
    // Standalone bootstrap - the fragment arrives alone when the URL is opened directly,
237
    // with no include-scripts.vm, so the screen would never initialise.
238
    (function () {
239
        var base = window.ocrContext || '';
240
        function addScript(src, next) {
241
            var s = document.createElement('script');
242
            s.src = src;
243
            s.onload = next;
244
            document.head.appendChild(s);
245
        }
246
        // The script registers everything inside $(function(){...}), which runs on the
247
        // NEXT tick - so at this script's onload the init function does not exist yet.
248
        // Calling it here directly is a silent no-op that leaves the screen on "Loading".
249
        // Defer through jQuery's ready queue instead: our callback is registered after
250
        // the file's own, so it runs after it.
251
        function start() {
252
            if (!window.jQuery) { return; }
253
            window.jQuery(function () {
254
                if (window.initOfferCircularResolve) { window.initOfferCircularResolve(); }
255
            });
256
        }
257
        if (!window.jQuery) {
258
            addScript(base + '/resources/js/jquery-3.2.1.min.js', function () {
259
                addScript(base + '/resources/js/offer-circular-resolve.js?v=${version}', start);
260
            });
261
        } else if (!window.initOfferCircularResolve) {
262
            addScript(base + '/resources/js/offer-circular-resolve.js?v=${version}', start);
263
        } else {
264
            start();
265
        }
266
    })();
267
</script>
268
</section>