Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added dropdown login in navbar #11

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 23 additions & 1 deletion templates/layouts/bootstrap.html.ep
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
#funktioner:hover ul {
display: block;
}

.login-dropdown {
min-width:320px;
padding:10px;
}
</style>
</head>
<body>
Expand Down Expand Up @@ -75,7 +80,24 @@
</li>
<li><a href="<%= url_for('logout') %>">Log ud</a></li>
% } else {
<li><a href="<%= url_for('login') %>">Log ind</a></li>
<li>
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">Log ind</a>
<div class="dropdown-menu login-dropdown">
%= form_for 'login_submit' => begin
%= csrf_field
%= form_group 'username' => begin
<label for="username">Brugernavn:</label>
%= text_field username => (class => 'form-control', placeholder => 'Brugernavn')
% end
%= form_group 'password' => begin
<label for="password">Løsen:</label>
%= password_field password => (class => 'form-control', placeholder => 'Løsen')
% end

<button type="submit" class="btn btn-primary">Log ind</button>
% end
</div>
</li>
<li><a href="<%= url_for('create_user') %>">Opret bruger</a></li>
% }
</ul>
Expand Down