30 lines
844 B
Plaintext
Raw Normal View History

2018-03-13 22:06:16 +00:00
component CompaniesIndex(groups [][]*arn.Company, user *arn.User)
2017-12-02 20:53:01 +00:00
CompaniesTabs(user)
2017-11-18 10:46:17 +00:00
2017-12-02 22:18:11 +00:00
h1.page-title All companies
2018-03-13 22:06:16 +00:00
.company-index-groups
2017-12-02 20:53:01 +00:00
each group in groups
2018-03-13 22:06:16 +00:00
.company-index-group.mountable
2018-03-01 21:44:14 +00:00
h3= strings.ToUpper(group[0].Name.English[:1])
2017-12-02 20:53:01 +00:00
ul
each company in group
2018-03-01 21:44:14 +00:00
li
a(href=company.Link())= company.Name.English
2017-12-02 20:53:01 +00:00
component CompaniesTabs(user *arn.User)
.tabs
2018-03-13 22:06:16 +00:00
Tab("Popular", "globe", "/companies")
Tab("All", "font", "/companies/all")
2017-12-02 20:53:01 +00:00
2017-11-18 23:42:22 +00:00
.corner-buttons
2018-03-01 21:44:14 +00:00
if user != nil && (user.Role == "editor" || user.Role == "admin")
2017-11-18 10:46:17 +00:00
if user.DraftIndex().CompanyID == ""
button.action(data-action="newObject", data-trigger="click", data-type="company")
Icon("plus")
span Add company
else
a.button(href="/company/" + user.DraftIndex().CompanyID + "/edit")
2017-11-18 10:46:17 +00:00
Icon("pencil")
2017-12-02 20:53:01 +00:00
span Edit draft