invidious-mod/src/invidious/views/login.ecr

76 行
3.9 KiB
Plaintext
Raw 通常表示 履歴

2018-03-17 12:13:39 +09:00
<% content_for "header" do %>
<title>Login - Invidious</title>
<% end %>
2018-03-17 01:40:29 +09:00
<div class="pure-g">
<div class="pure-u-1 pure-u-md-1-5"></div>
<div class="pure-u-1 pure-u-md-3-5">
<div class="h-box">
2018-07-19 04:26:02 +09:00
<div class="pure-g">
<div class="pure-u-1-2">
<a class="pure-button <% if account_type == "invidious" %>pure-button-disabled<% end %>" href="/login">Login/Register</a>
2018-07-19 04:26:02 +09:00
</div>
<div class="pure-u-1-2">
<a class="pure-button <% if account_type == "google" %>pure-button-disabled<% end %>" href="/login?type=google">Login to Google</a>
2018-07-19 04:26:02 +09:00
</div>
</div>
<hr>
<% if account_type == "invidious" %>
2018-08-18 00:19:20 +09:00
<form class="pure-form pure-form-stacked" action="/login?referer=<%= URI.escape(referer) %>&type=invidious" method="post">
2018-07-19 04:26:02 +09:00
<fieldset>
<label for="email">User ID:</label>
<input required class="pure-input-1" name="email" type="text" placeholder="User ID">
2018-07-26 12:25:14 +09:00
<label for="password">Password:</label>
2018-07-19 04:26:02 +09:00
<input required class="pure-input-1" name="password" type="password" placeholder="Password">
2018-11-23 04:26:08 +09:00
<% if captcha_type == "image" %>
<img style="width:100%" src='<%= captcha.not_nil![:image] %>'/>
2018-07-19 04:26:02 +09:00
<input type="hidden" name="token" value="<%= captcha.not_nil![:token] %>">
<input type="hidden" name="challenge" value="<%= captcha.not_nil![:challenge] %>">
2018-11-26 09:26:21 +09:00
<label for="answer">Time (h:mm:ss):</label>
<input required type="text" name="answer" type="text" placeholder="h:mm:ss">
2018-11-23 04:26:08 +09:00
<label>
<a href="/login?referer=<%= URI.escape(referer) %>&type=invidious&captcha=text">Text CAPTCHA</a>
</label>
<% else %>
<% text_captcha.not_nil![:tokens].each_with_index do |token, i| %>
<input type="hidden" name="text_challenge<%= i %>" value="<%= token[0] %>">
<input type="hidden" name="text_token<%= i %>" value="<%= token[1] %>">
<% end %>
<label for="text_answer"><%= text_captcha.not_nil![:question] %></label>
<input required type="text" name="text_answer" type="text" placeholder="Answer">
<label>
<a href="/login?referer=<%= URI.escape(referer) %>&type=invidious">Image CAPTCHA</a>
</label>
<% end %>
2018-07-19 04:26:02 +09:00
<button type="submit" name="action" value="signin" class="pure-button pure-button-primary">Sign In</button>
<button type="submit" name="action" value="register" class="pure-button pure-button-primary">Register</button>
</fieldset>
</form>
<% elsif account_type == "google" %>
2018-08-18 00:19:20 +09:00
<form class="pure-form pure-form-stacked" action="/login?referer=<%= URI.escape(referer) %>" method="post">
<fieldset>
<label for="email">Email:</label>
<input required class="pure-input-1" name="email" type="email" placeholder="Email">
<label for="password">Password:</label>
<input required class="pure-input-1" name="password" type="password" placeholder="Password">
<% if tfa %>
<label for="tfa">Google verification code:</label>
<input required class="pure-input-1" name="tfa" type="text" placeholder="Google verification code">
<% end %>
2018-11-27 05:28:15 +09:00
<button type="submit" class="pure-button pure-button-primary">Sign In</button>
</fieldset>
</form>
2018-07-19 04:26:02 +09:00
<% end %>
2018-03-17 01:40:29 +09:00
</div>
</div>
<div class="pure-u-1 pure-u-md-1-5"></div>
</div>