Skip to content

Commit

Permalink
Merge branch 'main' into linked-contacts
Browse files Browse the repository at this point in the history
  • Loading branch information
jace committed Aug 20, 2024
2 parents 50dbcb1 + 6c9a5be commit 3efde19
Show file tree
Hide file tree
Showing 17 changed files with 707 additions and 682 deletions.
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,18 @@ repos:
]
files: ^requirements/.*\.txt$
- repo: https://github.com/asottile/pyupgrade
rev: v3.16.0
rev: v3.17.0
hooks:
- id: pyupgrade
args: ['--keep-runtime-typing', '--py311-plus']
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.5.1
rev: v0.6.1
hooks:
- id: ruff
args: ['--fix', '--exit-non-zero-on-fix']
- id: ruff-format
- repo: https://github.com/PyCQA/pylint
rev: v3.2.5
rev: v3.2.6
hooks:
- id: pylint
args: [
Expand Down Expand Up @@ -124,7 +124,7 @@ repos:
- id: forbid-tabs
- id: remove-tabs
- repo: https://github.com/pycontribs/mirrors-prettier
rev: v3.3.2
rev: v3.3.3
hooks:
- id: prettier
- repo: https://github.com/ducminh-phan/reformat-gherkin
Expand Down
14 changes: 14 additions & 0 deletions funnel/assets/sass/pages/profile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,16 @@
}
}

.profile-details {
ul {
padding: 0;
display: flex;
flex-direction: column;
gap: 8px;
list-style: none;
}
}

.profile-dropdown-btn {
background-color: $mui-bg-color-primary-dark;
padding: $mui-grid-padding * 0.5 $mui-grid-padding;
Expand Down Expand Up @@ -213,6 +223,10 @@
}
.profile-details {
padding: 2 * $mui-grid-padding 0 0;
ul {
gap: 16px;
flex-direction: row;
}
}
.profile.profile--unverified {
.profile__banner__box {
Expand Down
5 changes: 2 additions & 3 deletions funnel/assets/sass/pages/schedule.scss
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,9 @@
margin: $mui-grid-padding-double 0;
.schedule__table {
overflow: auto;
max-height: 100vh;
.schedule__row {
overflow: auto;
overflow: initial;
.schedule__row__column {
position: relative;
background-image: url('../../img/schedule-box-background.png');
Expand Down Expand Up @@ -238,8 +239,6 @@
}
}
.schedule__row--sticky {
overflow: auto;

.schedule__row__column--header {
outline: 1px solid $mui-divider-color;
border: none !important;
Expand Down
5 changes: 4 additions & 1 deletion funnel/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -1560,7 +1560,10 @@ def __repr__(self) -> str:
def redirect_view_args(self) -> dict[str, str]:
"""View arguments to substitute in a URL."""
if self.project:
return {'account': self.account.urlname, 'project': self.project.name}
return {
'account': self.project.account.urlname,
'project': self.project.name,
}
return {}

def is_over_a_day_old(self) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion funnel/models/sync_ticket.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class TicketParticipant(
grants_via={None: project_child_role_map},
)

scanned_contacts: Mapped[ContactExchange] = with_roles(
scanned_contacts: Mapped[list[ContactExchange]] = with_roles(
relationship(passive_deletes=True, back_populates='ticket_participant'),
grants_via={'account': {'scanner'}},
)
Expand Down
7 changes: 6 additions & 1 deletion funnel/pages/about/contact.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,9 @@ For general enquiries, email us at [[email protected]](mailto:[email protected]).

You can also call us at [+91 7676 33 2020](tel:+917676332020). This goes straight to the mobile numbers of all team members. If all of us are unable to take a call (or you hang up before we answer), we’ll call you back as soon as we can.

As a remote-only company, we do not have a physical location. Everybody works from home or a co-working location of their convenience.
Regd. Office Address
Hasgeek Learning Private Limited
No. 141/142, 2nd Cross,
Pai Layout, Hulimavu Gate,
Bangalore-560076
India
6 changes: 5 additions & 1 deletion funnel/pages/about/policy/refunds.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,14 @@ Refunds, where eligible, are typically issued via the same instrument that was u

## Events

We offer a 100% refund on attendee ticket cancellations until the day before the event, but some events may have a specific policy that overrides this generic policy. Please check if the event you are cancelling for has a specific policy.
Memberships can be cancelled within 1 hour of purchase. Workshop tickets can be cancelled or transferred upto 24 hours prior to the workshop.

Please check if the event you are cancelling for has a specific policy.

Please write to us at <[email protected]> to request a refund (or see the [contact info](/about/contact) page for other ways to contact us).

Refund requests will be processed within 24 hours. Once processed, the refund amount will be credited to the customer's original method of payment. Please note that it may take 7-10 business days for the refunded amount to reflect in your account, depending on your bank.

We may cancel an event due to unforeseen reasons or circumstances outside our control (force majeure events such as floods, fire, riots, terrorist incidents, bandhs, etc). If that happens, we may reschedule the event or issue a full or partial refund at our discretion.

## Merchandise
Expand Down
2 changes: 1 addition & 1 deletion funnel/templates/contacts.html.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<div class="mui--clearfix">
<div class="user mui--pull-left">
<div class="user__box">
{{ useravatar(contact.ticket_participant.participant) }}
{{ useravatar(contact.ticket_participant.participant, add_follow_btn=false) }}
<div class="user__box__header">
<p class="mui--text-subhead zero-bottom-margin">{{ contact.ticket_participant.fullname }}</p>
<p class="mui--text-body2 zero-bottom-margin">{{ contact.ticket_participant.email }}</p>
Expand Down
8 changes: 4 additions & 4 deletions funnel/templates/profile_layout.html.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -450,16 +450,16 @@
<p class="mui--text-title mui--text-light">@{{ profile.name }}</p>
{%- endif %}
</div>
<ul class="bullet-separated-list">
{%- if profile.tagline %}
<p>{{ profile.tagline }}</p>
{%- endif %}
<ul>
{%- if profile.joined_at %}
<li>{{ faicon(icon='history') }} {% trans date=profile.joined_at|date(format='MMM YYYY') %}Joined {{ date }}{% endtrans %}</li>
{%- endif %}
{%- if profile.website %}
<li><a href="{{ profile.website }}" target="_blank" rel="noopener nofollow">{{ faicon(icon='globe') }} {{ profile.website|cleanurl }}</a></li>
{%- endif %}
{%- if profile.tagline %}
<li>{{ profile.tagline }}</li>
{%- endif %}
</ul>
<div class="mui--visible-xs-block mui--visible-sm-block">
{{ profile_header_buttons(profile) }}
Expand Down
12 changes: 6 additions & 6 deletions funnel/templates/project_layout.html.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -286,9 +286,9 @@
{% endmacro %}

{% macro project_host_sponsor(project) %}
<p class="mui--text-subhead text-bold mui--text-light">{% trans %}Hosted by{% endtrans %}</p>
<div class="card card--shaped card--lessmargin">
<div class="card__body margin-bottom">
<p class="mui--text-subhead top-padding text-bold mui--text-light">{% trans %}Hosted by{% endtrans %}</p>
<div class="page-card">
<div class="project-section bottom-padding">
<div class="flex-wrapper flex-wrapper--center margin-bottom">
{{ profileavatar(project.account, css_class='flex-order-last flex-item-align-end') }}
</div>
Expand All @@ -305,16 +305,16 @@
</div>
</div>
{%- if project.has_sponsors %}
<p class="mui--text-subhead text-bold mui--text-light">{% trans %}Supported by{% endtrans %}</p>
<p class="mui--text-subhead text-bold top-padding mui--text-light">{% trans %}Supported by{% endtrans %}</p>
{%- endif %}
<div class="sponsors-wrapper">
{% for sponsorship in project.sponsor_memberships %}
{%- with sponsor_public = sponsorship.member.profile_state.ACTIVE_AND_PUBLIC %}
{%- if current_auth.user and current_auth.user.is_site_editor %}
<div id="{{ sponsorship.uuid_b58 }}" class="sortable" data-drag-placeholder="ui-box-placeholder" draggable="true">
{%- endif %}
<div class="card card--shaped card--lessmargin" data-cy="sponsor-card">
<div class="card__body margin-bottom">
<div class="page-card" data-cy="sponsor-card">
<div class="project-section bottom-padding margin-bottom">
<div class="flex-wrapper flex-wrapper--center flex-wrapper--space-between">
<div>
{% if sponsorship.label %}
Expand Down
6 changes: 6 additions & 0 deletions funnel/views/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -1020,6 +1020,12 @@ def delete(self) -> ReturnView:
)


@app.route('/.well-known/change-password')
def well_known_change_password() -> ReturnView:
"""Redirect to the change_password page."""
return redirect(url_for('change_password'), 303)


# MARK: Compatibility routes -----------------------------------------------------------


Expand Down
28 changes: 17 additions & 11 deletions funnel/views/membership.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,17 +110,23 @@ def new_member(self) -> ReturnView:
.one_or_none()
)
if previous_membership is not None:
return {
'status': 'error',
'error_description': _("This user is already an admin"),
'errors': membership_form.errors,
}, 422

new_membership = AccountMembership(
account=self.obj, granted_by=current_auth.user, is_admin=True
)
membership_form.populate_obj(new_membership)
db.session.add(new_membership)
if previous_membership.is_admin:
return {
'status': 'error',
'error_description': _("This user is already an admin"),
'errors': membership_form.errors,
}, 422
new_membership = previous_membership.replace(
actor=current_auth.user,
is_owner=membership_form.is_owner.data,
is_admin=True,
)
else:
new_membership = AccountMembership(
account=self.obj, granted_by=current_auth.user, is_admin=True
)
membership_form.populate_obj(new_membership)
db.session.add(new_membership)
db.session.commit()
dispatch_notification(
AccountAdminNotification(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,9 @@ def upgrade_() -> None:
followers.setdefault(item.account_id, {}).setdefault(
item.member_id, item.created_at
)
if item.created_at < followers[item.account_id][item.member_id]:
followers[item.account_id][item.member_id] = item.created_at
followers[item.account_id][item.member_id] = min(
item.created_at, followers[item.account_id][item.member_id]
)

# Load from RSVP
rsvp_select = (
Expand All @@ -130,8 +131,9 @@ def upgrade_() -> None:
followers.setdefault(item.account_id, {}).setdefault(
item.participant_id, item.created_at
)
if item.created_at < followers[item.account_id][item.participant_id]:
followers[item.account_id][item.participant_id] = item.created_at
followers[item.account_id][item.participant_id] = min(
item.created_at, followers[item.account_id][item.participant_id]
)

# Load from ticket participants
ticket_select = (
Expand All @@ -154,8 +156,9 @@ def upgrade_() -> None:
followers.setdefault(item.account_id, {}).setdefault(
item.participant_id, item.created_at
)
if item.created_at < followers[item.account_id][item.participant_id]:
followers[item.account_id][item.participant_id] = item.created_at
followers[item.account_id][item.participant_id] = min(
item.created_at, followers[item.account_id][item.participant_id]
)

# Get account names
accounts: dict[int, str | None] = {
Expand Down
Loading

0 comments on commit 3efde19

Please sign in to comment.