Role: color sql db format change

master
E. Almqvist 3 years ago
parent 1cc4f5fdbd
commit 34bcffe9ba
  1. 3
      src/db_models.rb
  2. 2
      src/sql/tables/Role.sql
  3. 2
      src/views/user/profile.slim

@ -18,9 +18,6 @@ class User < EntityModel
end
def role
roles = self.roles
p "####"
p roles
if roles.length > 0 then
role = roles.max_by { |role| role.flags }
return role.name

@ -1,7 +1,7 @@
CREATE TABLE IF NOT EXISTS "Role" (
"id" INTEGER NOT NULL UNIQUE,
"name" TEXT NOT NULL,
"color" INTEGER NOT NULL DEFAULT 16777215,
"color" TEXT NOT NULL DEFAULT "#ffffff",
"flags" INTEGER NOT NULL DEFAULT 0,
PRIMARY KEY("id" AUTOINCREMENT)
);

@ -26,7 +26,7 @@
ul.button-container
- user.roles.each do |role|
li
label = role.name
label style="color: #{role.color};" = role.name
#reputation.card
h2 Reputation

Loading…
Cancel
Save