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">
|
2018-07-25 09:36:09 +09:00
|
|
|
<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>
|
2018-07-25 09:36:09 +09:00
|
|
|
<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>
|
2018-07-27 00:37:16 +09:00
|
|
|
<% 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
|
|
|
|
2019-03-02 07:06:45 +09:00
|
|
|
<% if config.captcha_enabled %>
|
|
|
|
<% if captcha_type == "image" %>
|
|
|
|
<img style="width:100%" src='<%= captcha.not_nil![:image] %>'/>
|
|
|
|
<input type="hidden" name="token" value="<%= captcha.not_nil![:token] %>">
|
|
|
|
<input type="hidden" name="challenge" value="<%= captcha.not_nil![:challenge] %>">
|
|
|
|
<label for="answer"><%= translate(locale, "Time (h:mm:ss):") %></label>
|
|
|
|
<input required type="text" name="answer" type="text" placeholder="h:mm:ss">
|
|
|
|
|
|
|
|
<label>
|
|
|
|
<a href="/login?referer=<%= URI.escape(referer) %>&type=invidious&captcha=text">
|
|
|
|
<%= translate(locale, "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">
|
|
|
|
<%= translate(locale, "Image CAPTCHA") %>
|
|
|
|
</a>
|
|
|
|
</label>
|
|
|
|
<% end %>
|
2018-11-23 04:26:08 +09:00
|
|
|
<% 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>
|
2019-03-02 07:06:45 +09:00
|
|
|
<% if config.registration_enabled %>
|
2018-12-21 06:32:09 +09:00
|
|
|
<button type="submit" name="action" value="register" class="pure-button pure-button-primary"><%= translate(locale, "Register") %></button>
|
2019-03-02 07:06:45 +09:00
|
|
|
<% end %>
|
2018-07-19 04:26:02 +09:00
|
|
|
</fieldset>
|
|
|
|
</form>
|
2018-07-27 00:37:16 +09:00
|
|
|
<% 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">
|
2018-07-27 00:37:16 +09:00
|
|
|
<fieldset>
|
2018-12-21 06:32:09 +09:00
|
|
|
<label for="email"><%= translate(locale, "Email:") %></label>
|
2018-07-27 00:37:16 +09:00
|
|
|
<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>
|
2018-07-27 00:37:16 +09:00
|
|
|
<input required class="pure-input-1" name="password" type="password" placeholder="Password">
|
2019-03-02 07:06:45 +09:00
|
|
|
|
2018-07-27 00:37:16 +09:00
|
|
|
<% if tfa %>
|
2018-12-21 06:32:09 +09:00
|
|
|
<label for="tfa"><%= translate(locale, "Google verification code:") %></label>
|
2018-07-27 00:37:16 +09:00
|
|
|
<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>
|
2018-07-27 00:37:16 +09:00
|
|
|
</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>
|
2018-03-17 02:14:40 +09:00
|
|
|
</div>
|