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

Open login modal from link #1518

Merged
merged 1 commit into from
Mar 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions frontend/src/components/StartSocialAuth.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ const StartSocialAuth = (props) => {
<div className="form-group form-social-auth">
<FormHeader className={labelClassName} text={header} />
<div className="row">
{socialAuth.map(({ id, name, button_text, button_color, url }) => {
const className = "btn btn-block btn-default btn-social-" + id
{socialAuth.map(({ pk, name, button_text, button_color, url }) => {
const className = "btn btn-block btn-default btn-social-" + pk
const style = button_color ? { color: button_color } : null
const finalButtonLabel =
button_text || interpolate(buttonLabel, { site: name }, true)

return (
<div className={buttonClassName || "col-xs-12"} key={id}>
<div className={buttonClassName || "col-xs-12"} key={pk}>
<a className={className} style={style} href={url}>
{finalButtonLabel}
</a>
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/components/user-menu/guest-nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ export class GuestMenu extends React.Component {
modal.show(SignInModal)
}

componentDidMount() {
const params = new URLSearchParams(window.location.search)

if (params.get("modal") === "login") {
window.setTimeout(this.showSignInModal, 500)
}
}

render() {
const delegateAuth = misago.get("SETTINGS").DELEGATE_AUTH

Expand Down
2 changes: 1 addition & 1 deletion misago/static/misago/js/misago.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion misago/static/misago/js/misago.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion misago/templates/misago/emails/register/complete.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<br>
<br>
{% capture trimmed as login_link %}
<a href="{% absoluteurl LOGIN_URL %}">{% trans "this form" %}</a>
<a href="{% absoluteurl LOGIN_URL %}?modal=login">{% trans "this form" %}</a>
{% endcapture %}
{% blocktrans trimmed with login_form=login_link|safe %}
You can always sign in to your account using {{ login_form }}.
Expand Down
2 changes: 1 addition & 1 deletion misago/templates/misago/emails/register/complete.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,5 @@ You may now join discussion on our forums. Why not spend a minute or two to have
{% blocktrans trimmed %}
You can always sign in to your account using the form below:
{% endblocktrans %}
{% absoluteurl LOGIN_URL %}
{% absoluteurl LOGIN_URL %}?modal=login
{% endblock content %}