Artem Egorkine avatar Artem Egorkine committed f13c2ee

Show plugin setup errors in the plugins page.
* zine/shared/admin/style.css:
Style for the pluin error row, plugin error message header and body.
* zine/templates/admin/plugins.html:
Show plugin setup error message and set classes in case of plugin errors.

Comments (0)

Files changed (2)

zine/shared/admin/style.css

     background-color: #DEEEF8;
 }
 
+table.plugins tr.plugin-error td {
+    background-color: #F8EBDE;
+}
+
+table.plugins tr.plugin-error-top td {
+    border-bottom: none;
+}
+
+table.plugins div.error-header {
+    font-weight: bold;
+}
+
+table.plugins div.error-message {
+    color: #824031;
+}
+
 span.bundlemarker {
     font-weight: normal;
     color: #444;

zine/templates/admin/plugins.html

         <th class="active">{{ _("Activate") }}</th>
       </tr>
     {%- for plugin in plugins %}
-      <tr class="plugin-{{ 'active' if plugin.active else 'inactive' }}">
+      <tr class="plugin-{{ 'active' if plugin.active else 'inactive' }}
+                 {{ 'plugin-error plugin-error-top' if plugin.setup_error else '' }}">
         <td class="plugin">{{ plugin.html_display_name }}
           {%- if plugin.is_bundled %} <span class="bundlemarker">*</span>{% endif %}
         <td class="version">{{ (plugin.version or '?')|e }}
         </td>
         <td class="active">{{ form.active_plugins[plugin.name]() }}</td>
       </tr>
+      {%- if plugin.setup_error %}
+      <tr class="plugin-error">
+        <td colspan="4">
+            <div class="error-header">{{ _("Plugin setup error") }}:</div>
+            <div class="error-message">{{ plugin.setup_error }}</div>
+        </td>
+      </tr>
+      {% endif -%}
     {%- endfor %}
     </table>
     <p>{% trans %}
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.