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
Jérome Perrin
gitlab-ce
Commits
bc5bc7cb
Commit
bc5bc7cb
authored
Aug 03, 2016
by
Alfredo Sumaran
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix class names and move each class to its own file
parent
2b2c42a1
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
79 additions
and
74 deletions
+79
-74
app/assets/javascripts/allowed_to_merge_dropdowns.js.es6
app/assets/javascripts/allowed_to_merge_dropdowns.js.es6
+13
-0
app/assets/javascripts/allowed_to_merge_select.js.es6
app/assets/javascripts/allowed_to_merge_select.js.es6
+0
-0
app/assets/javascripts/allowed_to_push_dropdowns.js.es6
app/assets/javascripts/allowed_to_push_dropdowns.js.es6
+13
-0
app/assets/javascripts/protected_branch_access_dropdown.js.es6
...ssets/javascripts/protected_branch_access_dropdown.js.es6
+18
-0
app/assets/javascripts/protected_branch_create.js.es6
app/assets/javascripts/protected_branch_create.js.es6
+2
-49
app/assets/javascripts/protected_branch_edit.js.es6
app/assets/javascripts/protected_branch_edit.js.es6
+3
-16
app/assets/javascripts/protected_branch_edit_list.js.es6
app/assets/javascripts/protected_branch_edit_list.js.es6
+12
-0
app/assets/javascripts/protected_branch_select.js.es6
app/assets/javascripts/protected_branch_select.js.es6
+3
-3
app/assets/stylesheets/pages/projects.scss
app/assets/stylesheets/pages/projects.scss
+8
-1
app/views/projects/protected_branches/_branches_list.html.haml
...iews/projects/protected_branches/_branches_list.html.haml
+7
-5
No files found.
app/assets/javascripts/allowed_to_merge_dropdowns.js.es6
0 → 100644
View file @
bc5bc7cb
class AllowedToMergeDropdowns {
constructor (options) {
const { $dropdowns, onSelect } = options;
$dropdowns.each((i, el) => {
new ProtectedBranchAccessDropdown({
$dropdown: $(el),
data: gon.merge_access_levels,
onSelect: onSelect
});
});
}
}
app/assets/javascripts/allowed_to_merge_select.js.es6
deleted
100644 → 0
View file @
2b2c42a1
app/assets/javascripts/allowed_to_push_dropdowns.js.es6
0 → 100644
View file @
bc5bc7cb
class AllowedToPushDropdowns {
constructor (options) {
const { $dropdowns, onSelect } = options;
$dropdowns.each((i, el) => {
new ProtectedBranchAccessDropdown({
$dropdown: $(el),
data: gon.push_access_levels,
onSelect: onSelect
});
});
}
}
\ No newline at end of file
app/assets/javascripts/protected_branch_access_dropdown.js.es6
0 → 100644
View file @
bc5bc7cb
class ProtectedBranchAccessDropdown {
constructor(options) {
const { $dropdown, data, onSelect } = options;
$dropdown.glDropdown({
data: data,
selectable: true,
fieldName: $dropdown.data('field-name'),
toggleLabel(item) {
return item.text;
},
clicked(item, $el, e) {
e.preventDefault();
onSelect();
}
});
}
}
app/assets/javascripts/protect_branch_create.js.es6
→
app/assets/javascripts/protect
ed
_branch_create.js.es6
View file @
bc5bc7cb
class ProtectedBranchesAccessDropdown {
constructor(options) {
const { $dropdown, data, onSelect } = options;
$dropdown.glDropdown({
data: data,
selectable: true,
fieldName: $dropdown.data('field-name'),
toggleLabel(item) {
return item.text;
},
clicked(item, $el, e) {
e.preventDefault();
onSelect();
}
});
}
}
class AllowedToMergeDropdowns {
constructor (options) {
const { $dropdowns, onSelect } = options;
$dropdowns.each((i, el) => {
new ProtectedBranchesAccessDropdown({
$dropdown: $(el),
data: gon.merge_access_levels,
onSelect: onSelect
});
});
}
}
class AllowedToPushSelects {
constructor (options) {
const { $dropdowns, onSelect } = options;
$dropdowns.each((i, el) => {
new ProtectedBranchesAccessDropdown({
$dropdown: $(el),
data: gon.push_access_levels,
onSelect: onSelect
});
});
}
}
class ProtectedBranchCreate {
class ProtectedBranchCreate {
constructor() {
constructor() {
this.$wrap = this.$form = $('#new_protected_branch');
this.$wrap = this.$form = $('#new_protected_branch');
...
@@ -59,12 +12,12 @@ class ProtectedBranchCreate {
...
@@ -59,12 +12,12 @@ class ProtectedBranchCreate {
});
});
// Allowed to Push dropdowns
// Allowed to Push dropdowns
new AllowedToPush
Select
s({
new AllowedToPush
Dropdown
s({
$dropdowns: this.$wrap.find('.js-allowed-to-push'),
$dropdowns: this.$wrap.find('.js-allowed-to-push'),
onSelect: this.onSelect.bind(this)
onSelect: this.onSelect.bind(this)
});
});
new ProtectedBranch
Select
s({
new ProtectedBranch
Dropdown
s({
$dropdowns: this.$wrap.find('.js-protected-branch-select'),
$dropdowns: this.$wrap.find('.js-protected-branch-select'),
onSelect: this.onSelect.bind(this)
onSelect: this.onSelect.bind(this)
});
});
...
...
app/assets/javascripts/protect_branch_edit.js.es6
→
app/assets/javascripts/protect
ed
_branch_edit.js.es6
View file @
bc5bc7cb
...
@@ -10,14 +10,14 @@ class ProtectedBranchEdit {
...
@@ -10,14 +10,14 @@ class ProtectedBranchEdit {
buildDropdowns() {
buildDropdowns() {
// Allowed to merge dropdown
// Allowed to merge dropdown
new ProtectedBranch
es
AccessDropdown({
new ProtectedBranchAccessDropdown({
$dropdown: this.$allowedToMergeDropdown,
$dropdown: this.$allowedToMergeDropdown,
data: gon.merge_access_levels,
data: gon.merge_access_levels,
onSelect: this.onSelect.bind(this)
onSelect: this.onSelect.bind(this)
});
});
// Allowed to push dropdown
// Allowed to push dropdown
new ProtectedBranch
es
AccessDropdown({
new ProtectedBranchAccessDropdown({
$dropdown: this.$allowedToPushDropdown,
$dropdown: this.$allowedToPushDropdown,
data: gon.push_access_levels,
data: gon.push_access_levels,
onSelect: this.onSelect.bind(this)
onSelect: this.onSelect.bind(this)
...
@@ -47,23 +47,10 @@ class ProtectedBranchEdit {
...
@@ -47,23 +47,10 @@ class ProtectedBranchEdit {
success: () => {
success: () => {
this.$wrap.effect('highlight');
this.$wrap.effect('highlight');
},
},
error
: function
() {
error() {
$.scrollTo(0);
$.scrollTo(0);
new Flash('Failed to update branch!');
new Flash('Failed to update branch!');
}
}
});
});
}
}
}
}
class ProtectedBranchEditList {
constructor() {
this.$wrap = $('.protected-branches-list');
// Build edit forms
this.$wrap.find('.js-protected-branch-edit-form').each((i, el) => {
new ProtectedBranchEdit({
$wrap: $(el)
});
});
}
}
app/assets/javascripts/protected_branch_edit_list.js.es6
0 → 100644
View file @
bc5bc7cb
class ProtectedBranchEditList {
constructor() {
this.$wrap = $('.protected-branches-list');
// Build edit forms
this.$wrap.find('.js-protected-branch-edit-form').each((i, el) => {
new ProtectedBranchEdit({
$wrap: $(el)
});
});
}
}
app/assets/javascripts/protected_branch_select.js.es6
View file @
bc5bc7cb
class ProtectedBranch
Select
{
class ProtectedBranch
Dropdown
{
constructor(options) {
constructor(options) {
this.onSelect = options.onSelect;
this.onSelect = options.onSelect;
this.$dropdown = options.$dropdown;
this.$dropdown = options.$dropdown;
...
@@ -74,12 +74,12 @@ class ProtectedBranchSelect {
...
@@ -74,12 +74,12 @@ class ProtectedBranchSelect {
}
}
}
}
class ProtectedBranch
Select
s {
class ProtectedBranch
Dropdown
s {
constructor(options) {
constructor(options) {
const { $dropdowns, onSelect } = options;
const { $dropdowns, onSelect } = options;
$dropdowns.each((i, el) => {
$dropdowns.each((i, el) => {
new ProtectedBranch
Select
({
new ProtectedBranch
Dropdown
({
$dropdown: $(el),
$dropdown: $(el),
onSelect: onSelect
onSelect: onSelect
});
});
...
...
app/assets/stylesheets/pages/projects.scss
View file @
bc5bc7cb
...
@@ -675,7 +675,14 @@ pre.light-well {
...
@@ -675,7 +675,14 @@ pre.light-well {
}
}
}
}
&
.table-bordered
{
.settings-message
{
margin
:
0
;
border-radius
:
0
0
1px
1px
;
padding
:
20px
0
;
border
:
none
;
}
.table-bordered
{
border-radius
:
1px
;
border-radius
:
1px
;
th
:not
(
:last-child
),
td
:not
(
:last-child
)
{
th
:not
(
:last-child
),
td
:not
(
:last-child
)
{
...
...
app/views/projects/protected_branches/_branches_list.html.haml
View file @
bc5bc7cb
.panel.panel-default
.panel.panel-default
.protected-branches-list
-
if
@protected_branches
.
empty?
-
if
@protected_branches
.
empty?
.panel-heading
%b
Protected branch (
#{
@protected_branches
.
size
}
)
%p
.settings-message.text-center
%p
.settings-message.text-center
No branches are protected
, protect a branch with the form above.
There are currently no protected braches
, protect a branch with the form above.
-
else
-
else
-
can_admin_project
=
can?
(
current_user
,
:admin_project
,
@project
)
-
can_admin_project
=
can?
(
current_user
,
:admin_project
,
@project
)
%table
.table.
protected-branches-list.
table-bordered
%table
.table.table-bordered
%colgroup
%colgroup
%col
{
width:
"20%"
}
%col
{
width:
"30%"
}
%col
{
width:
"25%"
}
%col
{
width:
"25%"
}
%col
{
width:
"30%"
}
%col
{
width:
"25%"
}
%col
{
width:
"25%"
}
%col
{
width:
"20%"
}
%thead
%thead
%tr
%tr
%th
Protected branch (
#{
@protected_branches
.
size
}
)
%th
Protected branch (
#{
@protected_branches
.
size
}
)
...
...
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