Skip to content

Commit

Permalink
Show cancel rsvp button event after project has ended
Browse files Browse the repository at this point in the history
  • Loading branch information
vidya-ram committed Oct 27, 2023
1 parent a35355c commit b6df4d5
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 24 deletions.
2 changes: 1 addition & 1 deletion funnel/assets/sass/components/_ticket-modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
}

.price-btn {
min-width: 200px;
min-width: 150px;
font-size: inherit;
padding: 0;
display: flex;
Expand Down
46 changes: 23 additions & 23 deletions funnel/templates/project_layout.html.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,28 @@
{% macro registerblock(project) %}
<div class="register-block">
<div class="register-block__content {% if project.features.show_tickets %}register-block__content--half {%- endif %}">
{% if project.features.rsvp() %}
{%- if project.features.rsvp_registered() %}
<span class="register-block__content__txt mui--text-light"></span>
<a id="cancel-rsvp-btn" class="mui-btn mui-btn--accent mui-btn--raised register-block__btn js-register-btn" rel="modal:open" href="#register-modal" aria-haspopup="true">
<span class="register-block__btn__txt register-block__btn__txt--hover" data-cy="registered">{% if project.features.follow_mode() %}{% trans %}Following{% endtrans %}{% else %}{% trans %}Registered{% endtrans %}{% endif %}{{ faicon(icon='check-circle-solid', icon_size='caption', baseline=true, css_class="mui--text-success fa-icon--left-margin") }}</span>
<span class="register-block__btn__txt register-block__btn__txt--hover--show">{% if project.features.follow_mode() %}{% trans %}Unfollow{% endtrans %}{% else %}{% trans %}Cancel Registration{% endtrans %}{% endif %}</span>
<span class="register-block__btn__txt register-block__btn__txt--smaller mui--text-light register-block__btn__txt--mobile">{{ project.views.registration_text() }}</span>
</a>
<div class="modal" id="register-modal" role="dialog" aria-labelledby="cancel-rsvp" aria-modal="true" tabindex="-1">
<div class="modal__header">
<a class="modal__close mui--text-dark" data-target="close cancel register modal" aria-label="{% trans %}Close{% endtrans %}" rel="modal:close" href="#" onclick="return false;" role="button" tabindex="0">{{ faicon(icon='times', baseline=false, icon_size='title') }}</a>
</div>
<div class="modal__body">
<p class="mui--text-subhead" id="cancel-rsvp">{% if project.features.follow_mode() %}{% trans %}No longer interested?{% endtrans %}{% else %}{% trans %}Can’t make it?{% endtrans %}{% endif %}</p>
<form action="{{ project.url_for('deregister') }}" method="post" class="form-inline">
{{ csrf_tag() }}
<div class="mui--text-right">
<button class="mui-btn mui-btn--raised" type="submit" name="submit" value="no" data-cy="cancel-rsvp">{% if project.features.follow_mode() %}{% trans %}Stop following{% endtrans %}{% else %}{% trans %}Confirm cancellation{% endtrans %}{% endif %}</button>
</div>
</form>
</div>
</div>
{% elif project.features.rsvp() %}
{%- if current_auth.is_anonymous %}
<a class="mui-btn mui-btn--raised {% if project.features.show_tickets %} mui-btn--dark {%- else %} mui-btn--primary {%- endif %} register-block__btn" id="register-nav" href="{{ url_for('login', next=request.path + '#register-modal', modal='register-modal') }}" rel="modal:open" aria-haspopup="true" data-register-modal="register-modal">{{ project.views.register_button_text() }}</a>
{% elif project.features.rsvp_unregistered() -%}
Expand All @@ -149,34 +170,13 @@
<span class="register-block__btn__txt" data-cy="unregistered">{{ project.views.register_button_text() }}</span>
<span class="register-block__btn__txt register-block__btn__txt--smaller primary-color-lighter-txt" data-cy="unregistered">{{ project.views.registration_text() }}</span>
</a>
{%- elif project.features.rsvp_registered() %}
<span class="register-block__content__txt mui--text-light"></span>
<a id="cancel-rsvp-btn" class="mui-btn mui-btn--accent mui-btn--raised register-block__btn js-register-btn" rel="modal:open" href="#register-modal" aria-haspopup="true">
<span class="register-block__btn__txt register-block__btn__txt--hover" data-cy="registered">{% if project.features.follow_mode() %}{% trans %}Following{% endtrans %}{% else %}{% trans %}Registered{% endtrans %}{% endif %}{{ faicon(icon='check-circle-solid', icon_size='caption', baseline=true, css_class="mui--text-success fa-icon--left-margin") }}</span>
<span class="register-block__btn__txt register-block__btn__txt--hover--show">{% if project.features.follow_mode() %}{% trans %}Unfollow{% endtrans %}{% else %}{% trans %}Cancel Registration{% endtrans %}{% endif %}</span>
<span class="register-block__btn__txt register-block__btn__txt--smaller mui--text-light register-block__btn__txt--mobile">{{ project.views.registration_text() }}</span>
</a>
<div class="modal" id="register-modal" role="dialog" aria-labelledby="cancel-rsvp" aria-modal="true" tabindex="-1">
<div class="modal__header">
<a class="modal__close mui--text-dark" data-target="close cancel register modal" aria-label="{% trans %}Close{% endtrans %}" rel="modal:close" href="#" onclick="return false;" role="button" tabindex="0">{{ faicon(icon='times', baseline=false, icon_size='title') }}</a>
</div>
<div class="modal__body">
<p class="mui--text-subhead" id="cancel-rsvp">{% if project.features.follow_mode() %}{% trans %}No longer interested?{% endtrans %}{% else %}{% trans %}Can’t make it?{% endtrans %}{% endif %}</p>
<form action="{{ project.url_for('deregister') }}" method="post" class="form-inline">
{{ csrf_tag() }}
<div class="mui--text-right">
<button class="mui-btn mui-btn--raised" type="submit" name="submit" value="no" data-cy="cancel-rsvp">{% if project.features.follow_mode() %}{% trans %}Stop following{% endtrans %}{% else %}{% trans %}Confirm cancellation{% endtrans %}{% endif %}</button>
</div>
</form>
</div>
</div>
{%- endif %}
{% elif project.buy_tickets_url.url -%}
<a class="register-block__btn full-width-btn mui-btn mui-btn--primary" href="{{ project.buy_tickets_url.url }}" data-action="external register url" target="_blank" rel="noopener"><span>{{ faicon(icon='arrow-up-right-from-square', baseline=true, css_class="mui--text-white fa-icon--right-margin") }}{{ project.views.register_button_text() }}</span></a>
{% endif %}
</div>
{% if project.current_roles.ticket_participant %}
<div class="register-block__content"><button class="mui-btn mui-btn--accent register-block__btn mui--is-disabled">{% trans %}You are a member{% endtrans %}</button></div>
<div class="register-block__content {% if project.features.rsvp() or project.buy_tickets_url.url %} register-block__content--half {%- endif %}"><button class="mui-btn mui-btn--accent register-block__btn mui--is-disabled">{% trans %}You are a member{% endtrans %}</button></div>
{% elif project.features.show_tickets %}
<div class="register-block__content {% if project.features.rsvp() or project.buy_tickets_url.url %} register-block__content--half {%- endif %}">
<button class="js-open-ticket-widget register-block__btn mui-btn mui-btn--primary">
Expand Down

0 comments on commit b6df4d5

Please sign in to comment.