Open platform to collect and prioritize feedback
404 and 500 pages + neutral design (#90)
Guilherme Oenning941168b8ddf6
diff --git a/app/middlewares/domain.go b/app/middlewares/domain.goindex f6b6b7579..b41f2aad9 100644--- a/app/middlewares/domain.go+++ b/app/middlewares/domain.go@@ -58,7 +58,7 @@ func MultiTenant() web.MiddlewareFunc {}c.Logger().Debugf("Tenant not found for '%s'.", hostname)- return c.NoContent(http.StatusNotFound)+ return c.NotFound()}}}diff --git a/public/components/SupportCounter.tsx b/public/components/SupportCounter.tsxindex 3607e2f92..aad393392 100644--- a/public/components/SupportCounter.tsx+++ b/public/components/SupportCounter.tsx@@ -70,7 +70,7 @@ export class SupportCounter extends React.Component<SupportCounterProps, Supportpublic render() {const status = IdeaStatus.Get(this.props.idea.status);- const support = <div className="ui mini violet inverted animated button"+ const support = <div className="ui mini main-color inverted animated button"onClick={async () => await this.supportOrUndo()}><div className="visible content">Want</div><div className="hidden content">@@ -78,7 +78,7 @@ export class SupportCounter extends React.Component<SupportCounterProps, Support</div></div>;- const undo = <div className="ui mini violet animated button"+ const undo = <div className="ui mini main-color animated button"onClick={async () => await this.supportOrUndo()}><div className="visible content"><i className="heart icon"></i></div><div className="hidden content">Undo</div>diff --git a/public/pages/home/SiteHomePage.scss b/public/pages/home/SiteHomePage.scssindex 6e9152923..c507633f2 100644--- a/public/pages/home/SiteHomePage.scss+++ b/public/pages/home/SiteHomePage.scss@@ -23,31 +23,31 @@#new-idea-input {margin-bottom: 20px;border: none;- border-bottom: 1.5px dashed $violet;- color: $violet;+ border-bottom: 1.5px dashed $main-color;+ color: $main-color;font-size: 18px;- background-color: $bgcolor;+ background-color: $bg-color;padding: 0px 0px 10px 0px;font-weight: bold;margin: 10px 0px;}#new-idea-input::-webkit-input-placeholder { /* WebKit, Blink, Edge */- color: #a291fb;+ color: $main-color;}#new-idea-input:-moz-placeholder { /* Mozilla Firefox 4 to 18 */- color: #a291fb;+ color: $main-color;opacity: 1;}#new-idea-input::-moz-placeholder { /* Mozilla Firefox 19+ */- color: #a291fb;+ color: $main-color;opacity: 1;}#new-idea-input:-ms-input-placeholder { /* Internet Explorer 10-11 */- color: #a291fb;+ color: $main-color;}#new-idea-input::-ms-input-placeholder { /* Microsoft Edge */- color: #a291fb;+ color: $main-color;}.idea-title {diff --git a/public/styles/main.scss b/public/styles/main.scssindex 260f63efa..f24ec8118 100644--- a/public/styles/main.scss+++ b/public/styles/main.scss@@ -10,16 +10,16 @@}body {- background-color: $bgcolor;+ background-color: $bg-color;}#menu {margin-top: 0px;- background-color: $violet;+ background-color: $main-color;margin-bottom: 30px;div, a {border: none;- color: #fff;+ color: textColorFor($main-color);}a::before {content: none;@@ -136,10 +136,30 @@ code {min-width: 290px;}-.ui.violet.button {- background-color: $violet;+.ui.main-color {+ background-color: $main-color;+ color: #fff;++ &.inverted {+ box-shadow: 0 0 0 2px lighten( $main-color, 10% ) inset !important;+ background-color: #fff;+ color: lighten( $main-color, 10% );+ }++ &:hover, &.inverted:hover {+ box-shadow: 0 0 0 2px darken( $main-color, 10% ) inset !important;+ background-color: darken( $main-color, 10% );+ color: #fff;+ }}-.ui.inverted.violet.button, .ui.inverted.violet.buttons .button {- background-color: #fff;+.failure-page {+ height: 60%;+ p {+ font-size: 150%;+ }+ h1 {+ font-size: 200%;+ color: #3b4450;+ }}\ No newline at end of filediff --git a/public/styles/variables.scss b/public/styles/variables.scssindex 221d06a68..71f238c4a 100644--- a/public/styles/variables.scss+++ b/public/styles/variables.scss@@ -1,2 +1,10 @@-$violet: #6f42c1;-$bgcolor: #f9f9f9;\ No newline at end of file+$main-color: #744fb7;+$bg-color: #f9f9f9;++@function textColorFor($color) {+ @if (lightness($color) > 60) {+ @return #484848; // Lighter backgorund, return dark color+ } @else {+ @return #ffffff; // Darker background, return light color+ }+}\ No newline at end of filediff --git a/router.go b/router.goindex 14c513392..d8507e87a 100644--- a/router.go+++ b/router.go@@ -76,19 +76,19 @@ func GetMainEngine(settings *models.AppSettings) *web.Engine {public.Get("/api/status", handlers.Status(settings))}- private := page.Group("")+ private := page.Group("/api"){private.Use(middlewares.IsAuthenticated())- private.Post("/api/ideas", handlers.PostIdea())- private.Post("/api/ideas/:number/comments", handlers.PostComment())- private.Post("/api/ideas/:number/status", handlers.SetResponse())- private.Post("/api/ideas/:number/support", handlers.AddSupporter())- private.Post("/api/ideas/:number/unsupport", handlers.RemoveSupporter())+ private.Post("/ideas", handlers.PostIdea())+ private.Post("/ideas/:number/comments", handlers.PostComment())+ private.Post("/ideas/:number/status", handlers.SetResponse())+ private.Post("/ideas/:number/support", handlers.AddSupporter())+ private.Post("/ideas/:number/unsupport", handlers.RemoveSupporter())private.Use(middlewares.IsAuthorized(models.RoleMember, models.RoleAdministrator))- private.Post("/api/settings", handlers.UpdateSettings())+ private.Post("/settings", handlers.UpdateSettings())}admin := page.Group("/admin")diff --git a/views/404.html b/views/404.htmlindex 106044cec..7d7b750af 100644--- a/views/404.html+++ b/views/404.html@@ -1,7 +1,22 @@{{define "title"}}- 404: Page not found+ Page not found · Fider{{end}}{{define "javascript"}}{{end}}--{{define "content"}}<h1>404: Page not found</h1>{{end}}\ No newline at end of file++{{define "content"}}+ <div class="ui middle aligned center aligned grid failure-page">+ <div class="column">+ <img src="http://getfider.com/images/logo-100x100.png"/>+ <h1>PAGE NOT FOUND</h1>+ <p>+ The link you clicked may be broken or <br />+ the page may have been removed.+ </p>++ {{ if .tenant }}+ <span>Take me back to <a href="{{ .baseUrl }}">{{ .tenant.Subdomain }}.fider.io</a> home page.</span>+ {{ end }}+ </div>+ </div>+{{end}}\ No newline at end of filediff --git a/views/500.html b/views/500.htmlindex 93b740926..bd2207f24 100644--- a/views/500.html+++ b/views/500.html@@ -1,7 +1,19 @@{{define "title"}}- 500: Oops, something unexpected happened :(+ Shoot! Well, this is unexpected… · Fider{{end}}{{define "javascript"}}{{end}}-{{define "content"}}<h1>500: Oops, something unexpected happened... :(</h1>{{end}}\ No newline at end of file+{{define "content"}}+ <div class="ui middle aligned center aligned grid failure-page">+ <div class="column">+ <img src="http://getfider.com/images/logo-100x100.png"/>+ <h1>Shoot! Well, this is unexpected…</h1>+ <p>An error has occurred and we're working to fix the problem! </br> We’ll be up and running shortly.</p>++ {{ if .tenant }}+ <span>Take me back to <a href="{{ .baseUrl }}">{{ .tenant.Subdomain }}.fider.io</a> home page.</span>+ {{ end }}+ </div>+ </div>+{{end}}\ No newline at end of file