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

115 行
6.0 KiB
Plaintext
Raw 通常表示 履歴

2018-03-17 12:13:39 +09:00
<% content_for "header" do %>
2019-04-20 01:14:11 +09:00
<title><%= translate(locale, "Log in") %> - Invidious</title>
2018-03-17 12:13:39 +09:00
<% end %>
2018-03-17 01:40:29 +09:00
<div class="pure-g">
2019-04-15 07:04:52 +09:00
<div class="pure-u-1 pure-u-lg-1-5"></div>
<div class="pure-u-1 pure-u-lg-3-5">
2018-03-17 01:40:29 +09:00
<div class="h-box">
2018-07-19 04:26:02 +09:00
<div class="pure-g">
<div class="pure-u-1-2">
2019-03-20 06:13:23 +09:00
<a class="pure-button <% if account_type == "invidious" %>pure-button-disabled<% end %>" href="/login?type=invidious">
2019-04-20 01:14:11 +09:00
<%= translate(locale, "Log in/register") %>
2018-12-21 06:32:09 +09:00
</a>
2018-07-19 04:26:02 +09:00
</div>
<div class="pure-u-1-2">
2018-12-21 06:32:09 +09:00
<a class="pure-button <% if account_type == "google" %>pure-button-disabled<% end %>" href="/login?type=google">
2019-04-20 01:14:11 +09:00
<%= translate(locale, "Log in with Google") %>
2018-12-21 06:32:09 +09:00
</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>
2019-03-20 06:13:23 +09:00
<% if email %>
<input name="email" type="hidden" value="<%= email %>">
<% else %>
2019-04-15 09:17:56 +09:00
<label for="email"><%= translate(locale, "User ID") %> :</label>
<input required class="pure-input-1" name="email" type="text" placeholder="<%= translate(locale, "User ID") %>">
2019-03-20 06:13:23 +09:00
<% end %>
2018-07-19 04:26:02 +09:00
2019-03-20 06:13:23 +09:00
<% if password %>
<input name="password" type="hidden" value="<%= password %>">
<% else %>
2019-04-15 09:17:56 +09:00
<label for="password"><%= translate(locale, "Password") %> :</label>
<input required class="pure-input-1" name="password" type="password" placeholder="<%= translate(locale, "Password") %>">
2019-03-20 06:13:23 +09:00
<% end %>
2018-11-23 04:26:08 +09:00
2019-03-20 06:13:23 +09:00
<% if captcha %>
<% case captcha_type when %>
<% when "image" %>
<% captcha = captcha.not_nil! %>
<img style="width:100%" src='<%= captcha[:question] %>'/>
<% captcha[:tokens].each_with_index do |token, i| %>
<input type="hidden" name="token[<%= i %>]" value="<%= URI.escape(token) %>">
2019-03-20 06:13:23 +09:00
<% end %>
<input type="hidden" name="captcha_type" value="image">
2019-03-02 07:06:45 +09:00
<label for="answer"><%= translate(locale, "Time (h:mm:ss):") %></label>
2019-03-20 06:13:23 +09:00
<input type="text" name="answer" type="text" placeholder="h:mm:ss">
<% when "text" %>
<% captcha = captcha.not_nil! %>
<% captcha[:tokens].each_with_index do |token, i| %>
<input type="hidden" name="token[<%= i %>]" value="<%= URI.escape(token) %>">
2019-03-20 06:13:23 +09:00
<% end %>
<input type="hidden" name="captcha_type" value="text">
<label for="answer"><%= captcha[:question] %></label>
2019-04-15 09:17:56 +09:00
<input type="text" name="answer" type="text" placeholder="<%= translate(locale, "Answer") %>">
2019-03-20 06:13:23 +09:00
<% end %>
2019-03-02 07:06:45 +09:00
2019-03-20 06:13:23 +09:00
<button type="submit" name="action" value="signin" class="pure-button pure-button-primary">
<%= translate(locale, "Register") %>
</button>
<% case captcha_type when %>
<% when "image" %>
2019-03-02 07:06:45 +09:00
<label>
2019-03-20 06:13:23 +09:00
<button type="submit" name="change_type" class="pure-button pure-button-primary" value="text">
2019-03-02 07:06:45 +09:00
<%= translate(locale, "Text CAPTCHA") %>
2019-03-20 06:13:23 +09:00
</button>
2019-03-02 07:06:45 +09:00
</label>
2019-03-20 06:13:23 +09:00
<% when "text" %>
2019-03-02 07:06:45 +09:00
<label>
2019-03-20 06:13:23 +09:00
<button type="submit" name="change_type" class="pure-button pure-button-primary" value="image">
2019-03-02 07:06:45 +09:00
<%= translate(locale, "Image CAPTCHA") %>
2019-03-20 06:13:23 +09:00
</button>
2019-03-02 07:06:45 +09:00
</label>
<% end %>
2019-03-20 06:13:23 +09:00
<% else %>
<button type="submit" name="action" value="signin" class="pure-button pure-button-primary">
<%= translate(locale, "Sign In") %>/<%= translate(locale, "Register") %>
</button>
2018-11-23 04:26:08 +09:00
<% end %>
2018-07-19 04:26:02 +09:00
</fieldset>
</form>
<% elsif account_type == "google" %>
2019-03-20 06:13:23 +09:00
<form class="pure-form pure-form-stacked" action="/login?referer=<%= URI.escape(referer) %>&type=google" method="post">
<fieldset>
2019-03-20 06:13:23 +09:00
<% if email %>
<input name="email" type="hidden" value="<%= email %>">
<% else %>
2019-04-20 01:14:11 +09:00
<label for="email"><%= translate(locale, "E-mail") %> :</label>
<input required class="pure-input-1" name="email" type="email" placeholder="<%= translate(locale, "E-mail") %>">
2019-03-20 06:13:23 +09:00
<% end %>
2019-03-20 06:13:23 +09:00
<% if password %>
<input name="password" type="hidden" value="<%= password %>">
<% else %>
2019-04-15 09:17:56 +09:00
<label for="password"><%= translate(locale, "Password") %> :</label>
<input required class="pure-input-1" name="password" type="password" placeholder="<%= translate(locale, "Password") %>">
2019-03-20 06:13:23 +09:00
<% end %>
2019-03-02 07:06:45 +09:00
<% if tfa %>
2019-04-15 09:17:56 +09:00
<label for="tfa"><%= translate(locale, "Google verification code") %> :</label>
<input required class="pure-input-1" name="tfa" type="text" placeholder="<%= translate(locale, "Google verification code") %>">
<% end %>
2018-12-21 06:32:09 +09:00
<button type="submit" class="pure-button pure-button-primary"><%= translate(locale, "Sign In") %></button>
</fieldset>
</form>
2018-07-19 04:26:02 +09:00
<% end %>
2018-03-17 01:40:29 +09:00
</div>
</div>
2019-04-15 07:04:52 +09:00
<div class="pure-u-1 pure-u-lg-1-5"></div>
</div>