Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
429aa035
Commit
429aa035
authored
Oct 22, 2015
by
Ray Schamp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add dismissable email confirmation banner
parent
af415e1b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
127 additions
and
49 deletions
+127
-49
src/components/banner/banner.jsx
src/components/banner/banner.jsx
+24
-0
src/components/banner/banner.scss
src/components/banner/banner.scss
+40
-0
src/views/splash/splash.jsx
src/views/splash/splash.jsx
+63
-49
No files found.
src/components/banner/banner.jsx
0 → 100644
View file @
429aa035
var
React
=
require
(
'
react
'
);
require
(
'
./banner.scss
'
);
var
Banner
=
React
.
createClass
({
type
:
'
Banner
'
,
propTypes
:
{
onRequestDismiss
:
React
.
PropTypes
.
func
},
render
:
function
()
{
return
(
<
div
className=
{
'
banner
'
+
this
.
props
.
className
}
>
<
div
className=
"inner"
>
{
this
.
props
.
children
}
{
this
.
props
.
onRequestDismiss
?
[
<
a
className=
"close"
key=
"close"
href=
"#"
onClick=
{
this
.
props
.
onRequestDismiss
}
>
x
</
a
>
]
:
[]
}
</
div
>
</
div
>
);
}
});
module
.
exports
=
Banner
;
src/components/banner/banner.scss
0 → 100644
View file @
429aa035
@import
"../../colors"
;
$navigation-height
:
50px
;
.banner
{
position
:
fixed
;
top
:
$navigation-height
;
box-shadow
:
0
1px
1px
$ui-dark-gray
;
background-color
:
$ui-orange
;
width
:
100%
;
overflow
:
hidden
;
text-align
:
center
;
line-height
:
$navigation-height
;
&
,
a
{
color
:
$ui-white
;
}
a
{
text-decoration
:
underline
;
}
.close
{
float
:
right
;
margin-top
:
$navigation-height
/
4
;
border-radius
:
$navigation-height
/
4
;
background-color
:
$box-shadow-gray
;
width
:
$navigation-height
/
2
;
height
:
$navigation-height
/
2
;
text-decoration
:
none
;
text-shadow
:
none
;
line-height
:
$navigation-height
/
2
;
color
:
$ui-white
;
font-weight
:
normal
;
}
&
.warning
{
background-color
:
$ui-orange
;
}
}
src/views/splash/splash.jsx
View file @
429aa035
...
@@ -7,6 +7,7 @@ var Session = require('../../mixins/session.jsx');
...
@@ -7,6 +7,7 @@ var Session = require('../../mixins/session.jsx');
var
Activity
=
require
(
'
../../components/activity/activity.jsx
'
);
var
Activity
=
require
(
'
../../components/activity/activity.jsx
'
);
var
AdminPanel
=
require
(
'
../../components/adminpanel/adminpanel.jsx
'
);
var
AdminPanel
=
require
(
'
../../components/adminpanel/adminpanel.jsx
'
);
var
Banner
=
require
(
'
../../components/banner/banner.jsx
'
);
var
Box
=
require
(
'
../../components/box/box.jsx
'
);
var
Box
=
require
(
'
../../components/box/box.jsx
'
);
var
Button
=
require
(
'
../../components/forms/button.jsx
'
);
var
Button
=
require
(
'
../../components/forms/button.jsx
'
);
var
Carousel
=
require
(
'
../../components/carousel/carousel.jsx
'
);
var
Carousel
=
require
(
'
../../components/carousel/carousel.jsx
'
);
...
@@ -235,58 +236,71 @@ var Splash = injectIntl(React.createClass({
...
@@ -235,58 +236,71 @@ var Splash = injectIntl(React.createClass({
},
},
render
:
function
()
{
render
:
function
()
{
var
featured
=
this
.
renderHomepageRows
();
var
featured
=
this
.
renderHomepageRows
();
var
showEmailConfirmation
=
true
;(
this
.
state
.
session
.
user
&&
this
.
state
.
session
.
flags
.
has_outstanding_email_confirmation
&&
this
.
state
.
session
.
flags
.
confirm_email_banner
);
return
(
return
(
<
div
className=
"inner"
>
<
div
className=
"splash"
>
{
this
.
state
.
session
.
user
?
[
{
showEmailConfirmation
?
[
<
div
key=
"header"
className=
"splash-header"
>
<
Banner
key=
"confirmedEmail"
{
this
.
state
.
session
.
flags
.
show_welcome
?
[
className=
"warning"
<
Welcome
key=
"welcome"
onDismiss=
{
this
.
handleDismiss
.
bind
(
this
,
'
welcome
'
)
}
/>
onRequestDismiss=
{
this
.
handleDismiss
.
bind
(
this
,
'
confirmed_email
'
)
}
>
]
:
[
<
a
href=
"#"
onClick=
{
this
.
showConfirmEmailPopup
}
>
Confirm your email
</
a
>
to enable sharing.
{
'
'
}
<
Activity
key=
"activity"
items=
{
this
.
state
.
activity
}
/>
<
a
href=
"/info/faq/#accounts"
>
Having trouble?
</
a
>
]
}
</
Banner
>
<
News
items=
{
this
.
state
.
news
}
/>
]
:
[]
}
</
div
>
<
div
key=
"inner"
className=
"inner"
>
]
:
[
{
this
.
state
.
session
.
user
?
[
<
Intro
projectCount=
{
this
.
state
.
projectCount
}
key=
"intro"
/>
<
div
key=
"header"
className=
"splash-header"
>
]
}
{
this
.
state
.
session
.
flags
.
show_welcome
?
[
<
Welcome
key=
"welcome"
onDismiss=
{
this
.
handleDismiss
.
bind
(
this
,
'
welcome
'
)
}
/>
]
:
[
<
Activity
key=
"activity"
items=
{
this
.
state
.
activity
}
/>
]
}
<
News
items=
{
this
.
state
.
news
}
/>
</
div
>
]
:
[
<
Intro
projectCount=
{
this
.
state
.
projectCount
}
key=
"intro"
/>
]
}
{
featured
}
{
featured
}
<
AdminPanel
>
<
AdminPanel
>
<
dt
>
Tools
</
dt
>
<
dt
>
Tools
</
dt
>
<
dd
>
<
dd
>
<
ul
>
<
ul
>
<
li
>
<
li
>
<
a
href=
"/scratch_admin/tickets"
>
Ticket Queue
</
a
>
<
a
href=
"/scratch_admin/tickets"
>
Ticket Queue
</
a
>
</
li
>
</
li
>
<
li
>
<
li
>
<
a
href=
"/scratch_admin/ip-search/"
>
IP Search
</
a
>
<
a
href=
"/scratch_admin/ip-search/"
>
IP Search
</
a
>
</
li
>
</
li
>
<
li
>
<
li
>
<
a
href=
"/scratch_admin/email-search/"
>
Email Search
</
a
>
<
a
href=
"/scratch_admin/email-search/"
>
Email Search
</
a
>
</
li
>
</
li
>
</
ul
>
</
ul
>
</
dd
>
</
dd
>
<
dt
>
Homepage Cache
</
dt
>
<
dt
>
Homepage Cache
</
dt
>
<
dd
>
<
dd
>
<
ul
className=
"cache-list"
>
<
ul
className=
"cache-list"
>
<
li
>
<
li
>
<
form
<
form
id=
"homepage-refresh-form"
id=
"homepage-refresh-form"
method=
"post"
method=
"post"
action=
"/scratch_admin/homepage/clear-cache/"
>
action=
"/scratch_admin/homepage/clear-cache/"
>
<
div
className=
"button-row"
>
<
div
className=
"button-row"
>
<
span
>
Refresh row data:
</
span
>
<
span
>
Refresh row data:
</
span
>
<
Button
type=
"submit"
>
<
Button
type=
"submit"
>
<
span
>
Refresh
</
span
>
<
span
>
Refresh
</
span
>
</
Button
>
</
Button
>
</
div
>
</
div
>
</
form
>
</
form
>
</
li
>
</
li
>
</
ul
>
</
ul
>
</
dd
>
</
dd
>
</
AdminPanel
>
</
AdminPanel
>
</
div
>
</
div
>
</
div
>
);
);
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment