Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzcinski <ayufan@ayufan.eu>2015-09-15 23:40:35 +0300
committerKamil Trzcinski <ayufan@ayufan.eu>2015-09-15 23:40:35 +0300
commite21deaee8ee0d453bf899c1b3fb46262cc60dab9 (patch)
tree59b04c9cb1c8ce6c510a78ee787fb31817619835 /app/assets
parent7e2dbcbe0915cfd75e91d78e943c153f284df37d (diff)
parent0ad669bb5ba08d012d3daa50b51a3a6b069e3e83 (diff)
Merge remote-tracking branch 'origin/master' into ci-and-ce-sitting-in-a-tree-k-i-s-s-i-n-g
# Conflicts: # Gemfile.lock
Diffstat (limited to 'app/assets')
-rw-r--r--app/assets/javascripts/blob/blob_file_dropzone.js.coffee52
-rw-r--r--app/assets/stylesheets/generic/blocks.scss7
-rw-r--r--app/assets/stylesheets/generic/common.scss4
-rw-r--r--app/assets/stylesheets/generic/sidebar.scss2
-rw-r--r--app/assets/stylesheets/pages/editor.scss18
-rw-r--r--app/assets/stylesheets/pages/notes.scss2
-rw-r--r--app/assets/stylesheets/pages/tree.scss12
7 files changed, 90 insertions, 7 deletions
diff --git a/app/assets/javascripts/blob/blob_file_dropzone.js.coffee b/app/assets/javascripts/blob/blob_file_dropzone.js.coffee
new file mode 100644
index 00000000000..090af9bb376
--- /dev/null
+++ b/app/assets/javascripts/blob/blob_file_dropzone.js.coffee
@@ -0,0 +1,52 @@
+class @BlobFileDropzone
+ constructor: (form, method) ->
+ form_dropzone = form.find('.dropzone')
+ Dropzone.autoDiscover = false
+ dropzone = form_dropzone.dropzone(
+ autoDiscover: false
+ autoProcessQueue: false
+ url: form.attr('action')
+ # Rails uses a hidden input field for PUT
+ # http://stackoverflow.com/questions/21056482/how-to-set-method-put-in-form-tag-in-rails
+ method: method
+ clickable: true
+ uploadMultiple: false
+ paramName: "file"
+ maxFilesize: gon.max_file_size or 10
+ parallelUploads: 1
+ maxFiles: 1
+ addRemoveLinks: true
+ previewsContainer: '.dropzone-previews'
+ headers:
+ "X-CSRF-Token": $("meta[name=\"csrf-token\"]").attr("content")
+
+ success: (header, response) ->
+ window.location.href = response.filePath
+ return
+
+ error: (temp, errorMessage) ->
+ stripped = $("<div/>").html(errorMessage).text();
+ $('.dropzone-alerts').html('Error uploading file: \"' + stripped + '\"').show()
+ return
+
+ maxfilesexceeded: (file) ->
+ @removeFile file
+ return
+
+ removedfile: (file) ->
+ $('.dropzone-previews')[0].removeChild(file.previewTemplate)
+ $('.dropzone-alerts').html('').hide()
+ return true
+
+ sending: (file, xhr, formData) ->
+ formData.append('commit_message', form.find('#commit_message').val())
+ return
+ )
+
+ submitButton = form.find('#submit-all')[0]
+ submitButton.addEventListener 'click', (e) ->
+ e.preventDefault()
+ e.stopPropagation()
+ alert "Please select a file" if dropzone[0].dropzone.getQueuedFiles().length == 0
+ dropzone[0].dropzone.processQueue()
+ return false
diff --git a/app/assets/stylesheets/generic/blocks.scss b/app/assets/stylesheets/generic/blocks.scss
index 48d9f890f62..ce024272a30 100644
--- a/app/assets/stylesheets/generic/blocks.scss
+++ b/app/assets/stylesheets/generic/blocks.scss
@@ -36,6 +36,11 @@
margin-bottom: 0;
}
+ &.clear-block {
+ margin-bottom: $gl-padding - 1px;
+ padding-bottom: $gl-padding;
+ }
+
&.second-block {
margin-top: -1px;
margin-bottom: 0;
@@ -51,6 +56,6 @@
}
.oneline {
- line-height: 44px;
+ line-height: 42px;
}
}
diff --git a/app/assets/stylesheets/generic/common.scss b/app/assets/stylesheets/generic/common.scss
index 5e191d5dd4a..3a237bf3228 100644
--- a/app/assets/stylesheets/generic/common.scss
+++ b/app/assets/stylesheets/generic/common.scss
@@ -377,4 +377,8 @@ table {
height: 56px;
margin-top: -$gl-padding;
padding-top: $gl-padding;
+
+ &.no-bottom {
+ margin-bottom: 0;
+ }
}
diff --git a/app/assets/stylesheets/generic/sidebar.scss b/app/assets/stylesheets/generic/sidebar.scss
index 41ffd358576..3d055f0e66f 100644
--- a/app/assets/stylesheets/generic/sidebar.scss
+++ b/app/assets/stylesheets/generic/sidebar.scss
@@ -152,7 +152,6 @@
}
.collapse-nav a {
- left: 0px;
width: $sidebar_collapsed_width;
}
@@ -171,6 +170,7 @@
width: $sidebar_width;
position: fixed;
bottom: 0;
+ left: 0;
font-size: 13px;
background: transparent;
height: 40px;
diff --git a/app/assets/stylesheets/pages/editor.scss b/app/assets/stylesheets/pages/editor.scss
index 759ba6b1c22..1d565477dd4 100644
--- a/app/assets/stylesheets/pages/editor.scss
+++ b/app/assets/stylesheets/pages/editor.scss
@@ -9,6 +9,10 @@
width: 100%;
}
+ .ace_gutter-cell {
+ background-color: $background-color;
+ }
+
.cancel-btn {
color: #B94A48;
&:hover {
@@ -32,14 +36,12 @@
.file-title {
@extend .monospace;
- font-size: 14px;
- padding: 5px;
}
.editor-ref {
background: $background-color;
padding: 11px 15px;
- border-right: 1px solid #CCC;
+ border-right: 1px solid $border-color;
display: inline-block;
margin: -5px -5px;
margin-right: 10px;
@@ -50,5 +52,15 @@
display: inline-block;
width: 200px;
}
+
+ .form-control {
+ margin-top: -3px;
+ }
+ }
+
+ .form-actions {
+ margin: -$gl-padding;
+ margin-top: 0;
+ padding: $gl-padding
}
}
diff --git a/app/assets/stylesheets/pages/notes.scss b/app/assets/stylesheets/pages/notes.scss
index 2544356a5f6..2a77f065aed 100644
--- a/app/assets/stylesheets/pages/notes.scss
+++ b/app/assets/stylesheets/pages/notes.scss
@@ -235,8 +235,6 @@ ul.notes {
filter: alpha(opacity=0);
&:hover {
- width: 38px;
- font-size: 20px;
background: $gl-info;
color: #FFF;
@include show-add-diff-note;
diff --git a/app/assets/stylesheets/pages/tree.scss b/app/assets/stylesheets/pages/tree.scss
index 71ca37c0cd7..df7fab07a57 100644
--- a/app/assets/stylesheets/pages/tree.scss
+++ b/app/assets/stylesheets/pages/tree.scss
@@ -116,3 +116,15 @@
}
#modal-remove-blob > .modal-dialog { width: 850px; }
+
+.blob-upload-dropzone-previews {
+ text-align: center;
+ border: 2px;
+ border-style: dashed;
+ min-height: 200px;
+}
+
+.upload-link {
+ font-weight: normal;
+ color: #0000EE;
+}