Commit 3f559cc9 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq

Conflicts:
	app/views/help/index.html.haml
parents e34eac08 d3c429ed
......@@ -16,6 +16,8 @@ v 6.0.0
- Generate fingerprint for ssh keys
- You an use arrows to navigate at tree view
- Apply user project limit only for personal projects
- API: Allow login with LDAP credentials
- Ability to remove branches/tags with UI
v 5.4.0
- Ability to edit own comments
......@@ -24,8 +26,13 @@ v 5.4.0
- Fixed nav for empty repos
- GitLab Markdown help page
- Misspelling fixes
- Added suppoort of unicorn and fog gems
- Added support of unicorn and fog gems
- Added client list to API doc
- Fix PostgreSQL database restoration problem
- Increase snippet content column size
- allow project import via git:// url
- Show participants on issues, including mentions
- Notify mentioned users with email
v 5.3.0
- Refactored services
......
......@@ -137,7 +137,7 @@ group :assets do
gem "modernizr", "2.6.2"
gem "raphael-rails", git: "https://github.com/gitlabhq/raphael-rails.git"
gem 'bootstrap-sass'
gem "font-awesome-rails", "~> 3.1.1"
gem "font-awesome-rails"
gem "gemoji", "~> 1.2.1", require: 'emoji/railtie'
gem "gon"
end
......
......@@ -143,7 +143,7 @@ GEM
net-ssh (>= 2.1.3)
nokogiri (~> 1.5.0)
ruby-hmac
font-awesome-rails (3.1.1.3)
font-awesome-rails (3.2.1.2)
railties (>= 3.2, < 5.0)
foreman (0.63.0)
dotenv (>= 0.7)
......@@ -560,7 +560,7 @@ DEPENDENCIES
factory_girl_rails
ffaker
fog (~> 1.3.1)
font-awesome-rails (~> 3.1.1)
font-awesome-rails
foreman
gemoji (~> 1.2.1)
github-linguist
......
......@@ -14,7 +14,7 @@ class Admin
$('.log-bottom').click (e) ->
e.preventDefault()
visible_log = $(".file_content:visible")
visible_log = $(".file-content:visible")
visible_log.animate({ scrollTop: visible_log.find('ol').height() }, "fast")
modal = $('.change-owner-holder')
......
......@@ -50,5 +50,5 @@
callback(users)
buildUrl: (url) ->
url = gon.relative_url_root + url if gon.relative_url_root.present?
url = gon.relative_url_root + url if gon.relative_url_root?
return url.replace(':version', gon.api_version)
......@@ -15,7 +15,7 @@ class Dashboard
uiBox.find(".dash-list li").show()
else
uiBox.find(".dash-list li").each (index) ->
name = $(this).find(".well-title").text()
name = $(this).find(".filter-title").text()
if name.toLowerCase().search(terms.toLowerCase()) == -1
$(this).hide()
......
......@@ -30,7 +30,7 @@ class Dispatcher
new Wall(project_id)
when 'projects:teams:members:index'
new TeamMembers()
when 'groups:people'
when 'groups:members'
new GroupMembers()
when 'projects:tree:show'
new TreeView()
......
......@@ -62,6 +62,9 @@ $ ->
# Click a .one_click_select field, select the contents
$(".one_click_select").on 'click', -> $(@).select()
$('.remove-row').bind 'ajax:success', ->
$(this).closest('li').fadeOut()
# Click a .appear-link, appear-data fadeout
$(".appear-link").on 'click', (e) ->
$('.appear-data').fadeIn()
......
class Network
constructor: (opts) ->
$("#filter_ref").click ->
$(this).closest('form').submit()
branch_graph = new BranchGraph($(".network-graph"), opts)
vph = $(window).height() - 250
$('.network-graph').css 'height': (vph + 'px')
@Network = Network
......@@ -23,6 +23,12 @@ var NoteList = {
$(document).off("click", ".js-note-attachment-input");
$(document).off("click", ".js-close-discussion-note-form");
$(document).off("click", ".js-note-delete");
$(document).off("click", ".js-note-edit");
$(document).off("click", ".js-note-edit-cancel");
$(document).off("click", ".js-note-attachment-delete");
$(document).off("click", ".js-choose-note-attachment-button");
$(document).off("click", ".js-show-outdated-discussion");
$(document).off("ajax:complete", ".js-main-target-form");
......
......@@ -46,7 +46,11 @@ class window.ContributorsGraph
class window.ContributorsMasterGraph extends ContributorsGraph
constructor: (@data) ->
@width = 1100
if $(window).width() > 1214
@width = 1100
else
@width = 870
@height = 125
@x = null
@y = null
......@@ -118,7 +122,11 @@ class window.ContributorsMasterGraph extends ContributorsGraph
class window.ContributorsAuthorGraph extends ContributorsGraph
constructor: (@data) ->
@width = 490
if $(window).width() > 1214
@width = 490
else
@width = 380
@height = 130
@x = null
@y = null
......
......@@ -23,12 +23,8 @@ body {
.help li { color:$style_color; }
.back_link {
text-decoration: underline;
.back-link {
font-size: 14px;
font-weight: bold;
padding: 10px 0;
padding-bottom: 0;
}
table a code {
......@@ -146,23 +142,6 @@ input[type=text] {
}
}
li.commit {
.avatar {
width: 24px;
top:-5px;
margin-right: 10px;
margin-left: 10px;
}
code {
padding: 2px 2px 0;
margin-top: -2px;
&:hover {
color: black;
border: 1px solid #ccc;
}
}
}
p.time {
color: #999;
font-size: 90%;
......@@ -412,7 +391,7 @@ img.emoji {
}
.navless-container {
margin-top: 30px;
margin-top: 20px;
}
.description-block {
......@@ -420,3 +399,8 @@ img.emoji {
@extend .light;
margin-bottom: 10px;
}
.group-name {
font-size: 14px;
line-height: 24px;
}
......@@ -17,9 +17,6 @@
&.s24 { width: 24px; height: 24px; margin-right: 8px; }
&.s26 { width: 26px; height: 26px; margin-right: 8px; }
&.s32 { width: 32px; height: 32px; margin-right: 10px; }
&.s60 { width: 60px; height: 60px; margin-right: 12px; }
&.s90 { width: 90px; height: 90px; margin-right: 15px; }
}
img.lil_av { padding-left: 4px; padding-right: 3px; }
img.small { width: 80px; }
......@@ -11,7 +11,7 @@
*/
.ui-box {
background: #F9F9F9;
margin-bottom: 25px;
margin-bottom: 20px;
border: 1px solid #CCC;
word-wrap: break-word;
@include solid-shade;
......@@ -62,7 +62,6 @@
.ui-box-body {
border: none;
font-size: 12px;
background-color: #f5f5f5;
border: none;
border-top: 1px solid #eee;
......@@ -86,10 +85,11 @@
color: #456;
font-size: 16px;
text-shadow: 0 1px 1px #fff;
padding: 0px 10px;
line-height: 36px;
padding: 0 10px;
font-size: 14px;
line-height: 40px;
font-weight: normal;
margin: 0;
> a {
text-shadow: 0 1px 1px #fff;
......@@ -101,8 +101,7 @@
}
.btn {
position: relative;
top: -2px;
vertical-align: middle;
}
.nav-pills {
......@@ -132,15 +131,6 @@
margin-bottom: 0;
padding: 5px 20px;
}
.middle_title {
background: #f5f5f5;
margin:20px -20px;
padding: 0 20px;
border-top: 1px solid #eee;
border-bottom: 1px solid #eee;
font-size: 14px;
color: #777;
}
}
.row_title {
......
......@@ -43,11 +43,8 @@
}
}
&.success {
@extend .btn-success;
&.btn-success {
&:hover {
@extend .btn-success;
background: #51a351;
}
......@@ -59,7 +56,7 @@
&.btn-create {
@extend .wide;
@extend .success;
@extend .btn-success;
}
&.btn-save {
......
......@@ -68,10 +68,6 @@ input[type='text'].danger {
fieldset legend { font-size: 17px; }
/** PAGINATION **/
.gitlab_pagination {
}
.tab-content {
overflow: visible;
}
......
......@@ -2,12 +2,12 @@
* File content holder
*
*/
.file_holder {
.file-holder {
border: 1px solid #BBB;
margin-bottom: 1em;
@include solid-shade;
.file_title {
.file-title {
border-bottom: 1px solid #bbb;
@include bg-dark-gray-gradient;
margin: 0;
......@@ -33,7 +33,7 @@
}
}
}
.file_content {
.file-content {
background: #fff;
font-size: 11px;
......@@ -48,7 +48,8 @@
&.wiki {
padding: 20px;
font-size: 13px;
font-size: 14px;
line-height: 1.6;
.highlight {
margin-bottom: 9px;
......
......@@ -75,7 +75,6 @@ ul.bordered-list {
display: block;
margin: 0px;
&:last-child { border:none }
&.active {
background: #f9f9f9;
a { font-weight: bold; }
......
......@@ -70,19 +70,24 @@
@mixin header-font {
color: $style_color;
text-shadow: 0 1px 1px #FFF;
font-size: 18px;
font-size: 16px;
line-height: 40px;
font-weight: normal;
letter-spacing: -1px;
}
@mixin md-typography {
code { padding: 0 4px; }
p { font-size: 13px; }
h1 { font-size: 26px; line-height: 40px; margin: 10px 0;}
h2 { font-size: 22px; line-height: 40px; margin: 10px 0;}
h3 { font-size: 18px; line-height: 40px; margin: 10px 0;}
h4 { font-size: 16px; line-height: 20px; margin: 10px 0;}
h5 { font-size: 14px; line-height: 20px; margin: 10px 0;}
h6 { font-size: 12px; line-height: 20px; margin: 10px 0;}
h1 { margin-top: 30px;}
h2 { margin-top: 25px;}
h3 { margin-top: 20px;}
h4 { margin-top: 15px;}
}
@mixin page-title {
color: $style_color;
font-size: 20px;
font-weight: normal;
line-height: 1.5;
margin-top: 0px;
margin-bottom: 15px;
}
......@@ -3,15 +3,18 @@
*
*/
h1, h2, h3, h4, h5, h6 { margin: 0; }
h3, h4, h5, h6 { line-height: 36px; }
h5 { font-size: 14px; }
h3.page_title {
color: #456;
font-size: 20px;
font-weight: normal;
line-height: 28px;
h1.page-title {
@include page-title;
font-size: 28px;
}
h2.page-title {
@include page-title;
font-size: 24px;
}
h3.page-title {
@include page-title;
}
h6 {
......@@ -91,11 +94,10 @@ a:focus {
*
*/
.wiki {
font-size: 14px;
line-height: 1.6;
@include md-typography;
font-size: 13px;
line-height: 20px;
.white .highlight pre { background: #f5f5f5; }
ul { margin: 0 0 9px 25px !important; }
}
......
......@@ -437,3 +437,30 @@
border: none;
margin: 0;
}
.ui-box.commit-box {
margin-top: 0;
}
.commit-stat-summary {
color: #666;
line-height: 2;
}
li.commit {
.avatar {
width: 24px;
top:-5px;
margin-right: 5px;
margin-left: 10px;
}
code {
padding: 2px 2px 0;
margin-top: -2px;
&:hover {
color: black;
border: 1px solid #ccc;
}
}
}
......@@ -10,9 +10,6 @@
margin: 0px;
box-shadow: none;
> .title {
padding: 2px 15px;
}
.nav-projects-tabs li { padding: 0; }
}
}
......@@ -33,12 +30,10 @@
.dashboard {
.dash-filter {
margin: 0;
margin: 7px 0;
padding: 4px 6px;
width: 202px;
float: left;
margin-top: 3px;
margin-left: -2px;
}
}
......@@ -71,7 +66,7 @@
}
.project-row, .group-row {
padding: 15px !important;
padding: 12px 15px !important;
.namespace-name {
color: #666;
......
......@@ -31,6 +31,10 @@
*
*/
.event-item {
&:first-child {
padding-top: 0;
}
border-bottom: 1px solid #eee;
.event-title {
color: #333;
......@@ -99,7 +103,7 @@
}
}
padding: 16px 5px;
padding: 14px 0px;
&:last-child { border:none }
.event_commits {
......@@ -125,30 +129,6 @@
}
}
/**
* Push event widget
*
*/
.event_lp {
color: #777;
padding: 10px;
min-height: 22px;
border-left: 5px solid $primary_color;
margin-bottom: 20px;
background: #f9f9f9;
.avatar {
width: 24px;
}
.btn-new-mr {
@extend .btn-primary;
@extend .small;
@extend .pull-right;
margin: -2px;
}
}
/**
* Event filter
*
......
.graph_holder {
.project-network {
border: 1px solid #aaa;
padding: 1px;
h4 {
padding: 0 10px;
.tip {
color: #888;
font-size: 14px;
padding: 10px;
border-bottom: 1px solid #bbb;
@include bg-gray-gradient;
}
.graph {
.network-graph {
background: #f1f1f1;
height: 500px;
overflow-y: scroll;
......
......@@ -13,7 +13,7 @@ header {
.nav > li > a {
color: $style_color;
text-shadow: 0 1px 0 #fff;
font-size: 16px;
font-size: 14px;
padding: 10px;
}
......@@ -45,6 +45,7 @@ header {
margin: 0 6px;
h1 {
margin: 0;
background: url('logo-black.png') no-repeat center 1px;
background-size: 38px;
float: left;
......@@ -68,7 +69,7 @@ header {
position: relative;
float: left;
margin: 0;
margin-left: 10px;
margin-left: 5px;
@include header-font;
}
......@@ -92,7 +93,7 @@ header {
margin-left: 10px;
.search-input {
@extend .span2;
@extend .span3;
background-image: url("icon-search.png");
background-repeat: no-repeat;
background-position: 10px;
......@@ -103,7 +104,7 @@ header {
box-shadow: none;
@include transition(all 0.15s ease-in 0s);
&:focus {
@extend .span3;
@extend .span4;
}
}
}
......@@ -160,7 +161,7 @@ header {
}
.project_name {
a {
color: #DDD;
color: #BBB;
&:hover {
color: #FFF;
}
......
......@@ -82,10 +82,6 @@
}
}
.mr_direction_tip {
margin-top:40px
}
.label-branch {
@include border-radius(4px);
padding: 2px 4px;
......@@ -113,3 +109,12 @@
}
}
}
.merge-request-angle {
text-align: center;
margin-top: 45px;
}
.merge-request-form-info {
padding: 15px 0;
}
.main-nav {
background: #f5f5f5;
margin: 30px 0;
margin: 20px 0;
margin-top: 0;
padding-top: 4px;
border-bottom: 1px solid #E1E1E1;
ul {
margin: auto;
height: 40px;
height: 42px;
overflow: hidden;
.count {
font-weight: normal;
......@@ -74,7 +74,7 @@
text-align: center;
font-weight: normal;
height: 38px;
line-height: 34px;
line-height: 36px;
color: #777;
text-shadow: 0 1px 1px white;
padding: 0 10px;
......
.profile_history {
.event_feed {
min-height: 20px;
.avatar {
width: 20px;
}
}
}
.profile_avatar_holder {
float: left;
width: 60px;
height: 60px;
margin-right: 20px;
img {
width: 60px;
height: 60px;
background: #fff;
padding: 1px;
border: 1px solid #ddd;
}
}
.save-status-fixed {
position: fixed;
left: 20px;
......
......@@ -48,7 +48,7 @@
margin-bottom: 50px;
}
h3 {
@extend .page_title;
@extend .page-title;
}
}
......@@ -86,8 +86,13 @@ ul.nav.nav-projects-tabs {
border-bottom: 1px solid #eee;
.description {
margin-left: 22px;
margin-left: 15px;
color: #aaa;
}
}
}
.new-tag-btn {
position: relative;
top: -5px;
}
.snippet.file_holder {
.file_title {
.snippet.file-holder {
.file-title {
.snippet-file-name {
position: relative;
top: -4px;
......@@ -7,3 +7,9 @@
}
}
}
.my-snippets li:first-child {
h4 { margin-top: 0; }
padding-top: 0;
}
......@@ -14,27 +14,29 @@
font-size: 10px;
}
#contributors .person {
&:nth-child(even) {
float: right;
#contributors {
.contributors-list {
margin: 0 0 10px 0;
list-style: none;
padding: 0;
}
float: left;
margin-top: 10px;
}
.contributors-list {
margin: 0 0 10px 0;
list-style: none;
padding: 0;
}
.person {
&:nth-child(even) {
float: right;
}
float: left;
margin-top: 10px;
}
#contributors .person .spark {
display: block;
background: #f3f3f3;
}
.person .spark {
display: block;
background: #f3f3f3;
}
#contributors .person .area-contributor {
fill: #f17f49;
.person .area-contributor {
fill: #f17f49;
}
}
.selection rect {
......
......@@ -27,7 +27,7 @@
}
}
.votes-block {
margin: 14px 6px 6px 0;
margin: 6px;
.downvotes {
float: right;
}
......
h3.page_title .edit-wiki-header {
h3.page-title .edit-wiki-header {
width: 780px;
margin-left: auto;
margin-right: auto;
......
......@@ -31,4 +31,8 @@
border-left: 1px solid #666;
}
}
.main-nav {
box-shadow: 0 -1px 0 white inset;
}
}
......@@ -91,6 +91,10 @@ class ApplicationController < ActionController::Base
return access_denied! unless can?(current_user, :download_code, project) or project.public?
end
def authorize_push!
return access_denied! unless can?(current_user, :push_code, project)
end
def authorize_create_team!
return access_denied! unless can?(current_user, :create_team, nil)
end
......
......@@ -35,8 +35,6 @@ class DashboardController < ApplicationController
current_user.authorized_projects
end.sorted_by_activity
@projects = @projects.search(params[:search]) if params[:search].present?
@labels = current_user.authorized_projects.tags_on(:labels)
@projects = @projects.tagged_with(params[:label]) if params[:label].present?
......
......@@ -61,7 +61,7 @@ class GroupsController < ApplicationController
end
end
def people
def members
@project = group.projects.find(params[:project_id]) if params[:project_id]
@members = group.users_groups.order('group_access DESC')
@users_group = UsersGroup.new
......
class Profiles::GroupsController < ApplicationController
layout "profile"
def index
@groups = current_user.authorized_groups.page(params[:page]).per(20)
end
def leave
@users_group = group.users_groups.where(user_id: current_user.id).first
if group.owner == current_user
redirect_to(profile_groups_path, alert: "You can't leave group. You must transfer it to another owner before leaving.")
else
@users_group.destroy
redirect_to(profile_groups_path, info: "You left #{group.name} group.")
end
end
private
def group
@group ||= Group.find_by_path(params[:id])
end
end
class Projects::BranchesController < Projects::ApplicationController
# Authorize
before_filter :authorize_read_project!
before_filter :require_non_empty_project
before_filter :authorize_code_access!
before_filter :authorize_push!, only: [:create]
before_filter :authorize_admin_project!, only: [:destroy]
def index
@branches = Kaminari.paginate_array(@repository.branches).page(params[:page]).per(30)
end
def create
@repository.add_branch(params[:branch_name], params[:ref])
if new_branch = @repository.find_branch(params[:branch_name])
Event.create_ref_event(@project, current_user, new_branch, 'add')
end
redirect_to project_branches_path(@project)
end
def destroy
branch = @repository.find_branch(params[:id])
if branch && @repository.rm_branch(branch.name)
Event.create_ref_event(@project, current_user, branch, 'rm')
end
respond_to do |format|
format.html { redirect_to project_branches_path(@project) }
format.js { render nothing: true }
end
end
end
......@@ -8,14 +8,6 @@ class Projects::RepositoriesController < Projects::ApplicationController
@activities = @repository.commits_with_refs(20)
end
def branches
@branches = @repository.branches
end
def tags
@tags = @repository.tags
end
def stats
@stats = Gitlab::Git::Stats.new(@repository.raw, @repository.root_ref)
@graph = @stats.graph
......@@ -26,7 +18,6 @@ class Projects::RepositoriesController < Projects::ApplicationController
render_404 and return
end
storage_path = Rails.root.join("tmp", "repositories")
file_path = @repository.archive_repo(params[:ref], storage_path)
......
class Projects::TagsController < Projects::ApplicationController
# Authorize
before_filter :authorize_read_project!
before_filter :require_non_empty_project
before_filter :authorize_code_access!
before_filter :authorize_push!, only: [:create]
before_filter :authorize_admin_project!, only: [:destroy]
def index
@tags = Kaminari.paginate_array(@repository.tags).page(params[:page]).per(30)
end
def create
@repository.add_tag(params[:tag_name], params[:ref])
if new_tag = @repository.find_tag(params[:tag_name])
Event.create_ref_event(@project, current_user, new_tag, 'add', 'refs/tags')
end
redirect_to project_tags_path(@project)
end
def destroy
tag = @repository.find_tag(params[:id])
if tag && @repository.rm_tag(tag.name)
Event.create_ref_event(@project, current_user, tag, 'rm', 'refs/tags')
end
respond_to do |format|
format.html { redirect_to project_tags_path }
format.js { render nothing: true }
end
end
end
......@@ -9,7 +9,7 @@ class UsersGroupsController < ApplicationController
def create
@group.add_users(params[:user_ids].split(','), params[:group_access])
redirect_to people_group_path(@group), notice: 'Users were successfully added.'
redirect_to members_group_path(@group), notice: 'Users were successfully added.'
end
def update
......@@ -21,7 +21,7 @@ class UsersGroupsController < ApplicationController
@users_group.destroy unless @users_group.user == @group.owner
respond_to do |format|
format.html { redirect_to people_group_path(@group), notice: 'User was successfully removed from group.' }
format.html { redirect_to members_group_path(@group), notice: 'User was successfully removed from group.' }
format.js { render nothing: true }
end
end
......
......@@ -134,7 +134,7 @@ module CommitsHelper
parts = @path.split('/')
parts.each_with_index do |part, i|
crumbs += content_tag(:span, '/', class: 'divider')
crumbs += content_tag(:span, ' / ', class: 'divider')
crumbs += content_tag(:li) do
# The text is just the individual part, but the link needs all the parts before it
link_to part, project_commits_path(@project, tree_join(@ref, parts[0..i].join('/')))
......
......@@ -81,8 +81,8 @@ module TabHelper
end
def branches_tab_class
if current_page?(branches_project_repository_path(@project)) ||
current_controller?(:protected_branches) ||
if current_controller?(:protected_branches) ||
current_controller?(:branches) ||
current_page?(project_repository_path(@project))
'active'
end
......
......@@ -54,6 +54,27 @@ class Event < ActiveRecord::Base
Event::COMMENTED
end
end
def create_ref_event(project, user, ref, action = 'add', prefix = 'refs/heads')
if action.to_s == 'add'
before = '00000000'
after = ref.commit.id
else
before = ref.commit.id
after = '00000000'
end
Event.create(
project: project,
action: Event::PUSHED,
data: {
ref: "#{prefix}/#{ref.name}",
before: before,
after: after
},
author_id: user.id
)
end
end
def proper?
......
......@@ -21,11 +21,11 @@ class Key < ActiveRecord::Base
attr_accessible :key, :title
before_validation :strip_white_space
before_validation :strip_white_space, :generate_fingerpint
validates :title, presence: true, length: { within: 0..255 }
validates :key, presence: true, length: { within: 0..5000 }, format: { with: /\Assh-.*\Z/ }, uniqueness: true
validate :fingerprintable_key
validates :key, presence: true, length: { within: 0..5000 }, format: { with: /\A(ssh|ecdsa)-.*\Z/ }, uniqueness: true
validates :fingerprint, uniqueness: true, presence: { message: 'cannot be generated' }
delegate :name, :email, to: :user, prefix: true
......@@ -33,15 +33,6 @@ class Key < ActiveRecord::Base
self.key = key.strip unless key.blank?
end
def fingerprintable_key
return true unless key # Don't test if there is no key.
unless generate_fingerpint
errors.add(:key, "can't be fingerprinted")
false
end
end
# projects that has this key
def projects
user.authorized_projects
......@@ -54,26 +45,21 @@ class Key < ActiveRecord::Base
private
def generate_fingerpint
self.fingerprint = nil
return unless key.present?
cmd_status = 0
cmd_output = ''
file = Tempfile.new('gitlab_key_file')
begin
Tempfile.open('gitlab_key_file') do |file|
file.puts key
file.rewind
cmd_output, cmd_status = popen("ssh-keygen -lf #{file.path}", '/tmp')
ensure
file.close
file.unlink # deletes the temp file
end
if cmd_status.zero?
cmd_output.gsub /([\d\h]{2}:)+[\d\h]{2}/ do |match|
self.fingerprint = match
end
true
else
false
end
end
end
......@@ -88,7 +88,7 @@ class Project < ActiveRecord::Base
validates_uniqueness_of :path, scope: :namespace_id
validates :import_url,
format: { with: URI::regexp(%w(http https)), message: "should be a valid url" },
format: { with: URI::regexp(%w(git http https)), message: "should be a valid url" },
if: :import?
validate :check_limit
......
class Repository
include Gitlab::ShellAdapter
attr_accessor :raw_repository
def initialize(path_with_namespace, default_branch)
......@@ -33,6 +35,38 @@ class Repository
commits
end
def find_branch(name)
branches.find { |branch| branch.name == name }
end
def find_tag(name)
tags.find { |tag| tag.name == name }
end
def add_branch(branch_name, ref)
Rails.cache.delete(cache_key(:branch_names))
gitlab_shell.add_branch(path_with_namespace, branch_name, ref)
end
def add_tag(tag_name, ref)
Rails.cache.delete(cache_key(:tag_names))
gitlab_shell.add_tag(path_with_namespace, tag_name, ref)
end
def rm_branch(branch_name)
Rails.cache.delete(cache_key(:branch_names))
gitlab_shell.rm_branch(path_with_namespace, branch_name)
end
def rm_tag(tag_name)
Rails.cache.delete(cache_key(:tag_names))
gitlab_shell.rm_tag(path_with_namespace, tag_name)
end
def round_commit_count
if commit_count > 10000
'10000+'
......
%h3.page_title Background Jobs
%h3.page-title Background Jobs
%br
.ui-box
%iframe{src: sidekiq_path, width: '100%', height: 900, style: "border: none"}
.admin_dash.row
.span4
.ui-box
%h5.title Projects
.title Projects
.data.padded
= link_to admin_projects_path do
%h1= Project.count
......@@ -9,7 +9,7 @@
= link_to 'New Project', new_project_path, class: "btn btn-small"
.span4
.ui-box
%h5.title Users
.title Users
.data.padded
= link_to admin_users_path do
%h1= User.count
......@@ -17,7 +17,7 @@
= link_to 'New User', new_admin_user_path, class: "btn btn-small"
.span4
.ui-box
%h5.title Groups
.title Groups
.data.padded
= link_to admin_groups_path do
%h1= Group.count
......
%h3.page_title Edit Group
%h3.page-title Edit Group
%hr
= form_for [:admin, @group] do |f|
- if @group.errors.any?
......
%h3.page_title
%h3.page-title
Groups (#{@groups.total_count})
%small
allows you to keep projects organized.
......
%h3.page_title New Group
%h3.page-title New Group
%hr
= form_for [:admin, @group] do |f|
- if @group.errors.any?
......
%h3.page_title
%h3.page-title
Group: #{@group.name}
= link_to edit_admin_group_path(@group), class: "btn btn-small pull-right" do
......@@ -8,7 +8,7 @@
.row
.span6
.ui-box
%h5.title
.title
Group info:
%ul.well-list
%li
......@@ -50,7 +50,7 @@
= @group.created_at.stamp("March 1, 1999")
.ui-box
%h5.title
.title
Projects
%small
(#{@group.projects.count})
......@@ -64,7 +64,7 @@
.span6
.ui-box
%h5.title
.title
Add user(s) to the group:
.ui-box-body.form-holder
%p.light
......@@ -79,7 +79,7 @@
%hr
= submit_tag 'Add users into group', class: "btn btn-create"
.ui-box
%h5.title
.title
%strong #{@group.name}
Group Members
%small
......
......@@ -11,57 +11,57 @@
%p.light To prevent performance issues admin logs output the last 2000 lines
.tab-content
.tab-pane.active#githost
.file_holder#README
.file_title
.file-holder#README
.file-title
%i.icon-file
githost.log
.pull-right
= link_to '#', class: 'log-bottom' do
%i.icon-arrow-down
Scroll down
.file_content.logs
.file-content.logs
%ol
- Gitlab::GitLogger.read_latest.each do |line|
%li
%p= line
.tab-pane#application
.file_holder#README
.file_title
.file-holder#README
.file-title
%i.icon-file
application.log
.pull-right
= link_to '#', class: 'log-bottom' do
%i.icon-arrow-down
Scroll down
.file_content.logs
.file-content.logs
%ol
- Gitlab::AppLogger.read_latest.each do |line|
%li
%p= line
.tab-pane#production
.file_holder#README
.file_title
.file-holder#README
.file-title
%i.icon-file
production.log
.pull-right
= link_to '#', class: 'log-bottom' do
%i.icon-arrow-down
Scroll down
.file_content.logs
.file-content.logs
%ol
- Gitlab::Logger.read_latest_for('production.log').each do |line|
%li
%p= line
.tab-pane#sidekiq
.file_holder#README
.file_title
.file-holder#README
.file-title
%i.icon-file
sidekiq.log
.pull-right
= link_to '#', class: 'log-bottom' do
%i.icon-arrow-down
Scroll down
.file_content.logs
.file-content.logs
%ol
- Gitlab::Logger.read_latest_for('sidekiq.log').each do |line|
%li
......
%h3.page_title
Projects
= link_to 'New Project', new_project_path, class: "btn btn-small pull-right"
%hr
.row
.span4
.admin-filter
......@@ -41,8 +35,10 @@
= link_to "Reset", admin_projects_path, class: "btn"
.span8
.ui-box
%h5.title
.title
Projects (#{@projects.total_count})
.pull-right
= link_to 'New Project', new_project_path, class: "btn btn-small btn-primary wide"
%ul.well-list
- @projects.each do |project|
%li
......
%h3.page_title
%h3.page-title
Project: #{@project.name_with_namespace}
= link_to edit_project_path(@project), class: "btn pull-right" do
%i.icon-edit
......@@ -7,7 +7,7 @@
.row
.span6
.ui-box
%h5.title
.title
Project info:
%ul.well-list
%li
......@@ -76,7 +76,7 @@
.span6
- if @group
.ui-box
%h5.title
.title
%strong #{@group.name} Group
members (#{@group.users_groups.count})
.pull-right
......@@ -87,7 +87,7 @@
= render 'users_groups/users_group', member: member, show_controls: false
.ui-box
%h5.title
.title
Team
%small
(#{@project.users.count})
......
%h3.page_title
%h3.page-title
#{@user.name} &rarr;
%i.icon-edit
Edit user
......
%h3.page_title
Users
= link_to 'New User', new_admin_user_path, class: "btn btn-small pull-right"
%br
.row
.span3
.admin-filter
......@@ -32,8 +27,10 @@
.span9
.ui-box
%h5.title
.title
Users (#{@users.total_count})
.pull-right
= link_to 'New User', new_admin_user_path, class: "btn btn-small wide btn-primary"
%ul.well-list
- @users.each do |user|
%li
......
%h3.page_title
%h3.page-title
%i.icon-plus
New user
%hr
......
%h3.page_title
%h3.page-title
User:
= @user.name
- if @user.blocked?
......@@ -21,7 +21,7 @@
.row
.span6
.ui-box
%h5.title
.title
Account:
.pull-right
= image_tag gravatar_icon(@user.email, 32), class: "avatar s32"
......@@ -65,7 +65,7 @@
- if @user.users_groups.present?
.ui-box
%h5.title Groups:
.title Groups:
%ul.well-list
- @user.users_groups.each do |user_group|
- group = user_group.group
......@@ -76,7 +76,7 @@
.span6
.ui-box
%h5.title Projects (#{@projects.count})
.title Projects (#{@projects.count})
%ul.well-list
- @projects.sort_by(&:name_with_namespace).each do |project|
- tm = project.team.find_tm(@user.id)
......
= form_tag dashboard_filter_path(entity), method: 'get' do
%fieldset.dashboard-search-filter
= search_field_tag "search", params[:search], { id: 'filter_search', placeholder: 'Search', class: 'search-text-input' }
= button_tag type: 'submit', class: 'btn' do
%i.icon-search
%fieldset
%legend Status:
%ul.nav.nav-pills.nav-stacked
%li{class: ("active" if !params[:status])}
= link_to dashboard_filter_path(entity, status: nil) do
......
.ui-box
%h5.title.clearfix
.title.clearfix
= search_field_tag :filter_group, nil, placeholder: 'Filter by name', class: 'dash-filter'
- if current_user.can_create_group?
%span.pull-right
......@@ -10,7 +10,7 @@
- groups.each do |group|
%li.group-row
= link_to group_path(id: group.path), class: dom_class(group) do
%span.group-name
%span.group-name.filter-title
= truncate(group.name, length: 35)
%span.arrow
%i.icon-angle-right
......
.ui-box
%h5.title.clearfix
.title.clearfix
= search_field_tag :filter_projects, nil, placeholder: 'Filter by name', class: 'dash-filter'
- if current_user.can_create_project?
%span.pull-right
......@@ -15,7 +15,7 @@
- if project.namespace
= project.namespace.human_name
\/
%span.project-name
%span.project-name.filter-title
= truncate(project.name, length: 25)
%span.arrow
%i.icon-angle-right
......
%h3.page_title
%h3.page-title
Issues
%small (assigned to you)
%small.pull-right #{@issues.total_count} issues
%hr
%span.light
&ndash;
Assigned to you
%span.pull-right #{@issues.total_count} issues
.row
.span3
......@@ -13,7 +13,7 @@
- @issues.group_by(&:project).each do |group|
%div.ui-box
- project = group[0]
%h5.title
.title
= link_to_project project
&nbsp;
%i.icon-angle-right
......
%h3.page_title
%h3.page-title
Merge Requests
%small (authored by or assigned to you)
%small.pull-right #{@merge_requests.total_count} merge requests
%span.light
&ndash;
Authored by or assigned to you
%span.pull-right #{@merge_requests.total_count} merge requests
%hr
.row
.span3
= render 'filter', entity: 'merge_request'
......
......@@ -22,7 +22,7 @@
.span9
.ui-box
%h5.title
.title
Projects (#{@projects.total_count})
.pull-right.light
%small Last activity
......
= form_for(resource, as: resource_name, url: password_path(resource_name), html: { class: "login-box", method: :post }) do |f|
%h3.page_title Reset password
%h3.page-title Reset password
%br
= devise_error_messages!
= f.email_field :email, placeholder: "Email", class: "text"
......
= form_for(resource, as: resource_name, url: registration_path(resource_name), html: { class: "login-box" }) do |f|
%h3.page_title Sign Up
%h3.page-title Sign Up
%br
= devise_error_messages!
%div
......
.login-box
%h3.page_title Sign in
%h3.page-title Sign in
%br
- if ldap_enabled?
%ul.nav.nav-tabs
......
%h1.http_status_code 403
%h3.page_title Access Denied
%h3.page-title Access Denied
%hr
%p You are not allowed to access this page.
%p Read more about project permissions #{link_to "here", help_permissions_path, class: "vlink"}
%h1.http_status_code 500
%h3.page_title Encoding Error
%h3.page-title Encoding Error
%hr
%p Page can't be loaded because of an encoding error.
%h1.http_status_code 404
%h3.page_title Git Resource Not found
%h3.page-title Git Resource Not found
%hr
%p
Application can't get access to some branch or commit in your repository. It
......
%h1.http_status_code 404
%h3.page_title The resource you were looking for doesn't exist.
%h3.page-title The resource you were looking for doesn't exist.
%hr
%p You may have mistyped the address or the page may have moved.
- if show_last_push_widget?(event)
.event_lp
.event-last-push
%span You pushed to
= link_to project_commits_path(event.project, event.ref_name) do
%strong= truncate(event.ref_name, length: 28)
......@@ -8,6 +8,7 @@
%span
= time_ago_in_words(event.created_at)
ago.
= link_to new_mr_path_from_push_event(event), title: "New Merge Request", class: "btn btn-new-mr" do
Create Merge Request
.pull-right
= link_to new_mr_path_from_push_event(event), title: "New Merge Request", class: "btn btn-create btn-small" do
Create Merge Request
%hr
......@@ -13,9 +13,10 @@
= sanitize(markdown(truncate(event.target.note, length: 150)), tags: %w(a img b pre p))
- note = event.target
- if note.attachment.url
= link_to note.attachment.secure_url, target: "_blank", class: 'note-file-attach' do
- if note.attachment.image?
- if note.attachment.image?
= link_to note.attachment.url, target: '_blank' do
= image_tag note.attachment.url, class: 'note-image-attach'
- else
- else
= link_to note.attachment.secure_url, target: "_blank", class: 'note-file-attach' do
%i.icon-paper-clip
= note.attachment_identifier
= form_tag group_filter_path(entity), method: 'get' do
%fieldset.dashboard-search-filter
= search_field_tag "search", params[:search], { placeholder: 'Search', class: 'search-text-input' }
= button_tag type: 'submit', class: 'btn' do
%i.icon-search
%fieldset
%legend Status:
%ul.nav.nav-pills.nav-stacked
%li{class: ("active" if !params[:status])}
= link_to group_filter_path(entity, status: nil) do
......
......@@ -2,7 +2,7 @@
%fieldset
%legend= "New Group member(s) for #{@group.name}"
%h6 1. Choose people you want in the group
%h6 1. Choose users you want in the group
.clearfix
= f.label :user_ids, "People"
.input= users_select_tag(:user_ids, multiple: true, class: 'input-large')
......@@ -13,6 +13,5 @@
.input= select_tag :group_access, options_for_select(UsersGroup.group_access_roles, @users_group.group_access), class: "project-access-select chosen"
.form-actions
= hidden_field_tag :redirect_to, people_group_path(@group)
= f.submit 'Add users into group', class: "btn btn-create"
.ui-box
%h5.title
.title
Projects (#{projects.count})
- if can? current_user, :manage_group, @group
%span.pull-right
......
......@@ -18,7 +18,7 @@
.tab-content
.tab-pane.active#tab-edit
.ui-box
%h5.title
.title
%strong= @group.name
Group Settings:
%div.form-holder
......@@ -42,7 +42,7 @@
.tab-pane#tab-projects
.ui-box
%h5.title
.title
%strong= @group.name
Projects:
- if can? current_user, :manage_group, @group
......@@ -67,7 +67,7 @@
.tab-pane#tab-transfer
.ui-box.ui-box-danger
%h5.title Transfer group
.title Transfer group
.ui-box-body
%p
Transferring group will cause loss of admin control over group and all child projects
......@@ -78,7 +78,7 @@
.tab-pane#tab-remove
.ui-box.ui-box-danger
%h5.title Remove group
.title Remove group
.ui-box-body
%p
Remove of group will cause removing all child projects and resources.
......
%h3.page_title
%h3.page-title
Issues
%small (assigned to you)
%small.pull-right #{@issues.total_count} issues
......@@ -12,7 +12,7 @@
- @issues.group_by(&:project).each do |group|
%div.ui-box
- project = group[0]
%h5.title
.title
= link_to_project project
%ul.well-list.issues-list
- group[1].each do |issue|
......
......@@ -9,8 +9,9 @@
Only group owners can manage group members
.span6
.ui-box
%h5.title
#{@group.name} Group Members
.title
%strong #{@group.name}
Group Members
%small
(#{@members.count})
%ul.well-list
......
%h3.page_title
%h3.page-title
Merge Requests
%small (authored by or assigned to you)
%small.pull-right #{@merge_requests.total_count} merge requests
......
= render layout: 'help/api_layout' do
%h3.page_title
%h3.page-title
%span.light API
%span
\/
= @category.titleize
%br
.file_holder
.file_title
.file-holder
.file-title
%i.icon-file
= @category
.file_content.wiki
.file-content.wiki
= preserve do
= markdown File.read(Rails.root.join("doc", "api", "#{@category}.md"))
%h3.page_title
GITLAB
%h2.page-title
GitLab
%span.light Enterprise Edition
.pull-right
%span= Gitlab::VERSION
%small= Gitlab::REVISION
%hr
%p.lead
%p.slead
Self Hosted Git Management
%br
Fast, secure and stable solution based on Ruby on Rails.
......@@ -16,7 +15,7 @@
.span4
.ui-box
.title
%h5 Quick help
Quick help
%ul.well-list
%li
Email your
......@@ -40,7 +39,7 @@
.span4
.ui-box
.title
%h5 User documentation
User documentation
%ul.well-list
%li
%strong= link_to "Workflow", help_workflow_path
......@@ -69,7 +68,7 @@
.span4
.ui-box
.title
%h5 Admin documentation
Admin documentation
%ul.well-list
%li
......
= render layout: 'help/layout' do
%h3.page_title GitLab Flavored Markdown
%h3.page-title GitLab Flavored Markdown
%br
.help_body
......
= render layout: 'help/layout' do
%h3.page_title Permissions
%h3.page-title Permissions
%br
%fieldset
......
= render layout: 'help/layout' do
%h3.page_title Public Access
%h3.page-title Public Access
%br
%p
......
= render layout: 'help/layout' do
%h3.page_title GitLab Rake Tasks
%h3.page-title GitLab Rake Tasks
%br
%p.slead
......@@ -19,46 +19,46 @@
.tab-content
.tab-pane.active#features
.file_holder
.file_title
.file-holder
.file-title
%i.icon-file
Features
.file_content.wiki
.file-content.wiki
= preserve do
= markdown File.read(Rails.root.join("doc", "raketasks", "features.md"))
.tab-pane#maintenance
.file_holder
.file_title
.file-holder
.file-title
%i.icon-file
Maintenance
.file_content.wiki
.file-content.wiki
= preserve do
= markdown File.read(Rails.root.join("doc", "raketasks", "maintenance.md"))
.tab-pane#user_management
.file_holder
.file_title
.file-holder
.file-title
%i.icon-file
User Management
.file_content.wiki
.file-content.wiki
= preserve do
= markdown File.read(Rails.root.join("doc", "raketasks", "user_management.md"))
.tab-pane#cleanup
.file_holder
.file_title
.file-holder
.file-title
%i.icon-file
Cleanup
.file_content.wiki
.file-content.wiki
= preserve do
= markdown File.read(Rails.root.join("doc", "raketasks", "cleanup.md"))
.tab-pane#backup_restore
.file_holder
.file_title
.file-holder
.file-title
%i.icon-file
Backup & Restore
.file_content.wiki
.file-content.wiki
= preserve do
= markdown File.read(Rails.root.join("doc", "raketasks", "backup_restore.md"))
= render layout: 'help/layout' do
%h3.page_title SSH Keys
%h3.page-title SSH Keys
%br
%p.slead
......
= render layout: 'help/layout' do
%h3.page_title System hooks
%h3.page-title System hooks
%br
%p.slead
......
= render layout: 'help/layout' do
%h3.page_title Web hooks
%h3.page-title Web hooks
%br
%p.slead
......@@ -9,5 +9,5 @@
%br
GitLab will send POST request with commits information on every push.
%h5 Hooks request example:
= render "hooks/data_ex"
= render "projects/hooks/data_ex"
= render layout: 'help/layout' do
%h3.page_title Workflow
%h3.page-title Workflow
%br
%ol.help
......
.flash-container
- if alert
.alert
.alert.alert-error
%span= alert
- elsif notice
......
- if content_for?(:page_title)
= yield :page_title
- if content_for?(:page-title)
= yield :page-title
......@@ -10,8 +10,8 @@
= link_to merge_requests_group_path(@group) do
Merge Requests
%span.count= current_user.cared_merge_requests.opened.of_group(@group).count
= nav_link(path: 'groups#people') do
= link_to "People", people_group_path(@group)
= nav_link(path: 'groups#members') do
= link_to "Members", members_group_path(@group)
- if can?(current_user, :manage_group, @group)
= nav_link(path: 'groups#edit') do
......
......@@ -12,6 +12,8 @@
%span.count= current_user.keys.count
= nav_link(path: 'profiles#design') do
= link_to "Design", design_profile_path
= nav_link(controller: :groups) do
= link_to "Groups", profile_groups_path
= nav_link(path: 'profiles#history') do
= link_to "History", history_profile_path
......@@ -4,11 +4,11 @@
%i.icon-home
- if project_nav_tab? :files
= nav_link(controller: %w(tree blob blame)) do
= nav_link(controller: %w(tree blob blame edit_tree)) do
= link_to 'Files', project_tree_path(@project, @ref || @repository.root_ref)
- if project_nav_tab? :commits
= nav_link(controller: %w(commit commits compare repositories protected_branches)) do
= nav_link(controller: %w(commit commits compare repositories protected_branches tags branches)) do
= link_to "Commits", project_commits_path(@project, @ref || @repository.root_ref)
- if project_nav_tab? :network
......
.ui-box
.title
%strong Groups
(#{@groups.count})
- if current_user.can_create_group?
%span.pull-right
= link_to new_group_path, class: "btn btn-small btn-primary" do
%i.icon-plus
New Group
%ul.well-list
- @groups.each do |group|
%li
.pull-right
- if can?(current_user, :manage_group, group)
= link_to edit_group_path(group), class: "btn-small btn grouped" do
%i.icon-cogs
Settings
= link_to leave_profile_group_path(group), confirm: "Are you sure you want to leave #{group.name} group?", method: :delete, class: "btn-small btn grouped", title: 'Remove user from group' do
%i.icon-signout
Leave
= link_to group, class: 'group-name' do
= group.name
= paginate @groups
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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