Force "caution: prior errors" when errors in mutiple files
authorKarl O. Pinc <kop@karlpinc.com>
Mon, 18 Jan 2021 21:28:46 +0000 (15:28 -0600)
committerKarl O. Pinc <kop@karlpinc.com>
Mon, 18 Jan 2021 21:28:46 +0000 (15:28 -0600)
src/pgwui_bulk_upload/templates/bulk_upload.mak

index 220cbf7284a7776050bb4fbb414608cfa0160303..f2cb46dcacbdffc6ec629cd8415e4026e674b137 100644 (file)
@@ -65,7 +65,7 @@
   % endfor
 </%block>
 
-<%def name="file_errors(errors, filepath)">
+<%def name="file_errors(errors, filepath, firsterr)">
   % if filepath is not None:
       <%
       file_info = statmap[filepath]
@@ -78,7 +78,7 @@
       %>
   % endif
   <%
-  self.error_items(errors, sepclass='lightsep')
+  self.error_items(errors, sepclass='lightsep', caution=(not firsterr))
   %>
 </%def>
 
       <hr class="errorsep"></hr>
       <%
       # Either every error has a filepath or none do
+      firsterr = True
       last_filepath = None
       f_errors = []
       for error in errors:
           if isinstance(error, core_ex.UploadError):
               if error.filepath != last_filepath:
                   if last_filepath:
-                      self.file_errors(f_errors, last_filepath)
+                      self.file_errors(f_errors, last_filepath, firsterr)
+                      firsterr = False
                   last_filepath = error.filepath
                   f_errors = []
           f_errors.append(error)
-      self.file_errors(f_errors, last_filepath)
+      self.file_errors(f_errors, last_filepath, firsterr)
       %>
   % endif
 </%block>