Add infrastructure for /signup page

This commit is contained in:
syeopite 2023-07-26 13:56:49 -07:00
parent 72ec494f2b
commit b3ee685a70
No known key found for this signature in database
GPG Key ID: A73C186DA3955A1A
4 changed files with 19 additions and 3 deletions

View File

@ -0,0 +1,7 @@
#signin-button {
float: right;
}
.account-page-action-bar {
margin-top: 1em;
}

View File

@ -27,6 +27,9 @@ module Invidious::Routes::Login
templated "user/login" templated "user/login"
end end
def self.signup_page(env)
end
def self.login(env) def self.login(env)
locale = env.get("preferences").as(Preferences).locale locale = env.get("preferences").as(Preferences).locale

View File

@ -55,6 +55,7 @@ module Invidious::Routing
def register_user_routes def register_user_routes
# User login/out # User login/out
get "/login", Routes::Login, :login_page get "/login", Routes::Login, :login_page
get "/signup", Routes::Login, :signup_page
post "/login", Routes::Login, :login post "/login", Routes::Login, :login
post "/signout", Routes::Login, :signout post "/signout", Routes::Login, :signout

View File

@ -1,5 +1,6 @@
<% content_for "header" do %> <% content_for "header" do %>
<title><%= translate(locale, "Log in") %> - Invidious</title> <title><%= translate(locale, "Log in") %> - Invidious</title>
<link rel="stylesheet" href="/css/signin-signout.css?v=<%= ASSET_COMMIT %>">
<% end %> <% end %>
<div class="pure-g"> <div class="pure-g">
@ -64,9 +65,13 @@
</label> </label>
<% end %> <% end %>
<% else %> <% else %>
<button type="submit" name="action" value="signin" class="pure-button pure-button-primary"> <div class="account-page-action-bar">
<%= translate(locale, "Sign In") %>/<%= translate(locale, "Register") %> <a href="/signup" id="signup-link"><%= translate(locale, ("Create an account")) %> </a>
</button>
<button type="submit" name="action" value="signin" class="pure-button pure-button-primary" id="signin-button">
<%= translate(locale, "Sign In") %>
</button>
</div>
<% end %> <% end %>
</fieldset> </fieldset>
</form> </form>