master
E. Almqvist 3 years ago
parent 67838b149c
commit 73fe22071f
  1. 8
      src/app.rb
  2. 17
      src/views/admin/index.slim
  3. 2
      src/views/auction/new.slim
  4. 9
      src/views/stylesheets/style.sass

@ -229,12 +229,18 @@ get "/admin" do
auth_denied unless user.flags != 0 # reject the user if he/she has no roles
data = {
roles: Role.get_all
roles: Role.get_all,
users: User.get_all
}
serve :"admin/index", {flags: flags, data: data}
end
# ADMIN USER MANAGEMENT
get "/admin/users/:id/ban" do
end
# ADMIN ROLE MANAGEMENT
def role_check(id)
no_go_away if ROLE_IDS.include? id
auth_denied unless get_current_user.permitted? :roleman

@ -1,4 +1,4 @@
header
div
h1 Admin Panel
nav
ul.button-container
@ -15,6 +15,21 @@ header
h2#users User Management
.management-container
article.card.border
h2 Manage User
ul.list-container
- data[:users].each do |user|
li
| #{user.name}
a.inlbutton href="/admin/users/#{user.id}/edit"
| [EDIT]
- if user.banned?
a.green.inlbutton href="/admin/users/#{user.id}/unban"
| [UNBAN USER]
- else
a.red.inlbutton href="/admin/users/#{user.id}/ban"
| [BAN USER]
article.card.border
h2 Add User to Role

@ -16,6 +16,6 @@ h1 Post Auction
label Categories
- Category.get_all.each do |category|
input type="checkbox" name="category-#{category["id"]}" value="#{category["id"]}" = category["name"]
input type="checkbox" name="category-#{category.id}" value="#{category.id}" = category.name
input type="submit" value="Post"

@ -40,14 +40,7 @@ html
justify-content: center
align-items: center
width: auto
height: 100%
header
background: $bg_clr
margin-bottom: 2rem
h1
text-align: center
height: 100%
.fade-in
animation: fade-in .5s ease-in alternate

Loading…
Cancel
Save