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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
d939fbed
Commit
d939fbed
authored
Nov 02, 2016
by
Bryce Johnson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change show-gl-field-errors to gl-show-field-errors
parent
b193531b
Changes
16
Show whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
19 additions
and
19 deletions
+19
-19
app/assets/javascripts/dispatcher.js.es6
app/assets/javascripts/dispatcher.js.es6
+1
-1
app/assets/javascripts/gl_field_error.js.es6
app/assets/javascripts/gl_field_error.js.es6
+4
-4
app/assets/stylesheets/framework/forms.scss
app/assets/stylesheets/framework/forms.scss
+1
-1
app/views/admin/appearances/preview.html.haml
app/views/admin/appearances/preview.html.haml
+1
-1
app/views/devise/confirmations/new.html.haml
app/views/devise/confirmations/new.html.haml
+1
-1
app/views/devise/passwords/edit.html.haml
app/views/devise/passwords/edit.html.haml
+1
-1
app/views/devise/passwords/new.html.haml
app/views/devise/passwords/new.html.haml
+1
-1
app/views/devise/sessions/_new_base.html.haml
app/views/devise/sessions/_new_base.html.haml
+1
-1
app/views/devise/sessions/_new_crowd.html.haml
app/views/devise/sessions/_new_crowd.html.haml
+1
-1
app/views/devise/sessions/_new_ldap.html.haml
app/views/devise/sessions/_new_ldap.html.haml
+1
-1
app/views/devise/sessions/two_factor.html.haml
app/views/devise/sessions/two_factor.html.haml
+1
-1
app/views/devise/shared/_signup_box.html.haml
app/views/devise/shared/_signup_box.html.haml
+1
-1
app/views/devise/unlocks/new.html.haml
app/views/devise/unlocks/new.html.haml
+1
-1
app/views/groups/edit.html.haml
app/views/groups/edit.html.haml
+1
-1
spec/javascripts/fixtures/gl_field_errors.html.haml
spec/javascripts/fixtures/gl_field_errors.html.haml
+1
-1
spec/javascripts/gl_field_errors_spec.js.es6
spec/javascripts/gl_field_errors_spec.js.es6
+1
-1
No files found.
app/assets/javascripts/dispatcher.js.es6
View file @
d939fbed
...
@@ -299,7 +299,7 @@
...
@@ -299,7 +299,7 @@
};
};
Dispatcher.prototype.initFieldErrors = function() {
Dispatcher.prototype.initFieldErrors = function() {
$('.
show-gl
-field-errors').each((i, form) => {
$('.
gl-show
-field-errors').each((i, form) => {
new gl.GlFieldErrors(form);
new gl.GlFieldErrors(form);
});
});
};
};
...
...
app/assets/javascripts/gl_field_error.js.es6
View file @
d939fbed
...
@@ -3,7 +3,7 @@
...
@@ -3,7 +3,7 @@
/*
/*
* This class overrides the browser's validation error bubbles, displaying custom
* This class overrides the browser's validation error bubbles, displaying custom
* error messages for invalid fields instead. To begin validating any form, add the
* error messages for invalid fields instead. To begin validating any form, add the
* class `
show-gl
-field-errors` to the form element, and ensure error messages are
* class `
gl-show
-field-errors` to the form element, and ensure error messages are
* declared in each inputs' `title` attribute. If no title is declared for an invalid
* declared in each inputs' `title` attribute. If no title is declared for an invalid
* field the user attempts to submit, "This field is required." will be shown by default.
* field the user attempts to submit, "This field is required." will be shown by default.
*
*
...
@@ -16,13 +16,13 @@
...
@@ -16,13 +16,13 @@
*
*
* Basic:
* Basic:
*
*
* <form class='
show-gl
-field-errors'>
* <form class='
gl-show
-field-errors'>
* <input type='text' name='username' title='Username is required.'/>
* <input type='text' name='username' title='Username is required.'/>
* </form>
* </form>
*
*
* Ignore specific inputs (e.g. UsernameValidator):
* Ignore specific inputs (e.g. UsernameValidator):
*
*
* <form class='
show-gl
-field-errors'>
* <form class='
gl-show
-field-errors'>
* <div class="form-group>
* <div class="form-group>
* <input type='text' class='gl-field-errors-ignore' pattern='[a-zA-Z0-9-_]+'/>
* <input type='text' class='gl-field-errors-ignore' pattern='[a-zA-Z0-9-_]+'/>
* </div>
* </div>
...
@@ -33,7 +33,7 @@
...
@@ -33,7 +33,7 @@
*
*
* Custom Error Anchor (allows error message to be injected after specified element):
* Custom Error Anchor (allows error message to be injected after specified element):
*
*
* <form class='
show-gl
-field-errors'>
* <form class='
gl-show
-field-errors'>
* <div class="form-group gl-field-error-anchor">
* <div class="form-group gl-field-error-anchor">
* <input type='text' name='username' title='Username is required.'/>
* <input type='text' name='username' title='Username is required.'/>
* // Error message typically injected here
* // Error message typically injected here
...
...
app/assets/stylesheets/framework/forms.scss
View file @
d939fbed
...
@@ -136,7 +136,7 @@ label {
...
@@ -136,7 +136,7 @@ label {
color
:
$red-normal
;
color
:
$red-normal
;
}
}
.
show-gl
-field-errors
{
.
gl-show
-field-errors
{
.gl-field-success-outline
{
.gl-field-success-outline
{
border
:
1px
solid
$green-normal
;
border
:
1px
solid
$green-normal
;
...
...
app/views/admin/appearances/preview.html.haml
View file @
d939fbed
=
render
'devise/shared/tab_single'
,
tab_title:
'Sign in preview'
=
render
'devise/shared/tab_single'
,
tab_title:
'Sign in preview'
.login-box
.login-box
%form
.
show-gl
-field-errors
%form
.
gl-show
-field-errors
.form-group
.form-group
=
label_tag
:login
=
label_tag
:login
=
text_field_tag
:login
,
nil
,
class:
"form-control top"
,
title:
'Please provide your username or email address.'
=
text_field_tag
:login
,
nil
,
class:
"form-control top"
,
title:
'Please provide your username or email address.'
...
...
app/views/devise/confirmations/new.html.haml
View file @
d939fbed
=
render
'devise/shared/tab_single'
,
tab_title:
'Resend confirmation instructions'
=
render
'devise/shared/tab_single'
,
tab_title:
'Resend confirmation instructions'
.login-box
.login-box
.login-body
.login-body
=
form_for
(
resource
,
as:
resource_name
,
url:
confirmation_path
(
resource_name
),
html:
{
method: :post
,
class:
'
show-gl
-field-errors'
})
do
|
f
|
=
form_for
(
resource
,
as:
resource_name
,
url:
confirmation_path
(
resource_name
),
html:
{
method: :post
,
class:
'
gl-show
-field-errors'
})
do
|
f
|
.devise-errors
.devise-errors
=
devise_error_messages!
=
devise_error_messages!
.form-group
.form-group
...
...
app/views/devise/passwords/edit.html.haml
View file @
d939fbed
=
render
'devise/shared/tab_single'
,
tab_title
:'Change your password'
=
render
'devise/shared/tab_single'
,
tab_title
:'Change your password'
.login-box
.login-box
.login-body
.login-body
=
form_for
(
resource
,
as:
resource_name
,
url:
password_path
(
resource_name
),
html:
{
method: :put
,
class:
'
show-gl
-field-errors'
})
do
|
f
|
=
form_for
(
resource
,
as:
resource_name
,
url:
password_path
(
resource_name
),
html:
{
method: :put
,
class:
'
gl-show
-field-errors'
})
do
|
f
|
.devise-errors
.devise-errors
=
devise_error_messages!
=
devise_error_messages!
=
f
.
hidden_field
:reset_password_token
=
f
.
hidden_field
:reset_password_token
...
...
app/views/devise/passwords/new.html.haml
View file @
d939fbed
=
render
'devise/shared/tab_single'
,
tab_title:
'Reset Password'
=
render
'devise/shared/tab_single'
,
tab_title:
'Reset Password'
.login-box
.login-box
.login-body
.login-body
=
form_for
(
resource
,
as:
resource_name
,
url:
password_path
(
resource_name
),
html:
{
method: :post
,
class:
'
show-gl
-field-errors'
})
do
|
f
|
=
form_for
(
resource
,
as:
resource_name
,
url:
password_path
(
resource_name
),
html:
{
method: :post
,
class:
'
gl-show
-field-errors'
})
do
|
f
|
.devise-errors
.devise-errors
=
devise_error_messages!
=
devise_error_messages!
.form-group
.form-group
...
...
app/views/devise/sessions/_new_base.html.haml
View file @
d939fbed
=
form_for
(
resource
,
as:
resource_name
,
url:
session_path
(
resource_name
),
html:
{
class:
'new_user
show-gl
-field-errors'
,
'aria-live'
=>
'assertive'
})
do
|
f
|
=
form_for
(
resource
,
as:
resource_name
,
url:
session_path
(
resource_name
),
html:
{
class:
'new_user
gl-show
-field-errors'
,
'aria-live'
=>
'assertive'
})
do
|
f
|
%div
.form-group
%div
.form-group
=
f
.
label
"Username or email"
,
for: :login
=
f
.
label
"Username or email"
,
for: :login
=
f
.
text_field
:login
,
class:
"form-control top"
,
autofocus:
"autofocus"
,
autocapitalize:
"off"
,
autocorrect:
"off"
,
required:
true
,
title:
"This field is required."
=
f
.
text_field
:login
,
class:
"form-control top"
,
autofocus:
"autofocus"
,
autocapitalize:
"off"
,
autocorrect:
"off"
,
required:
true
,
title:
"This field is required."
...
...
app/views/devise/sessions/_new_crowd.html.haml
View file @
d939fbed
=
form_tag
(
omniauth_authorize_path
(
:user
,
:crowd
),
id:
'new_crowd_user'
,
class:
'
show-gl
-field-errors'
)
do
=
form_tag
(
omniauth_authorize_path
(
:user
,
:crowd
),
id:
'new_crowd_user'
,
class:
'
gl-show
-field-errors'
)
do
.form-group
.form-group
=
label_tag
:username
,
'Username or email'
=
label_tag
:username
,
'Username or email'
=
text_field_tag
:username
,
nil
,
{
class:
"form-control top"
,
title:
"This field is required"
,
autofocus:
"autofocus"
,
required:
true
}
=
text_field_tag
:username
,
nil
,
{
class:
"form-control top"
,
title:
"This field is required"
,
autofocus:
"autofocus"
,
required:
true
}
...
...
app/views/devise/sessions/_new_ldap.html.haml
View file @
d939fbed
=
form_tag
(
omniauth_callback_path
(
:user
,
server
[
'provider_name'
]),
id:
'new_ldap_user'
,
class:
"
show-gl
-field-errors"
)
do
=
form_tag
(
omniauth_callback_path
(
:user
,
server
[
'provider_name'
]),
id:
'new_ldap_user'
,
class:
"
gl-show
-field-errors"
)
do
.form-group
.form-group
=
label_tag
:username
,
"
#{
server
[
'label'
]
}
Username"
=
label_tag
:username
,
"
#{
server
[
'label'
]
}
Username"
=
text_field_tag
:username
,
nil
,
{
class:
"form-control top"
,
title:
"This field is required."
,
autofocus:
"autofocus"
,
required:
true
}
=
text_field_tag
:username
,
nil
,
{
class:
"form-control top"
,
title:
"This field is required."
,
autofocus:
"autofocus"
,
required:
true
}
...
...
app/views/devise/sessions/two_factor.html.haml
View file @
d939fbed
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
.login-box
.login-box
.login-body
.login-body
-
if
@user
.
two_factor_otp_enabled?
-
if
@user
.
two_factor_otp_enabled?
=
form_for
(
resource
,
as:
resource_name
,
url:
session_path
(
resource_name
),
method: :post
,
html:
{
class:
'edit_user
show-gl
-field-errors'
})
do
|
f
|
=
form_for
(
resource
,
as:
resource_name
,
url:
session_path
(
resource_name
),
method: :post
,
html:
{
class:
'edit_user
gl-show
-field-errors'
})
do
|
f
|
-
resource_params
=
params
[
resource_name
].
presence
||
params
-
resource_params
=
params
[
resource_name
].
presence
||
params
=
f
.
hidden_field
:remember_me
,
value:
resource_params
.
fetch
(
:remember_me
,
0
)
=
f
.
hidden_field
:remember_me
,
value:
resource_params
.
fetch
(
:remember_me
,
0
)
%div
%div
...
...
app/views/devise/shared/_signup_box.html.haml
View file @
d939fbed
#register-pane
.login-box
{
role:
'tabpanel'
,
class:
'tab-pane'
}
#register-pane
.login-box
{
role:
'tabpanel'
,
class:
'tab-pane'
}
.login-body
.login-body
=
form_for
(
resource
,
as:
"new_
#{
resource_name
}
"
,
url:
registration_path
(
resource_name
),
html:
{
class:
"new_new_user
show-gl
-field-errors"
,
"aria-live"
=>
"assertive"
})
do
|
f
|
=
form_for
(
resource
,
as:
"new_
#{
resource_name
}
"
,
url:
registration_path
(
resource_name
),
html:
{
class:
"new_new_user
gl-show
-field-errors"
,
"aria-live"
=>
"assertive"
})
do
|
f
|
.devise-errors
.devise-errors
=
devise_error_messages!
=
devise_error_messages!
%div
.form-group
%div
.form-group
...
...
app/views/devise/unlocks/new.html.haml
View file @
d939fbed
=
render
'devise/shared/tab_single'
,
tab_title:
'Resend unlock instructions'
=
render
'devise/shared/tab_single'
,
tab_title:
'Resend unlock instructions'
.login-box
.login-box
.login-body
.login-body
=
form_for
(
resource
,
as:
resource_name
,
url:
unlock_path
(
resource_name
),
html:
{
method: :post
,
class:
'
show-gl
-field-errors'
})
do
|
f
|
=
form_for
(
resource
,
as:
resource_name
,
url:
unlock_path
(
resource_name
),
html:
{
method: :post
,
class:
'
gl-show
-field-errors'
})
do
|
f
|
.devise-errors
.devise-errors
=
devise_error_messages!
=
devise_error_messages!
.form-group.append-bottom-20
.form-group.append-bottom-20
...
...
app/views/groups/edit.html.haml
View file @
d939fbed
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
.panel-heading
.panel-heading
Group settings
Group settings
.panel-body
.panel-body
=
form_for
@group
,
html:
{
multipart:
true
,
class:
"form-horizontal
show-gl
-field-errors"
},
authenticity_token:
true
do
|
f
|
=
form_for
@group
,
html:
{
multipart:
true
,
class:
"form-horizontal
gl-show
-field-errors"
},
authenticity_token:
true
do
|
f
|
=
form_errors
(
@group
)
=
form_errors
(
@group
)
=
render
'shared/group_form'
,
f:
f
=
render
'shared/group_form'
,
f:
f
...
...
spec/javascripts/fixtures/gl_field_errors.html.haml
View file @
d939fbed
%form
.
show-gl
-field-errors
{
action:
'submit'
,
method:
'post'
}
%form
.
gl-show
-field-errors
{
action:
'submit'
,
method:
'post'
}
.form-group
.form-group
%input
.required-text
{
required:
true
,
type:
'text'
}
Text
%input
.required-text
{
required:
true
,
type:
'text'
}
Text
.form-group
.form-group
...
...
spec/javascripts/gl_field_errors_spec.js.es6
View file @
d939fbed
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
describe('GL Style Field Errors', function() {
describe('GL Style Field Errors', function() {
beforeEach(function() {
beforeEach(function() {
fixture.load('gl_field_errors.html');
fixture.load('gl_field_errors.html');
const $form = this.$form = $('form.
show-gl
-field-errors');
const $form = this.$form = $('form.
gl-show
-field-errors');
this.fieldErrors = new global.GlFieldErrors($form);
this.fieldErrors = new global.GlFieldErrors($form);
});
});
...
...
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