Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update to latest fedora-bootstrap (bootstrap5) #354

Merged
merged 1 commit into from
Jul 8, 2024

Conversation

ryanlerch
Copy link
Contributor

No description provided.

@@ -105,7 +105,7 @@ def create_app(config=None):
# Admin UI
# Flask-Admin does not support having a single instance and multiple calls
# to init_app() (it stores the app as an instance attribute)
ADMIN = Admin(template_mode="bootstrap3")
ADMIN = Admin(template_mode="bootstrap4")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

flask-admin doesnt have a bootstrap5 template mode, so we use the bootstrap4 one... it works ok enough for the admin pages

@@ -1,94 +1,24 @@
{% extends 'admin/base.html' %}
{% import 'admin/lib.html' as lib with context %}
{% import 'admin/static.html' as admin_static with context %}
{% from "_macros.html" import footer, headincludes, nav, flashmessages, bottomincludes %}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this template is why i used macros here -- cos the admin plugin basically needs its own master template, so used macros for the complex stuff here so we can re-use in the main master template

Copy link
Member

@abompard abompard left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Some remarks:

  • all the flash messages for errors display in green, they should have the error category.
  • you can drop the views and templates you no longer use, such as host_category.

@@ -0,0 +1,26 @@
<div class="alert alert-light form-text">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't that duplicated from the macro with the same name?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops -- yeah didnt mean to add that file -- just going to keep this macro in _macros.html

removed this file

@@ -1,4 +1,4 @@
{% extends "master_noauth.html" %}
{% extends "master" %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be master.html

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the catch! fixed.

{{ asn.asn }}
{% if not host.private %}
<div><strong>Last Crawled:</strong> {% if host.last_crawled %} {{ host.last_crawled
}} <a href="{{url_for('base.crawler_log', host_id=host.id)}}">[Log]</a> {% else %} - {% endif %} </div>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe "never" rather than "-" here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah -- it was always '-' but never is better. fixed.

@ryanlerch
Copy link
Contributor Author

Looks great! Some remarks:

  • all the flash messages for errors display in green, they should have the error category.
    added a bunch of error categories to the flask.flash() calls
  • you can drop the views and templates you no longer use, such as host_category.
    dropped the host_category page!

@ryanlerch
Copy link
Contributor Author

Ready for re-review if you want

@abompard
Copy link
Member

abompard commented Jul 5, 2024

Looks great, anything you want to change before we merge it?

<div class="mt-3 d-flex justify-content-between align-items-center">
<div>
<h2 class="mb-0"><span class="fa fa-globe"></span> {{ site.name }}</h2>
Created by <strong>{{ site.created_by }}</strong> at <strong>{{ site.created_at }}</strong>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks a little bit weird:
image
Maybe do some formatting with the date? Nothing too fancy of course.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah -- i started that, but involved adding a filter -- so will merge this, and fix in another PR

@ryanlerch ryanlerch merged commit ca5aa18 into fedora-infra:master Jul 8, 2024
3 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants