Commit bfe0906f authored by Ariejan de Vroom's avatar Ariejan de Vroom

Merge remote-tracking branch 'upstream/master'

parents 4587ab6f df6f7481
......@@ -9,5 +9,10 @@ coverage/*
*.swp
public/uploads/
.rvmrc
.rbenv-version
.directory
nohup.out
Vagrantfile
.vagrant
config/gitlab.yml
config/database.yml
......@@ -4,6 +4,8 @@ branches:
- 'master'
rvm: 1.9.2
before_script:
- "cp config/database.yml.example config/database.yml"
- "cp config/gitlab.yml.example config/gitlab.yml"
- "bundle exec rake db:create RAILS_ENV=test"
- "bundle exec rake db:migrate RAILS_ENV=test"
- "bundle exec rake db:seed_fu RAILS_ENV=test"
......
source "http://rubygems.org"
gem "rails", "3.1.1"
gem "rails", "3.2.1"
gem "sqlite3"
gem "rake", "0.9.2.2"
gem "devise", "1.5.0"
gem "rake"
gem "devise"
gem "stamp"
gem "kaminari"
gem "haml", "3.1.4"
......@@ -16,7 +16,7 @@ gem "carrierwave"
gem "six"
gem "therubyracer"
gem "faker"
gem "seed-fu", "~> 2.1.0"
gem "seed-fu"
gem "pygments.rb", "0.2.4"
gem "thin"
gem "git"
......@@ -24,20 +24,23 @@ gem "acts_as_list"
gem "rdiscount"
gem "acts-as-taggable-on", "~> 2.1.0"
gem "drapper"
gem "resque"
gem "resque", "~> 1.20.0"
gem "httparty"
gem "charlock_holmes"
gem "foreman"
gem "omniauth-ldap"
gem 'bootstrap-sass', "1.4.4"
gem "colored"
group :assets do
gem "sass-rails", "~> 3.1.0"
gem "coffee-rails", "~> 3.1.0"
gem "uglifier"
gem "sass-rails", "3.2.3"
gem "coffee-rails", "3.2.1"
gem "uglifier", "1.0.3"
end
group :development do
gem "letter_opener"
gem "rails-footnotes", "~> 3.7.5"
gem "rails-footnotes"
gem "annotate", :git => "https://github.com/ctran/annotate_models.git"
end
......@@ -46,9 +49,7 @@ group :development, :test do
gem "capybara"
gem "autotest"
gem "autotest-rails"
unless ENV["CI"]
gem "ruby-debug19", :require => "ruby-debug"
end
gem "pry"
gem "awesome_print"
gem "database_cleaner"
gem "launchy"
......@@ -58,5 +59,5 @@ end
group :test do
gem "turn", :require => false
gem "simplecov", :require => false
gem "shoulda", "~> 3.0.0.beta2"
gem "shoulda", "3.0.0"
end
GIT
remote: https://github.com/ctran/annotate_models.git
revision: fb73329243056a6d9a64878e5c543aba9b6417de
revision: a43c08f0eb4d69a48c6830630ebb60e35ccb2d2d
specs:
annotate (2.4.1.beta1)
......@@ -25,48 +25,48 @@ GEM
remote: http://rubygems.org/
specs:
ZenTest (4.5.0)
actionmailer (3.1.1)
actionpack (= 3.1.1)
mail (~> 2.3.0)
actionpack (3.1.1)
activemodel (= 3.1.1)
activesupport (= 3.1.1)
actionmailer (3.2.1)
actionpack (= 3.2.1)
mail (~> 2.4.0)
actionpack (3.2.1)
activemodel (= 3.2.1)
activesupport (= 3.2.1)
builder (~> 3.0.0)
erubis (~> 2.7.0)
i18n (~> 0.6)
rack (~> 1.3.2)
journey (~> 1.0.1)
rack (~> 1.4.0)
rack-cache (~> 1.1)
rack-mount (~> 0.8.2)
rack-test (~> 0.6.1)
sprockets (~> 2.0.2)
activemodel (3.1.1)
activesupport (= 3.1.1)
sprockets (~> 2.1.2)
activemodel (3.2.1)
activesupport (= 3.2.1)
builder (~> 3.0.0)
i18n (~> 0.6)
activerecord (3.1.1)
activemodel (= 3.1.1)
activesupport (= 3.1.1)
arel (~> 2.2.1)
activerecord (3.2.1)
activemodel (= 3.2.1)
activesupport (= 3.2.1)
arel (~> 3.0.0)
tzinfo (~> 0.3.29)
activeresource (3.1.1)
activemodel (= 3.1.1)
activesupport (= 3.1.1)
activesupport (3.1.1)
activeresource (3.2.1)
activemodel (= 3.2.1)
activesupport (= 3.2.1)
activesupport (3.2.1)
i18n (~> 0.6)
multi_json (~> 1.0)
acts-as-taggable-on (2.1.1)
rails
acts_as_list (0.1.4)
addressable (2.2.6)
ansi (1.4.1)
archive-tar-minitar (0.5.2)
arel (2.2.1)
ansi (1.4.2)
arel (3.0.0)
autotest (4.4.6)
ZenTest (>= 4.4.1)
autotest-rails (4.1.1)
ZenTest (= 4.5)
awesome_print (0.4.0)
awesome_print (1.0.2)
bcrypt-ruby (3.0.1)
blankslate (2.1.2.4)
bootstrap-sass (1.4.4)
sass-rails (~> 3.1)
builder (3.0.0)
capybara (1.1.2)
mime-types (>= 1.16)
......@@ -78,19 +78,20 @@ GEM
carrierwave (0.5.8)
activesupport (~> 3.0)
charlock_holmes (0.6.8)
childprocess (0.2.2)
childprocess (0.3.1)
ffi (~> 1.0.6)
coffee-rails (3.1.1)
coderay (1.0.5)
coffee-rails (3.2.1)
coffee-script (>= 2.2.0)
railties (~> 3.1.0)
railties (~> 3.2.0.beta)
coffee-script (2.2.0)
coffee-script-source
execjs
coffee-script-source (1.1.3)
columnize (0.3.4)
coffee-script-source (1.2.0)
colored (1.2)
crack (0.3.1)
daemons (1.1.4)
database_cleaner (0.7.0)
daemons (1.1.8)
database_cleaner (0.7.1)
devise (1.5.0)
bcrypt-ruby (~> 3.0)
orm_adapter (~> 0.0.3)
......@@ -99,13 +100,13 @@ GEM
drapper (0.8.4)
erubis (2.7.0)
eventmachine (0.12.10)
execjs (1.2.9)
execjs (1.3.0)
multi_json (~> 1.0)
faker (1.0.1)
i18n (~> 0.4)
ffi (1.0.11)
foreman (0.27.0)
term-ansicolor (~> 1.0.5)
foreman (0.39.0)
term-ansicolor (~> 1.0.7)
thor (>= 0.13.6)
git (1.2.5)
haml (3.1.4)
......@@ -115,139 +116,143 @@ GEM
haml (~> 3.0)
railties (~> 3.0)
hashery (1.4.0)
hashie (1.2.0)
hike (1.2.1)
httparty (0.8.1)
multi_json
multi_xml
i18n (0.6.0)
jquery-rails (1.0.17)
railties (~> 3.0)
journey (1.0.1)
jquery-rails (2.0.0)
railties (>= 3.2.0.beta, < 5.0)
thor (~> 0.14)
json (1.6.1)
json_pure (1.6.1)
kaminari (0.12.4)
rails (>= 3.0.0)
json (1.6.5)
kaminari (0.13.0)
actionpack (>= 3.0.0)
activesupport (>= 3.0.0)
railties (>= 3.0.0)
launchy (2.0.5)
addressable (~> 2.2.6)
letter_opener (0.0.2)
launchy
libv8 (3.3.10.4)
linecache19 (0.5.12)
ruby_core_source (>= 0.1.4)
mail (2.3.0)
mail (2.4.1)
i18n (>= 0.4.0)
mime-types (~> 1.16)
treetop (~> 1.4.8)
method_source (0.7.0)
mime-types (1.17.2)
multi_json (1.0.3)
multi_json (1.0.4)
multi_xml (0.4.1)
net-ldap (0.2.2)
nokogiri (1.5.0)
orm_adapter (0.0.5)
omniauth (1.0.2)
hashie (~> 1.2)
rack
omniauth-ldap (1.0.2)
net-ldap (~> 0.2.2)
omniauth (~> 1.0)
pyu-ruby-sasl (~> 0.0.3.1)
rubyntlm (~> 0.1.1)
orm_adapter (0.0.6)
polyglot (0.3.3)
posix-spawn (0.3.6)
pry (0.9.8.2)
coderay (~> 1.0.5)
method_source (~> 0.7)
slop (>= 2.4.4, < 3)
pygments.rb (0.2.4)
rubypython (~> 0.5.3)
rack (1.3.5)
pyu-ruby-sasl (0.0.3.3)
rack (1.4.1)
rack-cache (1.1)
rack (>= 0.4)
rack-mount (0.8.3)
rack (>= 1.0.0)
rack-protection (1.1.4)
rack-protection (1.2.0)
rack
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
rack (>= 1.0)
rails (3.1.1)
actionmailer (= 3.1.1)
actionpack (= 3.1.1)
activerecord (= 3.1.1)
activeresource (= 3.1.1)
activesupport (= 3.1.1)
rails (3.2.1)
actionmailer (= 3.2.1)
actionpack (= 3.2.1)
activerecord (= 3.2.1)
activeresource (= 3.2.1)
activesupport (= 3.2.1)
bundler (~> 1.0)
railties (= 3.1.1)
railties (= 3.2.1)
rails-footnotes (3.7.5)
rails (>= 3.0.0)
railties (3.1.1)
actionpack (= 3.1.1)
activesupport (= 3.1.1)
railties (3.2.1)
actionpack (= 3.2.1)
activesupport (= 3.2.1)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2.2)
rdiscount (1.6.8)
rdoc (3.11)
rdoc (3.12)
json (~> 1.4)
redis (2.2.2)
redis-namespace (1.0.3)
redis (< 3.0.0)
resque (1.19.0)
resque (1.20.0)
multi_json (~> 1.0)
redis-namespace (~> 1.0.2)
sinatra (>= 0.9.2)
vegas (~> 0.1.2)
rspec (2.7.0)
rspec-core (~> 2.7.0)
rspec-expectations (~> 2.7.0)
rspec-mocks (~> 2.7.0)
rspec-core (2.7.1)
rspec-expectations (2.7.0)
rspec (2.8.0)
rspec-core (~> 2.8.0)
rspec-expectations (~> 2.8.0)
rspec-mocks (~> 2.8.0)
rspec-core (2.8.0)
rspec-expectations (2.8.0)
diff-lcs (~> 1.1.2)
rspec-mocks (2.7.0)
rspec-rails (2.7.0)
actionpack (~> 3.0)
activesupport (~> 3.0)
railties (~> 3.0)
rspec (~> 2.7.0)
ruby-debug-base19 (0.11.25)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
ruby_core_source (>= 0.1.4)
ruby-debug19 (0.11.6)
columnize (>= 0.3.1)
linecache19 (>= 0.5.11)
ruby-debug-base19 (>= 0.11.19)
ruby_core_source (0.1.5)
archive-tar-minitar (>= 0.5.2)
rspec-mocks (2.8.0)
rspec-rails (2.8.1)
actionpack (>= 3.0)
activesupport (>= 3.0)
railties (>= 3.0)
rspec (~> 2.8.0)
rubyntlm (0.1.1)
rubypython (0.5.3)
blankslate (>= 2.1.2.3)
ffi (~> 1.0.7)
rubyzip (0.9.4)
sass (3.1.10)
sass-rails (3.1.4)
actionpack (~> 3.1.0)
railties (~> 3.1.0)
sass (>= 3.1.4)
sprockets (~> 2.0.0)
tilt (~> 1.3.2)
seed-fu (2.1.0)
activerecord (~> 3.1.0)
activesupport (~> 3.1.0)
selenium-webdriver (2.12.2)
childprocess (>= 0.2.1)
rubyzip (0.9.6.1)
sass (3.1.15)
sass-rails (3.2.3)
railties (~> 3.2.0.beta)
sass (>= 3.1.10)
tilt (~> 1.3)
seed-fu (2.2.0)
activerecord (~> 3.1)
activesupport (~> 3.1)
selenium-webdriver (2.19.0)
childprocess (>= 0.2.5)
ffi (~> 1.0.9)
json_pure
multi_json (~> 1.0.4)
rubyzip
shoulda (3.0.0.beta2)
shoulda-context (~> 1.0.0.beta1)
shoulda-matchers (~> 1.0.0.beta1)
shoulda (3.0.0)
shoulda-context (~> 1.0.0)
shoulda-matchers (~> 1.0.0)
shoulda-context (1.0.0)
shoulda-matchers (1.0.0)
simplecov (0.5.4)
multi_json (~> 1.0.3)
simplecov-html (~> 0.5.3)
simplecov-html (0.5.3)
sinatra (1.3.1)
rack (~> 1.3, >= 1.3.4)
rack-protection (~> 1.1, >= 1.1.2)
sinatra (1.3.2)
rack (~> 1.3, >= 1.3.6)
rack-protection (~> 1.2)
tilt (~> 1.3, >= 1.3.3)
six (0.2.0)
sprockets (2.0.3)
slop (2.4.4)
sprockets (2.1.2)
hike (~> 1.2)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
sqlite3 (1.3.4)
sqlite3 (1.3.5)
stamp (0.1.6)
term-ansicolor (1.0.7)
therubyracer (0.9.9)
......@@ -261,17 +266,17 @@ GEM
treetop (1.4.10)
polyglot
polyglot (>= 0.3.1)
turn (0.8.3)
turn (0.9.2)
ansi
tzinfo (0.3.31)
uglifier (1.1.0)
uglifier (1.0.3)
execjs (>= 0.3.0)
multi_json (>= 1.0.2)
vegas (0.1.8)
vegas (0.1.11)
rack (>= 1.0.0)
warden (1.1.0)
rack (>= 1.0)
webmock (1.7.8)
webmock (1.7.10)
addressable (~> 2.2, > 2.2.5)
crack (>= 0.1.7)
xpath (0.1.4)
......@@ -287,12 +292,14 @@ DEPENDENCIES
autotest
autotest-rails
awesome_print
bootstrap-sass (= 1.4.4)
capybara
carrierwave
charlock_holmes
coffee-rails (~> 3.1.0)
coffee-rails (= 3.2.1)
colored
database_cleaner
devise (= 1.5.0)
devise
drapper
faker
foreman
......@@ -306,17 +313,18 @@ DEPENDENCIES
kaminari
launchy
letter_opener
omniauth-ldap
pry
pygments.rb (= 0.2.4)
rails (= 3.1.1)
rails-footnotes (~> 3.7.5)
rake (= 0.9.2.2)
rails (= 3.2.1)
rails-footnotes
rake
rdiscount
resque
resque (~> 1.20.0)
rspec-rails
ruby-debug19
sass-rails (~> 3.1.0)
seed-fu (~> 2.1.0)
shoulda (~> 3.0.0.beta2)
sass-rails (= 3.2.3)
seed-fu
shoulda (= 3.0.0)
simplecov
six
sqlite3
......@@ -324,5 +332,5 @@ DEPENDENCIES
therubyracer
thin
turn
uglifier
uglifier (= 1.0.3)
webmock
web: bundle exec rails s -p $PORT -e production
worker: bundle exec rake environment resque:work RAILS_ENV=production QUEUE=* VVERBOSE=1
worker: bundle exec rake environment resque:work RAILS_ENV=production QUEUE=*
app/assets/images/Info-UI.PNG

800 Bytes | W: | H:

app/assets/images/Info-UI.PNG

801 Bytes | W: | H:

app/assets/images/Info-UI.PNG
app/assets/images/Info-UI.PNG
app/assets/images/Info-UI.PNG
app/assets/images/Info-UI.PNG
  • 2-up
  • Swipe
  • Onion skin
app/assets/images/blueprint_add.png

518 Bytes | W: | H:

app/assets/images/blueprint_add.png

177 Bytes | W: | H:

app/assets/images/blueprint_add.png
app/assets/images/blueprint_add.png
app/assets/images/blueprint_add.png
app/assets/images/blueprint_add.png
  • 2-up
  • Swipe
  • Onion skin
app/assets/images/blueprint_delete.png

469 Bytes | W: | H:

app/assets/images/blueprint_delete.png

295 Bytes | W: | H:

app/assets/images/blueprint_delete.png
app/assets/images/blueprint_delete.png
app/assets/images/blueprint_delete.png
app/assets/images/blueprint_delete.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -10,6 +10,8 @@
//= require jquery.ui.selectmenu
//= require jquery.tagify
//= require jquery.cookie
//= require jquery.endless-scroll
//= require bootstrap-modal
//= require modernizr
//= require chosen
//= require raphael
......@@ -21,9 +23,6 @@ $(document).ready(function(){
$(this).select();
});
$('select#branch').selectmenu({style:'popup', width:200});
$('select#tag').selectmenu({style:'popup', width:200});
$(".account-box").mouseenter(showMenu);
$(".account-box").mouseleave(resetMenu);
......@@ -43,6 +42,9 @@ $(document).ready(function(){
}
});
/**
* Focus search field by pressing 's' key
*/
$(document).keypress(function(e) {
if( $(e.target).is(":input") ) return;
switch(e.which) {
......@@ -50,27 +52,12 @@ $(document).ready(function(){
e.preventDefault();
}
});
});
function focusSearch() {
$("#search").focus();
}
function taggifyForm(){
var tag_field = $('#tag_field').tagify();
tag_field.tagify('inputField').autocomplete({
source: '/tags.json'
});
$('form').submit( function() {
var tag_field = $('#tag_field')
tag_field.val( tag_field.tagify('serialize') );
return true;
});
}
function updatePage(data){
$.ajax({type: "GET", url: location.href, data: data, dataType: "script"});
}
......@@ -82,5 +69,3 @@ function showMenu() {
function resetMenu() {
$(this).removeClass("hover");
}
......@@ -2,6 +2,7 @@ var CommitsList = {
ref:null,
limit:0,
offset:0,
disable:false,
init:
function(ref, limit) {
......@@ -36,15 +37,21 @@ var CommitsList = {
$("#commits_list").append(html);
if(count > 0) {
this.offset += count;
this.initLoadMore();
} else {
this.disable = true;
}
},
initLoadMore:
function() {
$(window).bind('scroll', function(){
if($(window).scrollTop() == $(document).height() - $(window).height()){
$(window).unbind('scroll');
$(document).endlessScroll({
bottomPixels: 400,
fireDelay: 1000,
fireOnce:true,
ceaseFire: function() {
return CommitsList.disable;
},
callback: function(i) {
CommitsList.getOld();
}
});
......
function switchToNewIssue(form){
$("#issues-table-holder").hide("slide", { direction: "left" }, 150, function(){
$(".project-content").append(form);
$(".issues_content").hide("fade", { direction: "left" }, 150, function(){
$(".issues_content").after(form);
$('select#issue_assignee_id').chosen();
$("#new_issue_dialog").show("slide", { direction: "right" }, 150);
$("#new_issue_dialog").show("fade", { direction: "right" }, 150);
$('.top-tabs .add_new').hide();
});
}
function switchToEditIssue(form){
$("#issues-table-holder").hide("slide", { direction: "left" }, 150, function(){
$(".project-content").append(form);
$(".issues_content").hide("fade", { direction: "left" }, 150, function(){
$(".issues_content").after(form);
$('select#issue_assignee_id').chosen();
$("#edit_issue_dialog").show("slide", { direction: "right" }, 150);
$("#edit_issue_dialog").show("fade", { direction: "right" }, 150);
$('.add_new').hide();
});
}
......@@ -23,10 +25,11 @@ function switchFromEditIssue(){
}
function backToIssues(){
$("#edit_issue_dialog, #new_issue_dialog").hide("slide", { direction: "right" }, 150, function(){
$("#issues-table-holder").show("slide", { direction: "left" }, 150, function() {
$("#edit_issue_dialog, #new_issue_dialog").hide("fade", { direction: "right" }, 150, function(){
$(".issues_content").show("fade", { direction: "left" }, 150, function() {
$("#edit_issue_dialog").remove();
$("#new_issue_dialog").remove();
$('.add_new').show();
});
});
}
......@@ -4,46 +4,27 @@ var MergeRequest = {
init:
function() {
$(".merge-tabs a").live("click", function() {
$(".merge-tabs a").removeClass("active");
$(this).addClass("active");
$(".tabs a").live("click", function() {
$(".tabs a").parent().removeClass("active");
$(this).parent().addClass("active");
});
$(".merge-tabs a.merge-notes-tab").live("click", function() {
$(".merge-request-commits, .merge-request-diffs").hide();
$(".tabs a.merge-notes-tab").live("click", function(e) {
$(".merge-request-diffs").hide();
$(".merge-request-notes").show();
e.preventDefault();
});
$(".merge-tabs a.merge-commits-tab").live("click", function() {
if(!MergeRequest.commits_loaded) {
MergeRequest.loadCommits();
}
$(".merge-request-notes, .merge-request-diffs").hide();
$(".merge-request-commits").show();
});
$(".merge-tabs a.merge-diffs-tab").live("click", function() {
$(".tabs a.merge-diffs-tab").live("click", function(e) {
if(!MergeRequest.diffs_loaded) {
MergeRequest.loadDiff();
}
$(".merge-request-notes, .merge-request-commits").hide();
$(".merge-request-notes").hide();
$(".merge-request-diffs").show();
e.preventDefault();
});
},
loadCommits:
function() {
$(".dashboard-loader").show();
$.ajax({
type: "GET",
url: $(".merge-commits-tab").attr("data-url"),
complete: function(){
MergeRequest.commits_loaded = true;
$(".merge-request-notes, .merge-request-diffs").hide();
$(".dashboard-loader").hide()},
dataType: "script"});
},
loadDiff:
function() {
$(".dashboard-loader").show();
......@@ -52,7 +33,7 @@ var MergeRequest = {
url: $(".merge-diffs-tab").attr("data-url"),
complete: function(){
MergeRequest.diffs_loaded = true;
$(".merge-request-notes, .merge-request-commits").hide();
$(".merge-request-notes").hide();
$(".dashboard-loader").hide()},
dataType: "script"});
}
......
var NoteList = {
notes_path: null,
target_params: null,
target_id: 0,
target_type: null,
first_id: 0,
last_id: 0,
resource_name: null,
disable:false,
init:
function(resource_name, first_id, last_id) {
this.resource_name = resource_name;
this.first_id = first_id;
this.last_id = last_id;
function(tid, tt, path) {
this.notes_path = path + ".js";
this.target_id = tid;
this.target_type = tt;
this.target_params = "&target_type=" + this.target_type + "&target_id=" + this.target_id;
// get notes
this.getContent();
// get new notes every n seconds
this.initRefresh();
this.initLoadMore();
},
getOld:
function() {
$('.loading').show();
$.ajax({
type: "GET",
url: location.href,
data: "first_id=" + this.first_id,
complete: function(){ $('.loading').hide()},
dataType: "script"});
$('.delete-note').live('ajax:success', function() {
$(this).closest('li').fadeOut(); });
$("#new_note").live("ajax:before", function(){
$("#submit_note").attr("disabled", "disabled");
})
$("#new_note").live("ajax:complete", function(){
$("#submit_note").removeAttr("disabled");
})
$("#note_note").live("click", function(){
$(this).css("height", "100px");
$('.attach_holder').show();
});
},
append:
function(id, html) {
this.first_id = id;
$("#notes-list").append(html);
this.initLoadMore();
/**
* Load new notes to fresh list called 'new_notes_list':
* - Replace 'new_notes_list' with new list every n seconds
* - Append new notes to this list after submit
*/
initRefresh:
function() {
// init timer
var intNew = setInterval("NoteList.getNew()", 10000);
},
replace:
function(fid, lid, html) {
this.first_id = fid;
this.last_id = lid;
$("#notes-list").html(html);
this.initLoadMore();
function(html) {
$("#new_notes_list").html(html);
},
prepend:
function(id, html) {
if(id != this.last_id) {
this.last_id = id;
$("#notes-list").prepend(html);
$("#new_notes_list").prepend(html);
}
},
......@@ -52,8 +69,8 @@ getNew:
// refersh notes list
$.ajax({
type: "GET",
url: location.href,
data: "last_id=" + this.last_id,
url: this.notes_path,
data: "last_id=" + this.last_id + this.target_params,
dataType: "script"});
},
......@@ -62,25 +79,85 @@ refresh:
// refersh notes list
$.ajax({
type: "GET",
url: location.href,
data: "first_id=" + this.first_id + "&last_id=" + this.last_id,
url: this.notes_path,
data: "first_id=" + this.first_id + "&last_id=" + this.last_id + this.target_params,
dataType: "script"});
},
initRefresh:
/**
* Init load of notes:
* 1. Get content with ajax call
* 2. Set content of notes list with loaded one
*/
getContent:
function() {
$.ajax({
type: "GET",
url: this.notes_path,
data: "?" + this.target_params,
complete: function(){ $('.status').removeClass("loading")},
beforeSend: function() { $('.status').addClass("loading") },
dataType: "script"});
},
setContent:
function(fid, lid, html) {
this.last_id = lid;
this.first_id = fid;
$("#notes-list").html(html);
// Init infinite scrolling
this.initLoadMore();
},
/**
* Paging for old notes when scroll to bottom:
* 1. Init scroll events with 'initLoadMore'
* 2. Load onlder notes with 'getOld' method
* 3. append old notes to bottom of list with 'append'
*
*/
getOld:
function() {
// init timer
var intNew = setInterval("NoteList.getNew()", 15000);
var intRefresh = setInterval("NoteList.refresh()", 90000);
$('.loading').show();
$.ajax({
type: "GET",
url: this.notes_path,
data: "first_id=" + this.first_id + this.target_params,
complete: function(){ $('.status').removeClass("loading")},
beforeSend: function() { $('.status').addClass("loading") },
dataType: "script"});
},
append:
function(id, html) {
if(this.first_id == id) {
this.disable = true;
} else {
this.first_id = id;
$("#notes-list").append(html);
}
},
initLoadMore:
function() {
$(window).bind('scroll', function(){
if($(window).scrollTop() == $(document).height() - $(window).height()){
$(window).unbind('scroll');
$(document).endlessScroll({
bottomPixels: 400,
fireDelay: 1000,
fireOnce:true,
ceaseFire: function() {
return NoteList.disable;
},
callback: function(i) {
NoteList.getOld();
}
});
});
}
}
var ProjectsList = {
var Pager = {
limit:0,
offset:0,
disable:false,
init:
function(limit) {
this.limit=limit;
this.offset=limit;
this.initLoadMore();
$('.loading').show();
},
getOld:
......@@ -22,21 +24,27 @@ var ProjectsList = {
append:
function(count, html) {
$(".tile").append(html);
$(".content_list").append(html);
if(count > 0) {
this.offset += count;
this.initLoadMore();
} else {
this.disable = true;
}
},
initLoadMore:
function() {
$(window).bind('scroll', function(){
if($(window).scrollTop() == $(document).height() - $(window).height()){
$(window).unbind('scroll');
$(document).endlessScroll({
bottomPixels: 400,
fireDelay: 1000,
fireOnce:true,
ceaseFire: function() {
return Pager.disable;
},
callback: function(i) {
$('.loading').show();
ProjectsList.getOld();
Pager.getOld();
}
});
});
}
}
function backToMembers(){
$("#team_member_new").hide("slide", { direction: "right" }, 150, function(){
$("#new_team_member").hide("slide", { direction: "right" }, 150, function(){
$("#team-table").show("slide", { direction: "left" }, 150, function() {
$("#team_member_new").remove();
$("#new_team_member").remove();
$(".add_new").show();
});
});
......
......@@ -5,21 +5,24 @@
var Tree = {
init:
function() {
(new Image).src = "ajax-loader-facebook.gif";
$('#tree-slider td.tree-item-file-name a, #tree-breadcrumbs a').live("click", function() {
history.pushState({ path: this.path }, '', this.href)
$('#tree-slider .tree-item-file-name a, .breadcrumb li > a').live("click", function() {
$("#tree-content-holder").hide("slide", { direction: "left" }, 150)
})
$("#tree-slider tr.tree-item").live('click', function(e){
$('.project-refs-form').live({
"ajax:beforeSend": function() {
$("#tree-content-holder").hide("slide", { direction: "left" }, 150);
}
})
$("#tree-slider .tree-item").live('click', function(e){
if(e.target.nodeName != "A") {
link = $(this).find("td.tree-item-file-name a");
link = $(this).find(".tree-item-file-name a");
link.trigger("click");
}
});
$('#tree-slider td.tree-item-file-name a, #tree-breadcrumbs a').live({
$('#tree-slider .tree-item-file-name a, .breadcrumb a, .project-refs-form').live({
"ajax:beforeSend": function() { $('.tree_progress').addClass("loading"); },
"ajax:complete": function() { $('.tree_progress').removeClass("loading"); }
});
......
......@@ -7,5 +7,5 @@
*= require jquery-ui/jquery.tagify
*= require chosen
*= require_self
*= require common
*= require main
*/
/* Commit Page */
body.project-page.commits-page .commit-info{float: right;}
body.project-page.commits-page .commit-info data{
padding: 4px 10px;
font-size: 11px;
}
body.project-page.commits-page .commit-info data.commit-button{
background-image: -webkit-gradient(linear, 0 0, 0 26, color-stop(0.192, #fff), to(#f4f4f4));
background-image: -webkit-linear-gradient(#fff 19.2%, #f4f4f4);
background-image: -moz-linear-gradient(#fff 19.2%, #f4f4f4);
background-image: -o-linear-gradient(#fff 19.2%, #f4f4f4);
box-shadow: 0 -1px 0 white inset;
display: block;
border: 1px solid #eee;
border-radius: 5px;
margin-bottom: 2px;
position: relative;
padding-right: 20px;
}
body.project-page.commits-page .commit-button i{
background: url('images.png') no-repeat -138px -27px;
width: 6px;
height: 9px;
float: right;
position: absolute;
top: 6px;
right: 5px;
}
body.project-page.commits-page .commits-date {display: block; width: 100%; margin-bottom: 20px}
body.project-page.commits-page .commits-date .data {padding: 0}
body.project-page.commits-page a.commit{padding: 10px; border-bottom: 1px solid #eee; overflow: hidden; display: block;}
body.project-page.commits-page .commits-date a.commit {padding: 10px; border-bottom: none; overflow: hidden; display: block;}
body.project-page.commits-page .commits-date a.commit:last-child{border-bottom: 0}
body.project-page.commits-page .commits-date a.commit img{float: left; margin-right: 10px;}
body.project-page.commits-page .commits-date a.commit span.commit-title{display: block;}
body.project-page.commits-page .commits-date a.commit span.commit-title{margin-bottom: 10px}
body.project-page.commits-page .commits-date a.commit span.commit-author{color: #999; font-weight: normal; font-style: italic;}
body.project-page.commits-page .commits-date a.commit span.commit-author strong{font-weight: bold; font-style: normal;}
/* eo Commit Page */
/** Commit diff view **/
.diff_file {
border:1px solid #CCC;
margin-bottom:1em;
.diff_file_header {
padding:5px 5px;
border-bottom:1px solid #CCC;
background: #eee;
}
.diff_file_content {
overflow:auto;
overflow-y:hidden;
background:#fff;
color:#333;
font-size: 12px;
font-family: 'Courier New', 'andale mono','lucida console',monospace;
}
.diff_file_content_image {
background:#eee;
text-align:center;
img {
padding:100px;
max-width:300px;
}
}
}
.diff_file_content{
table {
border:none;
margin:0px;
padding:0px;
}
.old_line, .new_line {
margin:0px;
padding:0px;
border:none;
background:#F7F7F7;
color:#aaa;
padding: 0px 5px;
border-right: 1px solid #ccc;
text-align:right;
min-width:35px;
max-width:35px;
width:35px;
a {
float:left;
width:35px;
font-weight:normal;
color:#aaa;
&:hover {
text-decoration:underline;
}
}
}
.line_content {
white-space:pre;
height:14px;
margin:0px;
padding:0px;
border:none;
&.new {
background: #DFD;
}
&.old {
background: #FDD;
}
}
}
pre.commit_message {
white-space: pre-wrap;
font-family: "Helvetica", sans-serif;
color: #555;
font-weight:bold;
font-size:15px;
}
/** COMMIT BLOCK **/
.commit-title{display: block;}
.commit-title{margin-bottom: 10px}
.commit-author{color: #999; font-weight: normal; font-style: italic;}
.commit-author strong{font-weight: bold; font-style: normal;}
/** bordered list **/
ul.bordered-list {
margin:5px 0px;
padding:0px;
li {
padding: 5px 0;
border-bottom: 1px solid #EEE;
overflow: hidden;
display: block;
margin:0px;
}
}
ul.bordered-list li:last-child { border:none }
.line_holder {
&:hover {
td {
background: #FFFFCF !important;
}
}
}
.per_line_form {
font-family: "Helvetica", sans-serif;
background: #2FA0BB;
td {
padding:0;
}
form {
margin:5px;
width: 756px;
border: 1px solid #CCC;
padding: 20px;
background: white;
}
}
tr.line_notes_row {
font-family: "Helvetica", sans-serif;
&:hover {
background:none;
}
td {
margin:0px;
padding:0px;
border-bottom:1px solid #DEE2E3;
ul {
display:block;
list-style:none;
margin:0px;
padding:0px;
li {
border-top:1px solid #DEE2E3;
padding:10px;
}
}
}
}
This diff is collapsed.
body.dashboard-page h2.icon span{ background-position: 9px -69px; }
body.dashboard-page header{margin-bottom: 0}
body.dashboard-page .news-feed{margin-left: 285px; min-height: 600px; margin-top: 20px; margin-right:2px; padding:20px;}
body.dashboard-page .dashboard-content{ position: relative; float: left; width: 100%; height: 100%; }
body.dashboard-page .news-feed h2{float: left;}
body.dashboard-page aside{
min-height: 820px; position: relative; top: 0; bottom: 0; right: 0; width: 260px; float: left; border-right: 1px solid $border_color; padding:20px; padding-right:0;
h4{margin: 0; border-bottom: 1px solid #ccc; padding: 20px 20px 20px 0px; font-size: 11px; font-weight: bold; text-transform: uppercase;}
h4 a.button-small{float: right; text-transform: none; border-radius: 4px; margin-right: 2%; margin-top: -4px; display: block;}
.project-list {list-style: none; margin: 0; padding: 0;}
.project-list li a {background: white; color: #{$blue_link}; display: block; border-bottom: 1px solid $lite_border_color; padding: 14px 6% 14px 0px;}
.project-list li a span.project-name{font-size: 14px; display: block; margin-bottom: 8px}
.project-list li a span.time{color: #666; font-weight: normal; font-size: 11px}
.project-list li a span.arrow{float: right; background: #E3E5EA; padding: 10px; border-radius: 5px; margin-top: 2px; text-shadow: none; color: #999}
}
body.dashboard-page .news-feed .project-updates {
margin-bottom: 20px; display: block; width: 100%;
.data{ padding: 0}
a.project-update {padding: 10px; overflow: hidden; display: block;}
a.project-update:last-child{border-bottom: 0}
a.project-update img{float: left; margin-right: 10px;}
a.project-update span.update-title, .dashboard-page .news-feed .project-updates li a span.update-author{display: block;}
a.project-update span.update-title{margin-bottom: 10px}
a.project-update span.update-author{color: #999; font-weight: normal; font-style: italic;}
a.project-update span.update-author strong{font-weight: bold; font-style: normal;}
}
/* eo Dashboard Page */
.black .highlighttable {
background: #333;
td.linenos { border:none; }
pre { color: #eee }
.highlight { background: #333; border-left:1px solid #555; }
......
......@@ -10,13 +10,15 @@ table.highlighttable
margin:0px;
padding:0px;
font-size:12px;
table-layout:fixed
table-layout:fixed;
background: #F7F7F7;
}
td.code,
td.linenos{
padding:0;
margin:0;
border-top:0;
vertical-align:top;
}
......@@ -24,8 +26,16 @@ td.linenos{
background:none;
padding:10px 0px 0px 10px;
margin-left:0px;
border-left: 1px solid #DEE2E3;
background: white;
}
.linenodiv pre,
.highlight pre{
margin:0;
padding:0;
background:none;
border:none;
}
.linenodiv pre {
......@@ -48,7 +58,7 @@ td.code .highlight {
table.highlighttable pre{
padding:0;
margin:0;
font-family: 'Courier New', 'andale mono','lucida console',monospace;
font-family: 'Menlo', 'Courier New', 'andale mono','lucida console',monospace;
color: #333;
text-align:left;
}
......@@ -62,7 +72,7 @@ table.highlighttable pre{
padding:0;
line-height:2.0;
margin:0;
font-family: 'Courier New', 'andale mono','lucida console',monospace;
font-family: 'Menlo', 'Courier New', 'andale mono','lucida console',monospace;
color: #333;
text-align:left;}
}
......
.issue-number {
float: left;
border-radius: 5px;
text-shadow: none;
background: rgba(0, 0, 0, 0.12);
text-align: center;
padding: 14px 8px;
width: 40px;
margin-right: 10px;
color: #444;
}
.issues_filter {
margin:10px 0;
.left {
margin-right:15px;
}
}
.top_panel_issues{
#issue_search_form {
margin:5px 0;
input {
border:1px solid #D3D3D3;
padding: 3px;
height: 28px;
width: 250px;
-webkit-appearance:none;
box-sizing: border-box;
-moz-box-sizing: border-box;
&:focus {
border-color:#c2e1ef;
}
}
}
}
/** ISSUES LIST **/
.issue .action-links {
display:none;
a {
margin-left:10px;
}
}
.issue:hover .action-links { display:block; }
.issue-show-holder {
width:100%;
.data p { font-size:16px }
}
#issue_assignee_id {
width:300px;
}
.issue-form-holder .ui-box .data {
margin: 0;
padding: 0;
}
body.project-page .merge-request-form-holder table.no-borders tr,
body.project-page .merge-request-form-holder table.no-borders td,
body.project-page .issue-form-holder table.no-borders tr,
body.project-page .issue-form-holder table.no-borders td,
body.project-page .new_snippet table tr,
body.project-page .new_snippet table td,
body.project-page .edit_snippet table tr,
body.project-page .edit_snippet table td
{
&:hover {
background:none;
}
}
#issues-table {
tr {
border-top: 1px solid $lite_border_color;
&:first-child {
border:none;
}
}
}
/* Login Page */
body.login-page{
padding-top: 10%;
background:#f1f1f1;
}
.login-box{
width: 304px;
position: relative;
border-radius: 5px;
margin: auto;
padding: 20px;
background: white;
}
.login-box .login-logo{
margin: 10px 0 30px 0;
display: block;
}
.login-box input.text{background-color: #f1f1f1; font-size: 16px; border-radius: 0; padding: 14px 10px; width: 280px}
.login-box input.text.top{
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
}
.login-box input.text.bottom{
-webkit-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
-moz-border-radius-bottomright: 5px;
-moz-border-radius-bottomleft: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
border-top: 0;
margin-bottom: 20px;
}
.login-box a.forgot{float: right; padding-top: 6px}
@import "bootstrap";
/** GITLAB colors **/
$text_color:#222;
$lite_text_color: #666;
$link_color:#2A79A3;
$active_link_color:#2FA0BB;
$active_bg_color:#79C3E0;
$active_bd_color: #2FA0BB;
$border_color:#CCC;
$lite_border_color:#EEE;
$min_app_width:980px;
$max_app_width:980px;
$app_padding:20px;
$bg_color: #FFF;
$styled_border_color: #2FA0BB;
$color: "#4BB8D2";
$blue_link: "#2fa0bb";
/** Style colors **/
$style_color: #474D57;
$hover: #FDF5D9;
/** MIXINS **/
@mixin shade {
-moz-box-shadow: 0 0 3px #ddd;
-webkit-box-shadow: 0 0 3px #ddd;
box-shadow: 0 0 3px #ddd;
}
@mixin round-borders-bottom($radius) {
border-top: 1px solid #eaeaea;
-moz-border-radius-bottomright: $radius;
-moz-border-radius-bottomleft: $radius;
border-bottom-right-radius: $radius;
border-bottom-left-radius: $radius;
-webkit-border-bottom-left-radius: $radius;
-webkit-border-bottom-right-radius: $radius;
}
@mixin round-borders-top($radius) {
border-top: 1px solid #eaeaea;
-moz-border-radius-topright: $radius;
-moz-border-radius-topleft: $radius;
border-top-right-radius: $radius;
border-top-left-radius: $radius;
-webkit-border-top-left-radius: $radius;
-webkit-border-top-right-radius: $radius;
}
@mixin round-borders-all($radius) {
border: 1px solid #eaeaea;
-moz-border-radius: $radius;
-webkit-border-radius: $radius;
border-radius: $radius;
}
/**
* This file represent some UI that can be changed
* during web app restyle or theme select.
*
* Next items should be placed there
* - link colors
* - header styles
* - main menu styles
*
*/
@import "ui_basic.scss";
/**
* UI mars theme
*/
@import "ui_mars.scss";
/**
* Most of application styles placed here.
* This file represent common UI that should not be changed between themes
* or project restyling like form width or user avatar class or commit title
*
* TODO: clean it
*/
@import "common.scss";
/**
* This scss file redefine chozen selectbox styles for
* project Branch/Tag select element
*/
@import "ref_select.scss";
/**
* Code (files list) styles. Browsing project files there
*/
@import "tree.scss";
/**
* This file represent notes(comments) styles
*/
@import "notes.scss";
/**
* Devise styles
*/
@import "login.scss";
/**
* CODE HIGHTLIGHT BASE
*
*/
@import "highlight.scss";
/**
* CODE HIGHTLIGHT DARK schema
*
*/
@import "highlight.black.scss";
// Place all the styles related to the MergeRequests controller here.
// They will automatically be included in application.css.
// You can use Sass (SCSS) here: http://sass-lang.com/
.merge-request-form-holder {
select {
width:300px;
}
}
/** Notes **/
#notes-list {
display:block;
list-style:none;
margin:0px;
padding:0px;
}
.issue_notes {
.note_content {
float:left;
width:400px;
}
}
/* Note textare */
#note_note {
height:100px;
width:97%;
font-size:14px;
}
#new_note {
#note_note {
height:25px;
}
.attach_holder {
display:none;
}
}
#notes-list .note .delete-note { display:none; }
#notes-list .note:hover .delete-note { display:block; }
body.project-page #notes-list .note {padding: 10px 0; border-bottom: 1px solid #eee; overflow: hidden; display: block;}
body.project-page #notes-list .note img{float: left; margin-right: 10px;}
body.project-page #notes-list .note span.note-title{display: block;}
body.project-page #notes-list .note span.note-title{margin-bottom: 10px}
body.project-page #notes-list .note span.note-author{color: #999; font-weight: normal; font-style: italic;}
body.project-page #notes-list .note span.note-author strong{font-weight: bold; font-style: normal;}
.note .note-title { margin-left:55px; }
p.notify_controls input{
margin: 5px;
}
p.notify_controls span{
font-weight: 700;
}
/**
* Notes
*
*/
#notes-list,
#new_notes_list {
display:block;
list-style:none;
margin:0px;
padding:0px;
}
#new_notes_list li:last-child{
border-bottom:1px solid #aaa;
}
.issue_notes {
.note_content {
float:left;
width:400px;
}
}
/* Note textare */
#note_note {
height:100px;
width:97%;
font-size:14px;
}
#new_note {
#note_note {
height:25px;
}
.attach_holder {
display:none;
}
}
.note .delete-note {
display:none;
float:right;
}
.note:hover .delete-note { display:block; }
.note {padding: 10px 0; border-bottom: 1px solid #eee; overflow: hidden; display: block;}
.note img{float: left; margin-right: 10px;}
.note span.note-title{display: block;}
.note span.note-title{margin-bottom: 10px}
.note span.note-author{color: #999; font-weight: normal; font-style: italic;}
.note span.note-author strong{font-weight: bold; font-style: normal;}
.note p { color:$style_color; }
.note .note-author { color: $style_color;}
.note .note-title { margin-left:55px; }
p.notify_controls input{
margin: 5px;
}
p.notify_controls span{
font-weight: 700;
}
tr.line_notes_row {
border-bottom:1px solid #DDD;
&.reply {
background:#eee;
td {
padding:7px 10px;
}
a.line_note_reply_link {
@include round-borders-all(4px);
border-color:#aaa;
background: #bbb;
padding: 3px 20px;
color: white;
}
}
ul {
margin:0;
li {
padding:0;
border:none;
}
}
}
.line_notes_row, .per_line_form { font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; }
.per_line_form {
background:#f5f5f5;
form { margin: 0; }
td {
border-bottom:1px solid #ddd;
}
}
td .line_note_link {
position:absolute;
margin-left:-70px;
margin-top:-10px;
z-index:10;
background: url("comment_add.png") no-repeat left 0;
width:32px;
height:32px;
opacity: 0.0;
filter: alpha(opacity=0);
&:hover {
opacity: 1.0;
filter: alpha(opacity=100);
}
}
.diff_file_content tr.line_holder:hover > td { background: $hover !important; }
.diff_file_content tr.line_holder:hover > td .line_note_link {
opacity: 1.0;
filter: alpha(opacity=100);
}
/** Branch/tag selector **/
.project-refs-form {
margin:0;
span {
background:none !important;
position:static !important;
width:auto !important;
height:auto !important;
}
}
.project-refs-select {
width:120px;
}
.project-refs-form .chzn-container {
position: relative;
top: 0;
left: 0;
margin-right: 10px;
.chzn-drop {
margin:7px 0;
border: 1px solid #CCC;
min-width: 300px;
.chzn-results {
max-height:300px;
}
.chzn-search input {
min-width:200px;
}
}
.chzn-single {
background:#ddd;
//border:none;
//box-shadow:none;
div {
background:transparent;
border-left:none;
}
span {
font-weight: normal;
}
}
}
This diff is collapsed.
.tags-list {
padding : 0px 10px 10px 10px;
}
.tags-list a {
display: inline-block;
padding: 8px 11px 8px 11px;
margin: 1px 5px 0px 0px;
border-radius: 4px;
border: 1px solid #72bbdf;
background-color: #72bbdf;
color: #0f326d;
font-weight: bold;
font-size: 14px;
}
.small-tags a{
font-size: 9px;
display: inline-block;
padding: 2px 3px 1px 3px;
margin: 0px 3px 0px 0px;
border-radius: 2px;
background-color: #72bbdf;
color: #FFF;
text-shadow: none;
font-weight: bold;
}
.medium-tags a{
font-size: 12px;
display: inline-block;
padding: 3px 4px 2px 4px;
margin: 0px 7px 8px 0px;
border-radius: 3px;
background-color: #72bbdf;
color: #FFF;
text-shadow: none;
font-weight: bold;
}
.main_links {
width:130px;
float:left;
a {
float:left;
}
}
.dashboard_links {
padding:7px;
float:left;
a {
margin: 0 14px;
float: left;
font-size: 14px;
&.active {
color:$active_link_color;
}
&:hover {
color:$active_link_color;
}
}
}
.top-tabs {
margin: 0;
padding: 5px;
font-size: 14px;
padding-bottom:10px;
margin-bottom:20px;
height:26px;
border-bottom:1px solid #ccc;
.tab {
font-weight: bold;
background:none;
padding: 10px;
float:left;
padding-left:0px;
padding-right:40px;
&.active {
color: $active_link_color;
}
}
}
body header {
position:absolute;
width:100%;
padding:0;
margin:0;
top:0;
left:0;
background: #999; /* for non-css3 browsers */
filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#FFFFFF', endColorstr='#EAEAEA'); /* for IE */
background: -webkit-gradient(linear, left top, left bottom, from(#FFFFFF), to(#EAEAEA)); /* for webkit browsers */
background: -moz-linear-gradient(top, #FFFFFF, #EAEAEA); /* for firefox 3.6+ */
background: -o-linear-gradient(top, #FFFFFF, #EAEAEA); /* for firefox 3.6+ */
border-bottom: 1px solid #ccc;
height:50px;
.wrapper {
margin:auto;
width:$app_width;
position:relative;
.top_panel_content {
padding:10px $app_padding;
}
}
.project_name {
float:left;
width:235px;
margin-right:30px;
font-size:16px;
font-weight:bold;
padding:8px;
color:#333;
}
.git_url_wrapper {
padding:0px;
margin:0px;
float:left;
.git-url {
padding:0px;
margin:0px;
font-size: 12px;
margin-right:10px;
border-radius: 4px;
-moz-border-radius: 4px;
color: #666;
border: 1px solid #AAA;
padding: 0 10px 0 30px;
background: transparent url('images.png') no-repeat 8px -42px;
width: 160px;
height:26px;
}
}
}
.top_panel_holder .chzn-container {
position:relative;
.chzn-drop {
margin:7px 0;
border: 1px solid #CCC;
min-width: 300px;
.chzn-results {
max-height:300px;
}
}
.chzn-single {
background:transparent;
-moz-border-radius: 4px;
border-radius: 4px;
div {
background:transparent;
border-left:none;
}
span {
font-weight: normal;
}
}
}
.rss-icon {
margin:0 15px;
padding:3px;
border:1px solid #AAA;
border-radius:3px;
float:left;
}
#tree-breadcrumbs {
div {
margin:0;
margin-bottom:20px;
#tree-holder {
#tree-content-holder {
float:left;
font-size:14px;
width:100%;
}
#tree-readme-holder {
float:left;
width:100%;
.readme {
@include round-borders-all(4px);
padding:4px 15px;
background: #F7F7F7;
}
}
}
.tree_progress {
float:left;
width:16px;
height:16px;
margin:2px 6px;
&.loading {
background-position: 0px 0px;
background: url("ajax-loader-facebook.gif") no-repeat;
.tree_progress {
display:none;
margin:20px;
&.loading {
display:block;
}
}
}
/** FILE CONTENT VIEW **/
.view_file_content{
.old_line, .new_line {
background:#ECECEC;
color:#777;
width:15px;
float:left;
padding: 0px 10px;
border-right: 1px solid #ccc;
}
.old_line{
display:none;
/** FILE CONTENT VIEW **/
.view_file_content{
.old_line, .new_line {
background:#ECECEC;
color:#777;
width:15px;
float:left;
padding: 0px 10px;
border-right: 1px solid #ccc;
}
.old_line{
display:none;
}
}
}
.view_file .view_file_header,
.diff_file .diff_file_header {
background-image: -webkit-gradient(linear, 0 0, 0 26, color-stop(0.076, #fefefe), to(#F6F7F8));
background-image: -webkit-linear-gradient(#fefefe 7.6%, #F6F7F8);
background-image: -moz-linear-gradient(#fefefe 7.6%, #F6F7F8);
background-image: -o-linear-gradient(#fefefe 7.6%, #F6F7F8);
.view_file .view_file_header,
.diff_file .diff_file_header {
background:#f5f5f5;
margin: 0;
font-weight: normal;
font-weight: bold;
text-align: left;
color: #666;
border-bottom: 1px solid #DEE2E3;
border-bottom: 1px solid #ccc;
padding: 7px 10px;
.mode_text,
.file_icon {
margin-right:15px;
padding-right:15px;
border-right:1px solid $lite_border_color;
float:left;
color:#aaa;
}
}
.file_icon {
padding-left:15px;
.view_file {
border:1px solid #CCC;
margin-bottom:1em;
.view_file_content {
background:#fff;
color:#514721;
font-size: 11px;
}
}
.view_file_content_image {
background:#eee;
text-align:center;
img {
padding:100px;
max-width:300px;
}
}
}
.view_file {
border:1px solid #CCC;
margin-bottom:1em;
.view_file_content {
background:#fff;
color:#514721;
font-size: 11px;
}
.view_file_content_image {
background:#eee;
text-align:center;
img {
padding:100px;
max-width:300px;
td.code {
width: 100%;
.highlight {
margin-left: 55px;
overflow:auto;
overflow-y:hidden;
}
}
}
.highlight pre {
white-space: pre;
word-wrap:normal;
}
td.code {
width: 100%;
.highlight {
margin-left: 55px;
overflow:auto;
overflow-y:hidden;
border-left: 1px solid #DEE2E3;
background: white;
table.highlighttable {
border: none;
}
}
.highlight pre {
white-space: pre;
word-wrap:normal;
}
body.project-page table.highlighttable td { border: none }
table.highlighttable tr:hover { background:none;}
table.highlighttable {
border: none;
background: #F7F7F7;
}
body.project-page table.highlighttable td { border: none }
table.highlighttable tr:hover { background:none;}
table.highlighttable pre{
line-height:16px !important;
font-size:12px !important;
}
table.highlighttable pre{
line-height:16px !important;
font-size:12px !important;
}
table.highlighttable .linenodiv pre {
text-align: right;
padding-right: 4px;
color:#888;
}
table.highlighttable .linenodiv pre {
text-align: right;
padding-right: 4px;
color:#888;
}
.tree-item {
&:hover {
background: $hover;
cursor:pointer;
}
.tree-item-file-name {
font-weight:bold;
a {
color:$style_color;
}
img {
position: relative;
top: 2px;
}
}
}
ul.breadcrumb {
background:white;
border:none;
a {
color:#666;
font-weight:bold;
font-size:14px;
}
}
#tree-slider {
@include shade;
td {
padding:7px;
border-color:#f1f1f1;
}
th {
background:#f5f5f5;
}
}
.tree-commit-link {
color:#333;
}
#tree-content-holder .view_file{
@include shade;
}
#tree-readme-holder .readme {
@include shade;
margin-bottom:20px;
}
a.tree-commit-link {
color: #666;
&:hover {
text-decoration: underline;
}
}
.tree-item {
&:hover {
background: #FFFFCF;
.arrow {
background: url("images.png") no-repeat -85px -77px;
width: 19px;
height: 16px;
float: left;
position: relative;
left: -10px;
}
}
/**
* This file represent some UI that can be changed
* during web app restyle or theme select.
*
* Next items should be placed there
* - link colors
* - header styles
* - main menu styles
*
*/
.ui_basic {
/*
* Common styles
*
*/
a {
color: $link_color;
&:hover {
text-decoration:none;
color: $style_color;
}
}
/*
* Application Header
*
*/
header {
width:100%;
padding:0;
margin:0;
top:1px;
left:0;
background: #F1F1F1; /* for non-css3 browsers */
border-bottom: 1px solid #ccc;
box-shadow: 0 -1px 0 white inset;
-moz-box-shadow: 0 -1px 0 white inset;
-webkit-box-shadow: 0 -1px 0 white inset;
z-index:10;
height:60px;
.app_logo {
width:230px;
float:left;
a {
float:left;
h1 {
float:left;
margin-left:5px;
font-size:20px;
line-height:34px;
font-weight:bold;
color:#aaa;
text-shadow: 0 1px 1px #FFF;
}
&.home {
img {
float: left;
position: relative;
top: -9px;
width:46px;
}
}
&.admin_link {
width:16px;
height:16px;
padding: 5px;
border: 1px solid #ccc;
border-radius: 4px;
margin: 0px;
background: #eee;
margin-left:20px;
&:hover {
background:#f7f7f7;
}
img {
width:16px;
}
}
}
}
.wrapper {
margin:auto;
min-width:$min_app_width;
max-width:$max_app_width;
position:relative;
padding:15px 0;
.top_panel_content {
margin:0 $app_padding;
}
}
.project_name {
float:left;
width:400px;
margin:0;
margin-right:30px;
font-size:20px;
line-height:34px;
font-weight:bold;
color:$style_color;
text-shadow: 0 1px 1px #FFF;
}
.git_url_wrapper {
padding:0px;
margin:0px;
float:left;
.git-url {
padding:0px;
margin:0px;
font-size: 12px;
margin-right:10px;
border-radius: 4px;
-moz-border-radius: 4px;
color: #666;
border: 1px solid #AAA;
padding: 0 10px 0 30px;
background: transparent url('images.png') no-repeat 8px -42px;
width: 260px;
height:26px;
}
}
/* Account box */
.account-box {
position: absolute;
right: 0;
top: 13px;
z-index: 10000;
width: 128px;
font-size: 11px;
float: right;
display: block;
cursor: pointer;
img {
border-radius: 4px;
right: 20px;
position: absolute;
width: 33px;
height: 33px;
display: block;
top: 0;
&:after {
content: " ";
display: block;
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
float: right;
border-radius: 5px;
border: 1px solid rgba(255, 255, 255, 0.1);
border-bottom: 0;
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(255, 255, 255, 0.15)), to(rgba(0, 0, 0, 0.25))), -webkit-gradient(linear, left top, right bottom, color-stop(0, rgba(255, 255, 255, 0)), color-stop(0.5, rgba(255, 255, 255, 0.1)), color-stop(0.501, rgba(255, 255, 255, 0)), color-stop(1, rgba(255, 255, 255, 0)));
background: -moz-linear-gradient(top, rgba(255, 255, 255, 0.15), rgba(0, 0, 0, 0.25)), -moz-linear-gradient(left top, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0));
background: linear-gradient(top, rgba(255, 255, 255, 0.15), rgba(0, 0, 0, 0.25)), linear-gradient(left top, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0));
-webkit-background-origin: border-box;
-moz-background-origin: border;
background-origin: border-box; } } }
.account-box {
&.hover {
height: 138px; }
&:hover > .account-links {
display: block; } }
.account-links {
background: #79C3E0;
display: none;
border-radius: 5px;
width: 100px;
margin-top: 0;
float: right;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
position: relative;
&:before {
content: ".";
width: 0;
height: 0;
position: absolute;
border: 5px solid transparent;
border-color: rgba(255, 255, 255, 0);
border-bottom-color: #333;
text-indent: -9999px;
top: -10px;
line-height: 0;
right: 10px;
z-index: 10; }
background: #333;
display: none;
z-index: 100000;
border-radius: 5px;
width: 100px;
position: absolute;
right: 20px;
top: 46px;
margin-top: 0;
float: right;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
a {
color: #EEE;
padding: 6px 10px;
display: block;
text-shadow: none;
border-bottom: 1px solid #555;
&:hover {
background: #444; } } }
.account-box.hover .arrow-up {
top: 41px;
right: 6px;
position: absolute; }
.account-links a {
&:first-child {
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
border-top-left-radius: 5px;
border-top-right-radius: 5px; }
&:last-child {
-webkit-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
-moz-border-radius-bottomright: 5px;
-moz-border-radius-bottomleft: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
border-bottom: 0; } }
}
/*
* End of Application Header
*
*/
/*
* Main Menu of Application
*
*/
nav.main_menu {
overflow:hidden;
border-radius: 4px;
margin: auto;
margin:30px $app_padding;
background:#eee;
border:1px solid #ccc;
height:38px;
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);
@include shade;
.count {
color:#aaa;
margin-left:3px;
}
.label {
background:$hover;
text-shadow:none;
color:$style_color;
}
a {
font-weight:bold;
&:first-child{
-webkit-border-top-left-radius: 4px;
-webkit-border-bottom-left-radius: 4px;
-moz-border-radius-topleft: 4px;
-moz-border-radius-bottomleft: 4px;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
padding: 10px 25px;
display: inline-block;
color: $style_color;
border-right: 1px solid #d5d5d5;
position: relative;
box-shadow: 1px 0 0 rgba(255, 255, 255, 0.1);
margin: 0;
float:left;
text-shadow:0 1px 1px white;
&.home {
background: url(home_icon.PNG) no-repeat center center;
text-indent:-9999px;
min-width:40px;
img {
position:relative;
top:4px;
}
}
&.current {
background-color:#DDD;
}
}
}
/*
* End of Main Menu
*
*/
}
/**
* This file represent some UI that can be changed
* during web app restyle or theme select.
*
* Next items should be placed there
* - link colors
* - header styles
* - main menu styles
*
*/
.ui_mars {
/*
* Common styles
*
*/
a {
color: $link_color;
&:hover {
text-decoration:none;
color: $style_color;
}
}
/*
* Application Header
*
*/
header {
width:100%;
padding:0;
margin:0;
top:1px;
left:0;
background: #474D57 url('bg-header.png') repeat-x bottom;
z-index:10;
height:60px;
.search-input {
background-image:url("icon-search.png");
float: right;
text-shadow: none;
width: 116px;
background-image: url("icon-search.png");
background-repeat: no-repeat;
background-position: 10px;
border-radius: 100px;
border: 1px solid rgba(0, 0, 0, 0.7);
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 2px rgba(0, 0, 0, 0.4) inset;
background-color: #D2D5DA;
background-color: rgba(255, 255, 255, 0.5);
padding: 5px;
padding-left: 26px;
margin-right: 50px;
&:focus {
background-color: white;
width: 166px;
}
}
.search-input::-webkit-input-placeholder {
color: #666;
}
.app_logo {
width:230px;
float:left;
position:relative;
top:-4px;
a {
float:left;
h1 {
background: url('images.png') no-repeat -3px -7px;
width: 65px;
height: 26px;
margin: 5px 0;
padding: 0;
display: block;
float: left;
text-indent: -1000em;
}
&.home {
img {
display:none
}
}
&.admin_link {
width:16px;
height:16px;
padding: 5px;
border: 1px solid #888;
border-radius: 4px;
margin: 0px;
background:#474D57 ;
margin-left:20px;
margin-top:4px;
&:hover {
background:#f7f7f7;
}
img {
width:16px;
}
}
}
}
.wrapper {
margin:auto;
min-width:$min_app_width;
max-width:$max_app_width;
position:relative;
padding:15px 0;
.top_panel_content {
margin:0 $app_padding;
}
}
.project_name {
float:left;
width:400px;
margin:0;
margin-right:30px;
font-size:20px;
line-height:34px;
font-weight:bold;
color:#fff;
text-shadow: 0 1px 1px #111;
}
.git_url_wrapper {
padding:0px;
margin:0px;
float:left;
.git-url {
padding:0px;
margin:0px;
font-size: 12px;
margin-right:10px;
border-radius: 4px;
-moz-border-radius: 4px;
color: #666;
border: 1px solid #AAA;
padding: 0 10px 0 30px;
background: transparent url('images.png') no-repeat 8px -42px;
width: 260px;
height:26px;
}
}
/* Account box */
.account-box {
position: absolute;
right: 0;
top: 13px;
z-index: 10000;
width: 128px;
font-size: 11px;
float: right;
display: block;
cursor: pointer;
img {
border-radius: 4px;
right: 20px;
position: absolute;
width: 33px;
height: 33px;
display: block;
top: 0;
&:after {
content: " ";
display: block;
position: absolute;
top: 0;
right: 0;
left: 0;
bottom: 0;
float: right;
border-radius: 5px;
border: 1px solid rgba(255, 255, 255, 0.1);
border-bottom: 0;
background: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgba(255, 255, 255, 0.15)), to(rgba(0, 0, 0, 0.25))), -webkit-gradient(linear, left top, right bottom, color-stop(0, rgba(255, 255, 255, 0)), color-stop(0.5, rgba(255, 255, 255, 0.1)), color-stop(0.501, rgba(255, 255, 255, 0)), color-stop(1, rgba(255, 255, 255, 0)));
background: -moz-linear-gradient(top, rgba(255, 255, 255, 0.15), rgba(0, 0, 0, 0.25)), -moz-linear-gradient(left top, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0));
background: linear-gradient(top, rgba(255, 255, 255, 0.15), rgba(0, 0, 0, 0.25)), linear-gradient(left top, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.1) 50%, rgba(255, 255, 255, 0) 50%, rgba(255, 255, 255, 0));
-webkit-background-origin: border-box;
-moz-background-origin: border;
background-origin: border-box; } } }
.account-box {
&.hover {
height: 138px; }
&:hover > .account-links {
display: block; } }
.account-links {
background: #79C3E0;
display: none;
border-radius: 5px;
width: 100px;
margin-top: 0;
float: right;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
position: relative;
&:before {
content: ".";
width: 0;
height: 0;
position: absolute;
border: 5px solid transparent;
border-color: rgba(255, 255, 255, 0);
border-bottom-color: #333;
text-indent: -9999px;
top: -10px;
line-height: 0;
right: 10px;
z-index: 10; }
background: #333;
display: none;
z-index: 100000;
border-radius: 5px;
width: 100px;
position: absolute;
right: 20px;
top: 46px;
margin-top: 0;
float: right;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);
a {
color: #EEE;
padding: 6px 10px;
display: block;
text-shadow: none;
border-bottom: 1px solid #555;
&:hover {
background: #444; } } }
.account-box.hover .arrow-up {
top: 41px;
right: 6px;
position: absolute; }
.account-links a {
&:first-child {
-webkit-border-top-left-radius: 5px;
-webkit-border-top-right-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
border-top-left-radius: 5px;
border-top-right-radius: 5px; }
&:last-child {
-webkit-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
-moz-border-radius-bottomright: 5px;
-moz-border-radius-bottomleft: 5px;
border-bottom-right-radius: 5px;
border-bottom-left-radius: 5px;
border-bottom: 0; } }
}
/*
* End of Application Header
*
*/
/*
* Main Menu of Application
*
*/
nav.main_menu {
overflow:hidden;
border-radius: 4px;
margin: auto;
margin:30px $app_padding;
background:#eee;
border:1px solid #ccc;
height:38px;
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);
@include shade;
.count {
color:#aaa;
margin-left:3px;
}
.label {
background:$hover;
text-shadow:none;
color:$style_color;
}
a {
font-weight:bold;
&:first-child{
-webkit-border-top-left-radius: 4px;
-webkit-border-bottom-left-radius: 4px;
-moz-border-radius-topleft: 4px;
-moz-border-radius-bottomleft: 4px;
border-top-left-radius: 4px;
border-bottom-left-radius: 4px;
}
padding: 10px 25px;
display: inline-block;
color: $style_color;
border-right: 1px solid #d5d5d5;
position: relative;
box-shadow: 1px 0 0 rgba(255, 255, 255, 0.1);
margin: 0;
float:left;
text-shadow:0 1px 1px white;
&.home {
background: url(home_icon.PNG) no-repeat center center;
text-indent:-9999px;
min-width:40px;
img {
position:relative;
top:4px;
}
}
&.current {
background-color:#DDD;
}
}
}
/*
* End of Main Menu
*
*/
}
......@@ -52,6 +52,12 @@ class Admin::ProjectsController < ApplicationController
def update
@admin_project = Project.find_by_code(params[:id])
owner_id = params[:project].delete(:owner_id)
if owner_id
@admin_project.owner = User.find(owner_id)
end
if @admin_project.update_attributes(params[:project])
redirect_to [:admin, @admin_project], notice: 'Project was successfully updated.'
else
......
......@@ -3,39 +3,15 @@ class Admin::TeamMembersController < ApplicationController
before_filter :authenticate_user!
before_filter :authenticate_admin!
def index
@admin_team_members = UsersProject.page(params[:page]).per(100).order("project_id DESC")
end
def show
@admin_team_member = UsersProject.find(params[:id])
end
def new
@admin_team_member = UsersProject.new(params[:team_member])
end
def edit
@admin_team_member = UsersProject.find(params[:id])
end
def create
@admin_team_member = UsersProject.new(params[:team_member])
@admin_team_member.project_id = params[:team_member][:project_id]
if @admin_team_member.save
redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully created.'
else
render action: "new"
end
end
def update
@admin_team_member = UsersProject.find(params[:id])
@admin_team_member.project_id = params[:team_member][:project_id]
if @admin_team_member.update_attributes(params[:team_member])
redirect_to admin_team_member_path(@admin_team_member), notice: 'UsersProject was successfully updated.'
redirect_to [:admin, @admin_team_member.project], notice: 'Project Access was successfully updated.'
else
render action: "edit"
end
......@@ -45,6 +21,6 @@ class Admin::TeamMembersController < ApplicationController
@admin_team_member = UsersProject.find(params[:id])
@admin_team_member.destroy
redirect_to admin_team_members_url
redirect_to :back
end
end
......@@ -9,8 +9,28 @@ class Admin::UsersController < ApplicationController
def show
@admin_user = User.find(params[:id])
@projects = if @admin_user.projects.empty?
Project
else
Project.without_user(@admin_user)
end.all
end
def team_update
@admin_user = User.find(params[:id])
UsersProject.user_bulk_import(
@admin_user,
params[:project_ids],
params[:project_access],
params[:repo_access]
)
redirect_to [:admin, @admin_user], notice: 'Teams were successfully updated.'
end
def new
@admin_user = User.new(:projects_limit => 10)
end
......
......@@ -5,7 +5,11 @@ class ApplicationController < ActionController::Base
helper_method :abilities, :can?
rescue_from Gitlabhq::Gitolite::AccessDenied do |exception|
render :file => File.join(Rails.root, "public", "githost_error"), :layout => false
render "errors/gitolite", :layout => "error"
end
rescue_from ActiveRecord::RecordNotFound do |exception|
render "errors/not_found", :layout => "error", :status => 404
end
layout :layout_by_resource
......@@ -33,7 +37,8 @@ class ApplicationController < ActionController::Base
end
def project
@project ||= Project.find_by_code(params[:project_id])
@project ||= current_user.projects.find_by_code(params[:project_id])
@project || render_404
end
def add_project_abilities
......@@ -45,11 +50,23 @@ class ApplicationController < ActionController::Base
end
def authorize_project!(action)
return render_404 unless can?(current_user, action, project)
return access_denied! unless can?(current_user, action, project)
end
def authorize_code_access!
return access_denied! unless can?(current_user, :download_code, project)
end
def access_denied!
render_404
render "errors/access_denied", :layout => "error", :status => 404
end
def not_found!
render "errors/not_found", :layout => "error", :status => 404
end
def git_not_found!
render "errors/git_not_found", :layout => "error", :status => 404
end
def method_missing(method_sym, *arguments, &block)
......@@ -78,21 +95,13 @@ class ApplicationController < ActionController::Base
redirect_to @project unless @project.repo_exists? && @project.has_commits?
end
def respond_with_notes
if params[:last_id] && params[:first_id]
@notes = @notes.where("id >= ?", params[:first_id])
elsif params[:last_id]
@notes = @notes.where("id > ?", params[:last_id])
elsif params[:first_id]
@notes = @notes.where("id < ?", params[:first_id])
else
nil
end
end
def no_cache_headers
response.headers["Cache-Control"] = "no-cache, no-store, max-age=0, must-revalidate"
response.headers["Pragma"] = "no-cache"
response.headers["Expires"] = "Fri, 01 Jan 1990 00:00:00 GMT"
end
def render_full_content
@full_content = true
end
end
......@@ -7,12 +7,14 @@ class CommitsController < ApplicationController
# Authorize
before_filter :add_project_abilities
before_filter :authorize_read_project!
before_filter :authorize_code_access!
before_filter :require_non_empty_project
before_filter :load_refs, :only => :index # load @branch, @tag & @ref
before_filter :render_full_content
def index
@repo = project.repo
@limit, @offset = (params[:limit] || 20), (params[:offset] || 0)
@limit, @offset = (params[:limit] || 40), (params[:offset] || 0)
@commits = @project.commits(@ref, params[:path], @limit, @offset)
respond_to do |format|
......@@ -24,14 +26,31 @@ class CommitsController < ApplicationController
def show
@commit = project.commit(params[:id])
@notes = project.commit_notes(@commit).fresh.limit(20)
@note = @project.build_commit_note(@commit)
git_not_found! and return unless @commit
@note = @project.build_commit_note(@commit)
@comments_allowed = true
@line_notes = project.commit_line_notes(@commit)
end
respond_to do |format|
format.html
format.js { respond_with_notes }
def compare
first = project.commit(params[:to])
last = project.commit(params[:from])
@diffs = []
@commits = []
@line_notes = []
if first && last
commits = [first, last].sort_by(&:created_at)
younger = commits.first
older = commits.last
@commits = project.repo.commits_between(younger.id, older.id).map {|c| Commit.new(c)}
@diffs = project.repo.diff(younger.id, older.id) rescue []
@commit = Commit.new(older)
end
end
end
......@@ -3,7 +3,16 @@ class DashboardController < ApplicationController
def index
@projects = current_user.projects.all
@active_projects = @projects.select(&:repo_exists?).select(&:last_activity_date_cached).sort_by(&:last_activity_date_cached).reverse
@merge_requests = MergeRequest.where("author_id = :id or assignee_id = :id", :id => current_user.id).opened.order("created_at DESC").limit(10)
@user = current_user
@issues = current_user.assigned_issues.opened.order("created_at DESC").limit(10)
@issues = @issues.includes(:author, :project)
@events = Event.where(:project_id => @projects.map(&:id)).recent.limit(20)
end
# Get authored or assigned open merge requests
......
class ErrorsController < ApplicationController
layout "error"
def githost
render :file => File.join(Rails.root, "public", "githost_error"), :layout => false
render "errors/gitolite"
end
end
class IssuesController < ApplicationController
before_filter :authenticate_user!
before_filter :project
before_filter :module_enabled
before_filter :issue, :only => [:edit, :update, :destroy, :show]
layout "project"
......@@ -48,7 +49,6 @@ class IssuesController < ApplicationController
end
def show
@notes = @issue.notes.inc_author.order("created_at DESC").limit(20)
@note = @project.notes.new(:noteable => @issue)
@commits = if @issue.branch_name && @project.repo.heads.map(&:name).include?(@issue.branch_name)
......@@ -60,7 +60,7 @@ class IssuesController < ApplicationController
respond_to do |format|
format.html
format.js { respond_with_notes }
format.js
end
end
......@@ -69,7 +69,10 @@ class IssuesController < ApplicationController
@issue.author = current_user
@issue.save
respond_with(@issue)
respond_to do |format|
format.html { redirect_to project_issue_path(@project, @issue) }
format.js
end
end
def update
......@@ -125,11 +128,14 @@ class IssuesController < ApplicationController
end
def authorize_modify_issue!
can?(current_user, :modify_issue, @issue) ||
@issue.assignee == current_user
return render_404 unless can?(current_user, :modify_issue, @issue)
end
def authorize_admin_issue!
can?(current_user, :admin_issue, @issue)
return render_404 unless can?(current_user, :admin_issue, @issue)
end
def module_enabled
return render_404 unless @project.issues_enabled
end
end
class KeysController < ApplicationController
layout "profile"
respond_to :js
respond_to :js, :html
def index
@keys = current_user.keys.all
......
......@@ -9,6 +9,11 @@ class NotesController < ApplicationController
respond_to :js
def index
notes
respond_with(@notes)
end
def create
@note = @project.notes.new(params[:note])
@note.author = current_user
......@@ -24,9 +29,7 @@ class NotesController < ApplicationController
def destroy
@note = @project.notes.find(params[:id])
return access_denied! unless can?(current_user, :admin_note, @note)
@note.destroy
respond_to do |format|
......@@ -34,4 +37,28 @@ class NotesController < ApplicationController
end
end
protected
def notes
@notes = case params[:target_type]
when "commit"
then project.commit_notes(project.commit((params[:target_id]))).fresh.limit(20)
when "snippet"
then project.snippets.find(params[:target_id]).notes
when "wall"
then project.common_notes.order("created_at DESC").fresh.limit(50)
when "issue"
then project.issues.find(params[:target_id]).notes.inc_author.order("created_at DESC").limit(20)
when "merge_request"
then project.merge_requests.find(params[:target_id]).notes.inc_author.order("created_at DESC").limit(20)
end
@notes = if params[:last_id]
@notes.where("id > ?", params[:last_id])
elsif params[:first_id]
@notes.where("id < ?", params[:first_id])
else
@notes
end
end
end
class OmniauthCallbacksController < Devise::OmniauthCallbacksController
def ldap
# We only find ourselves here if the authentication to LDAP was successful.
info = request.env["omniauth.auth"]["info"]
@user = User.find_for_ldap_auth(info)
if @user.persisted?
@user.remember_me = true
end
sign_in_and_redirect @user
end
end
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.
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.
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