Skip to content
Snippets Groups Projects
Commit eefb27f5 authored by Sebastian Ziebell's avatar Sebastian Ziebell
Browse files

Merge branch 'master' into fixes/api

Conflicts:
	spec/requests/api/projects_spec.rb
parents 1b97a2ee b7ac654b
No related branches found
No related tags found
1 merge request!2835Fix API return codes
Showing
with 96 additions and 92 deletions
Loading
Loading
@@ -2,7 +2,7 @@
.rbx/
db/*.sqlite3
db/*.sqlite3-journal
log/*.log
log/*.log*
tmp/
.sass-cache/
coverage/*
Loading
Loading
@@ -20,6 +20,7 @@ config/database.yml
config/initializers/omniauth.rb
config/unicorn.rb
config/resque.yml
config/aws.yml
db/data.yml
.idea
.DS_Store
Loading
Loading
Loading
Loading
@@ -70,6 +70,9 @@ gem "github-markup", "~> 0.7.4", require: 'github/markup'
# Servers
gem "unicorn", "~> 4.4.0"
 
# State machine
gem "state_machine"
# Issue tags
gem "acts-as-taggable-on", "2.3.3"
 
Loading
Loading
Loading
Loading
@@ -425,6 +425,7 @@ GEM
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
stamp (0.3.0)
state_machine (1.1.2)
temple (0.5.5)
test_after_commit (0.0.1)
therubyracer (0.10.2)
Loading
Loading
@@ -536,6 +537,7 @@ DEPENDENCIES
slim
spinach-rails
stamp
state_machine
test_after_commit
therubyracer
thin
Loading
Loading
Loading
Loading
@@ -49,6 +49,10 @@ $ ->
# Bottom tooltip
$('.has_bottom_tooltip').tooltip(placement: 'bottom')
 
# Form submitter
$('.trigger-submit').on 'change', ->
$(@).parents('form').submit()
# Flash
if (flash = $("#flash-container")).length > 0
flash.click -> $(@).slideUp("slow")
Loading
Loading
Loading
Loading
@@ -27,7 +27,7 @@ class MergeRequest
this.$el.find(selector)
 
initMergeWidget: ->
this.showState( @opts.current_state )
this.showState( @opts.current_status )
 
if this.$('.automerge_widget').length and @opts.check_enable
$.get @opts.url_to_automerge_check, (data) =>
Loading
Loading
Loading
Loading
@@ -63,7 +63,7 @@
color: $style_color;
text-shadow: 0 1px 1px #FFF;
font-family: 'Yanone', sans-serif;
font-size: 26px;
line-height: 42px;
font-size: 24px;
line-height: 36px;
font-weight: normal;
}
Loading
Loading
@@ -29,7 +29,7 @@
a{
color: $style_color;
}
> span {
font-family: $monospace_font;
font-size: 14px;
Loading
Loading
@@ -124,7 +124,7 @@
.wrap{
display: inline-block;
}
.frame {
display: inline-block;
background-color: #fff;
Loading
Loading
@@ -149,7 +149,7 @@
 
.view.swipe{
position: relative;
.swipe-frame{
display: block;
margin: auto;
Loading
Loading
@@ -228,7 +228,7 @@
bottom: 0px;
left: 50%;
margin-left: -150px;
.drag-track{
display: block;
position: absolute;
Loading
Loading
@@ -237,7 +237,7 @@
width: 276px;
background: url('onion_skin_sprites.gif') -4px -20px repeat-x;
}
.dragger {
display: block;
position: absolute;
Loading
Loading
@@ -248,7 +248,7 @@
background: url('onion_skin_sprites.gif') 0px -34px repeat-x;
cursor: pointer;
}
.transparent {
display: block;
position: absolute;
Loading
Loading
@@ -258,7 +258,7 @@
width: 10px;
background: url('onion_skin_sprites.gif') -2px 0px no-repeat;
}
.opaque {
display: block;
position: absolute;
Loading
Loading
@@ -275,19 +275,19 @@
 
padding: 10px;
text-align: center;
background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #eee), to(#dfdfdf));
background-image: -webkit-linear-gradient(#eee 6.6%, #dfdfdf);
background-image: -moz-linear-gradient(#eee 6.6%, #dfdfdf);
background-image: -o-linear-gradient(#eee 6.6%, #dfdfdf);
ul, li{
list-style: none;
margin: 0;
padding: 0;
display: inline-block;
}
li{
color: grey;
border-left: 1px solid #c1c1c1;
Loading
Loading
@@ -322,12 +322,12 @@
}
.commit-author, .commit-committer{
display: block;
color: #999;
font-weight: normal;
color: #999;
font-weight: normal;
font-style: italic;
}
.commit-author strong, .commit-committer strong{
font-weight: bold;
font-weight: bold;
font-style: normal;
}
 
Loading
Loading
@@ -337,7 +337,6 @@
*/
.commit {
.browse_code_link_holder {
@extend .span2;
float: right;
}
 
Loading
Loading
Loading
Loading
@@ -5,15 +5,16 @@
header {
&.navbar-gitlab {
.navbar-inner {
height: 45px;
padding: 5px;
height: 40px;
padding: 3px;
background: #F1F1F1;
filter: none;
 
.nav > li > a {
color: $style_color;
text-shadow: 0 1px 0 #fff;
font-size: 18px;
padding: 12px;
font-size: 16px;
padding: 10px;
}
 
/** NAV block with links and profile **/
Loading
Loading
@@ -25,7 +26,6 @@ header {
}
 
z-index: 10;
/*height: 60px;*/
 
/**
*
Loading
Loading
@@ -34,7 +34,7 @@ header {
*/
.app_logo {
float: left;
margin-right: 15px;
margin-right: 9px;
position: relative;
top: -5px;
padding-top: 5px;
Loading
Loading
@@ -42,10 +42,10 @@ header {
a {
float: left;
padding: 0px;
margin: 0 10px;
margin: 0 6px;
 
h1 {
background: url('logo_dark.png') no-repeat 0px 2px;
background: url('logo_dark.png') no-repeat center 1px;
float: left;
height: 40px;
width: 40px;
Loading
Loading
@@ -79,7 +79,6 @@ header {
.search {
margin-right: 45px;
margin-left: 10px;
margin-top: 2px;
 
.search-input {
@extend .span2;
Loading
Loading
@@ -105,7 +104,7 @@ header {
.account-box {
position: absolute;
right: 0;
top: 6px;
top: 4px;
z-index: 10000;
width: 128px;
font-size: 11px;
Loading
Loading
@@ -228,6 +227,7 @@ header {
.search-input {
background-color: #D2D5DA;
background-color: rgba(255, 255, 255, 0.5);
border: 1px solid #AAA;
 
&:focus {
background-color: white;
Loading
Loading
@@ -240,13 +240,16 @@ header {
.app_logo {
a {
h1 {
background: url('logo_white.png') no-repeat center center;
background: url('logo_white.png') no-repeat center 1px;
color: #fff;
text-shadow: 0 1px 1px #111;
}
}
}
.project_name {
a {
color: #FFF;
}
color: #fff;
text-shadow: 0 1px 1px #111;
}
Loading
Loading
@@ -261,11 +264,11 @@ header {
 
.separator {
float: left;
height: 60px;
height: 46px;
width: 1px;
background: white;
border-left: 1px solid #DDD;
margin-top: -10px;
margin-top: -3px;
margin-left: 10px;
margin-right: 10px;
}
Loading
Loading
Loading
Loading
@@ -115,3 +115,7 @@ ul.nav.nav-projects-tabs {
}
}
}
.team_member_row form {
margin: 0px;
}
Loading
Loading
@@ -8,66 +8,27 @@
*
*/
.ui_mars {
/*
* Application Header
*
*/
header {
@extend .header-dark;
&.navbar-gitlab {
.navbar-inner {
background: #474D57 url('bg-header.png') repeat-x bottom;
border-bottom: 1px solid #444;
.nav > li > a {
color: #eee;
text-shadow: 0 1px 0 #444;
background: #474D57;
border-bottom: 1px solid #373D47;
.app_logo {
&:hover {
background-color: #373D47;
}
}
}
}
 
.search {
float: right;
margin-right: 45px;
.search-input {
border: 1px solid rgba(0, 0, 0, 0.7);
background-color: #D2D5DA;
background-color: rgba(255, 255, 255, 0.5);
&:focus {
background-color: white;
}
}
}
.search-input::-webkit-input-placeholder {
color: #666;
}
.app_logo {
a {
h1 {
background: url('logo_white.png') no-repeat center center;
color: #eee;
text-shadow: 0 1px 1px #111;
}
}
&:hover {
background-color: #41464e;
}
}
.project_name {
color: #eee;
text-shadow: 0 1px 1px #111;
.separator {
background: #31363E;
border-left: 1px solid #666;
}
}
.separator {
background: #31363E;
border-left: 1px solid #666;
}
/*
* End of Application Header
*
*/
}
Loading
Loading
@@ -14,7 +14,7 @@ class MergeRequestsLoadContext < BaseContext
end
 
merge_requests = merge_requests.page(params[:page]).per(20)
merge_requests = merge_requests.includes(:author, :project).order("closed, created_at desc")
merge_requests = merge_requests.includes(:author, :project).order("state, created_at desc")
 
# Filter by specific assignee_id (or lack thereof)?
if params[:assignee_id].present?
Loading
Loading
Loading
Loading
@@ -38,6 +38,8 @@ module Projects
if @project.valid? && @project.import_url.present?
shell = Gitlab::Shell.new
if shell.import_repository(@project.path_with_namespace, @project.import_url)
# We should create satellite for imported repo
@project.satellite.create unless @project.satellite.exists?
true
else
@project.errors.add(:import_url, 'cannot clone repo')
Loading
Loading
Loading
Loading
@@ -5,7 +5,7 @@ class DashboardController < ApplicationController
before_filter :event_filter, only: :show
 
def show
@groups = current_user.authorized_groups
@groups = current_user.authorized_groups.sort_by(&:human_name)
@has_authorized_projects = @projects.count > 0
@teams = current_user.authorized_teams
@projects_count = @projects.count
Loading
Loading
class FilesController < ApplicationController
def download
note = Note.find(params[:id])
if can?(current_user, :read_project, note.project)
uploader = note.attachment
send_file uploader.file.path, disposition: 'attachment'
else
not_found!
end
end
end
Loading
Loading
@@ -73,14 +73,14 @@ class MergeRequestsController < ProjectResourceController
if @merge_request.unchecked?
@merge_request.check_if_can_be_merged
end
render json: {state: @merge_request.human_state}
render json: {merge_status: @merge_request.human_merge_status}
rescue Gitlab::SatelliteNotExistError
render json: {state: :no_satellite}
render json: {merge_status: :no_satellite}
end
 
def automerge
return access_denied! unless can?(current_user, :accept_mr, @project)
if @merge_request.open? && @merge_request.can_be_merged?
if @merge_request.opened? && @merge_request.can_be_merged?
@merge_request.should_remove_source_branch = params[:should_remove_source_branch]
@merge_request.automerge!(current_user)
@status = true
Loading
Loading
Loading
Loading
@@ -12,7 +12,7 @@ class MilestonesController < ProjectResourceController
 
def index
@milestones = case params[:f]
when 'all'; @project.milestones.order("closed, due_date DESC")
when 'all'; @project.milestones.order("state, due_date DESC")
when 'closed'; @project.milestones.closed.order("due_date DESC")
else @project.milestones.active.order("due_date ASC")
end
Loading
Loading
Loading
Loading
@@ -51,7 +51,9 @@ class ProfilesController < ApplicationController
end
 
def update_username
@user.update_attributes(username: params[:user][:username])
if @user.can_change_username?
@user.update_attributes(username: params[:user][:username])
end
 
respond_to do |format|
format.js
Loading
Loading
Loading
Loading
@@ -4,7 +4,11 @@ class TeamMembersController < ProjectResourceController
before_filter :authorize_admin_project!, except: [:index, :show]
 
def index
@teams = UserTeam.scoped
@team = @project.users_projects.scoped
@team = @team.send(params[:type]) if %w(masters developers reporters guests).include?(params[:type])
@team = @team.sort_by(&:project_access).reverse.group_by(&:project_access)
@assigned_teams = @project.user_team_project_relationships
end
 
def show
Loading
Loading
Loading
Loading
@@ -27,7 +27,13 @@ class Teams::MembersController < Teams::ApplicationController
end
 
def update
options = {default_projects_access: params[:default_project_access], group_admin: params[:group_admin]}
member_params = params[:team_member]
options = {
default_projects_access: member_params[:permission],
group_admin: member_params[:group_admin]
}
if user_team.update_membership(team_member, options)
redirect_to team_members_path(user_team), notice: "Membership for #{team_member.name} was successfully updated in Team of users."
else
Loading
Loading
@@ -45,5 +51,4 @@ class Teams::MembersController < Teams::ApplicationController
def team_member
@member ||= user_team.members.find_by_username(params[:id])
end
end
Loading
Loading
@@ -9,13 +9,11 @@ class TeamsController < ApplicationController
layout 'user_team', except: [:new, :create]
 
def show
user_team
projects
@events = Event.in_projects(user_team.project_ids).limit(20).offset(params[:offset] || 0)
end
 
def edit
user_team
end
 
def update
Loading
Loading
@@ -41,6 +39,9 @@ class TeamsController < ApplicationController
@team.path = @team.name.dup.parameterize if @team.name
 
if @team.save
# Add current user as Master to the team
@team.add_members([current_user.id], UsersProject::MASTER, true)
redirect_to team_path(@team)
else
render action: :new
Loading
Loading
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