From 7724c2958f67389b2a0be0beab5efb09d591ade3 Mon Sep 17 00:00:00 2001 From: Eduard Urbach Date: Sun, 19 Nov 2017 01:15:57 +0100 Subject: [PATCH] Added company editing UI --- layout/sidebar/sidebar.pixy | 4 ++++ pages/companies/companies.pixy | 2 +- pages/company/company.pixy | 4 ++++ pages/index.go | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/layout/sidebar/sidebar.pixy b/layout/sidebar/sidebar.pixy index cb94600a..2954e1ad 100644 --- a/layout/sidebar/sidebar.pixy +++ b/layout/sidebar/sidebar.pixy @@ -16,6 +16,10 @@ component Sidebar(user *arn.User) SidebarButton("Forum", "/forum", "comment") SidebarButton("Explore", "/explore", "th") SidebarButton("Soundtracks", "/soundtracks", "headphones") + + if user != nil && user.Role == "admin" + SidebarButton("Companies", "/companies", "building") + SidebarButton("Users", "/users", "globe") if user != nil diff --git a/pages/companies/companies.pixy b/pages/companies/companies.pixy index 4cef3bd5..6d105e53 100644 --- a/pages/companies/companies.pixy +++ b/pages/companies/companies.pixy @@ -1,5 +1,5 @@ component Companies(companies []*arn.Company, user *arn.User) - h1.page-title Companies + h1 Companies .corner-buttons if user != nil diff --git a/pages/company/company.pixy b/pages/company/company.pixy index 382edbde..302e3d27 100644 --- a/pages/company/company.pixy +++ b/pages/company/company.pixy @@ -1,6 +1,10 @@ component CompanyPage(company *arn.Company, user *arn.User) + CompanyTabs(company, user) + h1= company.Name.English + .company-description!= markdown.Render(company.Description) + component CompanyTabs(company *arn.Company, user *arn.User) .tabs Tab("Company", "building", company.Link()) diff --git a/pages/index.go b/pages/index.go index d2ec7b83..d4c7f5dc 100644 --- a/pages/index.go +++ b/pages/index.go @@ -96,6 +96,7 @@ func Configure(app *aero.Application) { // Companies l.Page("/company/:id", company.Get) + l.Page("/company/:id/edit", company.Edit) l.Page("/companies", companies.Get) // Settings