summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGELOG1
-rw-r--r--app/assets/javascripts/application.js.coffee1
-rw-r--r--app/assets/javascripts/dispatcher.js.coffee8
-rw-r--r--app/assets/javascripts/markdown_area.js.coffee2
-rw-r--r--app/assets/javascripts/zen_mode.js.coffee51
-rw-r--r--app/assets/stylesheets/generic/forms.scss137
-rw-r--r--app/controllers/projects/tags_controller.rb2
-rw-r--r--app/models/service.rb7
-rw-r--r--app/views/projects/_issuable_form.html.haml10
-rw-r--r--app/views/projects/commits/_head.html.haml2
-rw-r--r--app/views/projects/merge_requests/_new_submit.html.haml7
-rw-r--r--app/views/projects/notes/_form.html.haml7
-rw-r--r--app/views/projects/tags/destroy.js.haml3
-rw-r--r--app/views/projects/tags/index.html.haml25
-rw-r--r--app/views/shared/_promo.html.haml1
-rw-r--r--db/migrate/20140907220153_serialize_service_properties.rb3
-rw-r--r--doc/install/installation.md4
-rw-r--r--features/project/commits/tags.feature10
-rw-r--r--features/steps/project/browse_tags.rb28
19 files changed, 285 insertions, 24 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 6021da42422..49bf983eb5e 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -26,6 +26,7 @@ v 7.3.0
- Don't allow edit of system notes
- Project wiki search (Ralf Seidler)
- Enabled Shibboleth authentication support (Matus Banas)
+ - Zen mode (fullscreen) for issues/MR/notes (Robert Schilling)
v 7.2.1
- Delete orphaned labels during label migration (James Brooks)
diff --git a/app/assets/javascripts/application.js.coffee b/app/assets/javascripts/application.js.coffee
index 86ccd8c21ed..9add1304dc7 100644
--- a/app/assets/javascripts/application.js.coffee
+++ b/app/assets/javascripts/application.js.coffee
@@ -34,6 +34,7 @@
#= require dropzone
#= require semantic-ui/sidebar
#= require mousetrap
+#= require mousetrap/pause
#= require shortcuts
#= require shortcuts_navigation
#= require shortcuts_dashboard_navigation
diff --git a/app/assets/javascripts/dispatcher.js.coffee b/app/assets/javascripts/dispatcher.js.coffee
index ae4cf577179..086c09f196e 100644
--- a/app/assets/javascripts/dispatcher.js.coffee
+++ b/app/assets/javascripts/dispatcher.js.coffee
@@ -24,18 +24,22 @@ class Dispatcher
when 'projects:issues:show'
new Issue()
shortcut_handler = new ShortcutsIssueable()
+ new ZenMode()
when 'projects:milestones:show'
new Milestone()
- when 'projects:issues:new'
+ when 'projects:issues:new','projects:issues:edit'
GitLab.GfmAutoComplete.setup()
shortcut_handler = new ShortcutsNavigation()
- when 'projects:merge_requests:new'
+ new ZenMode()
+ when 'projects:merge_requests:new', 'projects:merge_requests:edit'
GitLab.GfmAutoComplete.setup()
new Diff()
shortcut_handler = new ShortcutsNavigation()
+ new ZenMode()
when 'projects:merge_requests:show'
new Diff()
shortcut_handler = new ShortcutsIssueable()
+ new ZenMode()
when "projects:merge_requests:diffs"
new Diff()
when 'projects:merge_requests:index'
diff --git a/app/assets/javascripts/markdown_area.js.coffee b/app/assets/javascripts/markdown_area.js.coffee
index bee2785562d..a971e5dbf1d 100644
--- a/app/assets/javascripts/markdown_area.js.coffee
+++ b/app/assets/javascripts/markdown_area.js.coffee
@@ -27,7 +27,7 @@ $(document).ready ->
dropzone = $(".div-dropzone").dropzone(
url: project_image_path_upload
dictDefaultMessage: ""
- clickable: true
+ clickable: false
paramName: "markdown_img"
maxFilesize: 10
uploadMultiple: false
diff --git a/app/assets/javascripts/zen_mode.js.coffee b/app/assets/javascripts/zen_mode.js.coffee
new file mode 100644
index 00000000000..aea707d8550
--- /dev/null
+++ b/app/assets/javascripts/zen_mode.js.coffee
@@ -0,0 +1,51 @@
+class @ZenMode
+ @fullscreen_prefix = 'fullscreen_'
+ @ESC = 27
+
+ constructor: ->
+ @active_zen_area = null
+ @active_checkbox = null
+
+ $('body').on 'change', '.zennable input[type=checkbox]', (e) =>
+ checkbox = e.currentTarget;
+ if checkbox.checked
+ Mousetrap.pause()
+ @udpateActiveZenArea(checkbox)
+ else
+ @exitZenMode()
+
+ $(document).on 'keydown', (e) =>
+ console.log("esc")
+ if e.keyCode is ZenMode.ESC
+ @exitZenMode()
+
+ $(window).on 'hashchange', @updateZenModeFromLocationHash
+
+ udpateActiveZenArea: (checkbox) =>
+ @active_checkbox = $(checkbox)
+ @active_checkbox.prop('checked', true)
+ @active_zen_area = @active_checkbox.parent().find('textarea')
+ @active_zen_area.focus()
+ window.location.hash = ZenMode.fullscreen_prefix + @active_checkbox.prop('id')
+
+ exitZenMode: =>
+ if @active_zen_area isnt null
+ Mousetrap.unpause()
+ @active_checkbox.prop('checked', false)
+ @active_zen_area = null
+ @active_checkbox = null
+ window.location.hash = ''
+
+ checkboxFromLocationHash: (e) ->
+ id = $.trim(window.location.hash.replace('#' + ZenMode.fullscreen_prefix, ''))
+ if id
+ return $('.zennable input[type=checkbox]#' + id)[0]
+ else
+ return null
+
+ updateZenModeFromLocationHash: (e) =>
+ checkbox = @checkboxFromLocationHash()
+ if checkbox
+ @udpateActiveZenArea(checkbox)
+ else
+ @exitZenMode()
diff --git a/app/assets/stylesheets/generic/forms.scss b/app/assets/stylesheets/generic/forms.scss
index 2a31cae5dfb..3b90c4f27f0 100644
--- a/app/assets/stylesheets/generic/forms.scss
+++ b/app/assets/stylesheets/generic/forms.scss
@@ -83,3 +83,140 @@ label {
.form-control {
@include box-shadow(none);
}
+
+.issuable-description {
+ margin-top: 35px;
+}
+
+.zennable {
+ position: relative;
+
+ input {
+ display: none;
+ }
+
+ .collapse {
+ display: none;
+ opacity: 0.5;
+
+ &:before {
+ content: '\f066';
+ font-family: FontAwesome;
+ color: #000;
+ font-size: 28px;
+ position: relative;
+ padding: 30px 40px 0 0;
+ }
+
+ &:hover {
+ opacity: 0.8;
+ }
+ }
+
+ .expand {
+ opacity: 0.5;
+
+ &:before {
+ content: '\f065';
+ font-family: FontAwesome;
+ color: #000;
+ font-size: 14px;
+ line-height: 14px;
+ padding-right: 20px;
+ position: relative;
+ vertical-align: middle;
+ }
+
+ &:hover {
+ opacity: 0.8;
+ }
+ }
+
+ input:checked ~ .zen-backdrop .expand {
+ display: none;
+ }
+
+ input:checked ~ .zen-backdrop .collapse {
+ display: block;
+ position: absolute;
+ top: 0;
+ }
+
+ label {
+ position: absolute;
+ top: -26px;
+ right: 0;
+ font-variant: small-caps;
+ text-transform: uppercase;
+ font-size: 10px;
+ padding: 4px;
+ font-weight: 500;
+ letter-spacing: 1px;
+
+ &:before {
+ display: inline-block;
+ width: 10px;
+ height: 14px;
+ }
+ }
+
+ input:checked ~ .zen-backdrop {
+ background-color: white;
+ position: fixed;
+ top: 0;
+ bottom: 0;
+ left: 0;
+ right: 0;
+ z-index: 1031;
+
+ textarea {
+ border: none;
+ box-shadow: none;
+ border-radius: 0;
+ color: #000;
+ font-size: 20px;
+ line-height: 26px;
+ padding: 30px;
+ display: block;
+ outline: none;
+ resize: none;
+ height: 100vh;
+ max-width: 900px;
+ margin: 0 auto;
+ }
+ }
+
+ .zen-backdrop textarea::-webkit-input-placeholder {
+ color: white;
+ }
+
+ .zen-backdrop textarea:-moz-placeholder {
+ color: white;
+ }
+
+ .zen-backdrop textarea::-moz-placeholder {
+ color: white;
+ }
+
+ .zen-backdrop textarea:-ms-input-placeholder {
+ color: white;
+ }
+
+ input:checked ~ .zen-backdrop textarea::-webkit-input-placeholder {
+ color: #999;
+ }
+
+ input:checked ~ .zen-backdrop textarea:-moz-placeholder {
+ color: #999;
+ opacity: 1;
+ }
+
+ input:checked ~ .zen-backdrop textarea::-moz-placeholder {
+ color: #999;
+ opacity: 1;
+ }
+
+ input:checked ~ .zen-backdrop textarea:-ms-input-placeholder {
+ color: #999;
+ }
+}
diff --git a/app/controllers/projects/tags_controller.rb b/app/controllers/projects/tags_controller.rb
index 86788b9963b..c80ad8355d5 100644
--- a/app/controllers/projects/tags_controller.rb
+++ b/app/controllers/projects/tags_controller.rb
@@ -34,7 +34,7 @@ class Projects::TagsController < Projects::ApplicationController
respond_to do |format|
format.html { redirect_to project_tags_path }
- format.js { render nothing: true }
+ format.js
end
end
end
diff --git a/app/models/service.rb b/app/models/service.rb
index edfb31cbe08..1f3a6520473 100644
--- a/app/models/service.rb
+++ b/app/models/service.rb
@@ -17,7 +17,8 @@ class Service < ActiveRecord::Base
serialize :properties, JSON
default_value_for :active, false
- default_value_for :properties, {}
+
+ after_initialize :initialize_properties
belongs_to :project
has_one :service_hook
@@ -32,6 +33,10 @@ class Service < ActiveRecord::Base
:common
end
+ def initialize_properties
+ self.properties = {} if properties.nil?
+ end
+
def title
# implement inside child
end
diff --git a/app/views/projects/_issuable_form.html.haml b/app/views/projects/_issuable_form.html.haml
index f7c4673b52d..402cdb44182 100644
--- a/app/views/projects/_issuable_form.html.haml
+++ b/app/views/projects/_issuable_form.html.haml
@@ -4,11 +4,15 @@
.col-sm-10
= f.text_field :title, maxlength: 255, autofocus: true,
class: 'form-control pad js-gfm-input', required: true
-.form-group
+.form-group.issuable-description
= f.label :description, 'Description', class: 'control-label'
.col-sm-10
- = f.text_area :description, rows: 14,
- class: 'form-control js-gfm-input markdown-area'
+ .zennable
+ %input#zen-toggle-comment{ tabindex: '-1', type: 'checkbox' }
+ .zen-backdrop
+ = f.text_area :description, rows: 14, class: 'form-control js-gfm-input markdown-area', placeholder: 'Leave a comment'
+ %label{ for: 'zen-toggle-comment', class: 'expand' } Edit in fullscreen
+ %label{ for: 'zen-toggle-comment', class: 'collapse' }
.col-sm-12.hint
.pull-left
Parsed with
diff --git a/app/views/projects/commits/_head.html.haml b/app/views/projects/commits/_head.html.haml
index b636e8ffe16..2dcd84af010 100644
--- a/app/views/projects/commits/_head.html.haml
+++ b/app/views/projects/commits/_head.html.haml
@@ -12,7 +12,7 @@
= nav_link(controller: :tags) do
= link_to project_tags_path(@project) do
Tags
- %span.badge= @repository.tags.length
+ %span.badge.js-totaltags-count= @repository.tags.length
= nav_link(controller: :repositories, action: :stats) do
= link_to stats_project_repository_path(@project) do
diff --git a/app/views/projects/merge_requests/_new_submit.html.haml b/app/views/projects/merge_requests/_new_submit.html.haml
index e013fd6d1ce..657a77eb758 100644
--- a/app/views/projects/merge_requests/_new_submit.html.haml
+++ b/app/views/projects/merge_requests/_new_submit.html.haml
@@ -21,7 +21,12 @@
.form-group
.light
= f.label :description, "Description"
- = f.text_area :description, class: "form-control js-gfm-input markdown-area", rows: 10
+ .zennable
+ %input#zen-toggle-comment{ tabindex: '-1', type: 'checkbox' }
+ .zen-backdrop
+ = f.text_area :description, class: 'form-control js-gfm-input markdown-area', rows: 10, placeholder: 'Leave a comment'
+ %label{ for: 'zen-toggle-comment', class: 'expand' } Edit in fullscreen
+ %label{ for: 'zen-toggle-comment', class: 'collapse' }
.clearfix.hint
.pull-left Description is parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"), target: '_blank'}.
.pull-right Attach images (JPG, PNG, GIF) by dragging & dropping or #{link_to "selecting them", '#', class: 'markdown-selector' }.
diff --git a/app/views/projects/notes/_form.html.haml b/app/views/projects/notes/_form.html.haml
index 5ebafb13f1c..66b79e5026b 100644
--- a/app/views/projects/notes/_form.html.haml
+++ b/app/views/projects/notes/_form.html.haml
@@ -14,7 +14,12 @@
Preview
%div
.note-write-holder
- = f.text_area :note, size: 255, class: 'note_text js-note-text js-gfm-input markdown-area'
+ .zennable
+ %input#zen-toggle-comment{ tabindex: '-1', type: 'checkbox' }
+ .zen-backdrop
+ = f.text_area :note, size: 255, class: 'note_text js-note-text js-gfm-input markdown-area', placeholder: 'Leave a comment'
+ %label{ for: 'zen-toggle-comment', class: 'expand' } Edit in fullscreen
+ %label{ for: 'zen-toggle-comment', class: 'collapse' }
.light.clearfix
.pull-left Comments are parsed with #{link_to "GitLab Flavored Markdown", help_page_path("markdown", "markdown"),{ target: '_blank', tabindex: -1 }}
diff --git a/app/views/projects/tags/destroy.js.haml b/app/views/projects/tags/destroy.js.haml
new file mode 100644
index 00000000000..ada6710f940
--- /dev/null
+++ b/app/views/projects/tags/destroy.js.haml
@@ -0,0 +1,3 @@
+$('.js-totaltags-count').html("#{@repository.tags.size}")
+- if @repository.tags.size == 0
+ $('.tags').load(document.URL + ' .nothing-here-block').hide().fadeIn(1000)
diff --git a/app/views/projects/tags/index.html.haml b/app/views/projects/tags/index.html.haml
index dc3188d43b8..6cbf99239ee 100644
--- a/app/views/projects/tags/index.html.haml
+++ b/app/views/projects/tags/index.html.haml
@@ -12,18 +12,19 @@
Tags give the ability to mark specific points in history as being important
%hr
-- unless @tags.empty?
- %ul.bordered-list
- - @tags.each do |tag|
- = render 'tag', tag: @repository.find_tag(tag)
+.tags
+ - unless @tags.empty?
+ %ul.bordered-list
+ - @tags.each do |tag|
+ = render 'tag', tag: @repository.find_tag(tag)
- = paginate @tags, theme: 'gitlab'
+ = paginate @tags, theme: 'gitlab'
-- else
- .nothing-here-block
- Repository has no tags yet.
- %br
- %small
- Use git tag command to add a new one:
+ - else
+ .nothing-here-block
+ Repository has no tags yet.
%br
- %span.monospace git tag -a v1.4 -m 'version 1.4'
+ %small
+ Use git tag command to add a new one:
+ %br
+ %span.monospace git tag -a v1.4 -m 'version 1.4'
diff --git a/app/views/shared/_promo.html.haml b/app/views/shared/_promo.html.haml
index 7dec48e6585..5675e43b05f 100644
--- a/app/views/shared/_promo.html.haml
+++ b/app/views/shared/_promo.html.haml
@@ -2,3 +2,4 @@
= link_to "Homepage", "https://www.gitlab.com/"
= link_to "Blog", "https://www.gitlab.com/blog/"
= link_to "@gitlabhq", "https://twitter.com/gitlabhq"
+ = link_to "Requests", "http://feedback.gitlab.com/"
diff --git a/db/migrate/20140907220153_serialize_service_properties.rb b/db/migrate/20140907220153_serialize_service_properties.rb
index 2326fd0aebf..b95f5b82e03 100644
--- a/db/migrate/20140907220153_serialize_service_properties.rb
+++ b/db/migrate/20140907220153_serialize_service_properties.rb
@@ -1,6 +1,7 @@
class SerializeServiceProperties < ActiveRecord::Migration
def change
add_column :services, :properties, :text
+ Service.reset_column_information
associations =
{
@@ -13,7 +14,7 @@ class SerializeServiceProperties < ActiveRecord::Migration
HipchatService: [:token, :room],
PivotaltrackerService: [:token],
SlackService: [:subdomain, :token, :room],
- JenkinsService: [:token, :subdomain],
+ JenkinsService: [:project_url],
JiraService: [:project_url, :username, :password,
:api_version, :jira_issue_transition_id],
}
diff --git a/doc/install/installation.md b/doc/install/installation.md
index 5ad8392fb63..1175aff9dd9 100644
--- a/doc/install/installation.md
+++ b/doc/install/installation.md
@@ -176,8 +176,12 @@ We recommend using a PostgreSQL database. For MySQL check [MySQL setup guide](da
# Copy the example Unicorn config
sudo -u git -H cp config/unicorn.rb.example config/unicorn.rb
+ # Find number of cores
+ nproc
+
# Enable cluster mode if you expect to have a high load instance
# Ex. change amount of workers to 3 for 2GB RAM server
+ # Set the number of workers to at least the number of cores
sudo -u git -H editor config/unicorn.rb
# Copy the example Rack attack config
diff --git a/features/project/commits/tags.feature b/features/project/commits/tags.feature
index 36c7a6492ff..bea463cb786 100644
--- a/features/project/commits/tags.feature
+++ b/features/project/commits/tags.feature
@@ -27,5 +27,15 @@ Feature: Project Browse tags
And I submit new tag form with tag that already exists
Then I should see new an error that tag already exists
+ @javascript
+ Scenario: I delete a tag
+ Given I delete tag 'v1.1.0'
+ Then I should not see tag 'v1.1.0'
+
+ @javascript
+ Scenario: I delete all tags and see info message
+ Given I delete all tags
+ Then I should see tags info message
+
# @wip
# Scenario: I can download project by tag
diff --git a/features/steps/project/browse_tags.rb b/features/steps/project/browse_tags.rb
index 64c0c284f6c..6ccf5a87927 100644
--- a/features/steps/project/browse_tags.rb
+++ b/features/steps/project/browse_tags.rb
@@ -51,4 +51,32 @@ class ProjectBrowseTags < Spinach::FeatureSteps
step 'I should see new an error that tag already exists' do
page.should have_content 'Tag already exists'
end
+
+ step "I delete tag 'v1.1.0'" do
+ within '.tags' do
+ first('.btn-remove').click
+ sleep 0.05
+ end
+ end
+
+ step "I should not see tag 'v1.1.0'" do
+ within '.tags' do
+ page.all(visible: true).should_not have_content 'v1.1.0'
+ end
+ end
+
+ step 'I delete all tags' do
+ within '.tags' do
+ all('.btn-remove').each do |remove|
+ remove.click
+ sleep 0.05
+ end
+ end
+ end
+
+ step 'I should see tags info message' do
+ within '.tags' do
+ page.should have_content 'Repository has no tags yet.'
+ end
+ end
end