mirror of
https://github.com/lucaspalomodevelop/eventcally.git
synced 2026-03-13 00:07:22 +00:00
Phone, Email auch für Admin Unit
This commit is contained in:
parent
c433c6e3d4
commit
c8c3e1a8c1
55
app.py
55
app.py
@ -25,8 +25,8 @@ app.config['SECURITY_TRACKABLE'] = True
|
||||
app.config['SECURITY_REGISTERABLE'] = True
|
||||
app.config['SECURITY_SEND_REGISTER_EMAIL'] = False
|
||||
app.config['LANGUAGES'] = ['en', 'de']
|
||||
app.config['GOOGLE_OAUTH_CLIENT_ID'] = os.environ['GOOGLE_OAUTH_CLIENT_ID']
|
||||
app.config['GOOGLE_OAUTH_CLIENT_SECRET'] = os.environ['GOOGLE_OAUTH_CLIENT_SECRET']
|
||||
app.config['GOOGLE_OAUTH_CLIENT_ID'] = os.getenv('GOOGLE_OAUTH_CLIENT_ID')
|
||||
app.config['GOOGLE_OAUTH_CLIENT_SECRET'] = os.getenv('GOOGLE_OAUTH_CLIENT_SECRET')
|
||||
|
||||
# Generate a nice key using secrets.token_urlsafe()
|
||||
app.config['SECRET_KEY'] = os.environ.get("SECRET_KEY", 'pf9Wkove4IKEAXvy-cQkeDPhv9Cb3Ag-wyJILbq_dFw')
|
||||
@ -669,8 +669,6 @@ def get_event_suggestions_for_current_user():
|
||||
|
||||
@app.before_first_request
|
||||
def create_initial_data():
|
||||
return
|
||||
|
||||
# Event categories
|
||||
upsert_event_category('Art')
|
||||
upsert_event_category('Book')
|
||||
@ -834,7 +832,13 @@ def create_initial_data():
|
||||
|
||||
# Users
|
||||
admin_role = user_datastore.find_or_create_role("admin")
|
||||
admin_role.add_permissions(["user:create", "event:verify", "event:create", "event_suggestion:read", "admin_unit.members:read", "organization.members:read"])
|
||||
admin_role.add_permissions(["user:create",
|
||||
"event:verify",
|
||||
"event:create",
|
||||
"event_suggestion:read",
|
||||
"admin_unit:update",
|
||||
"admin_unit.members:read",
|
||||
"organization.members:read"])
|
||||
|
||||
admin_unit_admin_role = upsert_admin_unit_member_role('admin', ["admin_unit.members:read", "admin_unit.organizations.members:read"])
|
||||
admin_unit_event_verifier_role = upsert_admin_unit_member_role('event_verifier', ["event:verify", "event:create", "event_suggestion:read"])
|
||||
@ -962,18 +966,50 @@ def developer():
|
||||
|
||||
@app.route("/admin_units")
|
||||
def admin_units():
|
||||
return render_template('admin_units.html',
|
||||
return render_template('admin_unit/list.html',
|
||||
admin_units=AdminUnit.query.order_by(asc(func.lower(AdminUnit.name))).all())
|
||||
|
||||
@app.route('/admin_unit/<int:admin_unit_id>')
|
||||
def admin_unit(admin_unit_id):
|
||||
admin_unit = AdminUnit.query.filter_by(id = admin_unit_id).first()
|
||||
admin_unit = AdminUnit.query.get_or_404(admin_unit_id)
|
||||
current_user_member = AdminUnitMember.query.with_parent(admin_unit).filter_by(user_id = current_user.id).first() if current_user.is_authenticated else None
|
||||
|
||||
return render_template('admin_unit.html',
|
||||
return render_template('admin_unit/read.html',
|
||||
admin_unit=admin_unit,
|
||||
current_user_member=current_user_member,
|
||||
can_list_admin_unit_members=can_list_admin_unit_members(admin_unit))
|
||||
can_list_admin_unit_members=can_list_admin_unit_members(admin_unit),
|
||||
can_update_admin_unit=has_current_user_permission('admin_unit:update'))
|
||||
|
||||
def update_admin_unit_with_form(admin_unit, form):
|
||||
form.populate_obj(admin_unit)
|
||||
|
||||
if form.logo_file.data:
|
||||
fs = form.logo_file.data
|
||||
admin_unit.logo = upsert_image_with_data(admin_unit.logo, fs.read(), fs.content_type)
|
||||
|
||||
@app.route('/admin_unit/<int:admin_unit_id>/update', methods=('GET', 'POST'))
|
||||
def admin_unit_update(admin_unit_id):
|
||||
if not has_current_user_permission('admin_unit:update'):
|
||||
abort(401)
|
||||
|
||||
admin_unit = AdminUnit.query.get_or_404(admin_unit_id)
|
||||
form = UpdateAdminUnitForm(obj=admin_unit)
|
||||
|
||||
if form.validate_on_submit():
|
||||
if not admin_unit.location:
|
||||
admin_unit.location = Location()
|
||||
update_admin_unit_with_form(admin_unit, form)
|
||||
|
||||
try:
|
||||
db.session.commit()
|
||||
flash(gettext('Admin unit successfully updated'), 'success')
|
||||
return redirect(url_for('admin_unit', admin_unit_id=admin_unit.id))
|
||||
except SQLAlchemyError as e:
|
||||
flash(handleSqlError(e), 'danger')
|
||||
|
||||
return render_template('admin_unit/update.html',
|
||||
form=form,
|
||||
admin_unit=admin_unit)
|
||||
|
||||
@app.route("/organizations")
|
||||
def organizations():
|
||||
@ -1187,6 +1223,7 @@ from forms.event import CreateEventForm, UpdateEventForm
|
||||
from forms.event_suggestion import CreateEventSuggestionForm
|
||||
from forms.place import CreatePlaceForm, UpdatePlaceForm
|
||||
from forms.organization import CreateOrganizationForm, UpdateOrganizationForm
|
||||
from forms.admin_unit import CreateAdminUnitForm, UpdateAdminUnitForm
|
||||
|
||||
def update_event_with_form(event, form):
|
||||
form.populate_obj(event)
|
||||
|
||||
30
forms/admin_unit.py
Normal file
30
forms/admin_unit.py
Normal file
@ -0,0 +1,30 @@
|
||||
from flask_babelex import lazy_gettext
|
||||
from flask_wtf import FlaskForm
|
||||
from flask_wtf.file import FileField, FileAllowed
|
||||
from wtforms import StringField, SubmitField, DecimalField, TextAreaField, FormField, SelectField
|
||||
from wtforms.fields.html5 import EmailField, TelField
|
||||
from wtforms.validators import DataRequired, Optional
|
||||
import decimal
|
||||
from models import Location
|
||||
|
||||
class AdminUnitLocationForm(FlaskForm):
|
||||
street = StringField(lazy_gettext('Street'), validators=[Optional()])
|
||||
postalCode = StringField(lazy_gettext('Postal code'), validators=[DataRequired()])
|
||||
city = StringField(lazy_gettext('City'), validators=[DataRequired()])
|
||||
state = StringField(lazy_gettext('State'), validators=[Optional()])
|
||||
latitude = DecimalField(lazy_gettext('Latitude'), places=16, validators=[Optional()])
|
||||
longitude = DecimalField(lazy_gettext('Longitude'), places=16, validators=[Optional()])
|
||||
|
||||
class BaseAdminUnitForm(FlaskForm):
|
||||
name = StringField(lazy_gettext('Name'), validators=[DataRequired()])
|
||||
url = StringField(lazy_gettext('Link URL'), validators=[Optional()])
|
||||
email = EmailField(lazy_gettext('Email'), validators=[Optional()])
|
||||
phone = TelField(lazy_gettext('Phone'), validators=[Optional()])
|
||||
logo_file = FileField(lazy_gettext('Logo'), validators=[FileAllowed(['jpg', 'jpeg', 'png'], lazy_gettext('Images only!'))])
|
||||
location = FormField(AdminUnitLocationForm, default=lambda: Location())
|
||||
|
||||
class CreateAdminUnitForm(BaseAdminUnitForm):
|
||||
submit = SubmitField(lazy_gettext("Create admin unit"))
|
||||
|
||||
class UpdateAdminUnitForm(BaseAdminUnitForm):
|
||||
submit = SubmitField(lazy_gettext("Update admin unit"))
|
||||
@ -1,7 +1,7 @@
|
||||
from flask_babelex import lazy_gettext
|
||||
from flask_wtf import FlaskForm
|
||||
from wtforms import StringField, SubmitField, TextAreaField
|
||||
from wtforms.fields.html5 import DateTimeLocalField
|
||||
from wtforms.fields.html5 import DateTimeLocalField, EmailField
|
||||
from wtforms.validators import DataRequired, Optional
|
||||
|
||||
class CreateEventSuggestionForm(FlaskForm):
|
||||
@ -18,4 +18,4 @@ class CreateEventSuggestionForm(FlaskForm):
|
||||
|
||||
host_name = StringField(lazy_gettext('Event host'), validators=[DataRequired()])
|
||||
contact_name = StringField(lazy_gettext('Contact name'), validators=[DataRequired()])
|
||||
contact_email = StringField(lazy_gettext('Contact email'), validators=[DataRequired()])
|
||||
contact_email = EmailField(lazy_gettext('Contact email'), validators=[DataRequired()])
|
||||
|
||||
@ -2,6 +2,7 @@ from flask_babelex import lazy_gettext
|
||||
from flask_wtf import FlaskForm
|
||||
from flask_wtf.file import FileField, FileAllowed
|
||||
from wtforms import StringField, SubmitField, DecimalField, TextAreaField, FormField, SelectField
|
||||
from wtforms.fields.html5 import EmailField, TelField
|
||||
from wtforms.validators import DataRequired, Optional
|
||||
import decimal
|
||||
|
||||
@ -16,6 +17,8 @@ class OrganizationLocationForm(FlaskForm):
|
||||
class BaseOrganizationForm(FlaskForm):
|
||||
name = StringField(lazy_gettext('Name'), validators=[DataRequired()])
|
||||
url = StringField(lazy_gettext('Link URL'), validators=[Optional()])
|
||||
email = EmailField(lazy_gettext('Email'), validators=[Optional()])
|
||||
phone = TelField(lazy_gettext('Phone'), validators=[Optional()])
|
||||
logo_file = FileField(lazy_gettext('Logo'), validators=[FileAllowed(['jpg', 'jpeg', 'png'], lazy_gettext('Images only!'))])
|
||||
legal_name = TextAreaField(lazy_gettext('Legal name'), validators=[Optional()])
|
||||
location = FormField(OrganizationLocationForm)
|
||||
|
||||
@ -22,6 +22,12 @@ def get_sd_for_org(organization):
|
||||
if organization.logo_id:
|
||||
result["logo"] = url_for('image', id=organization.logo_id)
|
||||
|
||||
if organization.email:
|
||||
result["email"] = organization.email
|
||||
|
||||
if organization.phone:
|
||||
result["phone"] = organization.phone
|
||||
|
||||
return result
|
||||
|
||||
def get_sd_for_admin_unit(admin_unit):
|
||||
|
||||
45
migrations/versions/75c07cb9cfe3_.py
Normal file
45
migrations/versions/75c07cb9cfe3_.py
Normal file
@ -0,0 +1,45 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 75c07cb9cfe3
|
||||
Revises: abf0f671ba27
|
||||
Create Date: 2020-07-07 10:11:08.217831
|
||||
|
||||
"""
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
import sqlalchemy_utils
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '75c07cb9cfe3'
|
||||
down_revision = 'abf0f671ba27'
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('adminunit', sa.Column('email', sa.Unicode(length=255), nullable=True))
|
||||
op.add_column('adminunit', sa.Column('location_id', sa.Integer(), nullable=True))
|
||||
op.add_column('adminunit', sa.Column('logo_id', sa.Integer(), nullable=True))
|
||||
op.add_column('adminunit', sa.Column('phone', sa.Unicode(length=255), nullable=True))
|
||||
op.add_column('adminunit', sa.Column('url', sa.String(length=255), nullable=True))
|
||||
op.create_foreign_key(None, 'adminunit', 'image', ['logo_id'], ['id'])
|
||||
op.create_foreign_key(None, 'adminunit', 'location', ['location_id'], ['id'])
|
||||
op.add_column('organization', sa.Column('email', sa.Unicode(length=255), nullable=True))
|
||||
op.add_column('organization', sa.Column('phone', sa.Unicode(length=255), nullable=True))
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('organization', 'phone')
|
||||
op.drop_column('organization', 'email')
|
||||
op.drop_constraint(None, 'adminunit', type_='foreignkey')
|
||||
op.drop_constraint(None, 'adminunit', type_='foreignkey')
|
||||
op.drop_column('adminunit', 'url')
|
||||
op.drop_column('adminunit', 'phone')
|
||||
op.drop_column('adminunit', 'logo_id')
|
||||
op.drop_column('adminunit', 'location_id')
|
||||
op.drop_column('adminunit', 'email')
|
||||
# ### end Alembic commands ###
|
||||
@ -99,6 +99,8 @@ class Organization(db.Model, TrackableMixin):
|
||||
logo_id = db.Column(db.Integer, db.ForeignKey('image.id'))
|
||||
logo = db.relationship('Image', uselist=False)
|
||||
url = Column(String(255))
|
||||
email = Column(Unicode(255))
|
||||
phone = Column(Unicode(255))
|
||||
members = relationship('OrgMember', backref=backref('organization', lazy=True))
|
||||
|
||||
### Admin Unit
|
||||
@ -153,6 +155,13 @@ class AdminUnit(db.Model, TrackableMixin):
|
||||
name = Column(Unicode(255), unique=True)
|
||||
members = relationship('AdminUnitMember', backref=backref('adminunit', lazy=True))
|
||||
organizations = relationship('AdminUnitOrg', backref=backref('adminunit', lazy=True))
|
||||
location_id = db.Column(db.Integer, db.ForeignKey('location.id'))
|
||||
location = db.relationship('Location')
|
||||
logo_id = db.Column(db.Integer, db.ForeignKey('image.id'))
|
||||
logo = db.relationship('Image', uselist=False)
|
||||
url = Column(String(255))
|
||||
email = Column(Unicode(255))
|
||||
phone = Column(Unicode(255))
|
||||
|
||||
# Universal Types
|
||||
|
||||
|
||||
@ -56,7 +56,13 @@
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro render_location(location) %}{{ location.street }}, {{ location.postalCode }} {{ location.city }}{% endmacro %}
|
||||
{% macro render_location(location) %}
|
||||
{%- if location.street -%}
|
||||
{{ location.street }}, {{ location.postalCode }} {{ location.city }}
|
||||
{%- else -%}
|
||||
{{ location.postalCode }} {{ location.city }}
|
||||
{%- endif -%}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro render_place(place) %}
|
||||
{%- if place.location -%}
|
||||
@ -148,6 +154,24 @@
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro render_email_prop(email) %}
|
||||
{% if email %}
|
||||
<div>
|
||||
<i class="fa fa-fw fa-envelope" data-toggle="tooltip" title="{{ _('Email') }}"></i>
|
||||
<a href="mailto:{{ email }}">{{ email }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro render_phone_prop(phone) %}
|
||||
{% if phone %}
|
||||
<div>
|
||||
<i class="fa fa-fw fa-phone" data-toggle="tooltip" title="{{ _('Phone') }}"></i>
|
||||
<a href="tel:{{ phone }}">{{ phone }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro render_location_prop(location) %}
|
||||
{% if location %}
|
||||
<div>
|
||||
@ -159,7 +183,13 @@
|
||||
|
||||
{% macro render_image(image_id) %}
|
||||
{% if image_id %}
|
||||
<img src="{{ url_for('image', id=image_id) }}" class="img-fluid rounded" />
|
||||
<img src="{{ url_for('image', id=image_id) }}" class="img-fluid rounded" style="max-width:700px;" />
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro render_logo(image_id) %}
|
||||
{% if image_id %}
|
||||
<img src="{{ url_for('image', id=image_id) }}" class="img-fluid rounded" style="max-width:200px;" />
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
@ -209,20 +239,14 @@
|
||||
<div class="my-4">{{ event.place.description }}</div>
|
||||
{% endif %}
|
||||
|
||||
{% if event.place.url %}
|
||||
<div class="my-4">{{ render_link_prop(event.place.url) }}</div>
|
||||
{% endif %}
|
||||
|
||||
{% if event.place.location %}
|
||||
<p>
|
||||
{{ event.place.location.street }}<br />
|
||||
{{ event.place.location.postalCode }} {{ event.place.location.city }}
|
||||
</p>
|
||||
<div class="my-4">
|
||||
{{ render_link_prop(event.place.url) }}
|
||||
{{ render_location_prop(event.place.location) }}
|
||||
</div>
|
||||
|
||||
<p>
|
||||
<a href="http://www.google.com/maps?q={{ render_place(event.place) | quote_plus }}">{{ _('Show directions') }}</a>
|
||||
<a href="http://www.google.com/maps?q={{ render_place(event.place) | quote_plus }}" class="btn btn-secondary">{{ _('Show directions') }}</a>
|
||||
</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -234,25 +258,33 @@
|
||||
|
||||
{% if event.host.admin_unit %}
|
||||
<h5 class="card-title"><a href="{{ url_for('admin_unit', admin_unit_id=event.host.admin_unit.id) }}" class="text-dark">{{ event.host.admin_unit.name }}</a></h5>
|
||||
|
||||
{% if event.host.admin_unit.logo_id %}
|
||||
<div class="my-4">{{ render_logo(event.host.admin_unit.logo_id) }}</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="my-4">
|
||||
{{ render_link_prop(event.host.admin_unit.url) }}
|
||||
{{ render_email_prop(event.host.admin_unit.email) }}
|
||||
{{ render_phone_prop(event.host.admin_unit.phone) }}
|
||||
{{ render_location_prop(event.host.admin_unit.location) }}
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
|
||||
{% if event.host.organization %}
|
||||
<h5 class="card-title"><a href="{{ url_for('organization', organization_id=event.host.organization.id) }}" class="text-dark">{{ event.host.organization.name }}</a></h5>
|
||||
|
||||
{% if event.host.organization.logo_id %}
|
||||
<div class="my-4">{{ render_image(event.host.organization.logo_id) }}</div>
|
||||
<div class="my-4">{{ render_logo(event.host.organization.logo_id) }}</div>
|
||||
{% endif %}
|
||||
|
||||
{% if event.host.organization.url %}
|
||||
<div class="my-4">{{ render_link_prop(event.host.organization.url) }}</div>
|
||||
{% endif %}
|
||||
|
||||
{% if event.host.organization.location %}
|
||||
<p>
|
||||
{{ event.host.organization.location.street }}<br />
|
||||
{{ event.host.organization.location.postalCode }} {{ event.host.organization.location.city }}
|
||||
</p>
|
||||
{% endif %}
|
||||
<div class="my-4">
|
||||
{{ render_link_prop(event.host.organization.url) }}
|
||||
{{ render_email_prop(event.host.organization.email) }}
|
||||
{{ render_phone_prop(event.host.organization.phone) }}
|
||||
{{ render_location_prop(event.host.organization.location) }}
|
||||
</div>
|
||||
|
||||
{% endif %}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{% extends "layout.html" %}
|
||||
{% from "_macros.html" import render_events %}
|
||||
{% from "_macros.html" import render_logo, render_phone_prop, render_email_prop, render_events, render_location_prop, render_link_prop, render_image %}
|
||||
{% block title %}
|
||||
{{ admin_unit.name }}
|
||||
{% endblock %}
|
||||
@ -7,29 +7,49 @@
|
||||
|
||||
<h1>{{ admin_unit.name }}</h1>
|
||||
|
||||
{% if can_update_admin_unit %}
|
||||
<div class="my-4">
|
||||
<a class="btn btn-primary my-1" href="{{ url_for('admin_unit_update', admin_unit_id=admin_unit.id) }}" role="button"><i class="fa fa-edit"></i> {{ _('Update admin unit') }}</a>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
{% if current_user_member or can_list_admin_unit_members %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#members" role="tab" area-selected="true">{{ _('Members') }}</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#organizations" role="tab">{{ _('Organizations') }}</a>
|
||||
</li>
|
||||
{% else %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#organizations" role="tab" area-selected="true">{{ _('Organizations') }}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#events" role="tab">{{ _('Events') }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#info" role="tab" area-selected="true">{{ _('Info') }}</a>
|
||||
</li>
|
||||
{% if current_user_member or can_list_admin_unit_members %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#members" role="tab" area-selected="true">{{ _('Members') }}</a>
|
||||
</li>
|
||||
{% endif %}
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#organizations" role="tab" area-selected="true">{{ _('Organizations') }}</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#events" role="tab">{{ _('Events') }}</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<!-- Tab panes -->
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane pt-4 active" id="info" role="tabpanel">
|
||||
|
||||
<div class="my-4">
|
||||
{{ render_location_prop(admin_unit.location) }}
|
||||
{{ render_link_prop(admin_unit.url) }}
|
||||
{{ render_email_prop(admin_unit.email) }}
|
||||
{{ render_phone_prop(admin_unit.phone) }}
|
||||
</div>
|
||||
|
||||
{% if admin_unit.logo_id %}
|
||||
<div class="my-4">{{ render_logo(admin_unit.logo_id) }}</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
{% if current_user_member or can_list_admin_unit_members %}
|
||||
<div class="tab-pane pt-4 active" id="members" role="tabpanel">
|
||||
<div class="tab-pane pt-4" id="members" role="tabpanel">
|
||||
{% if current_user_member %}
|
||||
<div class="my-4">
|
||||
{{ _('You are a member of this admin unit.') }}
|
||||
@ -59,7 +79,7 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
{% endif %}
|
||||
<div class="tab-pane pt-4{% if not current_user_member and not can_list_admin_unit_members %} active{% endif %}" id="organizations" role="tabpanel">
|
||||
<div class="tab-pane pt-4" id="organizations" role="tabpanel">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-sm table-bordered table-hover table-striped">
|
||||
<thead>
|
||||
56
templates/admin_unit/update.html
Normal file
56
templates/admin_unit/update.html
Normal file
@ -0,0 +1,56 @@
|
||||
{% extends "layout.html" %}
|
||||
{% from "_macros.html" import render_google_place_autocomplete_header, render_google_place_autocomplete_field, render_field_with_errors, render_field %}
|
||||
|
||||
{% block header %}
|
||||
{{ render_google_place_autocomplete_header(True) }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h1>{{ _('Update admin unit') }}</h1>
|
||||
<form action="{{ url_for('admin_unit_update', admin_unit_id=admin_unit.id) }}" method="POST" enctype="multipart/form-data">
|
||||
{{ form.hidden_tag() }}
|
||||
|
||||
<div class="card mb-4">
|
||||
<div class="card-header">
|
||||
{{ _('Admin unit') }}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ render_field_with_errors(form.name) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-4">
|
||||
<div class="card-header">
|
||||
{{ _('Location') }}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
|
||||
{{ render_google_place_autocomplete_field() }}
|
||||
|
||||
{{ form.location.hidden_tag() }}
|
||||
{{ render_field_with_errors(form.location.street) }}
|
||||
{{ render_field_with_errors(form.location.postalCode) }}
|
||||
{{ render_field_with_errors(form.location.city) }}
|
||||
{{ render_field_with_errors(form.location.state) }}
|
||||
{{ render_field_with_errors(form.location.latitude) }}
|
||||
{{ render_field_with_errors(form.location.longitude) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card mb-4">
|
||||
<div class="card-header">
|
||||
{{ _('Additional information') }}
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ render_field_with_errors(form.url) }}
|
||||
{{ render_field_with_errors(form.email) }}
|
||||
{{ render_field_with_errors(form.phone) }}
|
||||
{{ render_field_with_errors(form.logo_file) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ render_field(form.submit) }}
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
@ -45,6 +45,8 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ render_field_with_errors(form.url) }}
|
||||
{{ render_field_with_errors(form.email) }}
|
||||
{{ render_field_with_errors(form.phone) }}
|
||||
{{ render_field_with_errors(form.logo_file) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{% extends "layout.html" %}
|
||||
{% from "_macros.html" import render_events, render_location_prop, render_link_prop, render_image %}
|
||||
{% from "_macros.html" import render_logo, render_phone_prop, render_email_prop, render_events, render_location_prop, render_link_prop, render_image %}
|
||||
{% block title %}
|
||||
{{ organization.name }}
|
||||
{% endblock %}
|
||||
@ -39,10 +39,12 @@
|
||||
<div class="my-4">
|
||||
{{ render_location_prop(organization.location) }}
|
||||
{{ render_link_prop(organization.url) }}
|
||||
{{ render_email_prop(organization.email) }}
|
||||
{{ render_phone_prop(organization.phone) }}
|
||||
</div>
|
||||
|
||||
{% if organization.logo_id %}
|
||||
<div class="my-4">{{ render_image(organization.logo_id) }}</div>
|
||||
<div class="my-4">{{ render_logo(organization.logo_id) }}</div>
|
||||
{% endif %}
|
||||
|
||||
</div>
|
||||
|
||||
@ -45,6 +45,8 @@
|
||||
</div>
|
||||
<div class="card-body">
|
||||
{{ render_field_with_errors(form.url) }}
|
||||
{{ render_field_with_errors(form.email) }}
|
||||
{{ render_field_with_errors(form.phone) }}
|
||||
{{ render_field_with_errors(form.logo_file) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Binary file not shown.
@ -7,7 +7,7 @@ msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PROJECT VERSION\n"
|
||||
"Report-Msgid-Bugs-To: EMAIL@ADDRESS\n"
|
||||
"POT-Creation-Date: 2020-07-06 18:36+0200\n"
|
||||
"POT-Creation-Date: 2020-07-07 11:37+0200\n"
|
||||
"PO-Revision-Date: 2020-06-07 18:51+0200\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language: de\n"
|
||||
@ -94,31 +94,35 @@ msgstr "Sport"
|
||||
msgid "Event_Other"
|
||||
msgstr "Sonstiges"
|
||||
|
||||
#: app.py:1026
|
||||
#: app.py:1005
|
||||
msgid "Admin unit successfully updated"
|
||||
msgstr "Verwaltungseinheit erfolgreich aktualisiert"
|
||||
|
||||
#: app.py:1062
|
||||
msgid "Organization successfully created"
|
||||
msgstr "Organisation erfolgreich erstellt"
|
||||
|
||||
#: app.py:1046
|
||||
#: app.py:1082
|
||||
msgid "Organization successfully updated"
|
||||
msgstr "Organisation erfolgreich aktualisiert"
|
||||
|
||||
#: app.py:1101
|
||||
#: app.py:1137
|
||||
msgid "Place successfully updated"
|
||||
msgstr "Ort erfolgreich aktualisiert"
|
||||
|
||||
#: app.py:1124
|
||||
#: app.py:1160
|
||||
msgid "Place successfully created"
|
||||
msgstr "Ort erfolgreich erstellt"
|
||||
|
||||
#: app.py:1225
|
||||
#: app.py:1262
|
||||
msgid "Event successfully created"
|
||||
msgstr "Veranstaltung erfolgreich erstellt"
|
||||
|
||||
#: app.py:1246
|
||||
#: app.py:1283
|
||||
msgid "Event successfully updated"
|
||||
msgstr "Veranstaltung erfolgreich aktualisiert"
|
||||
|
||||
#: app.py:1283
|
||||
#: app.py:1320
|
||||
msgid "Event suggestion successfully created"
|
||||
msgstr "Veranstaltungsvorschlag erfolgreich erstellt"
|
||||
|
||||
@ -126,130 +130,103 @@ msgstr "Veranstaltungsvorschlag erfolgreich erstellt"
|
||||
msgid "Successfully signed in."
|
||||
msgstr "Erfolgreich eingeloggt."
|
||||
|
||||
#: templates/_macros.html:72 templates/event/create.html:6
|
||||
#: templates/_macros.html:78 templates/event/create.html:6
|
||||
msgid "Create event"
|
||||
msgstr "Veranstaltung erstellen"
|
||||
|
||||
#: templates/_macros.html:74 templates/event_suggestion/create.html:6
|
||||
#: templates/_macros.html:80 templates/event_suggestion/create.html:6
|
||||
msgid "Suggest event"
|
||||
msgstr "Veranstaltung vorschlagen"
|
||||
|
||||
#: templates/_macros.html:80 templates/event_suggestion/list.html:3
|
||||
#: templates/_macros.html:86 templates/event_suggestion/list.html:3
|
||||
#: templates/event_suggestion/list.html:7
|
||||
msgid "Event suggestions"
|
||||
msgstr "Veranstaltungsvorschläge"
|
||||
|
||||
#: templates/_macros.html:93 templates/_macros.html:174
|
||||
#: templates/_macros.html:99 templates/_macros.html:204
|
||||
#: templates/event/list.html:16 templates/event_suggestion/list.html:13
|
||||
#: templates/event_suggestion/read.html:18
|
||||
msgid "Date"
|
||||
msgstr "Datum"
|
||||
|
||||
#: templates/_macros.html:94 templates/admin/admin_units.html:18
|
||||
#: templates/admin_unit.html:45 templates/admin_unit.html:67
|
||||
#: templates/admin_units.html:13 templates/event/list.html:17
|
||||
#: templates/_macros.html:100 templates/admin/admin_units.html:18
|
||||
#: templates/admin_unit/list.html:13 templates/admin_unit/read.html:65
|
||||
#: templates/admin_unit/read.html:87 templates/event/list.html:17
|
||||
#: templates/event_suggestion/list.html:14 templates/home.html:22
|
||||
#: templates/home.html:44 templates/organization/list.html:19
|
||||
#: templates/organization/read.html:64 templates/place/list.html:19
|
||||
#: templates/organization/read.html:66 templates/place/list.html:19
|
||||
#: templates/profile.html:15 templates/profile.html:37
|
||||
msgid "Name"
|
||||
msgstr "Name"
|
||||
|
||||
#: templates/_macros.html:95 templates/_macros.html:192
|
||||
#: templates/_macros.html:231 templates/event/create.html:29
|
||||
#: templates/_macros.html:101 templates/_macros.html:222
|
||||
#: templates/_macros.html:255 templates/event/create.html:29
|
||||
#: templates/event/list.html:18 templates/event/update.html:29
|
||||
#: templates/event_suggestion/list.html:15
|
||||
msgid "Host"
|
||||
msgstr "Veranstalter"
|
||||
|
||||
#: templates/_macros.html:96 templates/_macros.html:154
|
||||
#: templates/_macros.html:175 templates/event/list.html:19
|
||||
#: templates/event_suggestion/list.html:16
|
||||
#: templates/_macros.html:102 templates/_macros.html:178
|
||||
#: templates/_macros.html:205 templates/admin_unit/update.html:25
|
||||
#: templates/event/list.html:19 templates/event_suggestion/list.html:16
|
||||
#: templates/event_suggestion/read.html:41
|
||||
#: templates/organization/create.html:26 templates/organization/update.html:26
|
||||
#: templates/place/create.html:29 templates/place/update.html:29
|
||||
msgid "Location"
|
||||
msgstr "Standort"
|
||||
|
||||
#: templates/_macros.html:106 templates/_macros.html:177
|
||||
#: templates/_macros.html:112 templates/_macros.html:207
|
||||
#: templates/event/list.html:29
|
||||
msgid "Verified"
|
||||
msgstr "Verifiziert"
|
||||
|
||||
#: templates/_macros.html:119
|
||||
#: templates/_macros.html:125
|
||||
msgid "Show all events"
|
||||
msgstr "Alle Veranstaltungen anzeigen"
|
||||
|
||||
#: templates/_macros.html:135
|
||||
#: templates/_macros.html:141
|
||||
msgid "Show on Google Maps"
|
||||
msgstr "Auf Google Maps anzeigen"
|
||||
|
||||
#: templates/_macros.html:145
|
||||
#: templates/_macros.html:151
|
||||
msgid "Link"
|
||||
msgstr "Link"
|
||||
|
||||
#: templates/_macros.html:169 templates/event/create.html:13
|
||||
#: templates/_macros.html:160
|
||||
msgid "Email"
|
||||
msgstr "Email"
|
||||
|
||||
#: templates/_macros.html:169
|
||||
msgid "Phone"
|
||||
msgstr "Telefon"
|
||||
|
||||
#: templates/_macros.html:199 templates/event/create.html:13
|
||||
#: templates/event/update.html:13 templates/event_suggestion/read.html:13
|
||||
msgid "Event"
|
||||
msgstr "Veranstaltung"
|
||||
|
||||
#: templates/_macros.html:190
|
||||
#: templates/_macros.html:220
|
||||
msgid "Category"
|
||||
msgstr "Kategorie"
|
||||
|
||||
#: templates/_macros.html:199 templates/event/create.html:38
|
||||
#: templates/_macros.html:229 templates/event/create.html:38
|
||||
#: templates/event/update.html:38 templates/place/create.html:20
|
||||
#: templates/place/update.html:20
|
||||
msgid "Place"
|
||||
msgstr "Ort"
|
||||
|
||||
#: templates/_macros.html:223
|
||||
#: templates/_macros.html:248
|
||||
msgid "Show directions"
|
||||
msgstr "Anreise planen"
|
||||
|
||||
#: templates/_macros.html:264
|
||||
#: templates/_macros.html:296
|
||||
msgid "Sign in with Google"
|
||||
msgstr "Mit Google anmelden"
|
||||
|
||||
#: templates/_macros.html:324
|
||||
#: templates/_macros.html:356
|
||||
msgid "Search location on Google"
|
||||
msgstr "Ort bei Google suchen"
|
||||
|
||||
#: templates/admin_unit.html:14 templates/organization/read.html:23
|
||||
msgid "Members"
|
||||
msgstr "Mitglieder"
|
||||
|
||||
#: templates/admin_unit.html:17 templates/admin_unit.html:21
|
||||
#: templates/layout.html:64 templates/organization/list.html:3
|
||||
#: templates/organization/list.html:7 templates/profile.html:32
|
||||
msgid "Organizations"
|
||||
msgstr "Organisationen"
|
||||
|
||||
#: templates/admin_unit.html:25 templates/event/list.html:4
|
||||
#: templates/event/list.html:8 templates/event/read.html:10
|
||||
#: templates/event_date/read.html:16 templates/layout.html:61
|
||||
#: templates/organization/read.html:27 templates/place/read.html:22
|
||||
msgid "Events"
|
||||
msgstr "Veranstaltungen"
|
||||
|
||||
#: templates/admin_unit.html:35
|
||||
msgid "You are a member of this admin unit."
|
||||
msgstr "Du bist Mitglied dieser Verwaltungseinheit"
|
||||
|
||||
#: templates/admin_unit.html:46 templates/admin_unit.html:68
|
||||
#: templates/home.html:23 templates/home.html:45
|
||||
#: templates/organization/read.html:65 templates/profile.html:16
|
||||
#: templates/profile.html:38
|
||||
msgid "Roles"
|
||||
msgstr "Rollen"
|
||||
|
||||
#: templates/admin/admin.html:15 templates/admin/admin_units.html:3
|
||||
#: templates/admin/admin_units.html:10 templates/admin_units.html:3
|
||||
#: templates/admin_units.html:7 templates/layout.html:63
|
||||
#: templates/profile.html:10
|
||||
msgid "Admin Units"
|
||||
msgstr "Verwaltungseinheiten"
|
||||
|
||||
#: templates/home.html:7
|
||||
msgid "Hi there!"
|
||||
msgstr "Moin!"
|
||||
@ -264,15 +241,42 @@ msgstr "Termine"
|
||||
msgid "Your Admin Units"
|
||||
msgstr "Deine Verwaltungseinheiten"
|
||||
|
||||
#: templates/admin_unit/read.html:66 templates/admin_unit/read.html:88
|
||||
#: templates/home.html:23 templates/home.html:45
|
||||
#: templates/organization/read.html:67 templates/profile.html:16
|
||||
#: templates/profile.html:38
|
||||
msgid "Roles"
|
||||
msgstr "Rollen"
|
||||
|
||||
#: templates/home.html:39
|
||||
msgid "Your Organizations"
|
||||
msgstr "Deine Organisationen"
|
||||
|
||||
#: templates/admin_unit/read.html:30 templates/event/list.html:4
|
||||
#: templates/event/list.html:8 templates/event/read.html:10
|
||||
#: templates/event_date/read.html:16 templates/layout.html:61
|
||||
#: templates/organization/read.html:27 templates/place/read.html:22
|
||||
msgid "Events"
|
||||
msgstr "Veranstaltungen"
|
||||
|
||||
#: templates/layout.html:62 templates/place/list.html:3
|
||||
#: templates/place/list.html:7
|
||||
msgid "Places"
|
||||
msgstr "Orte"
|
||||
|
||||
#: templates/admin/admin.html:15 templates/admin/admin_units.html:3
|
||||
#: templates/admin/admin_units.html:10 templates/admin_unit/list.html:3
|
||||
#: templates/admin_unit/list.html:7 templates/layout.html:63
|
||||
#: templates/profile.html:10
|
||||
msgid "Admin Units"
|
||||
msgstr "Verwaltungseinheiten"
|
||||
|
||||
#: templates/admin_unit/read.html:27 templates/layout.html:64
|
||||
#: templates/organization/list.html:3 templates/organization/list.html:7
|
||||
#: templates/profile.html:32
|
||||
msgid "Organizations"
|
||||
msgstr "Organisationen"
|
||||
|
||||
#: templates/developer/read.html:4 templates/developer/read.html:10
|
||||
#: templates/layout.html:65
|
||||
msgid "Developer"
|
||||
@ -291,17 +295,35 @@ msgstr "Administration"
|
||||
msgid "Logout"
|
||||
msgstr "Ausloggen"
|
||||
|
||||
#: templates/event/create.html:47 templates/event/update.html:47
|
||||
#: templates/organization/create.html:44 templates/organization/update.html:44
|
||||
#: templates/place/create.html:44 templates/place/update.html:44
|
||||
msgid "Additional information"
|
||||
msgstr "Zusätzliche Informationen"
|
||||
#: templates/admin_unit/read.html:12 templates/admin_unit/update.html:10
|
||||
msgid "Update admin unit"
|
||||
msgstr "Verwaltungseinheit aktualisieren"
|
||||
|
||||
#: templates/event/create.html:59 templates/event/update.html:59
|
||||
#: templates/organization/create.html:54
|
||||
#: templates/admin_unit/read.html:19 templates/organization/read.html:19
|
||||
#: templates/place/read.html:19
|
||||
msgid "Info"
|
||||
msgstr "Info"
|
||||
|
||||
#: templates/admin_unit/read.html:23 templates/organization/read.html:23
|
||||
msgid "Members"
|
||||
msgstr "Mitglieder"
|
||||
|
||||
#: templates/admin_unit/read.html:55
|
||||
msgid "You are a member of this admin unit."
|
||||
msgstr "Du bist Mitglied dieser Verwaltungseinheit"
|
||||
|
||||
#: templates/admin_unit/update.html:16 templates/event/create.html:59
|
||||
#: templates/event/update.html:59 templates/organization/create.html:56
|
||||
msgid "Admin unit"
|
||||
msgstr "Verwaltungseinheit"
|
||||
|
||||
#: templates/admin_unit/update.html:43 templates/event/create.html:47
|
||||
#: templates/event/update.html:47 templates/organization/create.html:44
|
||||
#: templates/organization/update.html:44 templates/place/create.html:44
|
||||
#: templates/place/update.html:44
|
||||
msgid "Additional information"
|
||||
msgstr "Zusätzliche Informationen"
|
||||
|
||||
#: templates/event/read.html:20
|
||||
msgid "Mark event as unverified"
|
||||
msgstr "Diese Veranstaltung als nicht verifiziert markieren"
|
||||
@ -375,11 +397,7 @@ msgstr "Organisation"
|
||||
msgid "Update organization"
|
||||
msgstr "Organisation aktualisieren"
|
||||
|
||||
#: templates/organization/read.html:19 templates/place/read.html:19
|
||||
msgid "Info"
|
||||
msgstr "Info"
|
||||
|
||||
#: templates/organization/read.html:54
|
||||
#: templates/organization/read.html:56
|
||||
msgid "You are a member of this organization."
|
||||
msgstr "Du bist Mitglied dieser Organisation"
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user