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

feat: added register to beta page #6

Merged
merged 1 commit into from
Nov 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
2 changes: 2 additions & 0 deletions superset/initialization/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ def init_views(self) -> None:
from superset.views.sqllab import SqllabView
from superset.views.tags import TagModelView, TagView
from superset.views.users.api import CurrentUserRestApi
from superset.views.register_beta import RegisterBetaView

#
# Setup API views
Expand Down Expand Up @@ -329,6 +330,7 @@ def init_views(self) -> None:
appbuilder.add_view_no_menu(TaggedObjectsModelView)
appbuilder.add_view_no_menu(TagView)
appbuilder.add_view_no_menu(ReportView)
appbuilder.add_view_no_menu(RegisterBetaView)

#
# Add links
Expand Down
59 changes: 59 additions & 0 deletions superset/templates/appbuilder/general/security/login_db.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<!-- extend base layout -->
{% extends "appbuilder/base.html" %}



{% block content %}

<div class="container">
<div id="loginbox" style="margin-top:50px;" class="mainbox col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2">
<div class="panel panel-primary" >
<div class="panel-heading">
<div class="panel-title">{{ title }}</div>
</div>
<div style="padding-top:30px" class="panel-body" >

<form class="form" action="" method="post" name="login">
{{form.hidden_tag()}}
<div class="help-block">{{_("Enter your login and password below")}}:</div>
<div class="control-group{% if form.errors.openid is defined %} error{% endif %}">
<label class="control-label" for="username">{{_("Username")}}:</label>

<div class="controls">
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-user"></i></span>
{{ form.username(size = 80, class = "form-control", autofocus = true) }}
</div>
{% for error in form.errors.get('openid', []) %}
<span class="help-inline">[{{error}}]</span><br>
{% endfor %}
<label class="control-label" for="password">{{_("Password")}}:</label>

<div class="input-group">
<span class="input-group-addon"><i class="fa fa-key"></i></span>
{{ form.password(size = 80, class = "form-control") }}
</div>
{% for error in form.errors.get('openid', []) %}
<span class="help-inline">[{{error}}]</span><br>
{% endfor %}
</div>
</div>

<div class="control-group">
<div class="controls">
<br>
<div>
<input class="btn btn-primary btn-block" type="submit" value="{{_('Sign In')}}">
<a href="/register/beta" class="btn btn-block btn-primary">
Sign up for closed beta
</a>
</div>
</div>
</div>
</form>

</div>
</div>
</div>
</div>
{% endblock %}
83 changes: 83 additions & 0 deletions superset/templates/appbuilder/general/security/register_beta.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<!-- extend base layout -->
{% extends "appbuilder/base.html" %}



{% block content %}
<div id="container">
<div id="loginbox" style="margin-top:50px;" class="mainbox col-md-6 col-md-offset-3 col-sm-8 col-sm-offset-2">
<div class="panel panel-primary">
<div class="panel-heading">
<div class="panel-title">Subscribe</div>
</div>
<div style="padding-top:30px" class="panel-body">
<form
action="https://ortege.us10.list-manage.com/subscribe/post?u=cc545d0e2ce1030a6b0466c35&amp;id=931737caa5&amp;v_id=5473&amp;f_id=00eedfe5f0"
method="post" id="mc-embedded-subscribe-form" name="mc-embedded-subscribe-form" class="validate"
target="_blank">
<div id="mc_embed_signup_scroll">
<div class="help-block"><span style="color: red;">*</span> indicates required</div>
<label class="control-label" for="mce-EMAIL">Email Address:<span
style="color: red;">*</span></label>
<div class="input-group">
<span class="input-group-addon"><i class="fa fa-envelope"></i></span>
<input id="mce-EMAIL" class="form-control" autofocus type="email" name="EMAIL" required>
</div>
<label class="control-label" for="mce-FNAME">First Name:<span
style="color: red;">*</span></label>
<div class="input-group">
<span class="input-group-addon"><i class="fa-solid fa-font"></i></i></span>
<input id="mce-FNAME" class="form-control" autofocus type="text" name="FNAME" required>
</div>
<label class="control-label" for="mce-LNAME">Last Name:<span
style="color: red;">*</span></label>
<div class="input-group">
<span class="input-group-addon"><i class="fa-solid fa-font"></i></span>
<input id="mce-LNAME" class="form-control" autofocus type="text" name="LNAME" required>
</div>
<label class="control-label" for="mce-WEBSITE1">Website:<span
style="color: red;">*</span></label>
<div class="input-group">
<span class="input-group-addon"><i class="fa-solid fa-link"></i></span>
<input id="mce-WEBSITE1" class="form-control" autofocus type="url" name="WEBSITE1" required>
</div>
<label class="control-label" for="mce-COUNTRY1">Country:<span
style="color: red;">*</span></label>
<div class="input-group">
<span class="input-group-addon"><i class="fa-solid fa-globe"></i></span>
<input id="mce-COUNTRY1" class="form-control" autofocus type="text" name="COUNTRY" required>
</div>
<label class="control-label">Marketing Permissions</label>
<p style="color: #879399; font-size: 12px; margin-bottom: 0px;">Please select if you would like to join weekly newsletter.</p>
<fieldset class="mc_fieldset gdprRequired mc-field-group" name="interestgroup_field">
<label class="checkbox subfield" for="gdpr60277" style="display: flex; align-items: center; gap: 10px;">
<input type="checkbox" id="gdpr_60277" name="gdpr[60277]" class="gdpr" value="Y" style="position: static; margin: 0px !important;">
<span style="color: #879399;">Email</span>
</label>
</fieldset>
<p style="color: #879399; font-size: 10px;">We use Mailchimp as our marketing platform. By clicking below to
subscribe, you
acknowledge that your information will be transferred to Mailchimp for processing.
<a href="https://mailchimp.com/legal/terms">Learn more</a> about Mailchimp's privacy
practices.
</p>
<p style="color: #879399; font-size: 10px;">You can unsubscribe at any time by clicking the link in the footer of
our emails. For
information about our privacy practices, please visit our website.
</p>
<div hidden=""><input type="hidden" name="tags" value="14175121,14175117,14175109"></div>
<div aria-hidden="true" style="position: absolute; left: -5000px;"><input type="text"
name="b_cc545d0e2ce1030a6b0466c35_931737caa5" tabindex="-1" value=""></div>
<div class="clear">
<input class="btn btn-primary btn-block" type="submit" value="Subscribe">
</div>
</div>
</form>
</div>
</div>
</div>
<script type="text/javascript" src="//s3.amazonaws.com/downloads.mailchimp.com/js/mc-validate.js"></script>
<script
type="text/javascript">(function ($) { window.fnames = new Array(); window.ftypes = new Array(); fnames[0] = 'EMAIL'; ftypes[0] = 'email'; fnames[1] = 'FNAME'; ftypes[1] = 'text'; fnames[2] = 'LNAME'; ftypes[2] = 'text'; fnames[6] = 'WEBSITE1'; ftypes[6] = 'url'; fnames[7] = 'COUNTRY1'; ftypes[7] = 'text'; fnames[3] = 'ADDRESS'; ftypes[3] = 'address'; fnames[4] = 'PHONE'; ftypes[4] = 'phone'; fnames[5] = 'BIRTHDAY'; ftypes[5] = 'birthday'; fnames[8] = 'CITIZENSHI'; ftypes[8] = 'text'; }(jQuery)); var $mcj = jQuery.noConflict(true);</script>
</div>
{% endblock %}
11 changes: 11 additions & 0 deletions superset/views/register_beta.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from flask_appbuilder import expose
from superset.views.base import BaseSupersetView

class RegisterBetaView(BaseSupersetView):
default_view = 'register_beta'
route_base = "/register"

@expose('/beta')
def register_beta(self):
self.update_redirect()
return self.render_template('appbuilder/general/security/register_beta.html')