Skip to content

armgit / fider

Public Imported from GitHub
0

Open platform to collect and prioritize feedback

More ui changes (#111)

Guilherme Oenning183399bbcfcc
diff --git a/app/storage/postgres/idea.go b/app/storage/postgres/idea.go
index 164673e4a..232219948 100644
--- a/app/storage/postgres/idea.go
+++ b/app/storage/postgres/idea.go
@@ -94,11 +94,13 @@ var (
u.id AS user_id,
u.name AS user_name,
u.email AS user_email,
+ u.role AS user_role,
i.response,
i.response_date,
r.id AS response_user_id,
r.name AS response_user_name,
- r.email AS response_user_email
+ r.email AS response_user_email,
+ r.role AS response_user_role
FROM ideas i
INNER JOIN users u
ON u.id = i.user_id
@@ -159,7 +161,8 @@ func (s *IdeaStorage) GetCommentsByIdea(number int) ([]*models.Comment, error) {
c.created_on,
u.id AS user_id,
u.name AS user_name,
- u.email AS user_email
+ u.email AS user_email,
+ u.role AS user_role
FROM comments c
INNER JOIN ideas i
ON i.id = c.idea_id
diff --git a/public/assets/styles/main.scss b/public/assets/styles/main.scss
index 3e5462034..cb9382730 100644
--- a/public/assets/styles/main.scss
+++ b/public/assets/styles/main.scss
@@ -38,11 +38,11 @@ body {
float: right;
}
+#menu a.subtitle,
.subtitle {
font-size: 11px;
font-weight: 600;
letter-spacing: .3px;
- line-height: 16px;
text-transform: uppercase;
color: #999;
}
@@ -92,7 +92,7 @@ code {
.fdr-avatar,
.ui.menu .item>img:not(.ui) {
- border-radius: 2rem;
+ border-radius: 50%;
width: 30px;
vertical-align: middle;
}
@@ -105,33 +105,48 @@ code {
margin: 0px !important;
}
+.name {
+ color: #4f5e6b;
+ font-weight: 500;
+ &.staff {
+ font-weight: 700;
+ color: $admin-color;
+ }
+}
+
.support-counter {
- width: 60px;
margin-right: 10px;
.button,
- .button.disabled {
+ .button.disabled {
+ font-size: 18px;
+ min-width: 45px;
margin: 0 auto !important;
- padding: 0rem 1rem 0.5rem 1rem !important;
+ padding: 0rem 0rem 0.5rem 0rem !important;
background-color: #fff !important;
- box-shadow: 0 0 0 1px rgba(34,36,38,.15) inset !important;
+
+ i.icon {
+ color: #C4C9CD;
+ }
}
.button.supported,
.button.no-touch:hover {
- background-color: lighten($main-color, 49%) !important;
color: $main-color;
- box-shadow: 0 0 0 1px $main-color inset !important;
+
+ i.icon {
+ color: lighten($main-color, 20%) !important;
+ }
}
i.icon {
- margin: 3px !important;
+ margin: 0 auto !important;
display: block;
}
}
.fdr-profile-popup div.item {
- padding: 10px 5px !important;
+ padding: 5px 0px !important;
}
.ui.segment.fdr-response {
@@ -205,12 +220,12 @@ code {
border-color: #ef7878 !important;
}
-.ui.message.signin-message {
- background-color: #fff;
+.login-message {
+ background-color: $menu-color;
}
-.ui.popup.signin-message {
- min-width: 290px;
+.ui.popup.login-message {
+ min-width: 360px;
}
.ui.main-color {
diff --git a/public/assets/styles/variables.scss b/public/assets/styles/variables.scss
index a75a13d84..2b1a036d0 100644
--- a/public/assets/styles/variables.scss
+++ b/public/assets/styles/variables.scss
@@ -1,4 +1,5 @@
$main-color: #0069ff; //#0c9
+$admin-color: #CC615C;
$bg-color: #fff;
$menu-color: #f9f9f9;
diff --git a/public/components/CommentInput.tsx b/public/components/CommentInput.tsx
index 8f4354ebc..70e80d7b1 100644
--- a/public/components/CommentInput.tsx
+++ b/public/components/CommentInput.tsx
@@ -56,12 +56,12 @@ export class CommentInput extends React.Component<CommentInputProps, CommentInpu
? <Button className="primary" onClick={ () => this.submit() }>
Submit
</Button>
- : <div className="ui message signin-message">
+ : <div className="ui message login-message">
<div className="header">
- Hey, we need to know who you are!
+ Log in to raise your voice.
</div>
- <p>It's only one second and you'll be good to go!</p>
- <SocialSignInList orientation="horizontal" size="small" />
+ <p className="info">We'll never post to any of your accounts.</p>
+ <SocialSignInList orientation="horizontal" size="normal" />
</div>;
return <div className="comment-input">
@@ -73,7 +73,7 @@ export class CommentInput extends React.Component<CommentInputProps, CommentInpu
rows={3}
placeholder="Write a comment..."></textarea>
</div>
- { this.state.content && user && button }
+ { this.state.content && button }
</div>
</div>;
}
diff --git a/public/components/IdeaInput.tsx b/public/components/IdeaInput.tsx
index 66964ef00..45ffec80f 100644
--- a/public/components/IdeaInput.tsx
+++ b/public/components/IdeaInput.tsx
@@ -63,24 +63,24 @@ export class IdeaInput extends React.Component<IdeaInputProps, IdeaInputState> {
public render() {
const user = this.session.getCurrentUser();
const buttonCss = this.state.title === '' ? 'primary disabled' : 'primary';
- const details = user ?
+ const details = user ?
<div>
<div className="field">
<textarea ref={(ref) => this.description = ref! }
rows={6}
- placeholder="Describe your idea (optional)"></textarea>
+ placeholder="Describe your idea"></textarea>
</div>
<Button className={buttonCss} onClick={() => this.form.submit() }>
Submit
</Button>
</div> :
<div>
- <div className="ui message signin-message">
+ <div className="ui message login-message">
<div className="header">
- Hey, we need to know who you are!
+ Log in to raise your voice.
</div>
- <p>It's only one second and you'll be good to go!</p>
- <SocialSignInList orientation="horizontal" size="small" />
+ <p className="info">We'll never post to any of your accounts.</p>
+ <SocialSignInList orientation="horizontal" size="normal" />
</div>
</div>;
@@ -91,7 +91,7 @@ export class IdeaInput extends React.Component<IdeaInputProps, IdeaInputState> {
maxLength={100}
onKeyUp={(e) => { this.setState({ title: e.currentTarget.value }); }}
placeholder={this.props.placeholder} />
- { (this.session.getCurrentUser() || this.state.title) && details }
+ { this.state.title && details }
</Form>;
}
}
diff --git a/public/components/ShowIdeaResponse.tsx b/public/components/ShowIdeaResponse.tsx
index ac15fe7de..9baf8b226 100644
--- a/public/components/ShowIdeaResponse.tsx
+++ b/public/components/ShowIdeaResponse.tsx
@@ -1,6 +1,6 @@
import * as React from 'react';
import { User, IdeaResponse, IdeaStatus } from '@fider/models';
-import { Gravatar, MultiLineText, Moment } from '@fider/components/common';
+import { Gravatar, MultiLineText, Moment, UserName } from '@fider/components/common';
interface IdeaResponseProps {
status: number;
@@ -13,7 +13,7 @@ export const ShowIdeaResponse = (props: IdeaResponseProps): JSX.Element => {
if (props.response && status.show) {
return <div className="fdr-response item ui segment">
<span className={`ui mini label ${status.color}`}>{ status.title }</span>
- <Gravatar name={props.response.user.name} hash={props.response.user.gravatar}/> { props.response.user.name }
+ <Gravatar name={props.response.user.name} hash={props.response.user.gravatar}/> <UserName user={props.response.user} />
<span className="info">
<Moment date={props.response.respondedOn} />
</span>
diff --git a/public/components/SupportCounter.tsx b/public/components/SupportCounter.tsx
index fe4b021c6..73d50fd0e 100644
--- a/public/components/SupportCounter.tsx
+++ b/public/components/SupportCounter.tsx
@@ -87,9 +87,12 @@ export class SupportCounter extends React.Component<SupportCounterProps, Support
<div className="support-counter ui">
{ status.closed ? disabled : vote }
</div>
- <div ref={(e) => { this.list = e!; } } className="ui popup transition hidden signin-message">
- <p className="header">Hey! We need to know who you are</p>
- <SocialSignInList orientation="horizontal" size="small" />
+ <div ref={(e) => { this.list = e!; } } className="ui popup transition hidden login-message">
+ <div className="header">
+ Log in to raise your voice.
+ </div>
+ <p className="info">We'll never post to any of your accounts.</p>
+ <SocialSignInList orientation="horizontal" size="normal" />
</div>
</div>;
}
diff --git a/public/components/common/Header.tsx b/public/components/common/Header.tsx
index d9d5f4bfa..09d821846 100644
--- a/public/components/common/Header.tsx
+++ b/public/components/common/Header.tsx
@@ -43,7 +43,7 @@ export class Header extends React.Component<{}, {}> {
}
<div className="item">
<a className="signout" href="/logout?redirect=/">
- Sign out
+ Log out
</a>
</div>
</div> :
@@ -51,12 +51,12 @@ export class Header extends React.Component<{}, {}> {
return <div>
<EnvironmentInfo />
- <div id="menu" className="ui mini menu no-border">
+ <div id="menu" className="ui small menu no-border">
<div className="ui container">
<a href="/" className="header item">
{ this.tenant.name }
</a>
- <a ref={(e) => { this.dropdown = e!; } } className="item right signin">
+ <a ref={(e) => { this.dropdown = e!; } } className={`item right signin ${!this.user.name && 'subtitle' }`}>
<Gravatar name={this.user.name} hash={this.user.gravatar} />
{ this.user.name || 'Log in' }
<i className="dropdown icon"></i>
diff --git a/public/components/common/SocialSignInButton.tsx b/public/components/common/SocialSignInButton.tsx
index 74ba87dea..f43e3c20d 100644
--- a/public/components/common/SocialSignInButton.tsx
+++ b/public/components/common/SocialSignInButton.tsx
@@ -14,12 +14,12 @@ const providers = {
google: {
name: 'Google',
class: 'google plus',
- icon: 'google plus'
+ icon: 'google'
},
facebook: {
name: 'Facebook',
class: 'facebook',
- icon: 'facebook'
+ icon: 'facebook f'
},
github: {
name: 'GitHub',
@@ -41,7 +41,7 @@ export class SocialSignInButton extends React.Component<SocialSignInButtonProps,
return <Button href={href} className={classes}>
<i className={'icon ' + providers[this.props.provider].icon}></i>
- { this.props.size === 'normal' && `Log in with ${providers[this.props.provider].name}` }
+ { this.props.size === 'normal' && `${providers[this.props.provider].name}` }
</Button>;
}
}
diff --git a/public/components/common/SocialSignInList.tsx b/public/components/common/SocialSignInList.tsx
index 50eba9e71..f620f57f8 100644
--- a/public/components/common/SocialSignInList.tsx
+++ b/public/components/common/SocialSignInList.tsx
@@ -20,7 +20,7 @@ export class SocialSignInList extends React.Component<SocialSignInListProps, {}>
public render() {
const settings = this.session.get<AuthSettings>('auth');
- const cssClasses = this.props.orientation === 'horizontal' ? 'horizontal divided' : '';
+ const cssClasses = this.props.orientation === 'horizontal' ? 'horizontal' : '';
const google = settings.providers.google &&
<div className="item">
diff --git a/public/components/common/UserName.tsx b/public/components/common/UserName.tsx
new file mode 100644
index 000000000..63a005768
--- /dev/null
+++ b/public/components/common/UserName.tsx
@@ -0,0 +1,11 @@
+import * as React from 'react';
+import { User } from '@fider/models';
+
+interface UserNameProps {
+ user: User;
+}
+
+export const UserName = (props: UserNameProps) => {
+ const isStaff = props.user && props.user.role >= 2;
+ return <span className={`name ${isStaff ? 'staff' : ''}`}>{ props.user.name }</span>;
+};
diff --git a/public/components/common/index.tsx b/public/components/common/index.tsx
index 2d6857141..a4d862e86 100644
--- a/public/components/common/index.tsx
+++ b/public/components/common/index.tsx
@@ -9,3 +9,4 @@ export * from './Header';
export * from './SocialSignInButton';
export * from './SocialSignInList';
export * from './Moment';
+export * from './UserName';
diff --git a/public/pages/signup/SignUpPage.scss b/public/pages/signup/SignUpPage.scss
index ba7442385..7b35637cd 100644
--- a/public/pages/signup/SignUpPage.scss
+++ b/public/pages/signup/SignUpPage.scss
@@ -3,11 +3,6 @@
max-width: 500px !important;
text-align: center;
- .signin-list {
- width: 300px;
- margin: 0 auto;
- }
-
.logo {
height: 100px;
}
diff --git a/public/pages/signup/SignUpPage.tsx b/public/pages/signup/SignUpPage.tsx
index 3f4df98b0..e49de1c95 100644
--- a/public/pages/signup/SignUpPage.tsx
+++ b/public/pages/signup/SignUpPage.tsx
@@ -109,7 +109,7 @@ export class SignUpPage extends React.Component<{}, SignUpPageState> {
</div> :
<div>
<p>We need to identify you in order to setup your new Fider instance.</p>
- <SocialSignInList size="normal" orientation="vertical" />
+ <SocialSignInList size="normal" orientation="horizontal" />
</div>
}
diff --git a/public/pages/site/ShowIdeaPage.scss b/public/pages/site/ShowIdeaPage.scss
index c6361e01b..5772a95ba 100644
--- a/public/pages/site/ShowIdeaPage.scss
+++ b/public/pages/site/ShowIdeaPage.scss
@@ -15,6 +15,11 @@
vertical-align: top;
margin-top: 2px;
}
+
+ .name {
+ line-height: 30px;
+ }
+
.comment > .content {
display: inline-block;
max-width: 85%;
diff --git a/public/pages/site/ShowIdeaPage.tsx b/public/pages/site/ShowIdeaPage.tsx
index 09ef81b83..1082c8a22 100644
--- a/public/pages/site/ShowIdeaPage.tsx
+++ b/public/pages/site/ShowIdeaPage.tsx
@@ -7,7 +7,7 @@ import { CommentInput } from '@fider/components/CommentInput';
import { ResponseForm } from '@fider/components/ResponseForm';
import { SupportCounter } from '@fider/components/SupportCounter';
import { ShowIdeaResponse } from '@fider/components/ShowIdeaResponse';
-import { Button, Gravatar, Moment, MultiLineText, Footer, Header, SocialSignInButton } from '@fider/components/common';
+import { Button, UserName, Gravatar, Moment, MultiLineText, Footer, Header, SocialSignInButton } from '@fider/components/common';
import { inject, injectables } from '@fider/di';
import { Session } from '@fider/services';
@@ -37,7 +37,7 @@ export class ShowIdeaPage extends React.Component<{}, {}> {
<div className="comment">
<Gravatar name={c.user.name} hash={c.user.gravatar} />
<div className="content">
- <span className="author">{ c.user.name }</span>
+ <UserName user={c.user} />
<div className="metadata">
· <Moment date={c.createdOn} />
</div>
@@ -61,7 +61,7 @@ export class ShowIdeaPage extends React.Component<{}, {}> {
<h1 className="ui header">{ this.idea.title }</h1>
<span className="info">
- Shared <Moment date={this.idea.createdOn} /> by <Gravatar name={ this.idea.user.name } hash={ this.idea.user.gravatar }/> <b>{ this.idea.user.name }</b>
+ Shared <Moment date={this.idea.createdOn} /> by <Gravatar name={ this.idea.user.name } hash={ this.idea.user.gravatar }/> <UserName user={this.idea.user} />
</span>
</div>
</div>
diff --git a/public/pages/site/SiteHomePage.tsx b/public/pages/site/SiteHomePage.tsx
index 9f36b5fe0..3077a5303 100644
--- a/public/pages/site/SiteHomePage.tsx
+++ b/public/pages/site/SiteHomePage.tsx
@@ -78,7 +78,7 @@ We'd love to hear what you're thinking about. This is the place for you to submi
<div className="ui grid stackable">
<div className="six wide column">
<MultiLineText className="welcome-message" text={ welcomeMessage } style="full" />
- <IdeaInput placeholder={this.tenant.invitation || 'Tell us your ideas'} />
+ <IdeaInput placeholder={this.tenant.invitation || 'I suggest you...'} />
</div>
<div className="ten wide column">
{