Skip to content

Commit

Permalink
Merge pull request rauchg#80 from jtatum/alreadyreg
Browse files Browse the repository at this point in the history
Add already registered link
  • Loading branch information
rauchg committed Aug 23, 2015
2 parents b4e732f + dd944ee commit 0bdbc4d
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default function slackin({
dom('link rel="shortcut icon" href=https://slack.global.ssl.fastly.net/272a/img/icons/favicon-32.png'),
css && dom('link rel=stylesheet', { href: css })
),
splash({ css, name, logo, channels, active, total })
splash({ css, name, org, logo, channels, active, total })
);
res.type('html');
res.send(page.toHTML());
Expand Down
4 changes: 4 additions & 0 deletions lib/slack-invite.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,10 @@ export default function invite({ org, token, email, channel }, fn){
if (!ok) {
if (providedError === 'missing_scope' && needed === 'admin') {
fn(new Error(`Missing admin scope: The token you provided is for an account that is not an admin. You must provide a token from an admin account in order to invite users through the Slack API.`));
} else if (providedError === 'already_invited') {
fn(new Error('You have already been invited to slack. Check for an email from [email protected].'));
} else if (providedError === 'already_in_team') {
fn(new Error(`Already invited. Sign in at https://${org}.slack.com.`));
} else {
fn(new Error(providedError));
}
Expand Down
32 changes: 26 additions & 6 deletions lib/splash.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import dom from 'vd';

export default function splash({ name, logo, active, total, channels, iframe }){
export default function splash({ name, org, logo, active, total, channels, iframe }){
let div = dom('.splash',
!iframe && dom('.logos',
logo && dom('.logo.org'),
Expand Down Expand Up @@ -32,6 +32,11 @@ export default function splash({ name, logo, active, total, channels, iframe }){
+ (!iframe ? 'autofocus' : '')),
dom('button.loading', 'Get my Invite')
),
!iframe && dom('p.signin',
'or ',
dom(`a href=https://${org}.slack.com`, 'sign in'),
'.'
),
!iframe && dom('footer',
'powered by ',
dom('a href=http://rauchg.com/slackin target=_blank', 'slackin')
Expand Down Expand Up @@ -140,14 +145,13 @@ function style({ logo, active, iframe } = {}){

css.add('button, .form-item', {
'font-size': '12px',
'height': '32px',
'line-height': '32px',
'margin-top': iframe ? '5px' : '10px',
'vertical-align': 'middle',
'display': 'block',
'text-align': 'center',
'box-sizing': 'border-box',
'width': '100%'
'width': '100%',
'padding': '9px'
});

css.add('button', {
Expand All @@ -159,7 +163,6 @@ function style({ logo, active, iframe } = {}){
'cursor': 'pointer',
'appearence': 'none',
'-webkit-appearence': 'none',
'padding': '0',
'outline': '0',
'transition': 'background-color 150ms ease-in, color 150ms ease-in'
});
Expand All @@ -176,7 +179,8 @@ function style({ logo, active, iframe } = {}){
});

css.add('button.error', {
'background-color': '#F4001E'
'background-color': '#F4001E',
'text-transform': 'none'
});

css.add('button.success:disabled', {
Expand Down Expand Up @@ -226,6 +230,22 @@ function style({ logo, active, iframe } = {}){
});
}

if (!iframe) {
css.add('p.signin', {
'padding': '10px 0 10px',
'font-size': '11px'
});

css.add('p.signin a', {
'color': pink,
'text-decoration': 'none'
});

css.add('p.signin a:hover', {
'background-color': '#9B9B9B'
});
}

if (!iframe) {
css.add('footer', {
'color': '#D6D6D6',
Expand Down

0 comments on commit 0bdbc4d

Please sign in to comment.