Fixed overflow styling

master
E. Almqvist 3 years ago
parent ce06ef7f89
commit 8b15c0aadf
  1. 10
      src/app.rb
  2. 2
      src/db_init.rb
  3. 3
      src/db_models.rb
  4. 5
      src/views/stylesheets/style.sass

@ -294,16 +294,16 @@ post "/admin/roles/give" do
user = get_current_user
auth_denied if user.permitted? :roleman
user_id = params[:user_id]
role_id = params[:role_id]
user_id = params[:user_id].to_i
role_id = params[:role_id].to_i
if user.role_ids.include? role_id or user.admin? then
User_Role_relation.give_role(user_id, role_id)
if user.role_ids.include?(role_id) or user.admin? then
resp = User_Role_relation.give_role(user_id, role_id)
newrole = Role.find_by_id role_id
promoted_user = User.find_by_id user_id
flash[:success] = "Gave role '#{newrole.name}' to #{promoted_user.name}!"
flash[:success] = "Gave role '#{newrole.name}' to #{promoted_user.name}!" if resp
redirect "/admin"
else
auth_denied "You are not permitted to give that role!", 403, "/admin"

@ -18,6 +18,6 @@ def db_init
# Create all default roles
q = "INSERT OR IGNORE INTO Role (id, name, color, flags) VALUES (?, ?, ?, ?)"
ROLES.each do |id, role|
db.query(q, role[:id], role[:name], role[:color], role[:flags])
Role.query(q, role[:id], role[:name], role[:color], role[:flags])
end
end

@ -229,8 +229,7 @@ class User_Role_relation < EntityModel
def self.give_role(user_id, role_id)
user = User.find_by_id user_id
# TODO prevent duplicate roles
if not user.role_ids.include? role_id then
if not user.role_ids.include?(role_id) then
data = {
role_id: role_id,
user_id: user_id

@ -315,6 +315,7 @@ ul.list-container
.card
background-color: $bg_clr
border-radius: $border_radius
width: inherit
h2
text-align: left
padding: 0 .8rem
@ -336,7 +337,11 @@ ul.list-container
margin: 0 auto
aside
display: flex
flex-direction: column
align-items: center
margin-right: 2rem
width: 300px
#userinfo
margin-bottom: 1.75rem
text-align: center

Loading…
Cancel
Save