summaryrefslogtreecommitdiff
path: root/public
diff options
context:
space:
mode:
authorWu Cheng-Han2016-12-02 01:58:14 +0800
committerWu Cheng-Han2016-12-02 01:58:14 +0800
commita73d9ce39e2107b2a9628003f05900d4a641bee5 (patch)
tree15778b1a6e3322bfe6e6c7a68f2c6e31f4c34844 /public
parent52772829ce8ccc7eac1fe1df9ace65d90ef36a2c (diff)
Update to support optional email register and signin
Diffstat (limited to '')
-rw-r--r--public/css/cover.css3
-rw-r--r--public/views/foot.ejs1
-rw-r--r--public/views/index.ejs7
-rw-r--r--public/views/signin-modal.ejs28
4 files changed, 38 insertions, 1 deletions
diff --git a/public/css/cover.css b/public/css/cover.css
index f9186825..dcf7321c 100644
--- a/public/css/cover.css
+++ b/public/css/cover.css
@@ -305,6 +305,9 @@ input {
text-align: left;
color: black;
}
+.modal-body {
+ color: black;
+}
.btn-file {
position: relative;
diff --git a/public/views/foot.ejs b/public/views/foot.ejs
index 4a54ac44..829d4d3d 100644
--- a/public/views/foot.ejs
+++ b/public/views/foot.ejs
@@ -19,6 +19,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.7.0/highlight.min.js" integrity="sha256-s63qpgPYoQk+wv3U6WZqioVJrwFNBTgD4dkeegLuwvo=" crossorigin="anonymous" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/gist-embed/2.6.0/gist-embed.min.js" integrity="sha256-KyF2D6xPIJUW5sUDSs93vWyZm+1RzIpKCexxElmxl8g=" crossorigin="anonymous" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/viz.js/1.3.0/viz.js" integrity="sha256-FGmk+pMdOeRk4xTJ168rnGms1KjYi6jYMYaNEmSsvuQ=" crossorigin="anonymous" defer></script>
+<script src="https://cdnjs.cloudflare.com/ajax/libs/1000hz-bootstrap-validator/0.11.5/validator.min.js" integrity="sha256-IxYUmOOk74FUrcx5FEMOHVmTJDb7ZAwnC/ivo/OQGxg=" crossorigin="anonymous" defer></script>
<%- include build/index-scripts %>
<% } else { %>
<script src="<%- url %>/build/MathJax/MathJax.js" defer></script>
diff --git a/public/views/index.ejs b/public/views/index.ejs
index 729987ca..789565af 100644
--- a/public/views/index.ejs
+++ b/public/views/index.ejs
@@ -51,6 +51,12 @@
<p class="lead">
<%= __('Best way to write and share your knowledge in markdown.') %>
</p>
+ <% if (infoMessage && infoMessage.length > 0) { %>
+ <div class="alert alert-info" style="max-width: 400px; margin: 0 auto;"><%= infoMessage %></div>
+ <% } %>
+ <% if (errorMessage && errorMessage.length > 0) { %>
+ <div class="alert alert-danger" style="max-width: 400px; margin: 0 auto;"><%= errorMessage %></div>
+ <% } %>
<% if(facebook || twitter || github || gitlab || dropbox || google) { %>
<span class="ui-signin">
<br>
@@ -195,6 +201,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/select2/3.5.2/select2.min.js" integrity="sha256-HzzZFiY4t0PIv02Tm8/R3CVvLpcjHhO1z/YAUCp4oQ4=" crossorigin="anonymous" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.15.1/moment-with-locales.min.js" integrity="sha256-J5wam9fTysK5BqYlUUBjbomFslRxkLgwB9AhnVWsj1Q=" crossorigin="anonymous" defer></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/js-url/2.3.0/url.min.js" integrity="sha256-HOZJz4x+1mn1Si84WT5XKXPtOlTytmZLnMb6n1v4+5Q=" crossorigin="anonymous" defer></script>
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/1000hz-bootstrap-validator/0.11.5/validator.min.js" integrity="sha256-IxYUmOOk74FUrcx5FEMOHVmTJDb7ZAwnC/ivo/OQGxg=" crossorigin="anonymous" defer></script>
<%- include build/cover-scripts %>
<% } else { %>
<%- include build/cover-pack-scripts %>
diff --git a/public/views/signin-modal.ejs b/public/views/signin-modal.ejs
index a3ca63f8..acbad256 100644
--- a/public/views/signin-modal.ejs
+++ b/public/views/signin-modal.ejs
@@ -7,7 +7,7 @@
</button>
<h4 class="modal-title" id="mySmallModalLabel"><%= __('Choose method') %></h4>
</div>
- <div class="modal-body">
+ <div class="modal-body" style="text-align: center;">
<% if(facebook) { %>
<a href="<%- url %>/auth/facebook" class="btn btn-lg btn-block btn-social btn-facebook">
<i class="fa fa-facebook"></i> <%= __('Sign in via %s', 'Facebook') %>
@@ -38,6 +38,32 @@
<i class="fa fa-google"></i> <%= __('Sign in via %s', 'Google') %>
</a>
<% } %>
+ <% if((facebook || twitter || github || gitlab || dropbox || google) && email) { %>
+ <hr>
+ <% }%>
+ <% if(email) { %>
+ <h4>Via Email</h4>
+ <form data-toggle="validator" role="form" class="form-horizontal" method="post" enctype="application/x-www-form-urlencoded">
+ <div class="form-group">
+ <div class="col-sm-12">
+ <input type="email" class="form-control" name="email" placeholder="Email" required>
+ <span class="help-block control-label with-errors" style="display: inline;"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <div class="col-sm-12">
+ <input type="password" class="form-control" name="password" placeholder="Password" required>
+ <span class="help-block control-label with-errors" style="display: inline;"></span>
+ </div>
+ </div>
+ <div class="form-group">
+ <div class="col-sm-12">
+ <button type="submit" class="btn btn-default" formaction="<%- url %>/register">Register</button>
+ <button type="submit" class="btn btn-primary" formaction="<%- url %>/login">Sign in</button>
+ </div>
+ </div>
+ </form>
+ <% }%>
</div>
</div>
</div>