Commit dd691a4b authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'ce-to-ee' into 'master'

Ce to ee

See merge request !417
parents c05a0afb 962fe84e
......@@ -63,13 +63,11 @@ class @Notes
# fetch notes when tab becomes visible
$(document).on "visibilitychange", @visibilityChange
@notes_forms = '.js-main-target-form textarea, .js-discussion-note-form textarea'
# Chrome doesn't fire keypress or keyup for Command+Enter, so we need keydown.
$(document).on('keydown', @notes_forms, (e) ->
$(document).on 'keydown', '.js-note-text', (e) ->
return if e.originalEvent.repeat
if e.keyCode == 10 || ((e.metaKey || e.ctrlKey) && e.keyCode == 13)
$(@).parents('form').submit()
)
$(@).closest('form').submit()
cleanBinding: ->
$(document).off "ajax:success", ".js-main-target-form"
......@@ -84,7 +82,7 @@ class @Notes
$(document).off "click", ".js-discussion-reply-button"
$(document).off "click", ".js-add-diff-note-button"
$(document).off "visibilitychange"
$(document).off "keydown", @notes_forms
$(document).off "keydown", ".js-note-text"
$(document).off "keyup", ".js-note-text"
$(document).off "click", ".js-note-target-reopen"
$(document).off "click", ".js-note-target-close"
......
......@@ -49,14 +49,6 @@ label {
width: 250px;
}
.input-mx-250 {
max-width: 250px;
}
.input-mn-300 {
min-width: 300px;
}
.custom-form-control {
width: 150px;
}
......
......@@ -202,9 +202,17 @@ header {
}
}
li {
display: table-cell;
width: 1%;
.navbar-collapse {
padding-left: 5px;
li {
display: table-cell;
width: 1%;
a {
margin-left: 8px !important;
}
}
}
}
}
......@@ -64,6 +64,21 @@
margin-left: 15px !important;
max-width: 70% !important;
}
.issue-info, .merge-request-info {
display: none;
}
.issue-details {
.creator,
.page-title .btn-close {
display: none;
}
}
%ul.notes .note-role, .note-actions {
display: none;
}
}
@media (max-width: $screen-sm-max) {
......
......@@ -130,14 +130,6 @@
.username {
display: none;
}
.avatar {
margin-bottom: 10px;
}
.logout-holder {
text-align: center;
}
}
}
}
......@@ -188,9 +180,8 @@
bottom: 0;
width: 100%;
padding: 10px;
color: #fff;
.avatar {
.username {
margin-top: 5px;
}
}
......@@ -29,7 +29,7 @@
line-height: 24px;
.str-truncated {
max-width: 72%;
max-width: 76%;
}
a {
......
......@@ -145,3 +145,9 @@ h2.issue-title {
.issue-form .select2-container {
width: 250px !important;
}
.issues-holder {
.issue-info {
margin-left: 20px;
}
}
......@@ -30,8 +30,12 @@
border-right: 1px solid $color-darker;
.sidebar-user {
a {
color: $color-light;
color: $color-light;
&:hover {
background-color: $color-dark;
color: #FFF;
text-decoration: none;
}
}
}
......
......@@ -67,7 +67,13 @@ module Mentionable
# Create a cross-reference Note for each GFM reference to another Mentionable found in +mentionable_text+.
def create_cross_references!(p = project, a = author, without = [])
refs = references(p) - without
refs = references(p)
# We're using this method instead of Array diffing because that requires
# both of the object's `hash` values to be the same, which may not be the
# case for otherwise identical Commit objects.
refs.reject! { |ref| without.include?(ref) }
refs.each do |ref|
Note.create_cross_reference_note(ref, local_reference, a)
end
......
......@@ -22,11 +22,11 @@
.form-group.js-toggle-colors-container.hide
= f.label :color, "Background Color", class: 'control-label'
.col-sm-10
= f.color_field :color, value: "#AA33EE", class: "form-control"
= f.color_field :color, value: "#eb9532", class: "form-control"
.form-group.js-toggle-colors-container.hide
= f.label :font, "Font Color", class: 'control-label'
.col-sm-10
= f.color_field :font, value: "#224466", class: "form-control"
= f.color_field :font, value: "#FFFFFF", class: "form-control"
.form-group
= f.label :starts_at, class: 'control-label'
.col-sm-10.datetime-controls
......
......@@ -11,7 +11,7 @@
= form_tag admin_groups_path, method: :get, class: 'form-inline' do
= hidden_field_tag :sort, @sort
.form-group
= text_field_tag :name, params[:name], class: "form-control input-mn-300"
= text_field_tag :name, params[:name], class: "form-control"
= button_tag "Search", class: "btn submit btn-primary"
.pull-right
......
......@@ -2,7 +2,7 @@
%h3.page-title
Group Membership
- if current_user.can_create_group?
%span.pull-right
%span.pull-right.hidden-xs
= link_to new_group_path, class: "btn btn-new" do
%i.fa.fa-plus
New Group
......@@ -17,7 +17,7 @@
- @group_members.each do |group_member|
- group = group_member.group
%li
.pull-right
.pull-right.hidden-xs
- if can?(current_user, :admin_group, group)
= link_to edit_group_path(group), class: "btn-sm btn btn-grouped" do
%i.fa.fa-cogs
......@@ -27,7 +27,7 @@
%i.fa.fa-sign-out
Leave
= image_tag group_icon(group), class: "avatar s40 avatar-tile"
= image_tag group_icon(group), class: "avatar s40 avatar-tile hidden-xs"
= link_to group, class: 'group-name' do
%strong= group.name
......
......@@ -4,7 +4,7 @@
= form_tag explore_groups_path, method: :get, class: 'form-inline form-tiny' do |f|
= hidden_field_tag :sort, @sort
.form-group
= search_field_tag :search, params[:search], placeholder: "Filter by name", class: "form-control search-text-input input-mn-300", id: "groups_search"
= search_field_tag :search, params[:search], placeholder: "Filter by name", class: "form-control search-text-input", id: "groups_search"
.form-group
= button_tag 'Search', class: "btn btn-primary wide"
......
.pull-left
= form_tag explore_projects_filter_path, method: :get, class: 'form-inline form-tiny' do |f|
.form-group
= search_field_tag :search, params[:search], placeholder: "Filter by name", class: "form-control search-text-input input-mn-300", id: "projects_search"
= search_field_tag :search, params[:search], placeholder: "Filter by name", class: "form-control search-text-input", id: "projects_search"
.form-group
= button_tag 'Search', class: "btn btn-primary wide"
......
......@@ -14,7 +14,7 @@
.clearfix.js-toggle-container
= form_tag group_group_members_path(@group), method: :get, class: 'form-inline member-search-form' do
.form-group
= search_field_tag :search, params[:search], { placeholder: 'Find existing member by name', class: 'form-control search-text-input input-mn-300' }
= search_field_tag :search, params[:search], { placeholder: 'Find existing member by name', class: 'form-control search-text-input' }
= button_tag 'Search', class: 'btn'
- if current_user && current_user.can?(:admin_group, @group)
......
......@@ -20,5 +20,3 @@
= render 'layouts/google_analytics' if extra_config.has_key?('google_analytics_id')
= render 'layouts/piwik' if extra_config.has_key?('piwik_url') && extra_config.has_key?('piwik_site_id')
= render 'layouts/bootlint' if Rails.env.development?
= yield :scripts_head
......@@ -8,14 +8,10 @@
.collapse-nav
= render partial: 'layouts/collapse_button'
- if current_user
.sidebar-user
= link_to current_user, class: 'profile-pic', id: 'profile-pic', data: {toggle: 'tooltip', placement: 'top'} do
= image_tag avatar_icon(current_user.email, 60), alt: 'User activity', class: 'avatar avatar s32'
= link_to current_user, class: 'sidebar-user' do
= image_tag avatar_icon(current_user.email, 60), alt: 'User activity', class: 'avatar avatar s32'
.username
= current_user.username
.logout-holder
= link_to destroy_user_session_path, class: 'logout', method: :delete, title: 'Sign out', data: {toggle: 'tooltip', placement: 'top'} do
= icon('sign-out')
.content-wrapper
.container-fluid
.content
......
......@@ -2,6 +2,9 @@
%html{ lang: "en"}
= render "layouts/head"
%body{class: "#{app_theme}", :'data-page' => body_data_page}
/ Ideally this would be inside the head, but turbolinks only evaluates page-specific JS in the body.
= yield :scripts_body_top
- if current_user
= render "layouts/header/default", title: header_title
- else
......
......@@ -19,7 +19,7 @@
%li.visible-sm.visible-xs
= link_to search_path, title: 'Search', data: {toggle: 'tooltip', placement: 'bottom'} do
= icon('search')
%li
%li.hidden-xs
= link_to help_path, title: 'Help', data: {toggle: 'tooltip', placement: 'bottom'} do
= icon('question-circle fw')
%li
......@@ -33,11 +33,14 @@
= link_to admin_root_path, title: 'Admin area', data: {toggle: 'tooltip', placement: 'bottom'} do
= icon('wrench fw')
- if current_user.can_create_project?
%li
%li.hidden-xs
= link_to new_project_path, title: 'New project', data: {toggle: 'tooltip', placement: 'bottom'} do
= icon('plus fw')
%li
= link_to profile_path, title: 'Profile settings', data: {toggle: 'tooltip', placement: 'bottom'} do
= icon('cog fw')
%li
= link_to destroy_user_session_path, class: 'logout', method: :delete, title: 'Sign out', data: {toggle: 'tooltip', placement: 'bottom'} do
= icon('sign-out')
= render 'shared/outdated_browser'
......@@ -2,8 +2,8 @@
- header_title project_title(@project)
- sidebar "project" unless sidebar
- content_for :scripts_head do
-if current_user
- content_for :scripts_body_top do
- if current_user
:javascript
window.project_uploads_path = "#{namespace_project_uploads_path @project.namespace, @project}";
window.markdown_preview_path = "#{markdown_preview_namespace_project_path(@project.namespace, @project)}";
......
......@@ -4,7 +4,7 @@
= check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, class: "selected_issue", disabled: !can?(current_user, :modify_issue, issue)
.issue-title
%span.str-truncated
%span.issue-title-text
= link_to_gfm issue.title, issue_path(issue), class: "row_title"
.issue-labels
- issue.labels.each do |label|
......
%li{ class: mr_css_classes(merge_request) }
.merge-request-title
%span.str-truncated
%span.merge-request-title-text
= link_to_gfm merge_request.title, merge_request_path(merge_request), class: "row_title"
.merge-request-labels
- merge_request.labels.each do |label|
......
......@@ -4,9 +4,10 @@
= render 'shared/issuable_search_form', path: namespace_project_merge_requests_path(@project.namespace, @project)
- if can? current_user, :write_merge_request, @project
= link_to new_namespace_project_merge_request_path(@project.namespace, @project), class: "btn btn-new pull-left", title: "New Merge Request" do
%i.fa.fa-plus
New Merge Request
.pull-left.hidden-xs
= link_to new_namespace_project_merge_request_path(@project.namespace, @project), class: "btn btn-new", title: "New Merge Request" do
%i.fa.fa-plus
New Merge Request
= render 'shared/issuable_filter', type: :merge_requests
.merge-requests-holder
= render 'merge_requests'
......@@ -15,7 +15,7 @@
.clearfix.js-toggle-container
= form_tag namespace_project_project_members_path(@project.namespace, @project), method: :get, class: 'form-inline member-search-form' do
.form-group
= search_field_tag :search, params[:search], { placeholder: 'Find existing member by name', class: 'form-control search-text-input input-mn-300' }
= search_field_tag :search, params[:search], { placeholder: 'Find existing member by name', class: 'form-control search-text-input' }
= button_tag 'Search', class: 'btn'
- if !membership_locked? && can?(current_user, :admin_project_member, @project)
......
......@@ -5,7 +5,7 @@
= hidden_field_tag :scope, params[:scope]
.search-holder.clearfix
.form-group
= search_field_tag :search, params[:search], placeholder: "Search for projects, issues etc", class: "form-control search-text-input input-mn-300", id: "dashboard_search", autofocus: true
= search_field_tag :search, params[:search], placeholder: "Search for projects, issues etc", class: "form-control search-text-input", id: "dashboard_search", autofocus: true
= button_tag 'Search', class: "btn btn-primary"
- unless params[:snippets].eql? 'true'
.pull-right
......
= form_tag(path, method: :get, id: "issue_search_form", class: 'pull-left issue-search-form') do
.append-right-10.hidden-xs.hidden-sm
= search_field_tag :issue_search, params[:issue_search], { placeholder: 'Filter by title or description', class: 'form-control issue_search search-text-input input-mn-300' }
= search_field_tag :issue_search, params[:issue_search], { placeholder: 'Filter by title or description', class: 'form-control issue_search search-text-input' }
= hidden_field_tag :state, params['state']
= hidden_field_tag :scope, params['scope']
= hidden_field_tag :assignee_id, params['assignee_id']
......
......@@ -16,6 +16,3 @@
%span.pull-right.light
%i.fa.fa-star
= project.star_count
- else
%span.arrow
%i.fa.fa-angle-right
......@@ -13,7 +13,7 @@
%h3
= @user.name
- if @user == current_user
.pull-right
.pull-right.hidden-xs
= link_to profile_path, class: 'btn btn-sm' do
%i.fa.fa-pencil-square-o
Edit Profile settings
......
......@@ -3,6 +3,7 @@
## User documentation
- [API](api/README.md) Automate GitLab via a simple and powerful API.
- [Importing to GitLab](workflow/importing/README.md).
- [Markdown](markdown/markdown.md) GitLab's advanced formatting system.
- [Permissions](permissions/permissions.md) Learn what each role in a project (guest/reporter/developer/master/owner) can do.
- [Project Services](project_services/project_services.md) Integrate a project with external services, such as CI and chat.
......@@ -36,4 +37,4 @@
- [Development](development/README.md) Explains the architecture and the guidelines for shell commands.
- [Legal](legal/README.md) Contributor license agreements.
- [Release](release/README.md) How to make the monthly and security releases.
\ No newline at end of file
- [Release](release/README.md) How to make the monthly and security releases.
# Import your project from Bitbucket to GitLab
It takes just a few steps to import your existing Bitbucket projects to GitLab. But keep in mind that it is possible only if Bitbucket support is enabled on your GitLab instance. You can read more about Bitbucket support [here](doc/integration/bitbucket.md).
1. Sign in to GitLab.com and go to your dashboard
2. Click on "New project"
![New project in GitLab](bitbucket_importer/bitbucket_import_new_project.jpg)
3. Click on the "Bitbucket" button
![Bitbucket](bitbucket_importer/bitbucket_import_select_bitbucket.jpg)
4. Grant GitLab access to your Bitbucket account
![Grant access](bitbucket_importer/bitbucket_import_grant_access.jpg)
5. Click on the projects that you'd like to import or "Import all projects"
![Import projects](bitbucket_importer/bitbucket_import_select_project.png)
A new GitLab project will be created with your imported data.
# Import your project from Bitbucket to GitLab
It takes just a few steps to import your existing Bitbucket projects to GitLab. But keep in mind that it is possible only if Bitbucket support is enabled on your GitLab instance. You can read more about Bitbucket support [here](doc/integration/bitbucket.md).
* Sign in to GitLab.com and go to your dashboard
* Click on "New project"
![New project in GitLab](bitbucket_importer/bitbucket_import_new_project.jpg)
* Click on the "Bitbucket" button
![Bitbucket](bitbucket_importer/bitbucket_import_select_bitbucket.jpg)
* Grant GitLab access to your Bitbucket account
![Grant access](bitbucket_importer/bitbucket_import_grant_access.jpg)
* Click on the projects that you'd like to import or "Import all projects"
![Import projects](bitbucket_importer/bitbucket_import_select_project.png)
A new GitLab project will be created with your imported data.
### Note
Milestones and wiki pages are not imported from Bitbucket.
\ No newline at end of file
# Import your project from GitHub to GitLab
It takes just a couple of steps to import your existing GitHub projects to GitLab. Keep in mind that it is possible only if
GitHub support is enabled on your GitLab instance. You can read more about GitHub support [here](http://doc.gitlab.com/ce/integration/github.html)
1. Sign in to GitLab.com and go to your dashboard.
2. To get to the importer page, you need to go to the "New project" page.
![New project page](github_importer/new_project_page.png)
3. Click on the "Import project from GitHub" link and you will be redirected to GitHub for permission to access your projects. After accepting, you'll be automatically redirected to the importer.
![Importer page](github_importer/importer.png)
4. To import a project, you can simple click "Add". The importer will import your repository and issues. Once the importer is done, a new GitLab project will be created with your imported data.
### Note
When you import your projects from GitHub, it is not possible to keep your labels and milestones and issue numbers won't match. We are working on improving this in the near future.
# Import your project from GitHub to GitLab
It takes just a couple of steps to import your existing GitHub projects to GitLab. Keep in mind that it is possible only if
GitHub support is enabled on your GitLab instance. You can read more about GitHub support [here](http://doc.gitlab.com/ce/integration/github.html)
* Sign in to GitLab.com and go to your dashboard.
* To get to the importer page, you need to go to the "New project" page.
![New project page](github_importer/new_project_page.png)
* Click on the "Import project from GitHub" link and you will be redirected to GitHub for permission to access your projects. After accepting, you'll be automatically redirected to the importer.
![Importer page](github_importer/importer.png)
* To import a project, you can simple click "Add". The importer will import your repository and issues. Once the importer is done, a new GitLab project will be created with your imported data.
### Note
When you import your projects from GitHub, it is not possible to keep your labels and milestones and issue numbers won't match. We are working on improving this in the near future.
\ No newline at end of file
......@@ -12,6 +12,7 @@ This styleguide recommends best practices to improve documentation and to keep i
* Be brief and clear.
* Whenever it applies, add documents in alphabetical order.
## When adding images to a document
......
......@@ -168,7 +168,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps
end
step 'I click on my profile picture' do
click_link 'profile-pic'
find(:css, '.sidebar-user').click
end
step 'I should see my user page' do
......
......@@ -4,11 +4,7 @@ module Gitlab
def initialize(project_id, query, repository_ref = nil)
@project = Project.find(project_id)
@repository_ref = if repository_ref.present?
repository_ref
else
nil
end
@repository_ref = repository_ref
@query = Shellwords.shellescape(query) if query.present?
end
......
......@@ -14,14 +14,31 @@ describe Mentionable do
end
describe Issue, "Mentionable" do
describe :mentioned_users do
describe '#mentioned_users' do
let!(:user) { create(:user, username: 'stranger') }
let!(:user2) { create(:user, username: 'john') }
let!(:issue) { create(:issue, description: '@stranger mentioned') }
let!(:issue) { create(:issue, description: "#{user.to_reference} mentioned") }
subject { issue.mentioned_users }
it { is_expected.to include(user) }
it { is_expected.not_to include(user2) }
end
describe '#create_cross_references!' do
let(:project) { create(:project) }
let(:author) { double('author') }
let(:commit) { project.commit }
let(:commit2) { project.commit }
let!(:issue) do
create(:issue, project: project, description: commit.to_reference)
end
it 'correctly removes already-mentioned Commits' do
expect(Note).not_to receive(:create_cross_reference_note)
issue.create_cross_references!(project, author, [commit2])
end
end
end
......@@ -21,8 +21,6 @@ module LoginHelpers
# Requires Javascript driver.
def logout
within '.logout-holder' do
find(:css, ".fa.fa-sign-out").click
end
find(:css, ".logout").click
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment