Skip to content
Snippets Groups Projects
Commit 3ecb3024 authored by Achilleas Pipinellis's avatar Achilleas Pipinellis
Browse files

Merge branch 'master' into docs_refactor

parents 07f5a6f1 835f1961
No related branches found
No related tags found
No related merge requests found
Showing
with 235 additions and 227 deletions
Loading
Loading
@@ -6,22 +6,40 @@ class @Issue
constructor: ->
# Prevent duplicate event bindings
@disableTaskList()
@fixAffixScroll()
if $('a.btn-close').length
@initTaskList()
@initIssueBtnEventListeners()
 
fixAffixScroll: ->
fixAffix = ->
$discussion = $('.issuable-discussion')
$sidebar = $('.issuable-sidebar')
if $sidebar.hasClass('no-affix')
$sidebar.removeClass(['affix-top','affix'])
discussionHeight = $discussion.height()
sidebarHeight = $sidebar.height()
if sidebarHeight > discussionHeight
$discussion.height(sidebarHeight + 50)
$sidebar.addClass('no-affix')
$(window).on('resize', fixAffix)
fixAffix()
initTaskList: ->
$('.detail-page-description .js-task-list-container').taskList('enable')
$(document).on 'tasklist:changed', '.detail-page-description .js-task-list-container', @updateTaskList
 
initIssueBtnEventListeners: ->
_this = @
issueFailMessage = 'Unable to update this issue at this time.'
$('a.btn-close, a.btn-reopen').on 'click', (e) ->
e.preventDefault()
e.stopImmediatePropagation()
$this = $(this)
isClose = $this.hasClass('btn-close')
shouldSubmit = $this.hasClass('btn-comment')
if shouldSubmit
_this.submitNoteForm($this.closest('form'))
$this.prop('disabled', true)
url = $this.attr('href')
$.ajax
Loading
Loading
@@ -32,12 +50,13 @@ class @Issue
new Flash(issueFailMessage, 'alert')
success: (data, textStatus, jqXHR) ->
if data.saved
$this.addClass('hidden')
if isClose
$('a.btn-close').addClass('hidden')
$('a.btn-reopen').removeClass('hidden')
$('div.status-box-closed').removeClass('hidden')
$('div.status-box-open').addClass('hidden')
else
$('a.btn-reopen').addClass('hidden')
$('a.btn-close').removeClass('hidden')
$('div.status-box-closed').addClass('hidden')
$('div.status-box-open').removeClass('hidden')
Loading
Loading
@@ -45,6 +64,11 @@ class @Issue
new Flash(issueFailMessage, 'alert')
$this.prop('disabled', false)
 
submitNoteForm: (form) =>
noteText = form.find("textarea.js-note-text").val()
if noteText.trim().length > 0
form.submit()
disableTaskList: ->
$('.detail-page-description .js-task-list-container').taskList('disable')
$(document).off 'tasklist:changed', '.detail-page-description .js-task-list-container'
Loading
Loading
Loading
Loading
@@ -15,10 +15,13 @@ class @MergeRequest
this.$('.show-all-commits').on 'click', =>
this.showAllCommits()
 
@fixAffixScroll();
@initTabs()
 
# Prevent duplicate event bindings
@disableTaskList()
@initMRBtnListeners()
 
if $("a.btn-close").length
@initTaskList()
Loading
Loading
@@ -27,6 +30,20 @@ class @MergeRequest
$: (selector) ->
this.$el.find(selector)
 
fixAffixScroll: ->
fixAffix = ->
$discussion = $('.issuable-discussion')
$sidebar = $('.issuable-sidebar')
if $sidebar.hasClass('no-affix')
$sidebar.removeClass(['affix-top','affix'])
discussionHeight = $discussion.height()
sidebarHeight = $sidebar.height()
if sidebarHeight > discussionHeight
$discussion.height(sidebarHeight + 50)
$sidebar.addClass('no-affix')
$(window).on('resize', fixAffix)
fixAffix()
initTabs: ->
if @opts.action != 'new'
# `MergeRequests#new` has no tab-persisting or lazy-loading behavior
Loading
Loading
@@ -43,6 +60,28 @@ class @MergeRequest
$('.detail-page-description .js-task-list-container').taskList('enable')
$(document).on 'tasklist:changed', '.detail-page-description .js-task-list-container', @updateTaskList
 
initMRBtnListeners: ->
_this = @
$('a.btn-close, a.btn-reopen').on 'click', (e) ->
$this = $(this)
shouldSubmit = $this.hasClass('btn-comment')
if shouldSubmit && $this.data('submitted')
return
if shouldSubmit
if $this.hasClass('btn-comment-and-close') || $this.hasClass('btn-comment-and-reopen')
e.preventDefault()
e.stopImmediatePropagation()
_this.submitNoteForm($this.closest('form'),$this)
submitNoteForm: (form, $button) =>
noteText = form.find("textarea.js-note-text").val()
if noteText.trim().length > 0
form.submit()
$button.data('submitted',true)
$button.trigger('click')
disableTaskList: ->
$('.detail-page-description .js-task-list-container').taskList('disable')
$(document).off 'tasklist:changed', '.detail-page-description .js-task-list-container'
Loading
Loading
Loading
Loading
@@ -5,7 +5,7 @@
#
# ### Example Markup
#
# <ul class="nav nav-tabs merge-request-tabs">
# <ul class="nav-links merge-request-tabs">
# <li class="notes-tab active">
# <a data-action="notes" data-target="#notes" data-toggle="tab" href="/foo/bar/merge_requests/1">
# Discussion
Loading
Loading
#= require autosave
#= require autosize
#= require dropzone
#= require dropzone_input
#= require gfm_auto_complete
Loading
Loading
@@ -33,8 +34,6 @@ class @Notes
$(document).on "click", ".note-edit-cancel", @cancelEdit
 
# Reopen and close actions for Issue/MR combined with note form submit
$(document).on "click", ".js-note-target-reopen", @targetReopen
$(document).on "click", ".js-note-target-close", @targetClose
$(document).on "click", ".js-comment-button", @updateCloseButton
$(document).on "keyup", ".js-note-text", @updateTargetButtons
 
Loading
Loading
@@ -248,6 +247,7 @@ class @Notes
else
previewButton.removeClass("turn-on").addClass "turn-off"
 
autosize(textarea)
new Autosave textarea, [
"Note"
form.find("#note_commit_id").val()
Loading
Loading
@@ -320,6 +320,7 @@ class @Notes
form.show()
textarea = form.find("textarea")
textarea.focus()
autosize(textarea)
 
# HACK (rspeicher/DouweM): Work around a Chrome 43 bug(?).
# The textarea has the correct value, Chrome just won't show it unless we
Loading
Loading
@@ -355,7 +356,7 @@ class @Notes
$('.note[id="' + note_id + '"]').each ->
note = $(this)
notes = note.closest(".notes")
count = notes.closest(".notes_holder").find(".discussion-notes-count")
count = notes.closest(".issuable-details").find(".notes-tab .badge")
 
# check if this is the last note for this line
if notes.find(".note").length is 1
Loading
Loading
@@ -365,9 +366,10 @@ class @Notes
 
# for diff lines
notes.closest("tr").remove()
else
# update notes count
count.get(0).lastChild.nodeValue = " #{notes.children().length - 1}"
# update notes count
oldNum = parseInt(count.text())
count.text(oldNum - 1)
 
note.remove()
 
Loading
Loading
@@ -512,17 +514,6 @@ class @Notes
visibilityChange: =>
@refresh()
 
targetReopen: (e) =>
@submitNoteForm($(e.target).parents('form'))
targetClose: (e) =>
@submitNoteForm($(e.target).parents('form'))
submitNoteForm: (form) =>
noteText = form.find(".js-note-text").val()
if noteText.trim().length > 0
form.submit()
updateCloseButton: (e) =>
textarea = $(e.target)
form = textarea.parents('form')
Loading
Loading
@@ -531,13 +522,16 @@ class @Notes
updateTargetButtons: (e) =>
textarea = $(e.target)
form = textarea.parents('form')
if textarea.val().trim().length > 0
form.find('.js-note-target-reopen').text('Comment & reopen')
form.find('.js-note-target-close').text('Comment & close')
form.find('.js-note-target-reopen').addClass('btn-comment-and-reopen')
form.find('.js-note-target-close').addClass('btn-comment-and-close')
else
form.find('.js-note-target-reopen').text('Reopen')
form.find('.js-note-target-close').text('Close')
form.find('.js-note-target-reopen').removeClass('btn-comment-and-reopen')
form.find('.js-note-target-close').removeClass('btn-comment-and-close')
 
initTaskList: ->
@enableTaskList()
Loading
Loading
#= require latinise
class @Wikis
constructor: ->
$('.build-new-wiki').bind "click", (e) ->
$('[data-error~=slug]').addClass("hidden")
$('p.hint').show()
$('.build-new-wiki').bind 'click', (e) =>
$('[data-error~=slug]').addClass('hidden')
field = $('#new_wiki_path')
valid_slug_pattern = /^[\w\/-]+$/
slug = @slugify(field.val())
 
slug = field.val()
if slug.match valid_slug_pattern
if (slug.length > 0)
path = field.attr('data-wikis-path')
if(slug.length > 0)
location.href = path + "/" + slug
else
e.preventDefault()
$('p.hint').hide()
$('[data-error~=slug]').removeClass("hidden")
location.href = path + '/' + slug
dasherize: (value) ->
value.replace(/[_\s]+/g, '-')
slugify: (value) =>
@dasherize(value.trim().toLowerCase().latinise())
Loading
Loading
@@ -24,6 +24,7 @@
@import "framework/lists.scss";
@import "framework/markdown_area.scss";
@import "framework/mobile.scss";
@import "framework/nav.scss";
@import "framework/pagination.scss";
@import "framework/panels.scss";
@import "framework/selects.scss";
Loading
Loading
Loading
Loading
@@ -18,9 +18,9 @@
line-height: 36px;
}
 
.content-block,
.gray-content-block {
margin: -$gl-padding;
margin-top: 0;
margin-bottom: -$gl-padding;
background-color: $background-color;
padding: $gl-padding;
margin-bottom: 0px;
Loading
Loading
@@ -86,10 +86,7 @@
.cover-block {
text-align: center;
background: $background-color;
margin: -$gl-padding;
margin-bottom: 0;
padding: 44px $gl-padding;
border-bottom: 1px solid $border-color;
padding-top: 44px;
position: relative;
 
.avatar-holder {
Loading
Loading
@@ -136,3 +133,19 @@
.block-connector {
margin-top: -1px;
}
.nav-block {
.controls {
float: right;
margin-top: 11px;
}
}
.content-block {
padding: $gl-padding 0;
border-bottom: 1px solid $border-color;
&.oneline-block {
line-height: 42px;
}
}
@mixin btn-default {
@include border-radius(3px);
border-width: 1px;
border-style: solid;
font-size: 15px;
font-size: $gl-font-size;
font-weight: 500;
line-height: 18px;
padding: 11px $gl-padding;
letter-spacing: .4px;
padding: $gl-vert-padding $gl-padding;
 
&:focus,
&:active {
Loading
Loading
@@ -17,8 +13,6 @@
 
@mixin btn-middle {
@include btn-default;
@include border-radius(3px);
padding: 11px 24px;
}
 
@mixin btn-color($light, $border-light, $normal, $border-normal, $dark, $border-dark, $color) {
Loading
Loading
@@ -74,16 +68,15 @@
@include btn-default;
@include btn-white;
 
&.btn-small,
&.btn-sm {
padding: 5px 10px;
}
&.btn-nr {
padding: 7px 10px;
padding: 4px 10px;
font-size: 13px;
line-height: 18px;
}
 
&.btn-xs {
padding: 1px 5px;
padding: 2px 5px;
}
 
&.btn-success,
Loading
Loading
@@ -131,6 +124,12 @@
&:last-child {
margin-right: 0px;
}
&.btn-xs {
margin-right: 3px;
}
}
&.disabled {
pointer-events: auto !important;
}
}
 
Loading
Loading
@@ -153,33 +152,42 @@
}
}
 
.btn-group-next {
.btn-clipboard {
border: none;
padding: 0 5px;
}
.input-group-btn {
.btn {
padding: 9px 0px;
font-size: 15px;
color: #7f8fa4;
border-color: #e7e9ed;
width: 140px;
.badge {
font-weight: normal;
background-color: #eee;
color: #78a;
@include btn-gray;
@include btn-middle;
&:hover {
outline: none;
}
 
&.active {
border-color: $gl-info;
background: $gl-info;
color: #fff;
&:focus {
outline: none;
}
&:active {
outline: none;
}
 
.badge {
color: $gl-info;
background-color: white;
}
&.btn-clipboard {
padding-left: 15px;
padding-right: 15px;
}
}
}
 
.btn-clipboard {
border: none;
.active {
@include box-shadow(inset 0 0 4px rgba(0, 0, 0, 0.12));
border: 1px solid #c6cacf !important;
background-color: #e4e7ed !important;
}
.btn-green {
@include btn-green
}
}
Loading
Loading
@@ -75,6 +75,8 @@ hr {
@include str-truncated;
}
 
.item-title { font-weight: 600; }
/** FLASH message **/
.author_link {
color: $gl-link-color;
Loading
Loading
@@ -374,75 +376,6 @@ table {
}
}
 
.center-top-menu, .left-top-menu {
@include nav-menu;
text-align: center;
margin-top: 5px;
margin-bottom: $gl-padding;
height: auto;
margin-top: -$gl-padding;
&.no-bottom {
margin-bottom: 0;
}
&.no-top {
margin-top: 0;
}
li a {
display: inline-block;
padding-top: $gl-padding;
padding-bottom: 11px;
margin-bottom: -1px;
}
&.bottom-border {
border-bottom: 1px solid $border-color;
height: 57px;
}
&.wide {
margin-left: -$gl-padding;
margin-right: -$gl-padding;
}
}
.left-top-menu {
text-align: left;
border-bottom: 1px solid #EEE;
}
.center-middle-menu {
@include nav-menu;
padding: 0;
text-align: center;
margin: -$gl-padding;
margin-top: 0;
margin-bottom: 0;
height: 58px;
border-bottom: 1px solid $border-color;
li {
&:after {
content: "|";
color: $border-gray-light;
}
&:last-child {
&:after {
content: none;
}
}
> a {
display: inline-block;
text-transform: uppercase;
font-size: 13px;
}
}
}
.dropzone .dz-preview .dz-progress {
border-color: $border-color !important;
}
Loading
Loading
Loading
Loading
@@ -3,11 +3,8 @@
*
*/
.file-holder {
margin-left: -$gl-padding;
margin-right: -$gl-padding;
border: none;
border-top: 1px solid #E7E9EE;
border-bottom: 1px solid #E7E9EE;
border: 1px solid $border-color;
 
&.readme-holder {
border-bottom: 0;
Loading
Loading
Loading
Loading
@@ -8,10 +8,12 @@
.flash-notice {
@extend .alert;
@extend .alert-info;
margin: 0;
}
 
.flash-alert {
@extend .alert;
@extend .alert-danger;
margin: 0;
}
}
Loading
Loading
@@ -3,23 +3,39 @@
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 300;
src: local('Source Sans Pro Light'), local('SourceSansPro-Light'), font-url('SourceSansPro-Light.ttf.woff');
src:
local('Source Sans Pro Light'),
local('SourceSansPro-Light'),
font-url('SourceSansPro-Light.ttf.woff2') format('woff2'),
font-url('SourceSansPro-Light.ttf.woff') format('woff');
}
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 400;
src: local('Source Sans Pro'), local('SourceSansPro-Regular'), font-url('SourceSansPro-Regular.ttf.woff');
src:
local('Source Sans Pro'),
local('SourceSansPro-Regular'),
font-url('SourceSansPro-Regular.ttf.woff2') format('woff2'),
font-url('SourceSansPro-Regular.ttf.woff') format('woff');
}
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 600;
src: local('Source Sans Pro Semibold'), local('SourceSansPro-Semibold'), font-url('SourceSansPro-Semibold.ttf.woff');
src:
local('Source Sans Pro Semibold'),
local('SourceSansPro-Semibold'),
font-url('SourceSansPro-Semibold.ttf.woff2') format('woff2'),
font-url('SourceSansPro-Semibold.ttf.woff') format('woff');
}
@font-face {
font-family: 'Source Sans Pro';
font-style: normal;
font-weight: 700;
src: local('Source Sans Pro Bold'), local('SourceSansPro-Bold'), font-url('SourceSansPro-Bold.ttf.woff');
src:
local('Source Sans Pro Bold'),
local('SourceSansPro-Bold'),
font-url('SourceSansPro-Bold.ttf.woff2') format('woff2'),
font-url('SourceSansPro-Bold.ttf.woff') format('woff');
}
Loading
Loading
@@ -74,8 +74,10 @@ label {
 
.form-control {
@include box-shadow(none);
height: 42px;
padding: 8px $gl-padding;
}
.form-control-inline {
display: inline;
}
 
.wiki-content {
Loading
Loading
Loading
Loading
@@ -28,6 +28,7 @@ header {
min-height: $header-height;
background-color: #fff;
border: none;
border-bottom: 1px solid #EEE;
 
.container-fluid {
width: 100% !important;
Loading
Loading
Loading
Loading
@@ -5,8 +5,6 @@ html {
}
 
body {
background-color: #F3F3F3 !important;
&.navless {
background-color: white !important;
}
Loading
Loading
Loading
Loading
@@ -74,7 +74,7 @@
 
 
/** light list with border-bottom between li **/
ul.bordered-list {
ul.bordered-list, ul.unstyled-list {
@include basic-list;
 
&.top-list {
Loading
Loading
@@ -88,6 +88,10 @@ ul.bordered-list {
}
}
 
ul.unstyled-list > li {
border-bottom: none;
}
ul.task-list {
li.task-list-item {
list-style-type: none;
Loading
Loading
@@ -105,10 +109,8 @@ ul.content-list {
padding: 0;
 
> li {
padding: $gl-padding;
padding: $gl-padding 0;
border-color: $table-border-color;
margin-left: -$gl-padding;
margin-right: -$gl-padding;
color: $gl-gray;
 
.avatar {
Loading
Loading
@@ -129,6 +131,7 @@ ul.content-list {
.panel > .content-list {
li {
margin: 0;
padding: $gl-padding;
}
}
 
Loading
Loading
@@ -144,7 +147,7 @@ ul.controls {
> li {
float: left;
margin-right: 10px;
&:last-child {
margin-right: 0;
}
Loading
Loading
Loading
Loading
@@ -65,13 +65,6 @@
position: relative;
}
 
.md-header {
ul {
float: left;
margin-bottom: 1px;
}
}
.referenced-users {
color: #4c4e54;
padding-top: 10px;
Loading
Loading
@@ -85,28 +78,12 @@
box-shadow: none;
}
 
.new_note,
.edit_note,
.detail-page-description,
.milestone-description,
.wiki-content,
.merge-request-form {
.nav-tabs {
margin-bottom: 0;
border: none;
li a,
li.active a {
border: 1px solid #DDD;
}
}
}
.markdown-area {
@include border-radius(0);
background: #FFF;
border: 1px solid #ddd;
min-height: 140px;
max-height: 430px;
padding: 5px;
box-shadow: none;
width: 100%;
Loading
Loading
Loading
Loading
@@ -118,38 +118,3 @@
font-size: 16px;
line-height: 24px;
}
@mixin nav-menu {
padding: 0;
margin: 0;
list-style: none;
height: 56px;
li {
display: inline-block;
a {
padding: 14px;
font-size: 15px;
line-height: 28px;
color: #959494;
border-bottom: 2px solid transparent;
&:hover, &:active, &:focus {
text-decoration: none;
outline: none;
}
}
&.active a {
color: #616060;
border-bottom: 2px solid #4688f1;
}
.badge {
font-weight: normal;
background-color: #eee;
color: #78a;
}
}
}
Loading
Loading
@@ -9,7 +9,7 @@
padding-right: 5px;
}
 
.nav.nav-tabs > li > a {
.nav-links > li > a {
padding: 10px;
font-size: 12px;
margin-right: 3px;
Loading
Loading
@@ -81,7 +81,7 @@
display: none;
}
 
.center-top-menu, .left-top-menu {
.nav-links, .nav-links {
li a {
font-size: 14px;
padding: 19px 10px;
Loading
Loading
@@ -100,11 +100,6 @@
}
 
@media (max-width: $screen-sm-max) {
.page-with-sidebar .content-wrapper {
padding: 0;
padding-top: 1px;
}
.issues-filters {
.milestone-filter, .labels-filter {
display: none;
Loading
Loading
.nav-links {
padding: 0;
margin: 0;
list-style: none;
height: auto;
border-bottom: 1px solid $border-color;
li {
display: inline-block;
a {
display: inline-block;
padding: 14px;
padding-top: $gl-padding;
padding-bottom: 11px;
margin-bottom: -1px;
font-size: 15px;
line-height: 28px;
color: #959494;
border-bottom: 2px solid transparent;
&:hover, &:active, &:focus {
text-decoration: none;
outline: none;
}
}
&.active a {
color: #000000;
border-bottom: 2px solid #4688f1;
}
.badge {
font-weight: normal;
background-color: #eee;
color: #78a;
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment