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

84 行
4.5 KiB
Plaintext
Raw 通常表示 履歴

2018-03-17 12:13:39 +09:00
<% content_for "header" do %>
2018-12-21 06:32:09 +09:00
<title><%= translate(locale, "Login") %> - Invidious</title>
2018-03-17 12:13:39 +09:00
<% 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">
2018-12-21 06:32:09 +09:00
<a class="pure-button <% if account_type == "invidious" %>pure-button-disabled<% end %>" href="/login">
<%= translate(locale, "Login/Register") %>
</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">
<%= translate(locale, "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>
2018-12-21 06:32:09 +09:00
<label for="email"><%= translate(locale, "User ID:") %></label>
2018-07-19 04:26:02 +09:00
<input required class="pure-input-1" name="email" type="text" placeholder="User ID">
2018-12-21 06:32:09 +09:00
<label for="password"><%= translate(locale, "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-12-21 06:32:09 +09:00
<label for="answer"><%= translate(locale, "Time (h:mm:ss):") %></label>
2018-11-26 09:26:21 +09:00
<input required type="text" name="answer" type="text" placeholder="h:mm:ss">
2018-11-23 04:26:08 +09:00
<label>
2018-12-21 06:32:09 +09:00
<a href="/login?referer=<%= URI.escape(referer) %>&type=invidious&captcha=text">
<%= translate(locale, "Text CAPTCHA") %>
</a>
2018-11-23 04:26:08 +09:00
</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>
2018-12-21 06:32:09 +09:00
<a href="/login?referer=<%= URI.escape(referer) %>&type=invidious">
<%= translate(locale, "Image CAPTCHA") %>
</a>
2018-11-23 04:26:08 +09:00
</label>
<% end %>
2018-07-19 04:26:02 +09:00
2018-12-21 06:32:09 +09:00
<button type="submit" name="action" value="signin" class="pure-button pure-button-primary"><%= translate(locale, "Sign In") %></button>
<button type="submit" name="action" value="register" class="pure-button pure-button-primary"><%= translate(locale, "Register") %></button>
2018-07-19 04:26:02 +09:00
</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>
2018-12-21 06:32:09 +09:00
<label for="email"><%= translate(locale, "Email:") %></label>
<input required class="pure-input-1" name="email" type="email" placeholder="Email">
2018-12-21 06:32:09 +09:00
<label for="password"><%= translate(locale, "Password:") %></label>
<input required class="pure-input-1" name="password" type="password" placeholder="Password">
<% if tfa %>
2018-12-21 06:32:09 +09:00
<label for="tfa"><%= translate(locale, "Google verification code:") %></label>
<input required class="pure-input-1" name="tfa" type="text" placeholder="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>
<div class="pure-u-1 pure-u-md-1-5"></div>
</div>