Commit 3374027e authored by Sebastian Ziebell's avatar Sebastian Ziebell
Browse files

Merge branch 'master' into fixes/api, code clean up and tests fixed

Conflicts:
	doc/api/projects.md
	spec/requests/api/projects_spec.rb
parents 39114d25 9c2a6e20
load 'deploy'
load 'deploy/assets'
require 'bundler/capistrano'
load 'config/deploy'
source "http://rubygems.org"
source "https://rubygems.org"
def darwin_only(require_as)
RUBY_PLATFORM.include?('darwin') && require_as
......@@ -103,6 +103,9 @@ gem 'settingslogic'
gem "foreman"
gem "git"
# Cache
gem "redis-rails"
group :assets do
gem "sass-rails", "~> 3.2.5"
gem "coffee-rails", "~> 3.2.2"
......
......@@ -13,7 +13,7 @@ GIT
raphael-rails (2.1.0)
GEM
remote: http://rubygems.org/
remote: https://rubygems.org/
specs:
actionmailer (3.2.12)
actionpack (= 3.2.12)
......@@ -329,8 +329,24 @@ GEM
json (~> 1.4)
redcarpet (2.2.2)
redis (3.0.2)
redis-actionpack (3.2.3)
actionpack (~> 3.2.3)
redis-rack (~> 1.4.0)
redis-store (~> 1.1.0)
redis-activesupport (3.2.3)
activesupport (~> 3.2.3)
redis-store (~> 1.1.0)
redis-namespace (1.2.1)
redis (~> 3.0.0)
redis-rack (1.4.2)
rack (~> 1.4.1)
redis-store (~> 1.1.0)
redis-rails (3.2.3)
redis-actionpack (~> 3.2.3)
redis-activesupport (~> 3.2.3)
redis-store (~> 1.1.0)
redis-store (1.1.3)
redis (>= 2.2.0)
request_store (1.0.5)
rspec (2.12.0)
rspec-core (~> 2.12.0)
......@@ -504,6 +520,7 @@ DEPENDENCIES
rb-fsevent
rb-inotify
redcarpet (~> 2.2.2)
redis-rails
rspec-rails (= 2.12.2)
sass-rails (~> 3.2.5)
sdoc
......
......@@ -5,14 +5,14 @@
### GitLab allows you to
* keep your code secure on your own server
* manage repositories, users and access permissions
* communicate though issues, line-comments and wiki's
* perform code reviews with merge requests
* communicate through issues, line-comments and wiki pages
* perform code review with merge requests
### GitLab is
* powered by Ruby on Rails
* completely free and open source (MIT license)
* used by 10.000 organization to keep their code secure
* used by 10.000 organizations to keep their code secure
### Code status
......@@ -34,28 +34,35 @@
### Requirements
* Ubuntu/Debian*
* Ubuntu/Debian**
* ruby 1.9.3+
* MySQL
* git
* gitlab-shell
* redis
* More details are in the [requirements doc](https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/requirements.md)
** More details are in the [requirements doc](https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/requirements.md)
### Installation
You can either follow the "ordinary" Installation guide to install it on a machine or use the Vagrant virtual machine. The Installation guide is recommended to set up a production server. The Vargrant virtual machine is recommended for development since it makes it much easier to set up all the dependencies for integration testing.
#### For production
* [Installation guide for latest stable release](https://github.com/gitlabhq/gitlabhq/blob/4-2-stable/doc/install/installation.md)
Follow the installation guide for production server.
* [Installation guide for the current master branch](https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md)
* [Installation guide for latest stable release (4.2)](https://github.com/gitlabhq/gitlabhq/blob/4-2-stable/doc/install/installation.md) - **Recommended**
* [Installation guide for the current master branch (5.0)](https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md)
#### For development
If you want to contribute, please first read our [Contributing Guidelines](https://github.com/gitlabhq/gitlabhq/blob/master/CONTRIBUTING.md) and then we suggest you to use the Vagrant virtual machine project to get an environment working sandboxed and with all dependencies.
* [Vagrant virtual machine](https://github.com/gitlabhq/gitlab-vagrant-vm)
### Starting
1. The Installation guide contains instructions to download an init script and run that on boot. With the init script you can also start GitLab with:
1. The Installation guide contains instructions to download an init script and run that on boot. With the init script you can also start GitLab
sudo service gitlab start
......@@ -63,18 +70,18 @@ You can either follow the "ordinary" Installation guide to install it on a machi
sudo /etc/init.d/gitlab restart
2. Start it with [Foreman](https://github.com/ddollar/foreman) in development model
2. Start it with [Foreman](https://github.com/ddollar/foreman) in development mode
bundle exec foreman start -p 3000
3. Start it manually in development mode
or start it manually
bundle exec rails s
bundle exec rake sidekiq:start
### Running the tests
* Seed the database with
* Seed the database
bundle exec rake db:setup RAILS_ENV=test
bundle exec rake db:seed_fu RAILS_ENV=test
......
......@@ -11,12 +11,7 @@ $ ->
# Make the entire tree-item row clickable, but not if clicking another link (like a commit message)
$("#tree-slider .tree-item").live 'click', (e) ->
$('.tree-item-file-name a', this).trigger('click') if (e.target.nodeName != "A")
# Show/Hide the loading spinner
$('#tree-slider .tree-item-file-name a, .breadcrumb a, .project-refs-form').live
"ajax:beforeSend": -> $('.tree_progress').addClass("loading")
"ajax:complete": -> $('.tree_progress').removeClass("loading")
# Maintain forward/back history while browsing the file tree
((window) ->
History = window.History
......@@ -33,7 +28,12 @@ $ ->
History.Adapter.bind window, 'statechange', ->
state = History.getState()
window.ajaxGet(state.url)
$.ajax({
url: state.url,
dataType: 'script',
beforeSend: -> $('.tree_progress').addClass("loading"),
complete: -> $('.tree_progress').removeClass("loading")
})
)(window)
# See if there are lines selected
......
......@@ -34,13 +34,6 @@
padding: 15px;
word-wrap: break-word;
pre {
background: none !important;
margin: 0;
border: none;
padding: 0;
}
.clearfix {
margin: 0;
}
......
......@@ -2,6 +2,7 @@
.cgray { color:gray }
.cred { color:#D12F19 }
.cgreen { color:#4a2 }
.cblue { color:#29A }
.cblack { color:#111 }
.cdark { color:#444 }
.cwhite { color:#fff!important }
......
......@@ -120,3 +120,16 @@ ul.nav.nav-projects-tabs {
.team_member_row form {
margin: 0px;
}
.public-projects {
li {
margin-top: 8px;
margin-bottom: 5px;
border-bottom: 1px solid #eee;
.description {
margin-left: 22px;
color: #aaa;
}
}
}
......@@ -91,7 +91,7 @@ class MergeRequest < ActiveRecord::Base
def validate_branches
if target_branch == source_branch
errors.add :base, "You can not use same branch for source and target branches"
errors.add :branch_conflict, "You can not use same branch for source and target branches"
end
end
......
class Repository
include Gitlab::Popen
# Repository directory name with namespace direcotry
# Examples:
# gitlab/gitolite
......@@ -147,4 +149,21 @@ def archive_repo(ref)
file_path
end
# Return repo size in megabytes
# Cached in redis
def size
Rails.cache.fetch(cache_key(:size)) do
size = popen('du -s', path_to_repo).first.strip.to_i
(size.to_f / 1024).round(2)
end
end
def expire_cache
Rails.cache.delete(cache_key(:size))
end
def cache_key(type)
"#{type}:#{path_with_namespace}"
end
end
......@@ -23,6 +23,7 @@ def execute(project, user, oldrev, newrev, ref)
project.ensure_satellite_exists
project.discover_default_branch
project.repository.expire_cache
if push_to_branch?(ref, oldrev)
project.update_merge_requests(oldrev, newrev, ref, @user)
......
= form_tag(user_omniauth_callback_path(:ldap), :class => "login-box", :id => 'new_ldap_user' ) do
= image_tag "login-logo.png", :width => "304", :height => "66", :class => "login-logo", :alt => "Login Logo"
= text_field_tag :username, nil, {:class => "text top", :placeholder => "LDAP Login"}
= text_field_tag :username, nil, {:class => "text top", :placeholder => "LDAP Login", :autofocus => "autofocus"}
= password_field_tag :password, nil, {:class => "text bottom", :placeholder => "Password"}
%br/
= submit_tag "LDAP Sign in", :class => "btn-primary btn"
......
- if event.proper?
%div.event-item
%span.cgray.pull-right
#{time_ago_in_words(event.created_at)} ago.
= cache event do
%div.event-item
%span.cgray.pull-right
#{time_ago_in_words(event.created_at)} ago.
= image_tag gravatar_icon(event.author_email), class: "avatar s24"
= image_tag gravatar_icon(event.author_email), class: "avatar s24"
- if event.push?
= render "events/event/push", event: event
.clearfix
- elsif event.note?
= render "events/event/note", event: event
- else
= render "events/event/common", event: event
- if event.push?
= render "events/event/push", event: event
.clearfix
- elsif event.note?
= render "events/event/note", event: event
- else
= render "events/event/common", event: event
......@@ -21,6 +21,8 @@
= link_to "Milestones", "#milestones", 'data-toggle' => 'tab'
%li
= link_to "Notes", "#notes", 'data-toggle' => 'tab'
%li
= link_to "System Hooks", "#system_hooks", 'data-toggle' => 'tab'
.tab-content
.tab-pane.active#README
......@@ -103,3 +105,12 @@
.file_content.wiki
= preserve do
= markdown File.read(Rails.root.join("doc", "api", "notes.md"))
.tab-pane#system_hooks
.file_holder
.file_title
%i.icon-file
System Hooks
.file_content.wiki
= preserve do
= markdown File.read(Rails.root.join("doc", "api", "system_hooks.md"))
......@@ -22,7 +22,7 @@
= mail_to Gitlab.config.gitlab.support_email, "support contact"
%li
Use the
= link_to "search bar", '#', onclick: "$("#search").focus();"
= link_to "search bar", '#', onclick: "$('#search').focus();"
on the top of this page
%li
Ask in our
......
......@@ -10,7 +10,7 @@
= link_to root_path, class: "home" do
%h1 GITLAB
%span.separator
%h1.project_name Public Projects
%h1.project_name Public Projects
.container
.content
.prepend-top-20
......
......@@ -9,11 +9,19 @@
Project name is
.input
= f.text_field :name, placeholder: "Example Project", class: "xxlarge"
- unless @repository.heads.empty?
.clearfix
= f.label :default_branch, "Default Branch"
.input= f.select(:default_branch, @repository.heads.map(&:name), {}, style: "width:210px;")
.clearfix
= f.label :description do
Project description
%span.light (optional)
.input
= f.text_area :description, placeholder: "awesome project", class: "xxlarge", rows: 3, maxlength: 250
%fieldset.features
%legend Features:
......
= render "project_head"
= render 'clone_panel'
= render "events/event_last_push", event: @last_push
.content_list= render @events
.loading.hide
.row
.span9
.content_list= render @events
.loading.hide
.span3
.ui-box.white
.padded
%h3.page_title
= @project.name
- if @project.description.present?
%p.light= @project.description
%hr
%p
Access level:
- if @project.public
%span.cblue
%i.icon-share
Public
- else
%span.cgreen
%i.icon-lock
Private
%p Repo Size: #{@project.repository.size} MB
%p Created at: #{@project.created_at.stamp('Aug 22, 2013')}
%p Owner: #{link_to @project.owner_name, @project.owner}
:javascript
$(function(){ Pager.init(20); });
%h3.page_title
Projects
Projects (#{@projects.total_count})
%small with read-only access
%hr
%ul.unstyled
- @projects.each do |project|
%li.clearfix
%h5
%i.icon-share
= project.name_with_namespace
.pull-right
%pre.dark.tiny git clone #{project.http_url_to_repo}
.public-projects
%ul.unstyled
- @projects.each do |project|
%li.clearfix
%h5
%i.icon-share
= project.name_with_namespace
.pull-right
%pre.dark.tiny git clone #{project.http_url_to_repo}
%p.description
= project.description
- unless @projects.present?
%h3.nothing_here_message No public projects
- unless @projects.present?
%h3.nothing_here_message No public projects
= paginate @projects, theme: "admin"
= paginate @projects, theme: "admin"
......@@ -11,9 +11,6 @@
- else
= link_to title, '#'
.clear
%div.tree_progress
%div#tree-content-holder.tree-content-holder
- if tree.is_blob?
= render "tree/blob", blob: tree
......@@ -40,6 +37,8 @@
- if tree.readme
= render "tree/readme", readme: tree.readme
%div.tree_progress
- unless tree.is_blob?
:javascript
// Load last commit log for each file in tree
......
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