diff --git a/model/status.go b/model/status.go new file mode 100644 index 00000000..2dfdc346 --- /dev/null +++ b/model/status.go @@ -0,0 +1,7 @@ +package model + +//user status e.g. verified, filtered, etc +type Status struct { + Id int `json:"id"` + Name string `json:"name",sql:"size:255"` +} diff --git a/model/user.go b/model/user.go index 08932fd2..d121c305 100644 --- a/model/user.go +++ b/model/user.go @@ -36,13 +36,16 @@ type User struct { LastLoginIp string `json:"lastLoginIp",sql:"size:100"` CurrentLoginIp string `json:"currentLoginIp",sql:"size:100"` + Status Status `gorm:"many2one:users_status;"` + // Liking - LikingCount int `json:"likingCount"` - LikedCount int `json:"likedCount"` - Likings []User `gorm:"foreignkey:userId;associationforeignkey:follower_id;many2many:users_followers;"` - Liked []User `gorm:"foreignkey:follower_id;associationforeignkey:userId;many2many:users_followers;"` + LikingCount int `json:"likingCount"` + LikedCount int `json:"likedCount"` + Likings []User `gorm:"foreignkey:userId;associationforeignkey:follower_id;many2many:users_followers;"` + Liked []User `gorm:"foreignkey:follower_id;associationforeignkey:userId;many2many:users_followers;"` Connections []Connection + Languages []Language `gorm:"many2many:user_languages;"` // Many To Many, user_languages is the join table Roles []Role `gorm:"many2many:users_roles;"` // Many To Many, users_roles Torrents []Torrents @@ -79,7 +82,7 @@ type PublicUser struct { Connections omit `json:"connections,omitempty"` Languages omit `json:"languages,omitempty"` Roles omit `json:"roles,omitempty"` - Torrents omit `json:"articles,omitempty"` + Torrents omit `json:"articles,omitempty"` //should user torrents not be displayed? } // Connection is a connection model for oauth. diff --git a/templates/_search.html b/templates/_search.html index 69ca25af..b6baf37c 100644 --- a/templates/_search.html +++ b/templates/_search.html @@ -38,6 +38,7 @@ +