|
|
|
@ -1,5 +1,46 @@ |
|
|
|
|
h1 Admin Panel |
|
|
|
|
header |
|
|
|
|
h1 Admin Panel |
|
|
|
|
nav |
|
|
|
|
ul.button-container |
|
|
|
|
li |
|
|
|
|
a.button href="#users" = "Manage Users" |
|
|
|
|
li |
|
|
|
|
a.button href="#roles" = "Roles" |
|
|
|
|
li |
|
|
|
|
a.button href="#auctions" = "Auctions" |
|
|
|
|
li |
|
|
|
|
a.button href="#categories" = "Category Settings" |
|
|
|
|
|
|
|
|
|
#admin-panel |
|
|
|
|
|
|
|
|
|
h2#users User Management |
|
|
|
|
.management-container |
|
|
|
|
article.card.border |
|
|
|
|
h2 Add User to Role |
|
|
|
|
|
|
|
|
|
.form-container |
|
|
|
|
form action="/admin/roles/give" method="post" |
|
|
|
|
label Select User |
|
|
|
|
select name="user_id" |
|
|
|
|
- User.get_all.each do |seluser| |
|
|
|
|
option value="#{seluser.id}" |
|
|
|
|
| #{seluser.name} (id=#{seluser.id}) |
|
|
|
|
|
|
|
|
|
label Select Role |
|
|
|
|
select name="role_id" |
|
|
|
|
- if session_user.admin? |
|
|
|
|
- Role.get_all.each do |selrole| |
|
|
|
|
option value="#{selrole.id}" |
|
|
|
|
| #{selrole.name} (id=#{selrole.id}) |
|
|
|
|
- else |
|
|
|
|
- session_user.roles.each do |selrole| |
|
|
|
|
option value="#{selrole.id}" |
|
|
|
|
| #{selrole.name} (id=#{selrole.id}) |
|
|
|
|
|
|
|
|
|
input type="submit" value="Add User" |
|
|
|
|
|
|
|
|
|
h2#roles Role Management |
|
|
|
|
.management-container |
|
|
|
|
article.card.border |
|
|
|
|
h2 Create Role |
|
|
|
|
|
|
|
|
@ -16,6 +57,7 @@ h1 Admin Panel |
|
|
|
|
|
|
|
|
|
input type="submit" value="Create role" |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
article.card.border |
|
|
|
|
h2 Manage Roles |
|
|
|
|
ul.list-container |
|
|
|
@ -26,27 +68,3 @@ h1 Admin Panel |
|
|
|
|
| [EDIT] |
|
|
|
|
a.inlbutton href="/admin/roles/#{role.id}/delete" |
|
|
|
|
| [DELETE] |
|
|
|
|
|
|
|
|
|
article.card.border |
|
|
|
|
h2 Add User to Role |
|
|
|
|
|
|
|
|
|
.form-container |
|
|
|
|
form action="/admin/roles/give" method="post" |
|
|
|
|
label Select User |
|
|
|
|
select name="user_id" |
|
|
|
|
- User.get_all.each do |seluser| |
|
|
|
|
option value="#{seluser.id}" |
|
|
|
|
| #{seluser.name} (id=#{seluser.id}) |
|
|
|
|
|
|
|
|
|
label Select Role |
|
|
|
|
select name="role_id" |
|
|
|
|
- if session_user.admin? |
|
|
|
|
- Role.get_all.each do |selrole| |
|
|
|
|
option value="#{selrole.id}" |
|
|
|
|
| #{selrole.name} (id=#{selrole.id}) |
|
|
|
|
- else |
|
|
|
|
- session_user.roles.each do |selrole| |
|
|
|
|
option value="#{selrole.id}" |
|
|
|
|
| #{selrole.name} (id=#{selrole.id}) |
|
|
|
|
|
|
|
|
|
input type="submit" value="Add User" |
|
|
|
|