Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-ce
Commits
7e24c5c4
Commit
7e24c5c4
authored
Dec 31, 2015
by
Robert Speicher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move broadcast message form to a partial
parent
1c7febc3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
34 deletions
+39
-34
app/assets/javascripts/admin.js.coffee
app/assets/javascripts/admin.js.coffee
+1
-2
app/views/admin/broadcast_messages/_form.html.haml
app/views/admin/broadcast_messages/_form.html.haml
+37
-0
app/views/admin/broadcast_messages/index.html.haml
app/views/admin/broadcast_messages/index.html.haml
+1
-32
No files found.
app/assets/javascripts/admin.js.coffee
View file @
7e24c5c4
...
@@ -10,8 +10,7 @@ class @Admin
...
@@ -10,8 +10,7 @@ class @Admin
$
(
'body'
).
on
'click'
,
'.js-toggle-colors-link'
,
(
e
)
->
$
(
'body'
).
on
'click'
,
'.js-toggle-colors-link'
,
(
e
)
->
e
.
preventDefault
()
e
.
preventDefault
()
$
(
'.js-toggle-colors-link'
).
hide
()
$
(
'.js-toggle-colors-container'
).
toggle
()
$
(
'.js-toggle-colors-container'
).
show
()
$
(
'input#broadcast_message_color'
).
on
'input'
,
->
$
(
'input#broadcast_message_color'
).
on
'input'
,
->
previewColor
=
$
(
'input#broadcast_message_color'
).
val
()
previewColor
=
$
(
'input#broadcast_message_color'
).
val
()
...
...
app/views/admin/broadcast_messages/_form.html.haml
0 → 100644
View file @
7e24c5c4
.broadcast-message-preview
=
icon
(
'bullhorn'
)
%span
Your message here
=
form_for
[
:admin
,
@broadcast_message
],
html:
{
class:
'broadcast-message-form form-horizontal js-requires-input'
}
do
|
f
|
-
if
@broadcast_message
.
errors
.
any?
.alert.alert-danger
-
@broadcast_message
.
errors
.
full_messages
.
each
do
|
msg
|
%p
=
msg
.form-group
=
f
.
label
:message
,
class:
'control-label'
.col-sm-10
=
f
.
text_area
:message
,
class:
"form-control"
,
rows:
2
,
required:
true
.form-group.js-toggle-colors-container
.col-sm-10.col-sm-offset-2
=
link_to
'Customize colors'
,
'#'
,
class:
'js-toggle-colors-link'
.form-group.js-toggle-colors-container.hide
=
f
.
label
:color
,
"Background Color"
,
class:
'control-label'
.col-sm-10
=
f
.
color_field
:color
,
value:
"#E75E40"
,
class:
"form-control"
.form-group.js-toggle-colors-container.hide
=
f
.
label
:font
,
"Font Color"
,
class:
'control-label'
.col-sm-10
=
f
.
color_field
:font
,
value:
"#FFFFFF"
,
class:
"form-control"
.form-group
=
f
.
label
:starts_at
,
class:
'control-label'
.col-sm-10.datetime-controls
=
f
.
datetime_select
:starts_at
,
{},
class:
'form-control form-control-inline'
.form-group
=
f
.
label
:ends_at
,
class:
'control-label'
.col-sm-10.datetime-controls
=
f
.
datetime_select
:ends_at
,
{},
class:
'form-control form-control-inline'
.form-actions
-
if
@broadcast_message
.
persisted?
=
f
.
submit
"Update broadcast message"
,
class:
"btn btn-create"
-
else
=
f
.
submit
"Add broadcast message"
,
class:
"btn btn-create"
app/views/admin/broadcast_messages/index.html.haml
View file @
7e24c5c4
...
@@ -6,39 +6,8 @@
...
@@ -6,39 +6,8 @@
Broadcast messages are displayed for every user and can be used to notify
Broadcast messages are displayed for every user and can be used to notify
users about scheduled maintenance, recent upgrades and more.
users about scheduled maintenance, recent upgrades and more.
.broadcast-message-preview
=
render
'form'
=
icon
(
'bullhorn'
)
%span
Your message here
=
form_for
[
:admin
,
@broadcast_message
],
html:
{
class:
'broadcast-message-form form-horizontal js-requires-input'
}
do
|
f
|
-
if
@broadcast_message
.
errors
.
any?
.alert.alert-danger
-
@broadcast_message
.
errors
.
full_messages
.
each
do
|
msg
|
%p
=
msg
.form-group
=
f
.
label
:message
,
class:
'control-label'
.col-sm-10
=
f
.
text_area
:message
,
class:
"form-control"
,
rows:
2
,
required:
true
%div
=
link_to
'Customize colors'
,
'#'
,
class:
'js-toggle-colors-link'
.form-group.js-toggle-colors-container.hide
=
f
.
label
:color
,
"Background Color"
,
class:
'control-label'
.col-sm-10
=
f
.
color_field
:color
,
value:
"#E75E40"
,
class:
"form-control"
.form-group.js-toggle-colors-container.hide
=
f
.
label
:font
,
"Font Color"
,
class:
'control-label'
.col-sm-10
=
f
.
color_field
:font
,
value:
"#FFFFFF"
,
class:
"form-control"
.form-group
=
f
.
label
:starts_at
,
class:
'control-label'
.col-sm-10.datetime-controls
=
f
.
datetime_select
:starts_at
,
{},
class:
'form-control form-control-inline'
.form-group
=
f
.
label
:ends_at
,
class:
'control-label'
.col-sm-10.datetime-controls
=
f
.
datetime_select
:ends_at
,
{},
class:
'form-control form-control-inline'
.form-actions
=
f
.
submit
"Add broadcast message"
,
class:
"btn btn-create"
-
if
@broadcast_messages
.
any?
-
if
@broadcast_messages
.
any?
%ul
.bordered-list.broadcast-messages
%ul
.bordered-list.broadcast-messages
...
...
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