mirror of
https://github.com/fspc/BikeShed-1.git
synced 2026-09-16 08:31:36 -04:00
WIP adding user roles view; adding end datetime to user roles
This commit is contained in:
@@ -36,7 +36,8 @@ class AppTabPanel < Netzke::Basepack::TabPanel
|
||||
{ layout: :fit,
|
||||
wrappedComponent: :transactions_border,
|
||||
title: "Transactions"},
|
||||
:logs]
|
||||
:logs,
|
||||
:user_roles]
|
||||
end
|
||||
|
||||
@@app_tab_panel_items.each do |item|
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
class UserRoles < Netzke::Basepack::Grid
|
||||
|
||||
def configure(c)
|
||||
super
|
||||
c.model = "UserRole"
|
||||
c.title = "User Roles"
|
||||
c.columns = [ :role, :created_at, :updated_at, :ends ]
|
||||
end
|
||||
|
||||
#override with nil to remove actions
|
||||
def default_bbar
|
||||
[ :apply, :add_in_form, :search ]
|
||||
end
|
||||
|
||||
end
|
||||
+5
-1
@@ -14,7 +14,7 @@ class User < ActiveRecord::Base
|
||||
has_many :user_profiles
|
||||
accepts_nested_attributes_for :user_profiles, allow_destroy: false
|
||||
|
||||
belongs_to :user_role
|
||||
has_one :user_role
|
||||
belongs_to :bike
|
||||
|
||||
validates :first_name, :presence => true
|
||||
@@ -24,6 +24,10 @@ class User < ActiveRecord::Base
|
||||
"#{first_name} #{last_name}"
|
||||
end
|
||||
|
||||
def full_name
|
||||
to_s
|
||||
end
|
||||
|
||||
def role
|
||||
user_role.role
|
||||
end
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class UserRole < ActiveRecord::Base
|
||||
attr_accessible :role
|
||||
|
||||
has_many :users
|
||||
belongs_to :user
|
||||
|
||||
self.per_page = 15
|
||||
|
||||
|
||||
Reference in New Issue
Block a user