Merge pull request #124 from DanielGrams/issue/123-frontend

Fix frontend glitches #123
This commit is contained in:
Daniel Grams 2021-02-17 10:15:52 +01:00 committed by GitHub
commit d283e77cda
4 changed files with 23 additions and 43 deletions

View File

@ -17,12 +17,17 @@ def is_list(value):
return isinstance(value, list)
def any_dict_value_true(data: dict):
return any(data.values())
app.jinja_env.filters["event_category_name"] = lambda u: get_event_category_name(u)
app.jinja_env.filters["loc_enum"] = lambda u: get_localized_enum_name(u)
app.jinja_env.filters["loc_scope"] = lambda s: get_localized_scope(s)
app.jinja_env.filters["env_override"] = env_override
app.jinja_env.filters["quote_plus"] = lambda u: quote_plus(u)
app.jinja_env.filters["is_list"] = is_list
app.jinja_env.filters["any_dict_value_true"] = any_dict_value_true
@app.context_processor

View File

@ -14,36 +14,12 @@ h3 {
margin: 2rem 0 1rem;
}
/* .navbar {
background-color: lightslategray;
font-size: 1em;
color: white;
padding: 8px 5px 8px 5px;
}
.navbar a {
text-decoration: none;
color: inherit;
}
.navbar-brand {
font-size: 1.2em;
font-weight: 600;
}
.navbar-item {
font-variant: small-caps;
margin-left: 30px;
} */
footer {
padding: 10px;
}
.social-btn {
/* background-color: #009688;
color: white; */
font-size: 1.5rem;
figure {
margin: 0;
}
tr.collapse.in {

View File

@ -305,18 +305,15 @@
{% macro render_image(image, size=500) %}
{% if image %}
{% set img_class = kwargs['class'] if 'class' in kwargs else '' %}
{% set img_style = kwargs['style'] if 'style' in kwargs else '' %}
{% set img_class = img_class + ' img-fluid' %}
{% if image.copyright_text %}
<figure class="figure mx-auto">
{% set img_class = img_class + ' figure-img' %}
{{ render_img_src(image, size, class=img_class, style=img_style, **kwargs) }}
<figcaption class="figure-caption">&copy; {{ image.copyright_text }}</figcaption>
</figure>
{% else %}
{% set img_class = kwargs.pop('class', '') %}
{% set img_style = kwargs.pop('style', '') %}
{% set img_class = img_class + ' figure-img img-fluid' %}
<figure class="figure mx-auto">
{{ render_img_src(image, size, class=img_class, style=img_style, **kwargs) }}
{% endif %}
{% if image.copyright_text %}
<figcaption class="figure-caption">&copy; {{ image.copyright_text }}</figcaption>
{% endif %}
</figure>
{% endif %}
{% endmacro %}
@ -966,7 +963,7 @@ if (URL) {
var canvas = cropper.getCroppedCanvas({
maxWidth: 1200,
maxHeight: 1200,
fillColor: '#eee'
fillColor: 'transparent'
});
var data_url = canvas.toDataURL();
crop_data = cropper.getData();
@ -1091,9 +1088,10 @@ if (URL) {
{% endmacro %}
{% macro render_event_menu(user_rights, event) %}
<div class="dropdown my-4">
<button class="btn btn-primary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ _('Actions') }}
{% if user_rights|any_dict_value_true %}
<div class="dropdown my-1">
<button class="btn btn-outline-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<i class="fa fa-cog"></i>
</button>
<div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton">
{% if user_rights['can_update_event'] %}
@ -1103,6 +1101,7 @@ if (URL) {
<a class="dropdown-item" href="{{ url_for('event_actions', event_id=event.id) }}">{{ _('More') }}&hellip;</a>
</div>
</div>
{% endif %}
{% endmacro %}
{% macro render_jquery_steps_header() %}

View File

@ -209,9 +209,9 @@
if (data.has_prev || data.has_next) {
$('#page_info_text').text("Seite " + data.page + " von " + data.pages + " (" + data.total + " insgesamt)")
$('#page_info').show();
$('#page_info').removeClass("d-none");
} else {
$('#page_info').hide();
$('#page_info').addClass("d-none");
}
handle_request_success();