From e954438a1d3a45addebf52ab04155459d7d84db0 Mon Sep 17 00:00:00 2001 From: Boyan Tabakov <boyan.tabakov@futurice.com> Date: Tue, 18 Dec 2012 21:24:31 +0200 Subject: [PATCH 01/55] Extended users API to support updating and deleting users. Also added tests. --- doc/api/users.md | 43 +++++++++++++++++++++++++++++ lib/api/entities.rb | 2 +- lib/api/users.rb | 47 +++++++++++++++++++++++++++++++- spec/requests/api/users_spec.rb | 48 +++++++++++++++++++++++++++++++++ 4 files changed, 138 insertions(+), 2 deletions(-) diff --git a/doc/api/users.md b/doc/api/users.md index 200c0e06e04..b94d7c0f789 100644 --- a/doc/api/users.md +++ b/doc/api/users.md @@ -20,6 +20,8 @@ GET /users "linkedin": "", "twitter": "", "dark_scheme": false, + "extern_uid": "john.smith", + "provider": "provider_name", "theme_id": 1 }, { @@ -34,6 +36,8 @@ GET /users "linkedin": "", "twitter": "", "dark_scheme": true, + "extern_uid": "jack.smith", + "provider": "provider_name", "theme_id": 1 } ] @@ -64,6 +68,8 @@ Parameters: "linkedin": "", "twitter": "", "dark_scheme": false, + "extern_uid": "john.smith", + "provider": "provider_name", "theme_id": 1 } ``` @@ -84,10 +90,47 @@ Parameters: + `linkedin` - Linkedin + `twitter` - Twitter account + `projects_limit` - Number of projects user can create ++ `extern_uid` - External UID ++ `provider` - External provider name ++ `bio` - User's bio Will return created user with status `201 Created` on success, or `404 Not found` on fail. +## User modification +Modify user. Available only for admin + +``` +PUT /users/:id +``` + +Parameters: ++ `email` - Email ++ `username` - Username ++ `name` - Name ++ `password` - Password ++ `skype` - Skype ID ++ `linkedin` - Linkedin ++ `twitter` - Twitter account ++ `projects_limit` - Limit projects wich user can create ++ `extern_uid` - External UID ++ `provider` - External provider name ++ `bio` - User's bio + + +Will return created user with status `200 OK` on success, or `404 Not +found` on fail. + +## User deletion +Delete user. Available only for admin + +``` +DELETE /users/:id +``` + +Will return deleted user with status `200 OK` on success, or `404 Not +found` on fail. + ## Current user Get currently authenticated user. diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 070fbad27ed..bfb9093d61e 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -2,7 +2,7 @@ module Gitlab module Entities class User < Grape::Entity expose :id, :username, :email, :name, :bio, :skype, :linkedin, :twitter, - :dark_scheme, :theme_id, :blocked, :created_at + :dark_scheme, :theme_id, :blocked, :created_at, :extern_uid, :provider end class UserBasic < Grape::Entity diff --git a/lib/api/users.rb b/lib/api/users.rb index 140c20f6bd2..7ea90c75e9e 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -34,11 +34,14 @@ module Gitlab # linkedin - Linkedin # twitter - Twitter account # projects_limit - Number of projects user can create + # extern_uid - External authentication provider UID + # provider - External provider + # bio - Bio # Example Request: # POST /users post do authenticated_as_admin! - attrs = attributes_for_keys [:email, :name, :password, :skype, :linkedin, :twitter, :projects_limit, :username] + attrs = attributes_for_keys [:email, :name, :password, :skype, :linkedin, :twitter, :projects_limit, :username, :extern_uid, :provider, :bio] user = User.new attrs, as: :admin if user.save present user, with: Entities::User @@ -46,6 +49,48 @@ module Gitlab not_found! end end + + # Update user. Available only for admin + # + # Parameters: + # email - Email + # name - Name + # password - Password + # skype - Skype ID + # linkedin - Linkedin + # twitter - Twitter account + # projects_limit - Limit projects wich user can create + # extern_uid - External authentication provider UID + # provider - External provider + # bio - Bio + # Example Request: + # PUT /users/:id + put ":id" do + authenticated_as_admin! + attrs = attributes_for_keys [:email, :name, :password, :skype, :linkedin, :twitter, :projects_limit, :username, :extern_uid, :provider, :bio] + user = User.find_by_id(params[:id]) + + if user && user.update_attributes(attrs) + present user, with: Entities::User + else + not_found! + end + end + + # Delete user. Available only for admin + # + # Example Request: + # DELETE /users/:id + delete ":id" do + authenticated_as_admin! + user = User.find_by_id(params[:id]) + + if user + user.destroy + else + not_found! + end + end end resource :user do diff --git a/spec/requests/api/users_spec.rb b/spec/requests/api/users_spec.rb index 4cfb4884e7c..108d1bf9458 100644 --- a/spec/requests/api/users_spec.rb +++ b/spec/requests/api/users_spec.rb @@ -53,6 +53,54 @@ describe Gitlab::API do end end + describe "PUT /users/:id" do + before { admin } + + it "should update user" do + put api("/users/#{user.id}", admin), {bio: 'new test bio'} + response.status.should == 200 + json_response['bio'].should == 'new test bio' + user.reload.bio.should == 'new test bio' + end + + it "should not allow invalid update" do + put api("/users/#{user.id}", admin), {email: 'invalid email'} + response.status.should == 404 + user.reload.email.should_not == 'invalid email' + end + + it "shouldn't available for non admin users" do + put api("/users/#{user.id}", user), attributes_for(:user) + response.status.should == 403 + end + + it "should return 404 for non-existing user" do + put api("/users/999999", admin), {bio: 'update should fail'} + response.status.should == 404 + end + end + + describe "DELETE /users/:id" do + before { admin } + + it "should delete user" do + delete api("/users/#{user.id}", admin) + response.status.should == 200 + expect { User.find(user.id) }.to raise_error ActiveRecord::RecordNotFound + json_response['email'].should == user.email + end + + it "shouldn't available for non admin users" do + delete api("/users/#{user.id}", user) + response.status.should == 403 + end + + it "should return 404 for non-existing user" do + delete api("/users/999999", admin) + response.status.should == 404 + end + end + describe "GET /user" do it "should return current user" do get api("/user", user) -- GitLab From b614e3b5cbff88b16b87ea8dc1b03ddc53146d15 Mon Sep 17 00:00:00 2001 From: fbehrens <fbehrens@gmail.com> Date: Wed, 23 Jan 2013 15:32:31 +0100 Subject: [PATCH 02/55] Update config/database.yml.postgresql This was necessary following the installation guide for ubuntu 10.4 with postgres --- config/database.yml.postgresql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/database.yml.postgresql b/config/database.yml.postgresql index 0e873d2b8fb..2bc0884f099 100644 --- a/config/database.yml.postgresql +++ b/config/database.yml.postgresql @@ -6,7 +6,7 @@ production: encoding: unicode database: gitlabhq_production pool: 5 - username: postgres + username: gitlab password: # host: localhost # port: 5432 -- GitLab From a0ff120377fb18ead86dc3414dafad0280a59a5b Mon Sep 17 00:00:00 2001 From: Mike Wyatt <wyatt.mike@gmail.com> Date: Fri, 25 Jan 2013 12:59:25 -0330 Subject: [PATCH 03/55] example capistrano deploy scripts --- Capfile.example | 3 +++ config/deploy.rb.example | 57 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 Capfile.example create mode 100644 config/deploy.rb.example diff --git a/Capfile.example b/Capfile.example new file mode 100644 index 00000000000..81ca1493119 --- /dev/null +++ b/Capfile.example @@ -0,0 +1,3 @@ +load 'deploy' +load 'deploy/assets' +load 'config/deploy' diff --git a/config/deploy.rb.example b/config/deploy.rb.example new file mode 100644 index 00000000000..eb686048a7f --- /dev/null +++ b/config/deploy.rb.example @@ -0,0 +1,57 @@ +require 'bundler/capistrano' + +set :domain, 'set application domain here' +set :db_adapter, 'mysql' # or postgres +set :mount_point, '/' +set :application, 'gitlab' +set :user, 'gitlab' +set :rails_env, 'production' +set :deploy_to, "/home/#{user}/apps/#{application}" +set :bundle_without, %w[development test] + (%w[mysql postgres] - db_adapter) +set :asset_env, "RAILS_GROUPS=assets RAILS_RELATIVE_URL_ROOT=#{mount_point}" + +set :use_sudo, false + +# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none` +set :scm, :git +set :repository, "git@#{domain}:#{application}.git" +set :deploy_via, :remote_cache + +# Alternatively, you can deploy via copy, if you don't have gitlab in git +#set :scm, :none +#set :repository, '.' +#set :deploy_via, :copy + +role :web, domain +role :app, domain +role :db, domain, primary: true + +namespace :foreman do + desc 'Export the Procfile to Ubuntu upstart scripts' + task :export, roles: :app do + run "cd #{release_path} && sudo foreman export upstart /etc/init -f Procfile -a #{application} -u #{user} -l #{release_path}/log/foreman" + end + + desc 'Start the application services' + task :start, roles: :app do + sudo "start #{application}" + end + + desc 'Stop the application services' + task :stop, roles: :app do + sudo "stop #{application}" + end + + desc 'Restart the application services' + task :restart, roles: :app do + run "sudo start #{application} || sudo restart #{application}" + end +end + +after 'deploy:cold' do + run "cd #{release_path} && #{rake} gitlab:app:setup RAILS_ENV=#{rails_env}" + foreman.restart +end + +after 'deploy:update', 'foreman:export' # Export foreman scripts +after 'deploy:update', 'foreman:restart' # Restart application scripts -- GitLab From 9852ce887df753f34b66814ab38aced9b511fcb4 Mon Sep 17 00:00:00 2001 From: Mike Wyatt <wyatt.mike@gmail.com> Date: Fri, 25 Jan 2013 13:03:01 -0330 Subject: [PATCH 04/55] fix error in bundle_without --- config/deploy.rb.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/deploy.rb.example b/config/deploy.rb.example index eb686048a7f..8c0f1561136 100644 --- a/config/deploy.rb.example +++ b/config/deploy.rb.example @@ -7,7 +7,7 @@ set :application, 'gitlab' set :user, 'gitlab' set :rails_env, 'production' set :deploy_to, "/home/#{user}/apps/#{application}" -set :bundle_without, %w[development test] + (%w[mysql postgres] - db_adapter) +set :bundle_without, %w[development test] + (%w[mysql postgres] - [db_adapter]) set :asset_env, "RAILS_GROUPS=assets RAILS_RELATIVE_URL_ROOT=#{mount_point}" set :use_sudo, false -- GitLab From dc13af90b12a2366f77a9b68a7b74d7b5f54bc1a Mon Sep 17 00:00:00 2001 From: Lennart Rosam <lennart.rosam@medien-systempartner.de> Date: Mon, 28 Jan 2013 12:54:07 +0100 Subject: [PATCH 05/55] Fix rake task - Update method name --- lib/tasks/gitlab/bulk_add_permission.rake | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/tasks/gitlab/bulk_add_permission.rake b/lib/tasks/gitlab/bulk_add_permission.rake index 36c51d060bc..54a5c7aea76 100644 --- a/lib/tasks/gitlab/bulk_add_permission.rake +++ b/lib/tasks/gitlab/bulk_add_permission.rake @@ -7,9 +7,9 @@ namespace :gitlab do Project.find_each do |project| puts "Importing #{user_ids.size} users into #{project.code}" - UsersProject.bulk_import(project, user_ids, UsersProject::DEVELOPER) + UsersProject.add_users_into_projects(project, user_ids, UsersProject::DEVELOPER) puts "Importing #{admin_ids.size} admins into #{project.code}" - UsersProject.bulk_import(project, admin_ids, UsersProject::MASTER) + UsersProject.add_users_into_projects(project, admin_ids, UsersProject::MASTER) end end @@ -18,7 +18,7 @@ namespace :gitlab do user = User.find_by_email args.email project_ids = Project.pluck(:id) - UsersProject.user_bulk_import(user, project_ids, UsersProject::DEVELOPER) + UsersProject.add_users_into_projects(user, project_ids, UsersProject::DEVELOPER) end end end \ No newline at end of file -- GitLab From f9a48f72d485af69b5cad6062b48ac5cfb651b74 Mon Sep 17 00:00:00 2001 From: Lennart Rosam <lennart.rosam@medien-systempartner.de> Date: Mon, 28 Jan 2013 13:52:30 +0100 Subject: [PATCH 06/55] Fix issue #2790 --- lib/tasks/gitlab/bulk_add_permission.rake | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/tasks/gitlab/bulk_add_permission.rake b/lib/tasks/gitlab/bulk_add_permission.rake index 54a5c7aea76..eb1a7559dbd 100644 --- a/lib/tasks/gitlab/bulk_add_permission.rake +++ b/lib/tasks/gitlab/bulk_add_permission.rake @@ -4,21 +4,21 @@ namespace :gitlab do task :all_users_to_all_projects => :environment do |t, args| user_ids = User.where(:admin => false).pluck(:id) admin_ids = User.where(:admin => true).pluck(:id) + projects_ids = Project.pluck(:id) - Project.find_each do |project| - puts "Importing #{user_ids.size} users into #{project.code}" - UsersProject.add_users_into_projects(project, user_ids, UsersProject::DEVELOPER) - puts "Importing #{admin_ids.size} admins into #{project.code}" - UsersProject.add_users_into_projects(project, admin_ids, UsersProject::MASTER) - end + puts "Importing #{user_ids.size} users into #{projects_ids.size} projects" + UsersProject.add_users_into_projects(projects_ids, user_ids, UsersProject::DEVELOPER) + + puts "Importing #{admin_ids.size} admins into #{projects_ids.size} projects" + UsersProject.add_users_into_projects(projects_ids, admin_ids, UsersProject::MASTER) end desc "GITLAB | Add a specific user to all projects (as a developer)" task :user_to_projects, [:email] => :environment do |t, args| user = User.find_by_email args.email project_ids = Project.pluck(:id) - - UsersProject.add_users_into_projects(user, project_ids, UsersProject::DEVELOPER) + puts "Importing #{user.email} users into #{project_ids.size} projects" + UsersProject.add_users_into_projects(project_ids, Array.wrap(user.id), UsersProject::DEVELOPER) end end end \ No newline at end of file -- GitLab From 0f4303384999f2464838294824557ddf72a66099 Mon Sep 17 00:00:00 2001 From: Mike Wyatt <wyatt.mike@gmail.com> Date: Mon, 28 Jan 2013 15:00:04 -0330 Subject: [PATCH 07/55] use gitlabhq as application name --- config/deploy.rb.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/deploy.rb.example b/config/deploy.rb.example index 8c0f1561136..4f2e776e4af 100644 --- a/config/deploy.rb.example +++ b/config/deploy.rb.example @@ -3,7 +3,7 @@ require 'bundler/capistrano' set :domain, 'set application domain here' set :db_adapter, 'mysql' # or postgres set :mount_point, '/' -set :application, 'gitlab' +set :application, 'gitlabhq' set :user, 'gitlab' set :rails_env, 'production' set :deploy_to, "/home/#{user}/apps/#{application}" -- GitLab From 65b7b8129bf6495548a7d3c82ffaa1132efcd92e Mon Sep 17 00:00:00 2001 From: Mike Wyatt <wyatt.mike@gmail.com> Date: Mon, 28 Jan 2013 15:01:12 -0330 Subject: [PATCH 08/55] wrap domain use in block for cap-multistage --- config/deploy.rb.example | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/deploy.rb.example b/config/deploy.rb.example index 4f2e776e4af..8910aba3aac 100644 --- a/config/deploy.rb.example +++ b/config/deploy.rb.example @@ -22,9 +22,9 @@ set :deploy_via, :remote_cache #set :repository, '.' #set :deploy_via, :copy -role :web, domain -role :app, domain -role :db, domain, primary: true +role(:web) { domain } +role(:app) { domain } +role(:db, primary: true) { domain } namespace :foreman do desc 'Export the Procfile to Ubuntu upstart scripts' -- GitLab From 934a7d8e18cc4023a55555ba743304ac1d0f7233 Mon Sep 17 00:00:00 2001 From: Mike Wyatt <wyatt.mike@gmail.com> Date: Mon, 28 Jan 2013 15:01:56 -0330 Subject: [PATCH 09/55] use bundler in foreman:export --- config/deploy.rb.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/deploy.rb.example b/config/deploy.rb.example index 8910aba3aac..17352dc0b9f 100644 --- a/config/deploy.rb.example +++ b/config/deploy.rb.example @@ -29,7 +29,7 @@ role(:db, primary: true) { domain } namespace :foreman do desc 'Export the Procfile to Ubuntu upstart scripts' task :export, roles: :app do - run "cd #{release_path} && sudo foreman export upstart /etc/init -f Procfile -a #{application} -u #{user} -l #{release_path}/log/foreman" + run "cd #{release_path} && sudo #{bundle_cmd} exec foreman export upstart /etc/init -f Procfile -a #{application} -u #{user} -l #{release_path}/log/foreman" end desc 'Start the application services' -- GitLab From 56b48aecab39a748383b6f120ca7d11a37d465c0 Mon Sep 17 00:00:00 2001 From: Mike Wyatt <wyatt.mike@gmail.com> Date: Mon, 28 Jan 2013 15:02:35 -0330 Subject: [PATCH 10/55] deploy:[start,stop,restart] is foreman:[start,stop,restart] --- config/deploy.rb.example | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/config/deploy.rb.example b/config/deploy.rb.example index 17352dc0b9f..846a54a59bb 100644 --- a/config/deploy.rb.example +++ b/config/deploy.rb.example @@ -48,10 +48,27 @@ namespace :foreman do end end +namespace :deploy do + desc 'Start the application services' + task :start, roles: :app do + foreman.start + end + + desc 'Stop the application services' + task :stop, roles: :app do + foreman.stop + end + + desc 'Restart the application services' + task :restart, roles: :app do + foreman.restart + end +end + after 'deploy:cold' do run "cd #{release_path} && #{rake} gitlab:app:setup RAILS_ENV=#{rails_env}" foreman.restart end after 'deploy:update', 'foreman:export' # Export foreman scripts -after 'deploy:update', 'foreman:restart' # Restart application scripts +#after 'deploy:update', 'foreman:restart' # Restart application scripts -- GitLab From c2e1a727d62ce4c14f41a063c1a3d549f7bc2865 Mon Sep 17 00:00:00 2001 From: Mike Wyatt <wyatt.mike@gmail.com> Date: Mon, 28 Jan 2013 15:02:56 -0330 Subject: [PATCH 11/55] move bundler/capistrano require to Capfile --- Capfile.example | 1 + config/deploy.rb.example | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Capfile.example b/Capfile.example index 81ca1493119..8863835da4a 100644 --- a/Capfile.example +++ b/Capfile.example @@ -1,3 +1,4 @@ load 'deploy' load 'deploy/assets' +require 'bundler/capistrano' load 'config/deploy' diff --git a/config/deploy.rb.example b/config/deploy.rb.example index 846a54a59bb..03eb59fa89f 100644 --- a/config/deploy.rb.example +++ b/config/deploy.rb.example @@ -1,5 +1,3 @@ -require 'bundler/capistrano' - set :domain, 'set application domain here' set :db_adapter, 'mysql' # or postgres set :mount_point, '/' -- GitLab From 299a9a10400e7fdcc641a90db95290322058c529 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Date: Mon, 28 Jan 2013 21:02:10 +0200 Subject: [PATCH 12/55] keys to gitolite via sidekiq now --- app/observers/key_observer.rb | 14 ++++++++++++-- app/workers/gitolite_worker.rb | 4 ++-- lib/gitlab/backend/gitolite.rb | 18 ++++++++++++++++-- 3 files changed, 30 insertions(+), 6 deletions(-) diff --git a/app/observers/key_observer.rb b/app/observers/key_observer.rb index bf5fa647647..44e78643d83 100644 --- a/app/observers/key_observer.rb +++ b/app/observers/key_observer.rb @@ -2,11 +2,21 @@ class KeyObserver < ActiveRecord::Observer include Gitolited def after_save(key) - gitolite.set_key(key.identifier, key.key, key.projects) + GitoliteWorker.perform_async( + :set_key, + key.identifier, + key.key, + key.projects.map(&:id) + ) end def after_destroy(key) return if key.is_deploy_key && !key.last_deploy? - gitolite.remove_key(key.identifier, key.projects) + + GitoliteWorker.perform_async( + :remove_key, + key.identifier, + key.projects.map(&:id) + ) end end diff --git a/app/workers/gitolite_worker.rb b/app/workers/gitolite_worker.rb index d134ea035f4..bff7a8c6a6f 100644 --- a/app/workers/gitolite_worker.rb +++ b/app/workers/gitolite_worker.rb @@ -4,7 +4,7 @@ class GitoliteWorker sidekiq_options queue: :gitolite - def perform(action, arg) - gitolite.send(action, arg) + def perform(action, *arg) + gitolite.send(action, *arg) end end diff --git a/lib/gitlab/backend/gitolite.rb b/lib/gitlab/backend/gitolite.rb index 1bcf1264fa9..cd9ac1554d6 100644 --- a/lib/gitlab/backend/gitolite.rb +++ b/lib/gitlab/backend/gitolite.rb @@ -8,14 +8,28 @@ module Gitlab Gitlab::GitoliteConfig.new end - def set_key key_id, key_content, projects + # Update gitolite config with new key + # + # Ex. + # set_key("m_gitlab_com_12343", "sha-rsa ...", [2, 3, 6]) + # + def set_key(key_id, key_content, project_ids) + projects = Project.where(id: project_ids) + config.apply do |config| config.write_key(key_id, key_content) config.update_projects(projects) end end - def remove_key key_id, projects + # Remove ssh key from gitolite config + # + # Ex. + # remove_key("m_gitlab_com_12343", [2, 3, 6]) + # + def remove_key(key_id, project_ids) + projects = Project.where(id: project_ids) + config.apply do |config| config.rm_key(key_id) config.update_projects(projects) -- GitLab From 1c931fb81477397929a31a6b95c5d65b6d582182 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Date: Mon, 28 Jan 2013 23:03:38 +0200 Subject: [PATCH 13/55] fix key observer tests --- app/observers/project_observer.rb | 2 +- spec/observers/key_observer_spec.rb | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/app/observers/project_observer.rb b/app/observers/project_observer.rb index cc454ae3e35..ccdb146140b 100644 --- a/app/observers/project_observer.rb +++ b/app/observers/project_observer.rb @@ -15,7 +15,7 @@ class ProjectObserver < ActiveRecord::Observer end def after_create project - log_info("#{project.owner.name} created a new project \"#{project.name}\"") + log_info("#{project.owner.name} created a new project \"#{project.name_with_namespace}\"") end protected diff --git a/spec/observers/key_observer_spec.rb b/spec/observers/key_observer_spec.rb index ae7b0f73e57..11f975cc57d 100644 --- a/spec/observers/key_observer_spec.rb +++ b/spec/observers/key_observer_spec.rb @@ -9,25 +9,19 @@ describe KeyObserver do is_deploy_key: false ) - @gitolite = double('Gitlab::Gitolite', - set_key: true, - remove_key: true - ) - @observer = KeyObserver.instance - @observer.stub(gitolite: @gitolite) end context :after_save do it do - @gitolite.should_receive(:set_key).with(@key.identifier, @key.key, @key.projects) + GitoliteWorker.should_receive(:perform_async).with(:set_key, @key.identifier, @key.key, @key.projects.map(&:id)) @observer.after_save(@key) end end context :after_destroy do it do - @gitolite.should_receive(:remove_key).with(@key.identifier, @key.projects) + GitoliteWorker.should_receive(:perform_async).with(:remove_key, @key.identifier, @key.projects.map(&:id)) @observer.after_destroy(@key) end end -- GitLab From f72dc7f7798f521d20a71fb465df57f0d66befb5 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Date: Tue, 29 Jan 2013 11:00:56 +0200 Subject: [PATCH 14/55] dont escape images inside links for gfm. Fixes #2701 --- app/helpers/gitlab_markdown_helper.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/helpers/gitlab_markdown_helper.rb b/app/helpers/gitlab_markdown_helper.rb index 111982e9147..1a3d34eb886 100644 --- a/app/helpers/gitlab_markdown_helper.rb +++ b/app/helpers/gitlab_markdown_helper.rb @@ -13,7 +13,13 @@ module GitlabMarkdownHelper def link_to_gfm(body, url, html_options = {}) return "" if body.blank? - gfm_body = gfm(escape_once(body), html_options) + escaped_body = if body =~ /^\<img/ + body + else + escape_once(body) + end + + gfm_body = gfm(escaped_body, html_options) gfm_body.gsub!(%r{<a.*?>.*?</a>}m) do |match| "</a>#{match}#{link_to("", url, html_options)[0..-5]}" # "</a>".length +1 -- GitLab From 7121a58eb9e4dcb63d762e17a668f3bb4b0eaa85 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Date: Tue, 29 Jan 2013 11:32:05 +0200 Subject: [PATCH 15/55] Advanced logging for post-receive worker --- app/workers/post_receive.rb | 14 ++++++++++++-- config/gitlab.yml.example | 3 ++- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/workers/post_receive.rb b/app/workers/post_receive.rb index a906f78f7e3..6d31c08fefc 100644 --- a/app/workers/post_receive.rb +++ b/app/workers/post_receive.rb @@ -4,12 +4,22 @@ class PostReceive sidekiq_options queue: :post_receive def perform(repo_path, oldrev, newrev, ref, identifier) - repo_path.gsub!(Gitlab.config.gitolite.repos_path.to_s, "") + + if repo_path.start_with?(Gitlab.config.gitolite.repos_path.to_s) + repo_path.gsub!(Gitlab.config.gitolite.repos_path.to_s, "") + else + Gitlab::GitLogger.error("POST-RECEIVE: Check gitlab.yml config for correct gitolite.repos_path variable. \"#{Gitlab.config.gitolite.repos_path}\" does not match \"#{repo_path}\"") + end + repo_path.gsub!(/.git$/, "") repo_path.gsub!(/^\//, "") project = Project.find_with_namespace(repo_path) - return false if project.nil? + + if project.nil? + Gitlab::GitLogger.error("POST-RECEIVE: Triggered hook for non-existing project with full path \"#{repo_path} \"") + return false + end # Ignore push from non-gitlab users user = if identifier.eql? Gitlab.config.gitolite.admin_key diff --git a/config/gitlab.yml.example b/config/gitlab.yml.example index 4df8efa9c06..1a34d22417f 100644 --- a/config/gitlab.yml.example +++ b/config/gitlab.yml.example @@ -106,7 +106,8 @@ backup: ## Gitolite settings gitolite: admin_uri: git@localhost:gitolite-admin - # repos_path must not be a symlink + + # REPOS_PATH MUST NOT BE A SYMLINK!!! repos_path: /home/git/repositories/ hooks_path: /home/git/.gitolite/hooks/ admin_key: gitlab -- GitLab From c84675ee06dfc72c46c178ef40e30f03053dcc5a Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Date: Tue, 29 Jan 2013 12:12:24 +0200 Subject: [PATCH 16/55] satellites logs --- lib/gitlab/satellite/logger.rb | 13 +++++++++++++ lib/gitlab/satellite/satellite.rb | 9 ++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 lib/gitlab/satellite/logger.rb diff --git a/lib/gitlab/satellite/logger.rb b/lib/gitlab/satellite/logger.rb new file mode 100644 index 00000000000..6f3f8255aca --- /dev/null +++ b/lib/gitlab/satellite/logger.rb @@ -0,0 +1,13 @@ +module Gitlab + module Satellite + class Logger < Gitlab::Logger + def self.file_name + 'satellites.log' + end + + def format_message(severity, timestamp, progname, msg) + "#{timestamp.to_s(:long)}: #{msg}\n" + end + end + end +end diff --git a/lib/gitlab/satellite/satellite.rb b/lib/gitlab/satellite/satellite.rb index d8e8f58963b..95273a6d208 100644 --- a/lib/gitlab/satellite/satellite.rb +++ b/lib/gitlab/satellite/satellite.rb @@ -13,6 +13,10 @@ module Gitlab @project = project end + def log message + Gitlab::Satellite::Logger.error(message) + end + def raise_no_satellite raise SatelliteNotExistError.new("Satellite doesn't exist") end @@ -29,10 +33,13 @@ module Gitlab output, status = popen("git clone #{project.url_to_repo} #{path}", Gitlab.config.satellites.path) + log("PID: #{project.id}: git clone #{project.url_to_repo} #{path}") + log("PID: #{project.id}: -> #{output}") + if status.zero? true else - Gitlab::GitLogger.error("Failed to create satellite for #{project.name_with_namespace}") + log("Failed to create satellite for #{project.name_with_namespace}") false end end -- GitLab From 9fdbdc662a01ac0845638c1012aa0625de6158be Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Date: Tue, 29 Jan 2013 14:49:10 +0200 Subject: [PATCH 17/55] set link to gitlab-ci --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1a43be134da..ee029f9bfcb 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ GitLab is a free project and repository management application - +[](http://ci.gitlab.org/projects/1?ref=master) ## Application details -- GitLab From 4d20de530dbc223e53d55606bfe2f30301923c2a Mon Sep 17 00:00:00 2001 From: Mike Wyatt <wyatt.mike@gmail.com> Date: Tue, 29 Jan 2013 10:14:40 -0330 Subject: [PATCH 18/55] use shared_path/log in foreman export --- config/deploy.rb.example | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/deploy.rb.example b/config/deploy.rb.example index 03eb59fa89f..1fc88cc9e8f 100644 --- a/config/deploy.rb.example +++ b/config/deploy.rb.example @@ -9,6 +9,7 @@ set :bundle_without, %w[development test] + (%w[mysql postgres] - [db_adapter]) set :asset_env, "RAILS_GROUPS=assets RAILS_RELATIVE_URL_ROOT=#{mount_point}" set :use_sudo, false +default_run_options[:pty] = true # Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none` set :scm, :git @@ -27,7 +28,8 @@ role(:db, primary: true) { domain } namespace :foreman do desc 'Export the Procfile to Ubuntu upstart scripts' task :export, roles: :app do - run "cd #{release_path} && sudo #{bundle_cmd} exec foreman export upstart /etc/init -f Procfile -a #{application} -u #{user} -l #{release_path}/log/foreman" + foreman_export = "foreman export upstart /etc/init -f Procfile -a #{application} -u #{user} -l #{shared_path}/log/foreman" + run "cd #{release_path} && #{sudo} #{fetch :bundle_cmd, 'bundle'} exec #{foreman_export}" end desc 'Start the application services' -- GitLab From 00540754ed3c709e34ad35f5176d1b14e36bfff8 Mon Sep 17 00:00:00 2001 From: Mike Wyatt <wyatt.mike@gmail.com> Date: Tue, 29 Jan 2013 10:15:24 -0330 Subject: [PATCH 19/55] use service instead of start/stop/restart --- config/deploy.rb.example | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/deploy.rb.example b/config/deploy.rb.example index 1fc88cc9e8f..7c20c880b4b 100644 --- a/config/deploy.rb.example +++ b/config/deploy.rb.example @@ -34,17 +34,17 @@ namespace :foreman do desc 'Start the application services' task :start, roles: :app do - sudo "start #{application}" + run "#{sudo} service #{application} start" end desc 'Stop the application services' task :stop, roles: :app do - sudo "stop #{application}" + run "#{sudo} service #{application} stop" end desc 'Restart the application services' task :restart, roles: :app do - run "sudo start #{application} || sudo restart #{application}" + run "#{sudo} service #{application} restart" end end -- GitLab From 549a96f8b969a27bf31a4a08261f49cb79cb5412 Mon Sep 17 00:00:00 2001 From: Mike Wyatt <wyatt.mike@gmail.com> Date: Tue, 29 Jan 2013 10:16:04 -0330 Subject: [PATCH 20/55] fix gitlab:setup in deploy:cold --- config/deploy.rb.example | 4 ++-- lib/tasks/gitlab/setup.rake | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/config/deploy.rb.example b/config/deploy.rb.example index 7c20c880b4b..7e8b6b7321f 100644 --- a/config/deploy.rb.example +++ b/config/deploy.rb.example @@ -66,8 +66,8 @@ namespace :deploy do end after 'deploy:cold' do - run "cd #{release_path} && #{rake} gitlab:app:setup RAILS_ENV=#{rails_env}" - foreman.restart + run "cd #{release_path} && #{rake} gitlab:setup force=yes RAILS_ENV=#{rails_env}" + deploy.restart end after 'deploy:update', 'foreman:export' # Export foreman scripts diff --git a/lib/tasks/gitlab/setup.rake b/lib/tasks/gitlab/setup.rake index 5699e5d6188..1a7907c75c7 100644 --- a/lib/tasks/gitlab/setup.rake +++ b/lib/tasks/gitlab/setup.rake @@ -7,10 +7,12 @@ namespace :gitlab do def setup warn_user_is_not_gitlab - puts "This will create the necessary database tables and seed the database." - puts "You will lose any previous data stored in the database." - ask_to_continue - puts "" + unless ENV['force'] == 'yes' + puts "This will create the necessary database tables and seed the database." + puts "You will lose any previous data stored in the database." + ask_to_continue + puts "" + end Rake::Task["db:setup"].invoke Rake::Task["db:seed_fu"].invoke -- GitLab From cdd55431735ab359f12bb9b6e203c0face879272 Mon Sep 17 00:00:00 2001 From: Carlos Xudiera <xudiera@gmail.com> Date: Tue, 29 Jan 2013 12:58:34 -0500 Subject: [PATCH 21/55] Fixed a grammar mistake in alert-message.block-message --- app/views/commits/_diffs.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/commits/_diffs.html.haml b/app/views/commits/_diffs.html.haml index 9a9aed39b08..556e67f6cda 100644 --- a/app/views/commits/_diffs.html.haml +++ b/app/views/commits/_diffs.html.haml @@ -1,7 +1,7 @@ - if @suppress_diff .alert-message.block-message %p - %strong Warning! Large commit with more then #{Commit::DIFF_SAFE_SIZE} files changed. + %strong Warning! Large commit with more than #{Commit::DIFF_SAFE_SIZE} files changed. %p To prevent performance issue we rejected diff information. %p But if you still want to see diff -- GitLab From 033aa1a885801c299a20ab39af6f897bb53dc3d4 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Date: Tue, 29 Jan 2013 22:18:19 +0200 Subject: [PATCH 22/55] refactor buttons pt1 --- .../stylesheets/gitlab_bootstrap/buttons.scss | 31 +++++++++---------- app/assets/stylesheets/sections/notes.scss | 6 ++-- app/views/admin/groups/edit.html.haml | 4 +-- app/views/admin/groups/index.html.haml | 4 +-- app/views/admin/groups/new.html.haml | 2 +- app/views/admin/groups/show.html.haml | 8 ++--- app/views/admin/hooks/index.html.haml | 2 +- app/views/admin/projects/_form.html.haml | 4 +-- app/views/admin/projects/index.html.haml | 4 +-- .../admin/projects/members/_form.html.haml | 2 +- app/views/admin/projects/show.html.haml | 4 +-- app/views/admin/teams/edit.html.haml | 4 +-- app/views/admin/teams/index.html.haml | 4 +-- app/views/admin/teams/members/_form.html.haml | 2 +- app/views/admin/teams/members/new.html.haml | 2 +- app/views/admin/teams/new.html.haml | 2 +- .../admin/teams/projects/_form.html.haml | 2 +- app/views/admin/teams/projects/new.html.haml | 2 +- app/views/admin/teams/show.html.haml | 10 +++--- app/views/admin/users/_form.html.haml | 8 ++--- app/views/admin/users/index.html.haml | 6 ++-- app/views/admin/users/show.html.haml | 4 +-- app/views/commits/_commit_box.html.haml | 2 +- app/views/compare/_form.html.haml | 2 +- .../_zero_authorized_projects.html.haml | 2 +- app/views/deploy_keys/_form.html.haml | 4 +-- app/views/devise/passwords/edit.html.haml | 2 +- app/views/devise/passwords/new.html.erb | 2 +- app/views/devise/registrations/new.html.haml | 2 +- app/views/devise/sessions/_new_ldap.html.haml | 6 ++-- app/views/devise/sessions/new.html.haml | 2 +- app/views/groups/_new_group_member.html.haml | 2 +- app/views/groups/_new_member.html.haml | 2 +- app/views/groups/new.html.haml | 2 +- app/views/groups/search.html.haml | 2 +- app/views/hooks/index.html.haml | 2 +- app/views/issues/_form.html.haml | 6 ++-- app/views/issues/index.html.haml | 4 +-- app/views/keys/_form.html.haml | 4 +-- app/views/keys/_show.html.haml | 2 +- app/views/keys/show.html.haml | 2 +- app/views/merge_requests/_form.html.haml | 10 +++--- app/views/merge_requests/index.html.haml | 2 +- app/views/milestones/_form.html.haml | 10 +++--- app/views/milestones/show.html.haml | 2 +- app/views/profiles/account.html.haml | 6 ++-- app/views/profiles/show.html.haml | 2 +- app/views/projects/_form.html.haml | 4 +-- app/views/projects/_new_form.html.haml | 2 +- app/views/projects/empty.html.haml | 2 +- app/views/projects/teams/available.html.haml | 4 +-- app/views/protected_branches/index.html.haml | 2 +- app/views/search/show.html.haml | 2 +- app/views/services/_gitlab_ci.html.haml | 2 +- app/views/snippets/_form.html.haml | 2 +- app/views/team_members/_form.html.haml | 4 +-- app/views/team_members/_show.html.haml | 2 +- app/views/team_members/_show_team.html.haml | 2 +- app/views/team_members/import.html.haml | 4 +-- app/views/team_members/index.html.haml | 2 +- app/views/team_members/show.html.haml | 2 +- app/views/teams/edit.html.haml | 4 +-- app/views/teams/members/_form.html.haml | 2 +- app/views/teams/members/_show.html.haml | 4 +-- app/views/teams/members/index.html.haml | 2 +- app/views/teams/members/new.html.haml | 2 +- app/views/teams/members/show.html.haml | 2 +- app/views/teams/new.html.haml | 2 +- app/views/teams/projects/_form.html.haml | 4 +-- app/views/teams/projects/edit.html.haml | 14 ++------- app/views/teams/projects/index.html.haml | 4 +-- app/views/teams/projects/new.html.haml | 2 +- app/views/tree/edit.html.haml | 4 +-- app/views/wikis/_form.html.haml | 4 +-- app/views/wikis/edit.html.haml | 2 +- 75 files changed, 139 insertions(+), 150 deletions(-) diff --git a/app/assets/stylesheets/gitlab_bootstrap/buttons.scss b/app/assets/stylesheets/gitlab_bootstrap/buttons.scss index 674481e2cd2..ed102253ab6 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/buttons.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/buttons.scss @@ -7,11 +7,7 @@ color: #333; } - &.btn-white { - background: #FFF; - } - - &.primary { + &.btn-primary { background: #2a79A3; @include linear-gradient(#47A7b7, #2585b5); border-color: #2A79A3; @@ -58,21 +54,17 @@ } } - &.save-btn { + &.btn-create { @extend .wide; - @extend .primary; - } - - &.cancel-btn { - float: right; + @extend .success; } - &.wide { - padding-left: 30px; - padding-right: 30px; + &.btn-save { + @extend .wide; + @extend .btn-primary; } - &.danger { + &.btn-remove { @extend .btn-danger; border-color: #BD362F; @@ -82,8 +74,13 @@ } } - &.danger { - @extend .btn-danger; + &.btn-cancel { + float: right; + } + + &.wide { + padding-left: 20px; + padding-right: 20px; } &.small { diff --git a/app/assets/stylesheets/sections/notes.scss b/app/assets/stylesheets/sections/notes.scss index 7a1cc444e5d..d4934791110 100644 --- a/app/assets/stylesheets/sections/notes.scss +++ b/app/assets/stylesheets/sections/notes.scss @@ -214,9 +214,11 @@ ul.notes { * Note Form */ -.comment-btn, +.comment-btn { + @extend .create-btn; +} .reply-btn { - @extend .save-btn; + @extend .primary; } .file .content tr.line_holder:hover > td { background: $hover !important; } .file .content tr.line_holder:hover > td .line_note_link { diff --git a/app/views/admin/groups/edit.html.haml b/app/views/admin/groups/edit.html.haml index 901d07e74f3..6ec520e74b4 100644 --- a/app/views/admin/groups/edit.html.haml +++ b/app/views/admin/groups/edit.html.haml @@ -24,5 +24,5 @@ %li It will change the git path to repositories under this group. .form-actions - = f.submit 'Rename group', class: "btn danger" - = link_to 'Cancel', admin_groups_path, class: "btn cancel-btn" + = f.submit 'Rename group', class: "btn btn-remove" + = link_to 'Cancel', admin_groups_path, class: "btn btn-cancel" diff --git a/app/views/admin/groups/index.html.haml b/app/views/admin/groups/index.html.haml index 49acedc8c79..443abece919 100644 --- a/app/views/admin/groups/index.html.haml +++ b/app/views/admin/groups/index.html.haml @@ -8,7 +8,7 @@ %br = form_tag admin_groups_path, method: :get, class: 'form-inline' do = text_field_tag :name, params[:name], class: "xlarge" - = submit_tag "Search", class: "btn submit primary" + = submit_tag "Search", class: "btn submit btn-primary" %table %thead @@ -31,5 +31,5 @@ = link_to group.owner_name, admin_user_path(group.owner_id) %td.bgred = link_to 'Rename', edit_admin_group_path(group), id: "edit_#{dom_id(group)}", class: "btn small" - = link_to 'Destroy', [:admin, group], confirm: "REMOVE #{group.name}? Are you sure?", method: :delete, class: "btn small danger" + = link_to 'Destroy', [:admin, group], confirm: "REMOVE #{group.name}? Are you sure?", method: :delete, class: "btn small btn-remove" = paginate @groups, theme: "admin" diff --git a/app/views/admin/groups/new.html.haml b/app/views/admin/groups/new.html.haml index 6ff0e781d17..f8d1dfcf931 100644 --- a/app/views/admin/groups/new.html.haml +++ b/app/views/admin/groups/new.html.haml @@ -10,7 +10,7 @@ .input = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" - = f.submit 'Create group', class: "btn primary" + = f.submit 'Create group', class: "btn btn-primary" %hr .padded %ul diff --git a/app/views/admin/groups/show.html.haml b/app/views/admin/groups/show.html.haml index e347f916c4f..b5bdeeaaded 100644 --- a/app/views/admin/groups/show.html.haml +++ b/app/views/admin/groups/show.html.haml @@ -42,7 +42,7 @@ = form_for [:admin, @group] do |f| = f.select :owner_id, User.all.map { |user| [user.name, user.id] }, {}, {class: 'chosen'} %div - = f.submit 'Change Owner', class: "btn danger" + = f.submit 'Change Owner', class: "btn btn-remove" = link_to "Cancel", "#", class: "btn change-owner-cancel-link" - if @group.projects.any? @@ -63,7 +63,7 @@ %span.monospace= project.path_with_namespace + ".git" %td= project.users.count %td.bgred - = link_to 'Transfer project to global namespace', remove_project_admin_group_path(@group, project_id: project.id), confirm: 'Remove project from group and move to global namespace. Are you sure?', method: :delete, class: "btn danger small" + = link_to 'Transfer project to global namespace', remove_project_admin_group_path(@group, project_id: project.id), confirm: 'Remove project from group and move to global namespace. Are you sure?', method: :delete, class: "btn btn-remove small" = form_tag project_teams_update_admin_group_path(@group), id: "new_team_member", class: "bulk_import", method: :put do %table.zebra-striped @@ -88,7 +88,7 @@ %td= select_tag :project_access, options_for_select(Project.access_options), {class: "project-access-select chosen span3"} %tr - %td= submit_tag 'Add user to projects in group', class: "btn primary" + %td= submit_tag 'Add user to projects in group', class: "btn btn-primary" %td Read more about project permissions %strong= link_to "here", help_permissions_path, class: "vlink" @@ -110,7 +110,7 @@ .input = select_tag :project_ids, options_from_collection_for_select(@projects , :id, :name_with_namespace), multiple: true, data: {placeholder: 'Select projects'}, class: 'chosen span5' .form-actions - = submit_tag 'Add', class: "btn primary" + = submit_tag 'Add', class: "btn btn-primary" :javascript $(function(){ diff --git a/app/views/admin/hooks/index.html.haml b/app/views/admin/hooks/index.html.haml index f17355fb2c2..15bff871cd5 100644 --- a/app/views/admin/hooks/index.html.haml +++ b/app/views/admin/hooks/index.html.haml @@ -15,7 +15,7 @@ .input = f.text_field :url, class: "text_field xxlarge" - = f.submit "Add System Hook", class: "btn primary" + = f.submit "Add System Hook", class: "btn btn-primary" %hr -if @hooks.any? diff --git a/app/views/admin/projects/_form.html.haml b/app/views/admin/projects/_form.html.haml index 0c7cf68ef43..6342802c699 100644 --- a/app/views/admin/projects/_form.html.haml +++ b/app/views/admin/projects/_form.html.haml @@ -65,8 +65,8 @@ .actions - = f.submit 'Save Project', class: "btn save-btn" - = link_to 'Cancel', admin_projects_path, class: "btn cancel-btn" + = f.submit 'Save Project', class: "btn btn-save" + = link_to 'Cancel', admin_projects_path, class: "btn btn-cancel" diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml index e47cda76636..8ac2fa12520 100644 --- a/app/views/admin/projects/index.html.haml +++ b/app/views/admin/projects/index.html.haml @@ -37,7 +37,7 @@ .form-actions - = submit_tag "Search", class: "btn submit primary" + = submit_tag "Search", class: "btn submit btn-primary" = link_to "Reset", admin_projects_path, class: "btn" .span8 .ui-box @@ -53,7 +53,7 @@ = link_to project.name_with_namespace, [:admin, project] .right = link_to 'Edit', edit_admin_project_path(project), id: "edit_#{dom_id(project)}", class: "btn small" - = link_to 'Destroy', [:admin, project], confirm: "REMOVE #{project.name}? Are you sure?", method: :delete, class: "btn small danger" + = link_to 'Destroy', [:admin, project], confirm: "REMOVE #{project.name}? Are you sure?", method: :delete, class: "btn small btn-remove" - if @projects.blank? %p.nothing_here_message 0 projects matches - else diff --git a/app/views/admin/projects/members/_form.html.haml b/app/views/admin/projects/members/_form.html.haml index f1bb6cfa226..bbd419be576 100644 --- a/app/views/admin/projects/members/_form.html.haml +++ b/app/views/admin/projects/members/_form.html.haml @@ -12,5 +12,5 @@ %br .actions - = f.submit 'Save', class: "btn primary" + = f.submit 'Save', class: "btn btn-primary" = link_to 'Cancel', :back, class: "btn" diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml index a213c09d456..fb1a7b488c1 100644 --- a/app/views/admin/projects/show.html.haml +++ b/app/views/admin/projects/show.html.haml @@ -130,7 +130,7 @@ = link_to tm.name, admin_user_path(tm) %td= @project.project_access_human(tm) %td= link_to 'Edit Access', edit_admin_project_member_path(@project, tm), class: "btn small" - %td= link_to 'Remove from team', admin_project_member_path(@project, tm), confirm: 'Are you sure?', method: :delete, class: "btn danger small" + %td= link_to 'Remove from team', admin_project_member_path(@project, tm), confirm: 'Are you sure?', method: :delete, class: "btn btn-remove small" %br %h5 Add new team member @@ -147,7 +147,7 @@ %td= select_tag :project_access, options_for_select(Project.access_options), {class: "project-access-select chosen span3"} %tr - %td= submit_tag 'Add', class: "btn primary" + %td= submit_tag 'Add', class: "btn btn-primary" %td Read more about project permissions %strong= link_to "here", help_permissions_path, class: "vlink" diff --git a/app/views/admin/teams/edit.html.haml b/app/views/admin/teams/edit.html.haml index b2499ef6b8b..d024d82381a 100644 --- a/app/views/admin/teams/edit.html.haml +++ b/app/views/admin/teams/edit.html.haml @@ -19,5 +19,5 @@ %li It will change web url for access team and team projects. .form-actions - = f.submit 'Rename team', class: "btn danger" - = link_to 'Cancel', admin_teams_path, class: "btn cancel-btn" + = f.submit 'Rename team', class: "btn btn-remove" + = link_to 'Cancel', admin_teams_path, class: "btn btn-cancel" diff --git a/app/views/admin/teams/index.html.haml b/app/views/admin/teams/index.html.haml index 3ab57448ab2..e7344f4ea2c 100644 --- a/app/views/admin/teams/index.html.haml +++ b/app/views/admin/teams/index.html.haml @@ -8,7 +8,7 @@ = form_tag admin_teams_path, method: :get, class: 'form-inline' do = text_field_tag :name, params[:name], class: "xlarge" - = submit_tag "Search", class: "btn submit primary" + = submit_tag "Search", class: "btn submit btn-primary" %table %thead @@ -33,6 +33,6 @@ = link_to team.owner.name, admin_user_path(team.owner_id) %td.bgred = link_to 'Rename', edit_admin_team_path(team), id: "edit_#{dom_id(team)}", class: "btn small" - = link_to 'Destroy', admin_team_path(team), confirm: "REMOVE #{team.name}? Are you sure?", method: :delete, class: "btn small danger" + = link_to 'Destroy', admin_team_path(team), confirm: "REMOVE #{team.name}? Are you sure?", method: :delete, class: "btn small btn-remove" = paginate @teams, theme: "admin" diff --git a/app/views/admin/teams/members/_form.html.haml b/app/views/admin/teams/members/_form.html.haml index b75d788a94a..098118a645d 100644 --- a/app/views/admin/teams/members/_form.html.haml +++ b/app/views/admin/teams/members/_form.html.haml @@ -16,5 +16,5 @@ %br .actions - = submit_tag 'Save', class: "btn primary" + = submit_tag 'Save', class: "btn btn-primary" = link_to 'Cancel', :back, class: "btn" diff --git a/app/views/admin/teams/members/new.html.haml b/app/views/admin/teams/members/new.html.haml index 066ab19fd08..a37c941db53 100644 --- a/app/views/admin/teams/members/new.html.haml +++ b/app/views/admin/teams/members/new.html.haml @@ -26,4 +26,4 @@ %td %span= check_box_tag :group_admin %span Admin? - %td= submit_tag 'Add', class: "btn primary", id: :add_members_to_team + %td= submit_tag 'Add', class: "btn btn-primary", id: :add_members_to_team diff --git a/app/views/admin/teams/new.html.haml b/app/views/admin/teams/new.html.haml index a40a2c4ebf9..7483f1bf32d 100644 --- a/app/views/admin/teams/new.html.haml +++ b/app/views/admin/teams/new.html.haml @@ -10,7 +10,7 @@ .input = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" - = f.submit 'Create team', class: "btn primary" + = f.submit 'Create team', class: "btn btn-primary" %hr .padded %ul diff --git a/app/views/admin/teams/projects/_form.html.haml b/app/views/admin/teams/projects/_form.html.haml index db4fe85b000..9ba406ea125 100644 --- a/app/views/admin/teams/projects/_form.html.haml +++ b/app/views/admin/teams/projects/_form.html.haml @@ -12,5 +12,5 @@ %br .actions - = submit_tag 'Save', class: "btn primary" + = submit_tag 'Save', class: "btn btn-primary" = link_to 'Cancel', :back, class: "btn" diff --git a/app/views/admin/teams/projects/new.html.haml b/app/views/admin/teams/projects/new.html.haml index 8a0a18a48c0..b60dad35214 100644 --- a/app/views/admin/teams/projects/new.html.haml +++ b/app/views/admin/teams/projects/new.html.haml @@ -20,4 +20,4 @@ %tr %td= select_tag :project_ids, options_from_collection_for_select(@projects , :id, :name_with_namespace), multiple: true, data: {placeholder: 'Select projects'}, class: 'chosen span5' %td= select_tag :greatest_project_access, options_for_select(Project.access_options), {class: "project-access-select chosen span3" } - %td= submit_tag 'Add', class: "btn primary", id: :assign_projects_to_team + %td= submit_tag 'Add', class: "btn btn-primary", id: :assign_projects_to_team diff --git a/app/views/admin/teams/show.html.haml b/app/views/admin/teams/show.html.haml index 6a1deaff989..2561e3aeaf5 100644 --- a/app/views/admin/teams/show.html.haml +++ b/app/views/admin/teams/show.html.haml @@ -36,13 +36,13 @@ = form_for @team, url: admin_team_path(@team) do |f| = f.select :owner_id, User.all.map { |user| [user.name, user.id] }, {}, {class: 'chosen'} %div - = f.submit 'Change Owner', class: "btn danger" + = f.submit 'Change Owner', class: "btn btn-remove" = link_to "Cancel", "#", class: "btn change-owner-cancel-link" %fieldset %legend Members (#{@team.members.count}) - %span= link_to 'Add members', new_admin_team_member_path(@team), class: "btn success small right", id: :add_members_to_team + %span= link_to 'Add members', new_admin_team_member_path(@team), class: "btn btn-primary small right", id: :add_members_to_team - if @team.members.any? %table#members_list %thead @@ -62,12 +62,12 @@ %td.bgred = link_to 'Edit', edit_admin_team_member_path(@team, member), class: "btn small" - = link_to 'Remove', admin_team_member_path(@team, member), confirm: 'Remove member from team. Are you sure?', method: :delete, class: "btn danger small", id: "remove_member_#{member.id}" + = link_to 'Remove', admin_team_member_path(@team, member), confirm: 'Remove member from team. Are you sure?', method: :delete, class: "btn btn-remove small", id: "remove_member_#{member.id}" %fieldset %legend Projects (#{@team.projects.count}) - %span= link_to 'Add projects', new_admin_team_project_path(@team), class: "btn success small right", id: :assign_projects_to_team + %span= link_to 'Add projects', new_admin_team_project_path(@team), class: "btn btn-primary small right", id: :assign_projects_to_team - if @team.projects.any? %table#projects_list %thead @@ -84,7 +84,7 @@ %td.bgred = link_to 'Edit', edit_admin_team_project_path(@team, project), class: "btn small" - = link_to 'Relegate', admin_team_project_path(@team, project), confirm: 'Remove project from team. Are you sure?', method: :delete, class: "btn danger small", id: "relegate_project_#{project.id}" + = link_to 'Relegate', admin_team_project_path(@team, project), confirm: 'Remove project from team. Are you sure?', method: :delete, class: "btn btn-remove small", id: "relegate_project_#{project.id}" :javascript $(function(){ diff --git a/app/views/admin/users/_form.html.haml b/app/views/admin/users/_form.html.haml index 465568ade9e..9f447bcd9e7 100644 --- a/app/views/admin/users/_form.html.haml +++ b/app/views/admin/users/_form.html.haml @@ -66,7 +66,7 @@ = link_to 'Unblock User', unblock_admin_user_path(@admin_user), method: :put, class: "btn small" - else %p Blocked users will be removed from all projects & will not be able to login to GitLab. - = link_to 'Block User', block_admin_user_path(@admin_user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn small danger" + = link_to 'Block User', block_admin_user_path(@admin_user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn small btn-remove" %fieldset %legend Profile .clearfix @@ -80,8 +80,8 @@ .input= f.text_field :twitter .actions - = f.submit 'Save', class: "btn save-btn" + = f.submit 'Save', class: "btn btn-save" - if @admin_user.new_record? - = link_to 'Cancel', admin_users_path, class: "btn cancel-btn" + = link_to 'Cancel', admin_users_path, class: "btn btn-cancel" - else - = link_to 'Cancel', admin_user_path(@admin_user), class: "btn cancel-btn" + = link_to 'Cancel', admin_user_path(@admin_user), class: "btn btn-cancel" diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml index 87290abe7a6..0aa8a16fbc6 100644 --- a/app/views/admin/users/index.html.haml +++ b/app/views/admin/users/index.html.haml @@ -5,7 +5,7 @@ = form_tag admin_users_path, method: :get, class: 'form-inline' do = text_field_tag :name, params[:name], class: "xlarge" - = submit_tag "Search", class: "btn submit primary" + = submit_tag "Search", class: "btn submit btn-primary" %ul.nav.nav-tabs %li{class: "#{'active' unless params[:filter]}"} = link_to admin_users_path do @@ -52,7 +52,7 @@ - if user.blocked = link_to 'Unblock', unblock_admin_user_path(user), method: :put, class: "btn small success" - else - = link_to 'Block', block_admin_user_path(user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn small danger" - = link_to 'Destroy', [:admin, user], confirm: "USER #{user.name} WILL BE REMOVED! Are you sure?", method: :delete, class: "btn small danger" + = link_to 'Block', block_admin_user_path(user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn small btn-remove" + = link_to 'Destroy', [:admin, user], confirm: "USER #{user.name} WILL BE REMOVED! Are you sure?", method: :delete, class: "btn small btn-remove" = paginate @admin_users, theme: "admin" diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml index d9d720dad76..fefb5706a93 100644 --- a/app/views/admin/users/show.html.haml +++ b/app/views/admin/users/show.html.haml @@ -86,7 +86,7 @@ %td= select_tag :project_access, options_for_select(Project.access_options), class: "project-access-select chosen span3" %tr - %td= submit_tag 'Add', class: "btn primary" + %td= submit_tag 'Add', class: "btn btn-primary" %td Read more about project permissions %strong= link_to "here", help_permissions_path, class: "vlink" @@ -124,4 +124,4 @@ %td= link_to project.name_with_namespace, admin_project_path(project) %td= tm.project_access_human %td= link_to 'Edit Access', edit_admin_project_member_path(project, tm.user), class: "btn small" - %td= link_to 'Remove from team', admin_project_member_path(project, tm.user), confirm: 'Are you sure?', method: :delete, class: "btn small danger" + %td= link_to 'Remove from team', admin_project_member_path(project, tm.user), confirm: 'Are you sure?', method: :delete, class: "btn small btn-remove" diff --git a/app/views/commits/_commit_box.html.haml b/app/views/commits/_commit_box.html.haml index 0544a1d10fe..4767c493ab7 100644 --- a/app/views/commits/_commit_box.html.haml +++ b/app/views/commits/_commit_box.html.haml @@ -13,7 +13,7 @@ %ul.dropdown-menu %li= link_to "Email Patches", project_commit_path(@project, @commit, format: :patch) %li= link_to "Plain Diff", project_commit_path(@project, @commit, format: :diff) - = link_to project_tree_path(@project, @commit), class: "btn primary grouped" do + = link_to project_tree_path(@project, @commit), class: "btn btn-primary grouped" do %span Browse Code » %h3.commit-title.page_title = gfm escape_once(@commit.title) diff --git a/app/views/compare/_form.html.haml b/app/views/compare/_form.html.haml index 0915782dddc..7c0688a2287 100644 --- a/app/views/compare/_form.html.haml +++ b/app/views/compare/_form.html.haml @@ -19,7 +19,7 @@ = text_field_tag :to, params[:to], placeholder: "aa8b4ef", class: "xlarge" .pull-left - = submit_tag "Compare", class: "btn primary wide commits-compare-btn" + = submit_tag "Compare", class: "btn btn-primary wide commits-compare-btn" - if @refs_are_same .alert %span Refs are the same diff --git a/app/views/dashboard/_zero_authorized_projects.html.haml b/app/views/dashboard/_zero_authorized_projects.html.haml index d1676ed11fa..4b0d0d6873d 100644 --- a/app/views/dashboard/_zero_authorized_projects.html.haml +++ b/app/views/dashboard/_zero_authorized_projects.html.haml @@ -6,7 +6,7 @@ = current_user.projects_limit projects. Click on button below to add a new one .link_holder - = link_to new_project_path, class: "btn primary" do + = link_to new_project_path, class: "btn btn-primary" do New Project » - else If you will be added to project - it will be displayed here diff --git a/app/views/deploy_keys/_form.html.haml b/app/views/deploy_keys/_form.html.haml index 6beba562a95..4deeb0e8e07 100644 --- a/app/views/deploy_keys/_form.html.haml +++ b/app/views/deploy_keys/_form.html.haml @@ -18,6 +18,6 @@ = link_to "here", help_ssh_path .actions - = f.submit 'Save', class: "save-btn btn" - = link_to "Cancel", project_deploy_keys_path(@project), class: "btn cancel-btn" + = f.submit 'Save', class: "btn-save btn" + = link_to "Cancel", project_deploy_keys_path(@project), class: "btn btn-cancel" diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml index 31d355673ab..6ca0c5d8c08 100644 --- a/app/views/devise/passwords/edit.html.haml +++ b/app/views/devise/passwords/edit.html.haml @@ -8,5 +8,5 @@ %div = f.password_field :password_confirmation, class: "text bottom", placeholder: "Confirm new password" %div - = f.submit "Change my password", class: "btn primary" + = f.submit "Change my password", class: "btn btn-primary" .right= render partial: "devise/shared/links" diff --git a/app/views/devise/passwords/new.html.erb b/app/views/devise/passwords/new.html.erb index 860d67d19e7..1171b3bfb75 100644 --- a/app/views/devise/passwords/new.html.erb +++ b/app/views/devise/passwords/new.html.erb @@ -4,6 +4,6 @@ <%= f.email_field :email, :placeholder => "Email", :class => "text" %> <br/> <br/> - <%= f.submit "Reset password", :class => "primary btn" %> + <%= f.submit "Reset password", :class => "btn-primary btn" %> <div class="right"> <%= link_to "Sign in", new_session_path(resource_name), :class => "btn" %><br /></div> <% end %> diff --git a/app/views/devise/registrations/new.html.haml b/app/views/devise/registrations/new.html.haml index 81eb2622261..2b72d4ade87 100644 --- a/app/views/devise/registrations/new.html.haml +++ b/app/views/devise/registrations/new.html.haml @@ -12,7 +12,7 @@ %div = f.password_field :password_confirmation, :class => "text bottom", :placeholder => "Confirm password", :required => true %div - = f.submit "Sign up", :class => "primary btn wide" + = f.submit "Sign up", :class => "btn-primary btn wide" %br %hr = link_to "Sign in", new_session_path(resource_name) diff --git a/app/views/devise/sessions/_new_ldap.html.haml b/app/views/devise/sessions/_new_ldap.html.haml index 4233aa61ecb..a4060130552 100644 --- a/app/views/devise/sessions/_new_ldap.html.haml +++ b/app/views/devise/sessions/_new_ldap.html.haml @@ -3,11 +3,11 @@ = text_field_tag :username, nil, {:class => "text top", :placeholder => "LDAP Login"} = password_field_tag :password, nil, {:class => "text bottom", :placeholder => "Password"} %br/ - = submit_tag "LDAP Sign in", :class => "primary btn" + = submit_tag "LDAP Sign in", :class => "btn-primary btn" - if devise_mapping.omniauthable? - (resource_class.omniauth_providers - [:ldap]).each do |provider| %hr/ - = link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider), :class => "btn primary" + = link_to "Sign in with #{provider.to_s.titleize}", omniauth_authorize_path(resource_name, provider), :class => "btn btn-primary" %br/ %hr/ %a#other_form_toggle{:href => "#", :onclick => "javascript:$('#new_user').toggle();"} Other Sign in @@ -24,6 +24,6 @@ = f.check_box :remember_me %span Remember me %br/ - = f.submit "Sign in", :class => "primary btn" + = f.submit "Sign in", :class => "btn-primary btn" .right = render :partial => "devise/shared/links" diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index 0983f3157c4..0a252e25487 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -11,7 +11,7 @@ = f.check_box :remember_me %span Remember me %br/ - = f.submit "Sign in", :class => "primary btn wide" + = f.submit "Sign in", :class => "btn-primary btn wide" .right = link_to "Forgot your password?", new_password_path(resource_name), :class => "btn" %br/ diff --git a/app/views/groups/_new_group_member.html.haml b/app/views/groups/_new_group_member.html.haml index 2d599816e2a..9cdbea60370 100644 --- a/app/views/groups/_new_group_member.html.haml +++ b/app/views/groups/_new_group_member.html.haml @@ -14,5 +14,5 @@ .form-actions = hidden_field_tag :redirect_to, people_group_path(@group) - = f.submit 'Add', class: "btn save-btn" + = f.submit 'Add', class: "btn btn-save" diff --git a/app/views/groups/_new_member.html.haml b/app/views/groups/_new_member.html.haml index 89ac05e774e..b3424b01bcb 100644 --- a/app/views/groups/_new_member.html.haml +++ b/app/views/groups/_new_member.html.haml @@ -14,5 +14,5 @@ .form-actions = hidden_field_tag :redirect_to, people_group_path(@group, project_id: @project.id) - = f.submit 'Add', class: "btn save-btn" + = f.submit 'Add', class: "btn btn-save" diff --git a/app/views/groups/new.html.haml b/app/views/groups/new.html.haml index b6d5f46507e..8fdedce95c9 100644 --- a/app/views/groups/new.html.haml +++ b/app/views/groups/new.html.haml @@ -10,7 +10,7 @@ .input = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" - = f.submit 'Create group', class: "btn primary" + = f.submit 'Create group', class: "btn btn-primary" %hr .padded %ul diff --git a/app/views/groups/search.html.haml b/app/views/groups/search.html.haml index 1ba4707aa52..f56bbadeac0 100644 --- a/app/views/groups/search.html.haml +++ b/app/views/groups/search.html.haml @@ -4,6 +4,6 @@ %strong Looking for .input = search_field_tag :search, params[:search], placeholder: "issue 143", class: "input-xxlarge search-text-input", id: "dashboard_search" - = submit_tag 'Search', class: "btn primary wide" + = submit_tag 'Search', class: "btn btn-primary wide" - if params[:search].present? = render 'search/result' diff --git a/app/views/hooks/index.html.haml b/app/views/hooks/index.html.haml index 1fcf6e1c57a..98a82f110de 100644 --- a/app/views/hooks/index.html.haml +++ b/app/views/hooks/index.html.haml @@ -18,7 +18,7 @@ .input = f.text_field :url, class: "text_field xxlarge" - = f.submit "Add Web Hook", class: "btn primary" + = f.submit "Add Web Hook", class: "btn btn-primary" %hr -if @hooks.any? diff --git a/app/views/issues/_form.html.haml b/app/views/issues/_form.html.haml index bef235f2dea..16d1b163ee8 100644 --- a/app/views/issues/_form.html.haml +++ b/app/views/issues/_form.html.haml @@ -44,12 +44,12 @@ .actions - if @issue.new_record? - = f.submit 'Submit new issue', class: "btn success" + = f.submit 'Submit new issue', class: "btn btn-create" -else - = f.submit 'Save changes', class: "save-btn btn" + = f.submit 'Save changes', class: "btn-save btn" - cancel_path = @issue.new_record? ? project_issues_path(@project) : project_issue_path(@project, @issue) - = link_to "Cancel", cancel_path, class: 'btn cancel-btn' + = link_to "Cancel", cancel_path, class: 'btn btn-cancel' diff --git a/app/views/issues/index.html.haml b/app/views/issues/index.html.haml index d5c29c780ce..a3fb0335205 100644 --- a/app/views/issues/index.html.haml +++ b/app/views/issues/index.html.haml @@ -6,7 +6,7 @@ .right .span5 - if can? current_user, :write_issue, @project - = link_to new_project_issue_path(@project, issue: { assignee_id: params[:assignee_id], milestone_id: params[:milestone_id]}), class: "right btn primary", title: "New Issue", id: "new_issue_link" do + = link_to new_project_issue_path(@project, issue: { assignee_id: params[:assignee_id], milestone_id: params[:milestone_id]}), class: "right btn btn-primary", title: "New Issue", id: "new_issue_link" do %i.icon-plus New Issue = form_tag search_project_issues_path(@project), method: :get, remote: true, id: "issue_search_form", class: :right do @@ -33,7 +33,7 @@ = select_tag('update[milestone_id]', options_from_collection_for_select(issues_active_milestones, "id", "title", params[:milestone_id]), prompt: "Milestone") = hidden_field_tag 'update[issues_ids]', [] = hidden_field_tag :status, params[:status] - = button_tag "Save", class: "btn update_selected_issues btn-small save-btn" + = button_tag "Save", class: "btn update_selected_issues btn-small btn-save" .issues_filters = form_tag project_issues_path(@project), method: :get do = select_tag(:label_name, options_for_select(issue_tags, params[:label_name]), prompt: "Labels") diff --git a/app/views/keys/_form.html.haml b/app/views/keys/_form.html.haml index 26700803e61..b60ad7df0ae 100644 --- a/app/views/keys/_form.html.haml +++ b/app/views/keys/_form.html.haml @@ -19,6 +19,6 @@ .actions - = f.submit 'Save', class: "btn save-btn" - = link_to "Cancel", keys_path, class: "btn cancel-btn" + = f.submit 'Save', class: "btn btn-save" + = link_to "Cancel", keys_path, class: "btn btn-cancel" diff --git a/app/views/keys/_show.html.haml b/app/views/keys/_show.html.haml index 9d4485cf9a4..049981766b6 100644 --- a/app/views/keys/_show.html.haml +++ b/app/views/keys/_show.html.haml @@ -8,5 +8,5 @@ = time_ago_in_words(key.created_at) ago %td - = link_to 'Remove', key, confirm: 'Are you sure?', method: :delete, class: "btn small danger delete-key right" + = link_to 'Remove', key, confirm: 'Are you sure?', method: :delete, class: "btn small btn-remove delete-key right" diff --git a/app/views/keys/show.html.haml b/app/views/keys/show.html.haml index a8cba6c8f9e..089d0558b52 100644 --- a/app/views/keys/show.html.haml +++ b/app/views/keys/show.html.haml @@ -11,4 +11,4 @@ %pre= @key.key .right - = link_to 'Remove', @key, confirm: 'Are you sure?', method: :delete, class: "btn danger delete-key" + = link_to 'Remove', @key, confirm: 'Are you sure?', method: :delete, class: "btn btn-remove delete-key" diff --git a/app/views/merge_requests/_form.html.haml b/app/views/merge_requests/_form.html.haml index 9a4f0617a3a..603f30407b9 100644 --- a/app/views/merge_requests/_form.html.haml +++ b/app/views/merge_requests/_form.html.haml @@ -51,19 +51,19 @@ .form-actions - if @merge_request.new_record? - = f.submit 'Submit merge request', class: "btn success" + = f.submit 'Submit merge request', class: "btn btn-create" -else - = f.submit 'Save changes', class: "save-btn btn" + = f.submit 'Save changes', class: "btn btn-save" - if @merge_request.new_record? - = link_to project_merge_requests_path(@project), class: "btn cancel-btn" do + = link_to project_merge_requests_path(@project), class: "btn btn-cancel" do Cancel - else - = link_to project_merge_request_path(@project, @merge_request), class: "btn cancel-btn" do + = link_to project_merge_request_path(@project, @merge_request), class: "btn btn-cancel" do Cancel :javascript $(function(){ - disableButtonIfEmptyField("#merge_request_title", ".save-btn"); + disableButtonIfEmptyField("#merge_request_title", ".btn-save"); var source_branch = $("#merge_request_source_branch") , target_branch = $("#merge_request_target_branch"); diff --git a/app/views/merge_requests/index.html.haml b/app/views/merge_requests/index.html.haml index 61c32b533f6..8c688e26814 100644 --- a/app/views/merge_requests/index.html.haml +++ b/app/views/merge_requests/index.html.haml @@ -1,5 +1,5 @@ - if can? current_user, :write_merge_request, @project - = link_to new_project_merge_request_path(@project), class: "right btn primary", title: "New Merge Request" do + = link_to new_project_merge_request_path(@project), class: "right btn btn-primary", title: "New Merge Request" do %i.icon-plus New Merge Request %h3.page_title diff --git a/app/views/milestones/_form.html.haml b/app/views/milestones/_form.html.haml index 1c496a93e54..2dc90bb89d0 100644 --- a/app/views/milestones/_form.html.haml +++ b/app/views/milestones/_form.html.haml @@ -32,16 +32,16 @@ .form-actions - if @milestone.new_record? - = f.submit 'Create milestone', class: "save-btn btn" - = link_to "Cancel", project_milestones_path(@project), class: "btn cancel-btn" + = f.submit 'Create milestone', class: "btn-save btn" + = link_to "Cancel", project_milestones_path(@project), class: "btn btn-cancel" -else - = f.submit 'Save changes', class: "save-btn btn" - = link_to "Cancel", project_milestone_path(@project, @milestone), class: "btn cancel-btn" + = f.submit 'Save changes', class: "btn-save btn" + = link_to "Cancel", project_milestone_path(@project, @milestone), class: "btn btn-cancel" :javascript $(function() { - disableButtonIfEmptyField("#milestone_title", ".save-btn"); + disableButtonIfEmptyField("#milestone_title", ".btn-save"); $( ".datepicker" ).datepicker({ dateFormat: "yy-mm-dd", onSelect: function(dateText, inst) { $("#milestone_due_date").val(dateText) } diff --git a/app/views/milestones/show.html.haml b/app/views/milestones/show.html.haml index fc7ae51f184..797f35befa5 100644 --- a/app/views/milestones/show.html.haml +++ b/app/views/milestones/show.html.haml @@ -25,7 +25,7 @@ %hr %p %span All issues for this milestone are closed. You may close milestone now. - = link_to 'Close Milestone', project_milestone_path(@project, @milestone, milestone: {closed: true }), method: :put, class: "btn small danger" + = link_to 'Close Milestone', project_milestone_path(@project, @milestone, milestone: {closed: true }), method: :put, class: "btn small btn-remove" .ui-box.ui-box-show .ui-box-head diff --git a/app/views/profiles/account.html.haml b/app/views/profiles/account.html.haml index 522e45e637a..71eacd571bd 100644 --- a/app/views/profiles/account.html.haml +++ b/app/views/profiles/account.html.haml @@ -24,7 +24,7 @@ %p.cgray - if current_user.private_token = text_field_tag "token", current_user.private_token, class: "xxlarge large_text" - = f.submit 'Reset', confirm: "Are you sure?", class: "btn primary btn-build-token" + = f.submit 'Reset', confirm: "Are you sure?", class: "btn btn-primary btn-build-token" - else %span You don`t have one yet. Click generate to fix it. = f.submit 'Generate', class: "btn success btn-build-token" @@ -49,7 +49,7 @@ = f.password_field :password_confirmation, required: true .clearfix .input - = f.submit 'Save password', class: "btn save-btn" + = f.submit 'Save password', class: "btn btn-save" @@ -75,6 +75,6 @@ %li It will change web url for personal projects. %li It will change the git path to repositories for personal projects. .input - = f.submit 'Save username', class: "btn save-btn" + = f.submit 'Save username', class: "btn btn-save" diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml index 7a3177f0efc..4c0463aff79 100644 --- a/app/views/profiles/show.html.haml +++ b/app/views/profiles/show.html.haml @@ -93,4 +93,4 @@ = link_to "Add Public Key", new_key_path, class: "btn small" .form-actions - = f.submit 'Save', class: "btn save-btn" + = f.submit 'Save', class: "btn btn-save" diff --git a/app/views/projects/_form.html.haml b/app/views/projects/_form.html.haml index b582adc97a2..a3e97fe9b70 100644 --- a/app/views/projects/_form.html.haml +++ b/app/views/projects/_form.html.haml @@ -77,9 +77,9 @@ %br .actions - = f.submit 'Save', class: "btn save-btn" + = f.submit 'Save', class: "btn btn-save" = link_to 'Cancel', @project, class: "btn" - unless @project.new_record? - if can?(current_user, :remove_project, @project) .right - = link_to 'Remove Project', @project, confirm: 'Removed project can not be restored! Are you sure?', method: :delete, class: "btn danger" + = link_to 'Remove Project', @project, confirm: 'Removed project can not be restored! Are you sure?', method: :delete, class: "btn btn-remove" diff --git a/app/views/projects/_new_form.html.haml b/app/views/projects/_new_form.html.haml index 5f7348d47a1..dc4f4e23356 100644 --- a/app/views/projects/_new_form.html.haml +++ b/app/views/projects/_new_form.html.haml @@ -7,7 +7,7 @@ Project name is .input = f.text_field :name, placeholder: "Example Project", class: "xxlarge" - = f.submit 'Create project', class: "btn success project-submit" + = f.submit 'Create project', class: "btn btn-create project-submit" - if current_user.can_select_namespace? .clearfix diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml index 52dff687a3a..e7ee8bbb171 100644 --- a/app/views/projects/empty.html.haml +++ b/app/views/projects/empty.html.haml @@ -31,4 +31,4 @@ - if can? current_user, :remove_project, @project .prepend-top-20 - = link_to 'Remove project', @project, confirm: 'Are you sure?', method: :delete, class: "btn danger right" + = link_to 'Remove project', @project, confirm: 'Are you sure?', method: :delete, class: "btn btn-remove right" diff --git a/app/views/projects/teams/available.html.haml b/app/views/projects/teams/available.html.haml index 814e216d6ad..da7823638b9 100644 --- a/app/views/projects/teams/available.html.haml +++ b/app/views/projects/teams/available.html.haml @@ -17,6 +17,6 @@ .actions - = submit_tag 'Assign', class: "btn save-btn" - = link_to "Cancel", project_team_index_path(@project), class: "btn cancel-btn" + = submit_tag 'Assign', class: "btn btn-create" + = link_to "Cancel", project_team_index_path(@project), class: "btn btn-cancel" diff --git a/app/views/protected_branches/index.html.haml b/app/views/protected_branches/index.html.haml index c1ecceda435..8ceff635fd9 100644 --- a/app/views/protected_branches/index.html.haml +++ b/app/views/protected_branches/index.html.haml @@ -24,7 +24,7 @@ .span3 = f.select(:name, @project.open_branches.map { |br| [br.name, br.name] } , {include_blank: "Select branch"}, {class: "chosen span3"}) - = f.submit 'Protect', class: "primary btn" + = f.submit 'Protect', class: "btn-primary btn" - unless @branches.empty? %table diff --git a/app/views/search/show.html.haml b/app/views/search/show.html.haml index 22e1ae50df1..5914c22df6e 100644 --- a/app/views/search/show.html.haml +++ b/app/views/search/show.html.haml @@ -4,7 +4,7 @@ %span Looking for .input = search_field_tag :search, params[:search], placeholder: "issue 143", class: "input-xxlarge search-text-input", id: "dashboard_search" - = submit_tag 'Search', class: "btn primary wide" + = submit_tag 'Search', class: "btn btn-primary wide" .clearfix .row .span3 diff --git a/app/views/services/_gitlab_ci.html.haml b/app/views/services/_gitlab_ci.html.haml index 649c5cc4c3c..822892c8337 100644 --- a/app/views/services/_gitlab_ci.html.haml +++ b/app/views/services/_gitlab_ci.html.haml @@ -40,7 +40,7 @@ .form-actions - = f.submit 'Save', class: 'btn save-btn' + = f.submit 'Save', class: 'btn btn-save' - if @service.valid? && @service.active = link_to 'Test settings', test_project_service_path(@project), class: 'btn btn-small' diff --git a/app/views/snippets/_form.html.haml b/app/views/snippets/_form.html.haml index baef737b565..1405bd1110f 100644 --- a/app/views/snippets/_form.html.haml +++ b/app/views/snippets/_form.html.haml @@ -27,7 +27,7 @@ = f.hidden_field :content, class: 'snippet-file-content' .form-actions - = f.submit 'Save', class: "save-btn btn" + = f.submit 'Save', class: "btn-save btn" = link_to "Cancel", project_snippets_path(@project), class: " btn" - unless @snippet.new_record? .right= link_to 'Destroy', [@project, @snippet], confirm: 'Are you sure?', method: :delete, class: "btn right danger delete-snippet", id: "destroy_snippet_#{@snippet.id}" diff --git a/app/views/team_members/_form.html.haml b/app/views/team_members/_form.html.haml index f9ee49dbdeb..1616ea3c229 100644 --- a/app/views/team_members/_form.html.haml +++ b/app/views/team_members/_form.html.haml @@ -19,5 +19,5 @@ .input= select_tag :project_access, options_for_select(Project.access_options, @user_project_relation.project_access), class: "project-access-select chosen" .actions - = f.submit 'Save', class: "btn save-btn" - = link_to "Cancel", project_team_index_path(@project), class: "btn cancel-btn" + = f.submit 'Save', class: "btn btn-save" + = link_to "Cancel", project_team_index_path(@project), class: "btn btn-cancel" diff --git a/app/views/team_members/_show.html.haml b/app/views/team_members/_show.html.haml index 52992033805..c8138af4428 100644 --- a/app/views/team_members/_show.html.haml +++ b/app/views/team_members/_show.html.haml @@ -23,6 +23,6 @@ - elsif user.blocked %span.btn.disabled.blocked Blocked - elsif allow_admin - = link_to project_team_member_path(@project, user), confirm: remove_from_project_team_message(@project, user), method: :delete, class: "very_small btn danger" do + = link_to project_team_member_path(@project, user), confirm: remove_from_project_team_message(@project, user), method: :delete, class: "very_small btn btn-remove" do %i.icon-minus.icon-white diff --git a/app/views/team_members/_show_team.html.haml b/app/views/team_members/_show_team.html.haml index da0262efda5..ebe6f633d68 100644 --- a/app/views/team_members/_show_team.html.haml +++ b/app/views/team_members/_show_team.html.haml @@ -11,5 +11,5 @@ .right - if allow_admin .left - = link_to resign_project_team_path(@project, team), method: :delete, confirm: "Are you shure?", class: "btn danger small" do + = link_to resign_project_team_path(@project, team), method: :delete, confirm: "Are you shure?", class: "btn btn-remove small" do %i.icon-minus.icon-white diff --git a/app/views/team_members/import.html.haml b/app/views/team_members/import.html.haml index 135db946041..d6c81befd08 100644 --- a/app/views/team_members/import.html.haml +++ b/app/views/team_members/import.html.haml @@ -12,6 +12,6 @@ .input= select_tag(:source_project_id, options_from_collection_for_select(current_user.authorized_projects, :id, :name_with_namespace), prompt: "Select project", class: "chosen xxlarge", required: true) .actions - = submit_tag 'Import', class: "btn save-btn" - = link_to "Cancel", project_team_index_path(@project), class: "btn cancel-btn" + = submit_tag 'Import', class: "btn btn-save" + = link_to "Cancel", project_team_index_path(@project), class: "btn btn-cancel" diff --git a/app/views/team_members/index.html.haml b/app/views/team_members/index.html.haml index 6425302b83b..935755f36c4 100644 --- a/app/views/team_members/index.html.haml +++ b/app/views/team_members/index.html.haml @@ -12,7 +12,7 @@ Import team from another project = link_to available_project_teams_path(@project), class: "btn small grouped", title: "Assign project to team of users" do Assign project to Team of users - = link_to new_project_team_member_path(@project), class: "btn success small grouped", title: "New Team Member" do + = link_to new_project_team_member_path(@project), class: "btn btn-primary small grouped", title: "New Team Member" do New Team Member %hr diff --git a/app/views/team_members/show.html.haml b/app/views/team_members/show.html.haml index a6a7152e92a..99564f8e167 100644 --- a/app/views/team_members/show.html.haml +++ b/app/views/team_members/show.html.haml @@ -2,7 +2,7 @@ .team_member_show - if can? current_user, :admin_project, @project - = link_to 'Remove from team', project_team_member_path(@project, @member), confirm: 'Are you sure?', method: :delete, class: "right btn danger" + = link_to 'Remove from team', project_team_member_path(@project, @member), confirm: 'Are you sure?', method: :delete, class: "right btn btn-remove" .profile_avatar_holder = image_tag gravatar_icon(@member.email, 60), class: "borders" %h3.page_title diff --git a/app/views/teams/edit.html.haml b/app/views/teams/edit.html.haml index 60535330c4a..2c565230b85 100644 --- a/app/views/teams/edit.html.haml +++ b/app/views/teams/edit.html.haml @@ -17,6 +17,6 @@ = f.text_field :path, placeholder: "opensource", class: "xxlarge left" .clearfix .input.span3.center - = f.submit 'Save team changes', class: "btn primary" + = f.submit 'Save team changes', class: "btn btn-primary" .input.span3.center - = link_to 'Delete team', team_path(@team), method: :delete, confirm: "You are shure?", class: "btn danger" + = link_to 'Delete team', team_path(@team), method: :delete, confirm: "You are shure?", class: "btn btn-remove" diff --git a/app/views/teams/members/_form.html.haml b/app/views/teams/members/_form.html.haml index b75d788a94a..701eb4f2233 100644 --- a/app/views/teams/members/_form.html.haml +++ b/app/views/teams/members/_form.html.haml @@ -16,5 +16,5 @@ %br .actions - = submit_tag 'Save', class: "btn primary" + = submit_tag 'Save', class: "btn btn-save" = link_to 'Cancel', :back, class: "btn" diff --git a/app/views/teams/members/_show.html.haml b/app/views/teams/members/_show.html.haml index 740d5a498c0..a14177dfe29 100644 --- a/app/views/teams/members/_show.html.haml +++ b/app/views/teams/members/_show.html.haml @@ -17,8 +17,8 @@ = f.select :permission, options_for_select(UsersProject.access_roles, @team.default_projects_access(user)), {}, class: "medium project-access-select span2" .left.span2 %span - Admin access = check_box_tag :group_admin, true, @team.admin?(user) + Admin access .right - if current_user == user %span.btn.disabled This is you! @@ -27,5 +27,5 @@ - elsif user.blocked %span.btn.disabled.blocked Blocked - elsif allow_admin - = link_to team_member_path(@team, user), confirm: remove_from_user_team_message(@team, user), method: :delete, class: "very_small btn danger" do + = link_to team_member_path(@team, user), confirm: remove_from_user_team_message(@team, user), method: :delete, class: "very_small btn btn-remove" do %i.icon-minus.icon-white diff --git a/app/views/teams/members/index.html.haml b/app/views/teams/members/index.html.haml index 90fa0aef35c..8ce6e5d83c0 100644 --- a/app/views/teams/members/index.html.haml +++ b/app/views/teams/members/index.html.haml @@ -7,7 +7,7 @@ - if can? current_user, :manage_user_team, @team %span.right - = link_to new_team_member_path(@team), class: "btn success small grouped", title: "New Team Member" do + = link_to new_team_member_path(@team), class: "btn btn-primary small grouped", title: "New Team Member" do New Team Member %hr diff --git a/app/views/teams/members/new.html.haml b/app/views/teams/members/new.html.haml index 274cdbadf29..083e137e0ae 100644 --- a/app/views/teams/members/new.html.haml +++ b/app/views/teams/members/new.html.haml @@ -25,4 +25,4 @@ %td %span= check_box_tag :group_admin %span Admin? - %td= submit_tag 'Add', class: "btn primary", id: :add_members_to_team + %td= submit_tag 'Add User', class: "btn btn-create", id: :add_members_to_team diff --git a/app/views/teams/members/show.html.haml b/app/views/teams/members/show.html.haml index 4008e8bd23e..6e655cee08e 100644 --- a/app/views/teams/members/show.html.haml +++ b/app/views/teams/members/show.html.haml @@ -3,7 +3,7 @@ .team_member_show - if can? current_user, :admin_project, @project - = link_to 'Remove from team', project_team_member_path(project_id: @project, id: @team_member.id), confirm: 'Are you sure?', method: :delete, class: "right btn danger" + = link_to 'Remove from team', project_team_member_path(project_id: @project, id: @team_member.id), confirm: 'Are you sure?', method: :delete, class: "right btn btn-remove" .profile_avatar_holder = image_tag gravatar_icon(user.email, 60), class: "borders" %h3.page_title diff --git a/app/views/teams/new.html.haml b/app/views/teams/new.html.haml index 12695f2b5ae..ca28f313e72 100644 --- a/app/views/teams/new.html.haml +++ b/app/views/teams/new.html.haml @@ -10,7 +10,7 @@ .input = f.text_field :name, placeholder: "Ex. Ruby Developers", class: "xxlarge left" - = f.submit 'Create team', class: "btn primary" + = f.submit 'Create team', class: "btn btn-primary" %hr .padded %ul diff --git a/app/views/teams/projects/_form.html.haml b/app/views/teams/projects/_form.html.haml index 3749dbc4f99..763d07a1c7e 100644 --- a/app/views/teams/projects/_form.html.haml +++ b/app/views/teams/projects/_form.html.haml @@ -12,5 +12,5 @@ %br .actions - = submit_tag 'Save', class: "btn primary" - = link_to 'Cancel', :back, class: "btn" + = submit_tag 'Save', class: "btn btn-save" + = link_to 'Cancel', :back, class: "btn btn-cancel" diff --git a/app/views/teams/projects/edit.html.haml b/app/views/teams/projects/edit.html.haml index b91a4982b81..82c7d734815 100644 --- a/app/views/teams/projects/edit.html.haml +++ b/app/views/teams/projects/edit.html.haml @@ -1,16 +1,6 @@ -%h3 - Edit max access in #{@project.name} for #{@team.name} team +%h3.page_title + Edit max access in #{link_to @project.name_with_namespace, @project} for #{link_to(@team.name, team_path(@team))} team %hr -%table.zebra-striped - %tr - %td Project: - %td= @project.name - %tr - %td Team: - %td= @team.name - %tr - %td Since: - %td= assigned_since(@team, @project).stamp("Nov 11, 2010") = render 'form' diff --git a/app/views/teams/projects/index.html.haml b/app/views/teams/projects/index.html.haml index 493fc2c5c9e..5aa6a999c20 100644 --- a/app/views/teams/projects/index.html.haml +++ b/app/views/teams/projects/index.html.haml @@ -6,7 +6,7 @@ - if current_user.can?(:manage_user_team, @team) && @avaliable_projects.any? %span.right - = link_to new_team_project_path(@team), class: "btn success small grouped", title: "New Team Member" do + = link_to new_team_project_path(@team), class: "btn btn-primary small grouped", title: "New Team Member" do Assign project to Team %hr @@ -30,7 +30,7 @@ - if current_user.can?(:admin_user_team, @team) %td.bgred = link_to 'Edit max access', edit_team_project_path(@team, project), class: "btn small" - = link_to 'Relegate', team_project_path(@team, project), confirm: 'Remove project from team and move to global namespace. Are you sure?', method: :delete, class: "btn danger small" + = link_to 'Relegate', team_project_path(@team, project), confirm: 'Remove project from team and move to global namespace. Are you sure?', method: :delete, class: "btn btn-remove small" - else %p.nothing_here_message This team has no projects yet diff --git a/app/views/teams/projects/new.html.haml b/app/views/teams/projects/new.html.haml index d57f56b2fee..3f3671aa0a4 100644 --- a/app/views/teams/projects/new.html.haml +++ b/app/views/teams/projects/new.html.haml @@ -20,4 +20,4 @@ %tr %td= select_tag :project_ids, options_from_collection_for_select(@avaliable_projects , :id, :name_with_namespace), multiple: true, data: {placeholder: 'Select projects'}, class: 'chosen span5' %td= select_tag :greatest_project_access, options_for_select(UserTeam.access_roles), {class: "project-access-select chosen span3" } - %td= submit_tag 'Add', class: "btn primary", id: :assign_projects_to_team + %td= submit_tag 'Add Project', class: "btn btn-create", id: :assign_projects_to_team diff --git a/app/views/tree/edit.html.haml b/app/views/tree/edit.html.haml index adee68a00f8..281f4cc5ba2 100644 --- a/app/views/tree/edit.html.haml +++ b/app/views/tree/edit.html.haml @@ -10,7 +10,7 @@ %strong= @ref %span.options .btn-group.tree-btn-group - = link_to "Cancel", project_tree_path(@project, @id), class: "btn very_small cancel-btn", confirm: "Are you sure?" + = link_to "Cancel", project_tree_path(@project, @id), class: "btn very_small btn-cancel", confirm: "Are you sure?" .file_content.code %pre#editor= @tree.data @@ -27,7 +27,7 @@ .message to branch %strong= @ref - = link_to "Cancel", project_tree_path(@project, @id), class: "btn cancel-btn", confirm: "Are you sure?" + = link_to "Cancel", project_tree_path(@project, @id), class: "btn btn-cancel", confirm: "Are you sure?" :javascript var ace_mode = "#{@tree.language.try(:ace_mode)}"; diff --git a/app/views/wikis/_form.html.haml b/app/views/wikis/_form.html.haml index 9eb2a571fe5..7758b129b07 100644 --- a/app/views/wikis/_form.html.haml +++ b/app/views/wikis/_form.html.haml @@ -23,5 +23,5 @@ = f.label :content .input= f.text_area :content, class: 'span8 js-gfm-input' .actions - = f.submit 'Save', class: "save-btn btn" - = link_to "Cancel", project_wiki_path(@project, :index), class: "btn cancel-btn" + = f.submit 'Save', class: "btn-save btn" + = link_to "Cancel", project_wiki_path(@project, :index), class: "btn btn-cancel" diff --git a/app/views/wikis/edit.html.haml b/app/views/wikis/edit.html.haml index 8f6b457f22a..bf4a9aad444 100644 --- a/app/views/wikis/edit.html.haml +++ b/app/views/wikis/edit.html.haml @@ -4,5 +4,5 @@ .right - if can? current_user, :admin_wiki, @project - = link_to project_wiki_path(@project, @wiki), confirm: "Are you sure you want to delete this page?", method: :delete, class: "btn small danger" do + = link_to project_wiki_path(@project, @wiki), confirm: "Are you sure you want to delete this page?", method: :delete, class: "btn small btn-remove" do Delete this page \ No newline at end of file -- GitLab From fb617c61b95aef4615346a5e554db469384d9b6c Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Date: Tue, 29 Jan 2013 22:29:21 +0200 Subject: [PATCH 23/55] refactor buttons pt2 --- app/assets/stylesheets/gitlab_bootstrap/buttons.scss | 2 +- app/assets/stylesheets/sections/notes.scss | 4 ++-- app/views/admin/dashboard/index.html.haml | 6 +++--- app/views/admin/groups/index.html.haml | 6 +++--- app/views/admin/hooks/index.html.haml | 4 ++-- app/views/admin/projects/index.html.haml | 6 +++--- app/views/admin/projects/show.html.haml | 2 +- app/views/admin/teams/index.html.haml | 6 +++--- app/views/admin/teams/show.html.haml | 10 +++++----- app/views/admin/users/_form.html.haml | 4 ++-- app/views/admin/users/index.html.haml | 10 +++++----- app/views/admin/users/show.html.haml | 4 ++-- app/views/commits/_diffs.html.haml | 2 +- app/views/dashboard/_groups.html.haml | 2 +- app/views/dashboard/_projects.html.haml | 2 +- app/views/dashboard/_teams.html.haml | 2 +- app/views/dashboard/projects.html.haml | 2 +- app/views/deploy_keys/_show.html.haml | 2 +- app/views/deploy_keys/index.html.haml | 2 +- app/views/deploy_keys/show.html.haml | 2 +- app/views/groups/_projects.html.haml | 2 +- app/views/groups/show.html.haml | 2 +- app/views/hooks/index.html.haml | 4 ++-- app/views/issues/_show.html.haml | 8 ++++---- app/views/keys/_show.html.haml | 2 +- app/views/merge_requests/_merge_request.html.haml | 8 ++++---- app/views/merge_requests/show/_mr_accept.html.haml | 2 +- app/views/milestones/_milestone.html.haml | 2 +- app/views/milestones/index.html.haml | 2 +- app/views/milestones/show.html.haml | 6 +++--- app/views/notes/_form.html.haml | 2 +- app/views/profiles/show.html.haml | 6 +++--- app/views/projects/_new_form.html.haml | 4 ++-- app/views/protected_branches/index.html.haml | 2 +- app/views/snippets/_blob.html.haml | 2 +- app/views/snippets/index.html.haml | 2 +- app/views/snippets/show.html.haml | 2 +- app/views/team_members/_show.html.haml | 4 ++-- app/views/team_members/index.html.haml | 4 ++-- app/views/teams/_projects.html.haml | 2 +- app/views/teams/members/_show.html.haml | 4 ++-- app/views/teams/projects/index.html.haml | 2 +- app/views/teams/show.html.haml | 2 +- app/views/tree/_blob_actions.html.haml | 10 +++++----- app/views/tree/_tree.html.haml | 2 +- app/views/tree/edit.html.haml | 2 +- app/views/users/show.html.haml | 2 +- app/views/wikis/edit.html.haml | 2 +- app/views/wikis/show.html.haml | 6 +++--- 49 files changed, 90 insertions(+), 90 deletions(-) diff --git a/app/assets/stylesheets/gitlab_bootstrap/buttons.scss b/app/assets/stylesheets/gitlab_bootstrap/buttons.scss index ed102253ab6..86b4c5b3b64 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/buttons.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/buttons.scss @@ -92,7 +92,7 @@ background-color: #ccc; } - &.very_small { + &.btn-tiny { font-size: 11px; padding: 2px 6px; line-height: 16px; diff --git a/app/assets/stylesheets/sections/notes.scss b/app/assets/stylesheets/sections/notes.scss index d4934791110..b29d2991d34 100644 --- a/app/assets/stylesheets/sections/notes.scss +++ b/app/assets/stylesheets/sections/notes.scss @@ -215,10 +215,10 @@ ul.notes { */ .comment-btn { - @extend .create-btn; + @extend .btn-create; } .reply-btn { - @extend .primary; + @extend .btn-primary; } .file .content tr.line_holder:hover > td { background: $hover !important; } .file .content tr.line_holder:hover > td .line_note_link { diff --git a/app/views/admin/dashboard/index.html.haml b/app/views/admin/dashboard/index.html.haml index 9a5e7edea0f..3698778e9fc 100644 --- a/app/views/admin/dashboard/index.html.haml +++ b/app/views/admin/dashboard/index.html.haml @@ -6,7 +6,7 @@ = link_to admin_projects_path do %h1= Project.count %hr - = link_to 'New Project', new_project_path, class: "btn small" + = link_to 'New Project', new_project_path, class: "btn btn-small" .span4 .ui-box %h5.title Groups @@ -14,7 +14,7 @@ = link_to admin_groups_path do %h1= Group.count %hr - = link_to 'New Group', new_admin_group_path, class: "btn small" + = link_to 'New Group', new_admin_group_path, class: "btn btn-small" .span4 .ui-box %h5.title Users @@ -22,7 +22,7 @@ = link_to admin_users_path do %h1= User.count %hr - = link_to 'New User', new_admin_user_path, class: "btn small" + = link_to 'New User', new_admin_user_path, class: "btn btn-small" .row .span4 diff --git a/app/views/admin/groups/index.html.haml b/app/views/admin/groups/index.html.haml index 443abece919..f1e857eca8a 100644 --- a/app/views/admin/groups/index.html.haml +++ b/app/views/admin/groups/index.html.haml @@ -4,7 +4,7 @@ allows you to keep projects organized. Use groups for uniting related projects. - = link_to 'New Group', new_admin_group_path, class: "btn small right" + = link_to 'New Group', new_admin_group_path, class: "btn btn-small right" %br = form_tag admin_groups_path, method: :get, class: 'form-inline' do = text_field_tag :name, params[:name], class: "xlarge" @@ -30,6 +30,6 @@ %td = link_to group.owner_name, admin_user_path(group.owner_id) %td.bgred - = link_to 'Rename', edit_admin_group_path(group), id: "edit_#{dom_id(group)}", class: "btn small" - = link_to 'Destroy', [:admin, group], confirm: "REMOVE #{group.name}? Are you sure?", method: :delete, class: "btn small btn-remove" + = link_to 'Rename', edit_admin_group_path(group), id: "edit_#{dom_id(group)}", class: "btn btn-small" + = link_to 'Destroy', [:admin, group], confirm: "REMOVE #{group.name}? Are you sure?", method: :delete, class: "btn btn-small btn-remove" = paginate @groups, theme: "admin" diff --git a/app/views/admin/hooks/index.html.haml b/app/views/admin/hooks/index.html.haml index 15bff871cd5..412a7ff2038 100644 --- a/app/views/admin/hooks/index.html.haml +++ b/app/views/admin/hooks/index.html.haml @@ -33,7 +33,7 @@ %td = link_to admin_hook_path(hook) do %strong= hook.url - = link_to 'Test Hook', admin_hook_test_path(hook), class: "btn small right" + = link_to 'Test Hook', admin_hook_test_path(hook), class: "btn btn-small right" %td POST %td - = link_to 'Remove', admin_hook_path(hook), confirm: 'Are you sure?', method: :delete, class: "danger btn small right" + = link_to 'Remove', admin_hook_path(hook), confirm: 'Are you sure?', method: :delete, class: "btn btn-remove btn-small right" diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml index 8ac2fa12520..f42e1f3af86 100644 --- a/app/views/admin/projects/index.html.haml +++ b/app/views/admin/projects/index.html.haml @@ -1,6 +1,6 @@ %h3.page_title Projects - = link_to 'New Project', new_project_path, class: "btn small right" + = link_to 'New Project', new_project_path, class: "btn btn-small right" %hr @@ -52,8 +52,8 @@ %i.icon-lock.cgreen = link_to project.name_with_namespace, [:admin, project] .right - = link_to 'Edit', edit_admin_project_path(project), id: "edit_#{dom_id(project)}", class: "btn small" - = link_to 'Destroy', [:admin, project], confirm: "REMOVE #{project.name}? Are you sure?", method: :delete, class: "btn small btn-remove" + = link_to 'Edit', edit_admin_project_path(project), id: "edit_#{dom_id(project)}", class: "btn btn-small" + = link_to 'Destroy', [:admin, project], confirm: "REMOVE #{project.name}? Are you sure?", method: :delete, class: "btn btn-small btn-remove" - if @projects.blank? %p.nothing_here_message 0 projects matches - else diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml index fb1a7b488c1..fc3ed1e8b23 100644 --- a/app/views/admin/projects/show.html.haml +++ b/app/views/admin/projects/show.html.haml @@ -129,7 +129,7 @@ %td = link_to tm.name, admin_user_path(tm) %td= @project.project_access_human(tm) - %td= link_to 'Edit Access', edit_admin_project_member_path(@project, tm), class: "btn small" + %td= link_to 'Edit Access', edit_admin_project_member_path(@project, tm), class: "btn btn-small" %td= link_to 'Remove from team', admin_project_member_path(@project, tm), confirm: 'Are you sure?', method: :delete, class: "btn btn-remove small" %br diff --git a/app/views/admin/teams/index.html.haml b/app/views/admin/teams/index.html.haml index e7344f4ea2c..1d54a27f8f5 100644 --- a/app/views/admin/teams/index.html.haml +++ b/app/views/admin/teams/index.html.haml @@ -3,7 +3,7 @@ %small simple Teams description - = link_to 'New Team', new_admin_team_path, class: "btn small right" + = link_to 'New Team', new_admin_team_path, class: "btn btn-small right" %br = form_tag admin_teams_path, method: :get, class: 'form-inline' do @@ -32,7 +32,7 @@ %td = link_to team.owner.name, admin_user_path(team.owner_id) %td.bgred - = link_to 'Rename', edit_admin_team_path(team), id: "edit_#{dom_id(team)}", class: "btn small" - = link_to 'Destroy', admin_team_path(team), confirm: "REMOVE #{team.name}? Are you sure?", method: :delete, class: "btn small btn-remove" + = link_to 'Rename', edit_admin_team_path(team), id: "edit_#{dom_id(team)}", class: "btn btn-small" + = link_to 'Destroy', admin_team_path(team), confirm: "REMOVE #{team.name}? Are you sure?", method: :delete, class: "btn btn-small btn-remove" = paginate @teams, theme: "admin" diff --git a/app/views/admin/teams/show.html.haml b/app/views/admin/teams/show.html.haml index 2561e3aeaf5..4d27f31be58 100644 --- a/app/views/admin/teams/show.html.haml +++ b/app/views/admin/teams/show.html.haml @@ -42,7 +42,7 @@ %fieldset %legend Members (#{@team.members.count}) - %span= link_to 'Add members', new_admin_team_member_path(@team), class: "btn btn-primary small right", id: :add_members_to_team + %span= link_to 'Add members', new_admin_team_member_path(@team), class: "btn btn-primary btn-small right", id: :add_members_to_team - if @team.members.any? %table#members_list %thead @@ -60,14 +60,14 @@ %td= @team.human_default_projects_access(member) %td= @team.admin?(member) ? "Admin" : "Member" %td.bgred - = link_to 'Edit', edit_admin_team_member_path(@team, member), class: "btn small" + = link_to 'Edit', edit_admin_team_member_path(@team, member), class: "btn btn-small" - = link_to 'Remove', admin_team_member_path(@team, member), confirm: 'Remove member from team. Are you sure?', method: :delete, class: "btn btn-remove small", id: "remove_member_#{member.id}" + = link_to 'Remove', admin_team_member_path(@team, member), confirm: 'Remove member from team. Are you sure?', method: :delete, class: "btn btn-remove btn-small", id: "remove_member_#{member.id}" %fieldset %legend Projects (#{@team.projects.count}) - %span= link_to 'Add projects', new_admin_team_project_path(@team), class: "btn btn-primary small right", id: :assign_projects_to_team + %span= link_to 'Add projects', new_admin_team_project_path(@team), class: "btn btn-primary btn-small right", id: :assign_projects_to_team - if @team.projects.any? %table#projects_list %thead @@ -82,7 +82,7 @@ %td %span= @team.human_max_project_access(project) %td.bgred - = link_to 'Edit', edit_admin_team_project_path(@team, project), class: "btn small" + = link_to 'Edit', edit_admin_team_project_path(@team, project), class: "btn btn-small" = link_to 'Relegate', admin_team_project_path(@team, project), confirm: 'Remove project from team. Are you sure?', method: :delete, class: "btn btn-remove small", id: "relegate_project_#{project.id}" diff --git a/app/views/admin/users/_form.html.haml b/app/views/admin/users/_form.html.haml index 9f447bcd9e7..51b05c05993 100644 --- a/app/views/admin/users/_form.html.haml +++ b/app/views/admin/users/_form.html.haml @@ -63,10 +63,10 @@ .alert.alert-error - if @admin_user.blocked %p This user is blocked and is not able to login to GitLab - = link_to 'Unblock User', unblock_admin_user_path(@admin_user), method: :put, class: "btn small" + = link_to 'Unblock User', unblock_admin_user_path(@admin_user), method: :put, class: "btn btn-small" - else %p Blocked users will be removed from all projects & will not be able to login to GitLab. - = link_to 'Block User', block_admin_user_path(@admin_user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn small btn-remove" + = link_to 'Block User', block_admin_user_path(@admin_user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn btn-small btn-remove" %fieldset %legend Profile .clearfix diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml index 0aa8a16fbc6..d8828183083 100644 --- a/app/views/admin/users/index.html.haml +++ b/app/views/admin/users/index.html.haml @@ -1,6 +1,6 @@ %h3.page_title Users - = link_to 'New User', new_admin_user_path, class: "btn small right" + = link_to 'New User', new_admin_user_path, class: "btn btn-small right" %br = form_tag admin_users_path, method: :get, class: 'form-inline' do @@ -44,15 +44,15 @@ %td= user.username %td= user.email %td= user.users_projects.count - %td= link_to 'Edit', edit_admin_user_path(user), id: "edit_#{dom_id(user)}", class: "btn small" + %td= link_to 'Edit', edit_admin_user_path(user), id: "edit_#{dom_id(user)}", class: "btn btn-small" %td.bgred - if user == current_user %span.cred It's you! - else - if user.blocked - = link_to 'Unblock', unblock_admin_user_path(user), method: :put, class: "btn small success" + = link_to 'Unblock', unblock_admin_user_path(user), method: :put, class: "btn btn-small success" - else - = link_to 'Block', block_admin_user_path(user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn small btn-remove" - = link_to 'Destroy', [:admin, user], confirm: "USER #{user.name} WILL BE REMOVED! Are you sure?", method: :delete, class: "btn small btn-remove" + = link_to 'Block', block_admin_user_path(user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn btn-small btn-remove" + = link_to 'Destroy', [:admin, user], confirm: "USER #{user.name} WILL BE REMOVED! Are you sure?", method: :delete, class: "btn btn-small btn-remove" = paginate @admin_users, theme: "admin" diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml index fefb5706a93..69062aa375a 100644 --- a/app/views/admin/users/show.html.haml +++ b/app/views/admin/users/show.html.haml @@ -123,5 +123,5 @@ %tr %td= link_to project.name_with_namespace, admin_project_path(project) %td= tm.project_access_human - %td= link_to 'Edit Access', edit_admin_project_member_path(project, tm.user), class: "btn small" - %td= link_to 'Remove from team', admin_project_member_path(project, tm.user), confirm: 'Are you sure?', method: :delete, class: "btn small btn-remove" + %td= link_to 'Edit Access', edit_admin_project_member_path(project, tm.user), class: "btn btn-small" + %td= link_to 'Remove from team', admin_project_member_path(project, tm.user), confirm: 'Are you sure?', method: :delete, class: "btn btn-small btn-remove" diff --git a/app/views/commits/_diffs.html.haml b/app/views/commits/_diffs.html.haml index 9a9aed39b08..5e7d43c99cb 100644 --- a/app/views/commits/_diffs.html.haml +++ b/app/views/commits/_diffs.html.haml @@ -33,7 +33,7 @@ - if diff.a_mode && diff.b_mode && diff.a_mode != diff.b_mode %span.file-mode= "#{diff.a_mode} → #{diff.b_mode}" - = link_to project_tree_path(@project, tree_join(@commit.id, diff.new_path)), {:class => 'btn very_small right view-file'} do + = link_to project_tree_path(@project, tree_join(@commit.id, diff.new_path)), {:class => 'btn btn-tiny right view-file'} do View file @ %span.commit-short-id= @commit.short_id(6) diff --git a/app/views/dashboard/_groups.html.haml b/app/views/dashboard/_groups.html.haml index f9774669d9a..535f0349212 100644 --- a/app/views/dashboard/_groups.html.haml +++ b/app/views/dashboard/_groups.html.haml @@ -5,7 +5,7 @@ (#{groups.count}) - if current_user.can_create_group? %span.right - = link_to new_group_path, class: "btn very_small info" do + = link_to new_group_path, class: "btn btn-tiny info" do %i.icon-plus New Group %ul.well-list diff --git a/app/views/dashboard/_projects.html.haml b/app/views/dashboard/_projects.html.haml index f2acd2b0b0c..a5396a0023d 100644 --- a/app/views/dashboard/_projects.html.haml +++ b/app/views/dashboard/_projects.html.haml @@ -5,7 +5,7 @@ (#{@projects_count}) - if current_user.can_create_project? %span.right - = link_to new_project_path, class: "btn very_small info" do + = link_to new_project_path, class: "btn btn-tiny info" do %i.icon-plus New Project diff --git a/app/views/dashboard/_teams.html.haml b/app/views/dashboard/_teams.html.haml index 5b2ea7a2384..1be6e25c54d 100644 --- a/app/views/dashboard/_teams.html.haml +++ b/app/views/dashboard/_teams.html.haml @@ -4,7 +4,7 @@ %small (#{@teams.count}) %span.right - = link_to new_team_path, class: "btn very_small info" do + = link_to new_team_path, class: "btn btn-tiny info" do %i.icon-plus New Team %ul.well-list diff --git a/app/views/dashboard/projects.html.haml b/app/views/dashboard/projects.html.haml index e6c710e68e9..94b319fe24f 100644 --- a/app/views/dashboard/projects.html.haml +++ b/app/views/dashboard/projects.html.haml @@ -4,7 +4,7 @@ (#{@projects.total_count}) - if current_user.can_create_project? %span.right - = link_to new_project_path, class: "btn very_small info" do + = link_to new_project_path, class: "btn btn-tiny info" do %i.icon-plus New Project diff --git a/app/views/deploy_keys/_show.html.haml b/app/views/deploy_keys/_show.html.haml index a5314ae92ad..68b00568c6d 100644 --- a/app/views/deploy_keys/_show.html.haml +++ b/app/views/deploy_keys/_show.html.haml @@ -8,5 +8,5 @@ = time_ago_in_words(key.created_at) ago %td - = link_to 'Remove', project_deploy_key_path(key.project, key), confirm: 'Are you sure?', method: :delete, class: "danger btn delete-key small right" + = link_to 'Remove', project_deploy_key_path(key.project, key), confirm: 'Are you sure?', method: :delete, class: "btn btn-remove delete-key btn-small right" diff --git a/app/views/deploy_keys/index.html.haml b/app/views/deploy_keys/index.html.haml index b9c654a1abe..db167f4e2f2 100644 --- a/app/views/deploy_keys/index.html.haml +++ b/app/views/deploy_keys/index.html.haml @@ -4,7 +4,7 @@ Deploy keys allow read-only access to repository. It matches perfectly for CI, staging or production servers. - if can? current_user, :admin_project, @project - = link_to new_project_deploy_key_path(@project), class: "btn small", title: "New Deploy Key" do + = link_to new_project_deploy_key_path(@project), class: "btn btn-small", title: "New Deploy Key" do Add Deploy Key - if @keys.any? %table diff --git a/app/views/deploy_keys/show.html.haml b/app/views/deploy_keys/show.html.haml index c94cf10dde0..4a864fae9d7 100644 --- a/app/views/deploy_keys/show.html.haml +++ b/app/views/deploy_keys/show.html.haml @@ -11,4 +11,4 @@ %hr %pre= @key.key .right - = link_to 'Remove', project_deploy_key_path(@key.project, @key), confirm: 'Are you sure?', method: :delete, class: "danger btn delete-key" + = link_to 'Remove', project_deploy_key_path(@key.project, @key), confirm: 'Are you sure?', method: :delete, class: "btn-remove btn delete-key" diff --git a/app/views/groups/_projects.html.haml b/app/views/groups/_projects.html.haml index 040d1ae94aa..b7732c50a32 100644 --- a/app/views/groups/_projects.html.haml +++ b/app/views/groups/_projects.html.haml @@ -5,7 +5,7 @@ (#{projects.count}) - if can? current_user, :manage_group, @group %span.right - = link_to new_project_path(namespace_id: @group.id), class: "btn very_small info" do + = link_to new_project_path(namespace_id: @group.id), class: "btn btn-tiny info" do %i.icon-plus New Project %ul.well-list diff --git a/app/views/groups/show.html.haml b/app/views/groups/show.html.haml index 84dd17c045d..a140b401b9d 100644 --- a/app/views/groups/show.html.haml +++ b/app/views/groups/show.html.haml @@ -1,7 +1,7 @@ .projects .activities.span8 = render "events/event_last_push", event: @last_push - = link_to dashboard_path, class: 'btn very_small' do + = link_to dashboard_path, class: 'btn btn-tiny' do ← To dashboard %span.cgray You will only see events from projects in this group diff --git a/app/views/hooks/index.html.haml b/app/views/hooks/index.html.haml index 98a82f110de..3d814ab4db8 100644 --- a/app/views/hooks/index.html.haml +++ b/app/views/hooks/index.html.haml @@ -38,5 +38,5 @@ %span.monospace= hook.url %td .right - = link_to 'Test Hook', test_project_hook_path(@project, hook), class: "btn small grouped" - = link_to 'Remove', project_hook_path(@project, hook), confirm: 'Are you sure?', method: :delete, class: "danger btn small grouped" + = link_to 'Test Hook', test_project_hook_path(@project, hook), class: "btn btn-small grouped" + = link_to 'Remove', project_hook_path(@project, hook), confirm: 'Are you sure?', method: :delete, class: "btn btn-remove btn-small grouped" diff --git a/app/views/issues/_show.html.haml b/app/views/issues/_show.html.haml index dcef901c15f..9f543ef97d8 100644 --- a/app/views/issues/_show.html.haml +++ b/app/views/issues/_show.html.haml @@ -4,15 +4,15 @@ = check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, class: "selected_issue", disabled: !can?(current_user, :modify_issue, issue) .right - if issue.notes.any? - %span.btn.small.disabled.grouped + %span.btn.btn-small.disabled.grouped %i.icon-comment = issue.notes.count - if can? current_user, :modify_issue, issue - if issue.closed - = link_to 'Reopen', project_issue_path(issue.project, issue, issue: {closed: false }, status_only: true), method: :put, class: "btn small grouped reopen_issue", remote: true + = link_to 'Reopen', project_issue_path(issue.project, issue, issue: {closed: false }, status_only: true), method: :put, class: "btn btn-small grouped reopen_issue", remote: true - else - = link_to 'Close', project_issue_path(issue.project, issue, issue: {closed: true }, status_only: true), method: :put, class: "btn small grouped close_issue", remote: true - = link_to edit_project_issue_path(issue.project, issue), class: "btn small edit-issue-link grouped" do + = link_to 'Close', project_issue_path(issue.project, issue, issue: {closed: true }, status_only: true), method: :put, class: "btn btn-small grouped close_issue", remote: true + = link_to edit_project_issue_path(issue.project, issue), class: "btn btn-small edit-issue-link grouped" do %i.icon-edit Edit diff --git a/app/views/keys/_show.html.haml b/app/views/keys/_show.html.haml index 049981766b6..9e85e6228ce 100644 --- a/app/views/keys/_show.html.haml +++ b/app/views/keys/_show.html.haml @@ -8,5 +8,5 @@ = time_ago_in_words(key.created_at) ago %td - = link_to 'Remove', key, confirm: 'Are you sure?', method: :delete, class: "btn small btn-remove delete-key right" + = link_to 'Remove', key, confirm: 'Are you sure?', method: :delete, class: "btn btn-small btn-remove delete-key right" diff --git a/app/views/merge_requests/_merge_request.html.haml b/app/views/merge_requests/_merge_request.html.haml index 7369f3dd061..cdfc623d0a5 100644 --- a/app/views/merge_requests/_merge_request.html.haml +++ b/app/views/merge_requests/_merge_request.html.haml @@ -2,19 +2,19 @@ .right .left - if merge_request.merged? - %span.btn.small.disabled.grouped + %span.btn.btn-small.disabled.grouped %strong %i.icon-ok = "MERGED" - if merge_request.notes.any? - %span.btn.small.disabled.grouped + %span.btn.btn-small.disabled.grouped %i.icon-comment = merge_request.mr_and_commit_notes.count - if merge_request.milestone_id? - %span.btn.small.disabled.grouped + %span.btn.btn-small.disabled.grouped %i.icon-time = merge_request.milestone.title - %span.btn.small.disabled.grouped + %span.btn.btn-small.disabled.grouped = merge_request.source_branch → = merge_request.target_branch diff --git a/app/views/merge_requests/show/_mr_accept.html.haml b/app/views/merge_requests/show/_mr_accept.html.haml index 128ffe76782..27f1c2ab8e1 100644 --- a/app/views/merge_requests/show/_mr_accept.html.haml +++ b/app/views/merge_requests/show/_mr_accept.html.haml @@ -31,7 +31,7 @@ .automerge_widget.cannot_be_merged{style: "display:none"} .alert.alert-info %span - = link_to "Show how to merge", "#", class: "how_to_merge_link btn small padded", title: "How To Merge" + = link_to "Show how to merge", "#", class: "how_to_merge_link btn btn-small padded", title: "How To Merge" %strong This request can't be merged with GitLab. You should do it manually diff --git a/app/views/milestones/_milestone.html.haml b/app/views/milestones/_milestone.html.haml index 3864792f7e8..9111ff8b954 100644 --- a/app/views/milestones/_milestone.html.haml +++ b/app/views/milestones/_milestone.html.haml @@ -1,7 +1,7 @@ %li{class: "milestone milestone-#{milestone.closed ? 'closed' : 'open'}", id: dom_id(milestone) } .right - if can?(current_user, :admin_milestone, milestone.project) and milestone.open? - = link_to edit_project_milestone_path(milestone.project, milestone), class: "btn small edit-milestone-link grouped" do + = link_to edit_project_milestone_path(milestone.project, milestone), class: "btn btn-small edit-milestone-link grouped" do %i.icon-edit Edit %h4 diff --git a/app/views/milestones/index.html.haml b/app/views/milestones/index.html.haml index 3089595fe0b..c1dc6da983d 100644 --- a/app/views/milestones/index.html.haml +++ b/app/views/milestones/index.html.haml @@ -3,7 +3,7 @@ %h3.page_title Milestones - if can? current_user, :admin_milestone, @project - = link_to "New Milestone", new_project_milestone_path(@project), class: "right btn small", title: "New Milestone" + = link_to "New Milestone", new_project_milestone_path(@project), class: "right btn btn-small", title: "New Milestone" %br %div.ui-box .title diff --git a/app/views/milestones/show.html.haml b/app/views/milestones/show.html.haml index 797f35befa5..eeefb70e57c 100644 --- a/app/views/milestones/show.html.haml +++ b/app/views/milestones/show.html.haml @@ -10,12 +10,12 @@ .span6 .right - unless @milestone.closed - = link_to new_project_issue_path(@project, issue: { milestone_id: @milestone.id }), class: "btn small grouped", title: "New Issue" do + = link_to new_project_issue_path(@project, issue: { milestone_id: @milestone.id }), class: "btn btn-small grouped", title: "New Issue" do %i.icon-plus New Issue = link_to 'Browse Issues', project_issues_path(@milestone.project, milestone_id: @milestone.id), class: "btn edit-milestone-link small grouped" - if can?(current_user, :admin_milestone, @project) - = link_to edit_project_milestone_path(@project, @milestone), class: "btn small grouped" do + = link_to edit_project_milestone_path(@project, @milestone), class: "btn btn-small grouped" do %i.icon-edit Edit @@ -25,7 +25,7 @@ %hr %p %span All issues for this milestone are closed. You may close milestone now. - = link_to 'Close Milestone', project_milestone_path(@project, @milestone, milestone: {closed: true }), method: :put, class: "btn small btn-remove" + = link_to 'Close Milestone', project_milestone_path(@project, @milestone, milestone: {closed: true }), method: :put, class: "btn btn-small btn-remove" .ui-box.ui-box-show .ui-box-head diff --git a/app/views/notes/_form.html.haml b/app/views/notes/_form.html.haml index d094119a9da..a063fb0a6bb 100644 --- a/app/views/notes/_form.html.haml +++ b/app/views/notes/_form.html.haml @@ -26,7 +26,7 @@ .attachment %h6 Attachment: .file_name.js-attachment-filename File name... - %a.choose-btn.btn.small.js-choose-note-attachment-button Choose File ... + %a.choose-btn.btn.btn-small.js-choose-note-attachment-button Choose File ... .hint Any file up to 10 MB = f.file_field :attachment, class: "js-note-attachment-input" diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml index 4c0463aff79..65b5a5d29fc 100644 --- a/app/views/profiles/show.html.haml +++ b/app/views/profiles/show.html.haml @@ -65,13 +65,13 @@ %li %p Need a group for several dependent projects? - = link_to new_group_path, class: "btn very_small" do + = link_to new_group_path, class: "btn btn-tiny" do Create a group - if current_user.can_create_team? %li %p Want to share a team between projects? - = link_to new_team_path, class: "btn very_small" do + = link_to new_team_path, class: "btn btn-tiny" do Create a team %fieldset %legend @@ -90,7 +90,7 @@ %span.right = link_to pluralize(current_user.keys.count, 'key'), keys_path .padded - = link_to "Add Public Key", new_key_path, class: "btn small" + = link_to "Add Public Key", new_key_path, class: "btn btn-small" .form-actions = f.submit 'Save', class: "btn btn-save" diff --git a/app/views/projects/_new_form.html.haml b/app/views/projects/_new_form.html.haml index dc4f4e23356..b3f2b82eb77 100644 --- a/app/views/projects/_new_form.html.haml +++ b/app/views/projects/_new_form.html.haml @@ -24,11 +24,11 @@ .clearfix .input.light Need a group for several dependent projects? - = link_to new_group_path, class: "btn very_small" do + = link_to new_group_path, class: "btn btn-tiny" do Create a group - if current_user.can_create_team? .clearfix .input.light Want to share a project between team? - = link_to new_team_path, class: "btn very_small" do + = link_to new_team_path, class: "btn btn-tiny" do Create a team diff --git a/app/views/protected_branches/index.html.haml b/app/views/protected_branches/index.html.haml index 8ceff635fd9..6e7c638eb0f 100644 --- a/app/views/protected_branches/index.html.haml +++ b/app/views/protected_branches/index.html.haml @@ -51,4 +51,4 @@ (branch was removed from repository) %td - if can? current_user, :admin_project, @project - = link_to 'Unprotect', [@project, branch], confirm: 'Are you sure?', method: :delete, class: "danger btn small" + = link_to 'Unprotect', [@project, branch], confirm: 'Are you sure?', method: :delete, class: "btn btn-remove btn-small" diff --git a/app/views/snippets/_blob.html.haml b/app/views/snippets/_blob.html.haml index ed518300ac0..017a33b34f3 100644 --- a/app/views/snippets/_blob.html.haml +++ b/app/views/snippets/_blob.html.haml @@ -3,7 +3,7 @@ %i.icon-file %strong= @snippet.file_name %span.options - = link_to "raw", raw_project_snippet_path(@project, @snippet), class: "btn very_small", target: "_blank" + = link_to "raw", raw_project_snippet_path(@project, @snippet), class: "btn btn-tiny", target: "_blank" .file_content.code - unless @snippet.content.empty? %div{class: user_color_scheme_class} diff --git a/app/views/snippets/index.html.haml b/app/views/snippets/index.html.haml index 7b8f94de7dd..db2185745ef 100644 --- a/app/views/snippets/index.html.haml +++ b/app/views/snippets/index.html.haml @@ -5,7 +5,7 @@ %small share code pastes with others out of git repository - if can? current_user, :write_snippet, @project - = link_to new_project_snippet_path(@project), class: "btn small add_new right", title: "New Snippet" do + = link_to new_project_snippet_path(@project), class: "btn btn-small add_new right", title: "New Snippet" do Add new snippet %br %table diff --git a/app/views/snippets/show.html.haml b/app/views/snippets/show.html.haml index 02022185f9a..767b9736545 100644 --- a/app/views/snippets/show.html.haml +++ b/app/views/snippets/show.html.haml @@ -4,7 +4,7 @@ = @snippet.title %small= @snippet.file_name - if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user - = link_to "Edit", edit_project_snippet_path(@project, @snippet), class: "btn small right" + = link_to "Edit", edit_project_snippet_path(@project, @snippet), class: "btn btn-small right" %br %div= render 'blob' diff --git a/app/views/team_members/_show.html.haml b/app/views/team_members/_show.html.haml index c8138af4428..c85ec9812a8 100644 --- a/app/views/team_members/_show.html.haml +++ b/app/views/team_members/_show.html.haml @@ -19,10 +19,10 @@ - if current_user == user %span.btn.disabled This is you! - if @project.namespace_owner == user - %span.btn.disabled.success Owner + %span.btn.disabled.btn-success Owner - elsif user.blocked %span.btn.disabled.blocked Blocked - elsif allow_admin - = link_to project_team_member_path(@project, user), confirm: remove_from_project_team_message(@project, user), method: :delete, class: "very_small btn btn-remove" do + = link_to project_team_member_path(@project, user), confirm: remove_from_project_team_message(@project, user), method: :delete, class: "btn-tiny btn btn-remove" do %i.icon-minus.icon-white diff --git a/app/views/team_members/index.html.haml b/app/views/team_members/index.html.haml index 935755f36c4..6e5090c7799 100644 --- a/app/views/team_members/index.html.haml +++ b/app/views/team_members/index.html.haml @@ -8,9 +8,9 @@ - if can? current_user, :admin_team_member, @project %span.right - = link_to import_project_team_members_path(@project), class: "btn small grouped", title: "Import team from another project" do + = link_to import_project_team_members_path(@project), class: "btn btn-small grouped", title: "Import team from another project" do Import team from another project - = link_to available_project_teams_path(@project), class: "btn small grouped", title: "Assign project to team of users" do + = link_to available_project_teams_path(@project), class: "btn btn-small grouped", title: "Assign project to team of users" do Assign project to Team of users = link_to new_project_team_member_path(@project), class: "btn btn-primary small grouped", title: "New Team Member" do New Team Member diff --git a/app/views/teams/_projects.html.haml b/app/views/teams/_projects.html.haml index 4d99d5c259b..e72125919b1 100644 --- a/app/views/teams/_projects.html.haml +++ b/app/views/teams/_projects.html.haml @@ -5,7 +5,7 @@ (#{projects.count}) - if can? current_user, :manage_user_team, @team %span.right - = link_to new_team_project_path(@team), class: "btn very_small info" do + = link_to new_team_project_path(@team), class: "btn btn-tiny info" do %i.icon-plus Assign Project %ul.well-list diff --git a/app/views/teams/members/_show.html.haml b/app/views/teams/members/_show.html.haml index a14177dfe29..e2b702ab0d7 100644 --- a/app/views/teams/members/_show.html.haml +++ b/app/views/teams/members/_show.html.haml @@ -23,9 +23,9 @@ - if current_user == user %span.btn.disabled This is you! - if @team.owner == user - %span.btn.disabled.success Owner + %span.btn.disabled.btn-success Owner - elsif user.blocked %span.btn.disabled.blocked Blocked - elsif allow_admin - = link_to team_member_path(@team, user), confirm: remove_from_user_team_message(@team, user), method: :delete, class: "very_small btn btn-remove" do + = link_to team_member_path(@team, user), confirm: remove_from_user_team_message(@team, user), method: :delete, class: "btn-tiny btn btn-remove" do %i.icon-minus.icon-white diff --git a/app/views/teams/projects/index.html.haml b/app/views/teams/projects/index.html.haml index 5aa6a999c20..de2bee093ec 100644 --- a/app/views/teams/projects/index.html.haml +++ b/app/views/teams/projects/index.html.haml @@ -29,7 +29,7 @@ - if current_user.can?(:admin_user_team, @team) %td.bgred - = link_to 'Edit max access', edit_team_project_path(@team, project), class: "btn small" + = link_to 'Edit max access', edit_team_project_path(@team, project), class: "btn btn-small" = link_to 'Relegate', team_project_path(@team, project), confirm: 'Remove project from team and move to global namespace. Are you sure?', method: :delete, class: "btn btn-remove small" - else diff --git a/app/views/teams/show.html.haml b/app/views/teams/show.html.haml index d9257ab090c..d6e80e2a51e 100644 --- a/app/views/teams/show.html.haml +++ b/app/views/teams/show.html.haml @@ -1,6 +1,6 @@ .projects .activities.span8 - = link_to dashboard_path, class: 'btn very_small' do + = link_to dashboard_path, class: 'btn btn-tiny' do ← To dashboard %span.cgray Events and projects are filtered in scope of team diff --git a/app/views/tree/_blob_actions.html.haml b/app/views/tree/_blob_actions.html.haml index 21334ea1f16..0bde968d0e6 100644 --- a/app/views/tree/_blob_actions.html.haml +++ b/app/views/tree/_blob_actions.html.haml @@ -1,12 +1,12 @@ .btn-group.tree-btn-group -# only show edit link for text files - if @tree.text? - = link_to "edit", edit_project_tree_path(@project, @id), class: "btn very_small", disabled: !allowed_tree_edit? - = link_to "raw", project_blob_path(@project, @id), class: "btn very_small", target: "_blank" + = link_to "edit", edit_project_tree_path(@project, @id), class: "btn btn-tiny", disabled: !allowed_tree_edit? + = link_to "raw", project_blob_path(@project, @id), class: "btn btn-tiny", target: "_blank" -# only show normal/blame view links for text files - if @tree.text? - if current_page? project_blame_path(@project, @id) - = link_to "normal view", project_tree_path(@project, @id), class: "btn very_small" + = link_to "normal view", project_tree_path(@project, @id), class: "btn btn-tiny" - else - = link_to "blame", project_blame_path(@project, @id), class: "btn very_small" - = link_to "history", project_commits_path(@project, @id), class: "btn very_small" + = link_to "blame", project_blame_path(@project, @id), class: "btn btn-tiny" + = link_to "history", project_commits_path(@project, @id), class: "btn btn-tiny" diff --git a/app/views/tree/_tree.html.haml b/app/views/tree/_tree.html.haml index c2842959510..b0f775673b5 100644 --- a/app/views/tree/_tree.html.haml +++ b/app/views/tree/_tree.html.haml @@ -24,7 +24,7 @@ %th Name %th Last Update %th Last Commit - %th= link_to "history", project_commits_path(@project, @id), class: "btn very_small right" + %th= link_to "history", project_commits_path(@project, @id), class: "btn btn-tiny right" - if tree.up_dir? %tr.tree-item diff --git a/app/views/tree/edit.html.haml b/app/views/tree/edit.html.haml index 281f4cc5ba2..81918e509b8 100644 --- a/app/views/tree/edit.html.haml +++ b/app/views/tree/edit.html.haml @@ -10,7 +10,7 @@ %strong= @ref %span.options .btn-group.tree-btn-group - = link_to "Cancel", project_tree_path(@project, @id), class: "btn very_small btn-cancel", confirm: "Are you sure?" + = link_to "Cancel", project_tree_path(@project, @id), class: "btn btn-tiny btn-cancel", confirm: "Are you sure?" .file_content.code %pre#editor= @tree.data diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 644826282b8..3977de24280 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -5,7 +5,7 @@ = @user.name - if @user == current_user .right - = link_to profile_path, class: 'btn small' do + = link_to profile_path, class: 'btn btn-small' do %i.icon-edit Edit Profile %br diff --git a/app/views/wikis/edit.html.haml b/app/views/wikis/edit.html.haml index bf4a9aad444..71f8d6a9b6c 100644 --- a/app/views/wikis/edit.html.haml +++ b/app/views/wikis/edit.html.haml @@ -4,5 +4,5 @@ .right - if can? current_user, :admin_wiki, @project - = link_to project_wiki_path(@project, @wiki), confirm: "Are you sure you want to delete this page?", method: :delete, class: "btn small btn-remove" do + = link_to project_wiki_path(@project, @wiki), confirm: "Are you sure you want to delete this page?", method: :delete, class: "btn btn-small btn-remove" do Delete this page \ No newline at end of file diff --git a/app/views/wikis/show.html.haml b/app/views/wikis/show.html.haml index d3bd58bbeec..245d192efa1 100644 --- a/app/views/wikis/show.html.haml +++ b/app/views/wikis/show.html.haml @@ -1,12 +1,12 @@ %h3.page_title = @wiki.title %span.right - = link_to pages_project_wikis_path(@project), class: "btn small grouped" do + = link_to pages_project_wikis_path(@project), class: "btn btn-small grouped" do Pages - if can? current_user, :write_wiki, @project - = link_to history_project_wiki_path(@project, @wiki), class: "btn small grouped" do + = link_to history_project_wiki_path(@project, @wiki), class: "btn btn-small grouped" do History - = link_to edit_project_wiki_path(@project, @wiki), class: "btn small grouped" do + = link_to edit_project_wiki_path(@project, @wiki), class: "btn btn-small grouped" do %i.icon-edit Edit %br -- GitLab From 7ba4f2dcfaa85fb89e15d9caa21bf75ad976389f Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Date: Tue, 29 Jan 2013 22:57:15 +0200 Subject: [PATCH 24/55] few styling for buttons --- app/assets/stylesheets/gitlab_bootstrap/blocks.scss | 4 ++++ app/assets/stylesheets/gitlab_bootstrap/buttons.scss | 9 ++++++--- app/views/groups/new.html.haml | 2 +- app/views/teams/new.html.haml | 2 +- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/app/assets/stylesheets/gitlab_bootstrap/blocks.scss b/app/assets/stylesheets/gitlab_bootstrap/blocks.scss index 8cb1c045778..26681c65bf4 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/blocks.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/blocks.scss @@ -98,6 +98,10 @@ margin-top: 3px; } + .btn-tiny { + @include box-shadow(0 0px 0px 1px #f1f1f1); + } + .nav-pills { > li { > a { diff --git a/app/assets/stylesheets/gitlab_bootstrap/buttons.scss b/app/assets/stylesheets/gitlab_bootstrap/buttons.scss index 86b4c5b3b64..a20c9b1b31e 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/buttons.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/buttons.scss @@ -1,9 +1,12 @@ .btn { - @include linear-gradient(#f7f7f7, #d5d5d5); + @include linear-gradient(#f1f1f1, #e1e1e1); + text-shadow: 0 1px 1px #FFF; border-color: #BBB; + &:hover { - @include bg-gray-gradient; - border-color: #bbb; + background: #f1f1f1; + @include linear-gradient(#fAfAfA, #f1f1f1); + border-color: #AAA; color: #333; } diff --git a/app/views/groups/new.html.haml b/app/views/groups/new.html.haml index 8fdedce95c9..224962df013 100644 --- a/app/views/groups/new.html.haml +++ b/app/views/groups/new.html.haml @@ -10,7 +10,7 @@ .input = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" - = f.submit 'Create group', class: "btn btn-primary" + = f.submit 'Create group', class: "btn btn-create" %hr .padded %ul diff --git a/app/views/teams/new.html.haml b/app/views/teams/new.html.haml index ca28f313e72..c0363fe39a8 100644 --- a/app/views/teams/new.html.haml +++ b/app/views/teams/new.html.haml @@ -10,7 +10,7 @@ .input = f.text_field :name, placeholder: "Ex. Ruby Developers", class: "xxlarge left" - = f.submit 'Create team', class: "btn btn-primary" + = f.submit 'Create team', class: "btn btn-create" %hr .padded %ul -- GitLab From 525a8cd3e96b7bae0acda8b6e94df529fa06ff6a Mon Sep 17 00:00:00 2001 From: Sato Hiroyuki <sathiroyuki@gmail.com> Date: Tue, 29 Jan 2013 17:25:17 +0900 Subject: [PATCH 25/55] Switchable the main branch on network graph --- app/controllers/graph_controller.rb | 18 ++++++++++++++++++ app/controllers/projects_controller.rb | 10 ---------- app/controllers/refs_controller.rb | 2 ++ .../graph.html.haml => graph/show.html.haml} | 8 +++++--- app/views/layouts/project_resource.html.haml | 4 ++-- config/routes.rb | 2 +- lib/extracts_path.rb | 3 ++- lib/gitlab/graph/json_builder.rb | 7 ++++--- vendor/assets/javascripts/branch-graph.js | 11 +++++++++-- 9 files changed, 43 insertions(+), 22 deletions(-) create mode 100644 app/controllers/graph_controller.rb rename app/views/{projects/graph.html.haml => graph/show.html.haml} (63%) diff --git a/app/controllers/graph_controller.rb b/app/controllers/graph_controller.rb new file mode 100644 index 00000000000..30ec5e89db2 --- /dev/null +++ b/app/controllers/graph_controller.rb @@ -0,0 +1,18 @@ +class GraphController < ProjectResourceController + include ExtractsPath + + # Authorize + before_filter :authorize_read_project! + before_filter :authorize_code_access! + before_filter :require_non_empty_project + + def show + respond_to do |format| + format.html + format.json do + graph = Gitlab::Graph::JsonBuilder.new(project, @ref) + render :json => graph.to_json + end + end + end +end diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 6e5e1f91381..7978ea6222c 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -90,16 +90,6 @@ class ProjectsController < ProjectResourceController end end - def graph - respond_to do |format| - format.html - format.json do - graph = Gitlab::Graph::JsonBuilder.new(project) - render :json => graph.to_json - end - end - end - def destroy return access_denied! unless can?(current_user, :remove_project, project) diff --git a/app/controllers/refs_controller.rb b/app/controllers/refs_controller.rb index 09d9eb51b82..0e4dba3dc4b 100644 --- a/app/controllers/refs_controller.rb +++ b/app/controllers/refs_controller.rb @@ -13,6 +13,8 @@ class RefsController < ProjectResourceController format.html do new_path = if params[:destination] == "tree" project_tree_path(@project, (@ref + "/" + params[:path])) + elsif params[:destination] == "graph" + project_graph_path(@project, @ref) else project_commits_path(@project, @ref) end diff --git a/app/views/projects/graph.html.haml b/app/views/graph/show.html.haml similarity index 63% rename from app/views/projects/graph.html.haml rename to app/views/graph/show.html.haml index 72d9cb5ef15..ca3a8706313 100644 --- a/app/views/projects/graph.html.haml +++ b/app/views/graph/show.html.haml @@ -1,6 +1,7 @@ %h3.page_title Project Network Graph %br - += render partial: 'shared/ref_switcher', locals: {destination: 'graph', path: @path} +%br .graph_holder %h4 %small You can move around the graph by using the arrow keys. @@ -11,7 +12,8 @@ var branch_graph; $(function(){ branch_graph = new BranchGraph($("#holder"), { - url: '#{url_for controller: 'projects', action: 'graph', format: :json}', - commit_url: '#{project_commit_path(@project, 'ae45ca32').gsub("ae45ca32", "%s")}' + url: '#{project_graph_path(@project, @ref, format: :json)}', + commit_url: '#{project_commit_path(@project, 'ae45ca32').gsub("ae45ca32", "%s")}', + ref: '#{@ref}' }); }); diff --git a/app/views/layouts/project_resource.html.haml b/app/views/layouts/project_resource.html.haml index 14671c5ca70..c19d33ceec9 100644 --- a/app/views/layouts/project_resource.html.haml +++ b/app/views/layouts/project_resource.html.haml @@ -20,8 +20,8 @@ = link_to 'Files', project_tree_path(@project, @ref || @repository.root_ref) = nav_link(controller: %w(commit commits compare repositories protected_branches)) do = link_to "Commits", project_commits_path(@project, @ref || @repository.root_ref) - = nav_link(path: 'projects#graph') do - = link_to "Network", graph_project_path(@project) + = nav_link(controller: %w(graph)) do + = link_to "Network", project_graph_path(@project, @ref || @repository.root_ref) - if @project.issues_enabled = nav_link(controller: %w(issues milestones labels)) do diff --git a/config/routes.rb b/config/routes.rb index 7ffa081ac32..1abd37fe45f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -163,7 +163,6 @@ Gitlab::Application.routes.draw do resources :projects, constraints: { id: /[a-zA-Z.0-9_\-\/]+/ }, except: [:new, :create, :index], path: "/" do member do get "wall" - get "graph" get "files" end @@ -173,6 +172,7 @@ Gitlab::Application.routes.draw do resources :compare, only: [:index, :create] resources :blame, only: [:show], constraints: {id: /.+/} resources :blob, only: [:show], constraints: {id: /.+/} + resources :graph, only: [:show], constraints: {id: /.+/} match "/compare/:from...:to" => "compare#show", as: "compare", :via => [:get, :post], constraints: {from: /.+/, to: /.+/} diff --git a/lib/extracts_path.rb b/lib/extracts_path.rb index 12700e4f4ac..976ac018204 100644 --- a/lib/extracts_path.rb +++ b/lib/extracts_path.rb @@ -54,9 +54,10 @@ module ExtractsPath input.gsub!(/^#{Gitlab.config.gitlab.relative_url_root}/, "") # Remove project, actions and all other staff from path input.gsub!(/^\/#{Regexp.escape(@project.path_with_namespace)}/, "") - input.gsub!(/^\/(tree|commits|blame|blob|refs)\//, "") # remove actions + input.gsub!(/^\/(tree|commits|blame|blob|refs|graph)\//, "") # remove actions input.gsub!(/\?.*$/, "") # remove stamps suffix input.gsub!(/.atom$/, "") # remove rss feed + input.gsub!(/.json$/, "") # remove json suffix input.gsub!(/\/edit$/, "") # remove edit route part if input.match(/^([[:alnum:]]{40})(.+)/) diff --git a/lib/gitlab/graph/json_builder.rb b/lib/gitlab/graph/json_builder.rb index a3157aa4b4d..5a2f27fc1af 100644 --- a/lib/gitlab/graph/json_builder.rb +++ b/lib/gitlab/graph/json_builder.rb @@ -9,8 +9,9 @@ module Gitlab @max_count ||= 650 end - def initialize project + def initialize project, ref @project = project + @ref = ref @repo = project.repo @ref_cache = {} @@ -66,9 +67,9 @@ module Gitlab heads.select!{|h| h.is_a? Grit::Head or h.is_a? Grit::Remote} # sort heads so the master is top and current branches are closer heads.sort! do |a,b| - if a.name == "master" + if a.name == @ref -1 - elsif b.name == "master" + elsif b.name == @ref 1 else b.commit.committed_date <=> a.commit.committed_date diff --git a/vendor/assets/javascripts/branch-graph.js b/vendor/assets/javascripts/branch-graph.js index 93849c79e80..cdaa8dd8d37 100644 --- a/vendor/assets/javascripts/branch-graph.js +++ b/vendor/assets/javascripts/branch-graph.js @@ -73,7 +73,8 @@ , cumonth = "" , offsetX = 20 , offsetY = 60 - , barWidth = Math.max(graphWidth, this.dayCount * 20 + 320); + , barWidth = Math.max(graphWidth, this.dayCount * 20 + 320) + , scrollLeft = cw; this.raphael = r; @@ -145,12 +146,18 @@ if (this.commits[i].refs) { this.appendLabel(x, y, this.commits[i].refs); + + // The main branch is displayed in the center. + re = new RegExp('(^| )' + this.options.ref + '( |$)'); + if (this.commits[i].refs.match(re)) { + scrollLeft = x - graphWidth / 2; + } } this.appendAnchor(top, this.commits[i], x, y); } top.toFront(); - this.element.scrollLeft(cw); + this.element.scrollLeft(scrollLeft); this.bindEvents(); }; -- GitLab From 1694dc8fe226c0687ce2c54a71739adba22f33c5 Mon Sep 17 00:00:00 2001 From: Micah Huff <micah@micahhuff.com> Date: Tue, 29 Jan 2013 21:15:13 -0800 Subject: [PATCH 26/55] Expose MergeRequest object as a notable in the API to allow for easy retrieval of comments --- lib/api/notes.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/api/notes.rb b/lib/api/notes.rb index 4613db54578..70344d6e381 100644 --- a/lib/api/notes.rb +++ b/lib/api/notes.rb @@ -3,7 +3,7 @@ module Gitlab class Notes < Grape::API before { authenticate! } - NOTEABLE_TYPES = [Issue, Snippet] + NOTEABLE_TYPES = [Issue, MergeRequest, Snippet] resource :projects do # Get a list of project wall notes -- GitLab From e2fb18a3ec8052997f0c9b795f76a6e4d57a9d97 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Date: Wed, 30 Jan 2013 16:40:43 +0200 Subject: [PATCH 27/55] replace right with pull-right --- .../stylesheets/gitlab_bootstrap/blocks.scss | 2 +- .../stylesheets/gitlab_bootstrap/common.scss | 1 - app/assets/stylesheets/sections/events.scss | 2 +- app/assets/stylesheets/sections/notes.scss | 4 ++-- app/assets/stylesheets/sections/projects.scss | 2 +- app/views/admin/dashboard/index.html.haml | 16 ++++++++-------- app/views/admin/groups/index.html.haml | 2 +- app/views/admin/groups/show.html.haml | 4 ++-- app/views/admin/hooks/index.html.haml | 4 ++-- app/views/admin/logs/show.html.haml | 8 ++++---- app/views/admin/projects/index.html.haml | 4 ++-- app/views/admin/projects/show.html.haml | 2 +- app/views/admin/teams/index.html.haml | 2 +- app/views/admin/teams/show.html.haml | 8 ++++---- app/views/admin/users/index.html.haml | 2 +- app/views/admin/users/show.html.haml | 2 +- app/views/blame/_head.html.haml | 2 +- app/views/commit/show.html.haml | 2 +- app/views/commits/_commit_box.html.haml | 2 +- app/views/commits/_diffs.html.haml | 4 ++-- app/views/commits/_head.html.haml | 2 +- app/views/dashboard/_filter.html.haml | 4 ++-- app/views/dashboard/_groups.html.haml | 4 ++-- app/views/dashboard/_projects.html.haml | 2 +- app/views/dashboard/_teams.html.haml | 4 ++-- app/views/dashboard/issues.html.haml | 2 +- app/views/dashboard/merge_requests.html.haml | 2 +- app/views/dashboard/projects.html.haml | 4 ++-- app/views/deploy_keys/_show.html.haml | 2 +- app/views/deploy_keys/show.html.haml | 2 +- app/views/devise/passwords/edit.html.haml | 2 +- app/views/devise/sessions/_new_ldap.html.haml | 2 +- app/views/devise/sessions/new.html.haml | 2 +- app/views/events/_event.html.haml | 2 +- app/views/groups/_filter.html.haml | 4 ++-- app/views/groups/_people_filter.html.haml | 4 ++-- app/views/groups/_projects.html.haml | 2 +- app/views/groups/issues.html.haml | 2 +- app/views/groups/merge_requests.html.haml | 2 +- app/views/groups/people.html.haml | 2 +- app/views/help/_layout.html.haml | 2 +- app/views/help/index.html.haml | 2 +- app/views/hooks/index.html.haml | 2 +- app/views/issues/_filter.html.haml | 2 +- app/views/issues/_head.html.haml | 2 +- app/views/issues/_issues.html.haml | 2 +- app/views/issues/_show.html.haml | 2 +- app/views/issues/index.html.haml | 8 ++++---- app/views/issues/show.html.haml | 6 +++--- app/views/kaminari/admin/_paginator.html.haml | 2 +- app/views/kaminari/gitlab/_paginator.html.haml | 2 +- app/views/keys/_show.html.haml | 2 +- app/views/keys/index.html.haml | 2 +- app/views/keys/show.html.haml | 2 +- app/views/labels/_label.html.haml | 2 +- app/views/merge_requests/_filter.html.haml | 2 +- .../merge_requests/_merge_request.html.haml | 2 +- app/views/merge_requests/index.html.haml | 6 +++--- .../merge_requests/show/_mr_title.html.haml | 4 ++-- app/views/milestones/_milestone.html.haml | 2 +- app/views/milestones/index.html.haml | 2 +- app/views/milestones/show.html.haml | 4 ++-- app/views/notes/_form.html.haml | 2 +- app/views/notes/_note.html.haml | 2 +- app/views/profiles/account.html.haml | 4 ++-- app/views/profiles/show.html.haml | 8 ++++---- app/views/projects/_clone_panel.html.haml | 4 ++-- app/views/projects/_form.html.haml | 2 +- app/views/projects/empty.html.haml | 2 +- app/views/public/projects/index.html.haml | 2 +- app/views/repositories/_feed.html.haml | 2 +- app/views/repositories/stats.html.haml | 2 +- app/views/services/_gitlab_ci.html.haml | 2 +- app/views/services/index.html.haml | 6 +++--- app/views/snippets/_form.html.haml | 2 +- app/views/snippets/index.html.haml | 2 +- app/views/snippets/show.html.haml | 2 +- app/views/team_members/_show.html.haml | 4 ++-- app/views/team_members/_show_team.html.haml | 4 ++-- app/views/team_members/index.html.haml | 2 +- app/views/team_members/show.html.haml | 2 +- app/views/teams/_filter.html.haml | 4 ++-- app/views/teams/_projects.html.haml | 2 +- app/views/teams/issues.html.haml | 2 +- app/views/teams/members/_show.html.haml | 4 ++-- app/views/teams/members/index.html.haml | 2 +- app/views/teams/members/show.html.haml | 2 +- app/views/teams/merge_requests.html.haml | 2 +- app/views/teams/projects/index.html.haml | 2 +- app/views/tree/_head.html.haml | 2 +- app/views/tree/_tree.html.haml | 2 +- app/views/users/_profile.html.haml | 10 +++++----- app/views/users/_projects.html.haml | 2 +- app/views/users/show.html.haml | 2 +- app/views/wikis/edit.html.haml | 2 +- app/views/wikis/show.html.haml | 2 +- 96 files changed, 143 insertions(+), 144 deletions(-) diff --git a/app/assets/stylesheets/gitlab_bootstrap/blocks.scss b/app/assets/stylesheets/gitlab_bootstrap/blocks.scss index 26681c65bf4..4d1b6446362 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/blocks.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/blocks.scss @@ -95,7 +95,7 @@ form { margin-bottom: 0; - margin-top: 3px; + margin-top: 0; } .btn-tiny { diff --git a/app/assets/stylesheets/gitlab_bootstrap/common.scss b/app/assets/stylesheets/gitlab_bootstrap/common.scss index f6b4881658c..fb2f34179b7 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/common.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/common.scss @@ -9,7 +9,6 @@ /** COMMON CLASSES **/ .left { float:left } -.right { float:right!important } .append-bottom-10 { margin-bottom:10px } .append-bottom-20 { margin-bottom:20px } .prepend-top-10 { margin-top:10px } diff --git a/app/assets/stylesheets/sections/events.scss b/app/assets/stylesheets/sections/events.scss index 7472cb09326..ff810147178 100644 --- a/app/assets/stylesheets/sections/events.scss +++ b/app/assets/stylesheets/sections/events.scss @@ -127,7 +127,7 @@ .btn-new-mr { @extend .btn-info; @extend .small; - @extend .right; + @extend .pull-right; margin: -3px; } } diff --git a/app/assets/stylesheets/sections/notes.scss b/app/assets/stylesheets/sections/notes.scss index b29d2991d34..895e9dfa4e3 100644 --- a/app/assets/stylesheets/sections/notes.scss +++ b/app/assets/stylesheets/sections/notes.scss @@ -258,7 +258,7 @@ ul.notes { } .attachment { - @extend .right; + @extend .pull-right; position: relative; width: 350px; height: 50px; @@ -274,7 +274,7 @@ ul.notes { } } .notify_options { - @extend .right; + @extend .pull-right; } } .note_text_and_preview { diff --git a/app/assets/stylesheets/sections/projects.scss b/app/assets/stylesheets/sections/projects.scss index b6db65adff1..28df1b5ac28 100644 --- a/app/assets/stylesheets/sections/projects.scss +++ b/app/assets/stylesheets/sections/projects.scss @@ -4,7 +4,7 @@ } .side { - @extend .right; + @extend .pull-right; .projects_box { > .title { diff --git a/app/views/admin/dashboard/index.html.haml b/app/views/admin/dashboard/index.html.haml index 3698778e9fc..46a876294ce 100644 --- a/app/views/admin/dashboard/index.html.haml +++ b/app/views/admin/dashboard/index.html.haml @@ -31,7 +31,7 @@ - @projects.each do |project| %p = link_to project.name_with_namespace, [:admin, project] - %span.light.right + %span.light.pull-right = time_ago_in_words project.created_at ago @@ -42,7 +42,7 @@ %p = link_to [:admin, user] do = user.name - %span.light.right + %span.light.pull-right = time_ago_in_words user.created_at ago @@ -51,25 +51,25 @@ %hr %p Issues - %span.light.right + %span.light.pull-right = Issue.count %p Merge Requests - %span.light.right + %span.light.pull-right = MergeRequest.count %p Notes - %span.light.right + %span.light.pull-right = Note.count %p Snippets - %span.light.right + %span.light.pull-right = Snippet.count %p SSH Keys - %span.light.right + %span.light.pull-right = Key.count %p Milestones - %span.light.right + %span.light.pull-right = Milestone.count diff --git a/app/views/admin/groups/index.html.haml b/app/views/admin/groups/index.html.haml index f1e857eca8a..25ce66575bf 100644 --- a/app/views/admin/groups/index.html.haml +++ b/app/views/admin/groups/index.html.haml @@ -4,7 +4,7 @@ allows you to keep projects organized. Use groups for uniting related projects. - = link_to 'New Group', new_admin_group_path, class: "btn btn-small right" + = link_to 'New Group', new_admin_group_path, class: "btn btn-small pull-right" %br = form_tag admin_groups_path, method: :get, class: 'form-inline' do = text_field_tag :name, params[:name], class: "xlarge" diff --git a/app/views/admin/groups/show.html.haml b/app/views/admin/groups/show.html.haml index b5bdeeaaded..6ae8a75d696 100644 --- a/app/views/admin/groups/show.html.haml +++ b/app/views/admin/groups/show.html.haml @@ -14,7 +14,7 @@ %td = @group.name - = link_to edit_admin_group_path(@group), class: "btn btn-small right" do + = link_to edit_admin_group_path(@group), class: "btn btn-small pull-right" do %i.icon-edit Rename %tr @@ -29,7 +29,7 @@ Owner: %td = @group.owner_name - .right + .pull-right = link_to "#", class: "btn btn-small change-owner-link" do %i.icon-edit Change owner diff --git a/app/views/admin/hooks/index.html.haml b/app/views/admin/hooks/index.html.haml index 412a7ff2038..838296ccf3a 100644 --- a/app/views/admin/hooks/index.html.haml +++ b/app/views/admin/hooks/index.html.haml @@ -33,7 +33,7 @@ %td = link_to admin_hook_path(hook) do %strong= hook.url - = link_to 'Test Hook', admin_hook_test_path(hook), class: "btn btn-small right" + = link_to 'Test Hook', admin_hook_test_path(hook), class: "btn btn-small pull-right" %td POST %td - = link_to 'Remove', admin_hook_path(hook), confirm: 'Are you sure?', method: :delete, class: "btn btn-remove btn-small right" + = link_to 'Remove', admin_hook_path(hook), confirm: 'Are you sure?', method: :delete, class: "btn btn-remove btn-small pull-right" diff --git a/app/views/admin/logs/show.html.haml b/app/views/admin/logs/show.html.haml index c8be2ffa43c..9ddd781c6ec 100644 --- a/app/views/admin/logs/show.html.haml +++ b/app/views/admin/logs/show.html.haml @@ -15,7 +15,7 @@ .file_title %i.icon-file githost.log - .right + .pull-right = link_to '#', class: 'log-bottom' do %i.icon-arrow-down Scroll down @@ -29,7 +29,7 @@ .file_title %i.icon-file application.log - .right + .pull-right = link_to '#', class: 'log-bottom' do %i.icon-arrow-down Scroll down @@ -43,7 +43,7 @@ .file_title %i.icon-file production.log - .right + .pull-right = link_to '#', class: 'log-bottom' do %i.icon-arrow-down Scroll down @@ -57,7 +57,7 @@ .file_title %i.icon-file sidekiq.log - .right + .pull-right = link_to '#', class: 'log-bottom' do %i.icon-arrow-down Scroll down diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml index f42e1f3af86..15b2778252a 100644 --- a/app/views/admin/projects/index.html.haml +++ b/app/views/admin/projects/index.html.haml @@ -1,6 +1,6 @@ %h3.page_title Projects - = link_to 'New Project', new_project_path, class: "btn btn-small right" + = link_to 'New Project', new_project_path, class: "btn btn-small pull-right" %hr @@ -51,7 +51,7 @@ - else %i.icon-lock.cgreen = link_to project.name_with_namespace, [:admin, project] - .right + .pull-right = link_to 'Edit', edit_admin_project_path(project), id: "edit_#{dom_id(project)}", class: "btn btn-small" = link_to 'Destroy', [:admin, project], confirm: "REMOVE #{project.name}? Are you sure?", method: :delete, class: "btn btn-small btn-remove" - if @projects.blank? diff --git a/app/views/admin/projects/show.html.haml b/app/views/admin/projects/show.html.haml index fc3ed1e8b23..b9294bbafbe 100644 --- a/app/views/admin/projects/show.html.haml +++ b/app/views/admin/projects/show.html.haml @@ -1,6 +1,6 @@ %h3.page_title Project: #{@project.name_with_namespace} - = link_to edit_admin_project_path(@project), class: "btn right" do + = link_to edit_admin_project_path(@project), class: "btn pull-right" do %i.icon-edit Edit diff --git a/app/views/admin/teams/index.html.haml b/app/views/admin/teams/index.html.haml index 1d54a27f8f5..1f2f4763f76 100644 --- a/app/views/admin/teams/index.html.haml +++ b/app/views/admin/teams/index.html.haml @@ -3,7 +3,7 @@ %small simple Teams description - = link_to 'New Team', new_admin_team_path, class: "btn btn-small right" + = link_to 'New Team', new_admin_team_path, class: "btn btn-small pull-right" %br = form_tag admin_teams_path, method: :get, class: 'form-inline' do diff --git a/app/views/admin/teams/show.html.haml b/app/views/admin/teams/show.html.haml index 4d27f31be58..e5d079981c0 100644 --- a/app/views/admin/teams/show.html.haml +++ b/app/views/admin/teams/show.html.haml @@ -14,7 +14,7 @@ %td = @team.name - = link_to edit_admin_team_path(@team), class: "btn btn-small right" do + = link_to edit_admin_team_path(@team), class: "btn btn-small pull-right" do %i.icon-edit Rename %tr @@ -23,7 +23,7 @@ Owner: %td = @team.owner.name - .right + .pull-right = link_to "#", class: "btn btn-small change-owner-link" do %i.icon-edit Change owner @@ -42,7 +42,7 @@ %fieldset %legend Members (#{@team.members.count}) - %span= link_to 'Add members', new_admin_team_member_path(@team), class: "btn btn-primary btn-small right", id: :add_members_to_team + %span= link_to 'Add members', new_admin_team_member_path(@team), class: "btn btn-primary btn-small pull-right", id: :add_members_to_team - if @team.members.any? %table#members_list %thead @@ -67,7 +67,7 @@ %fieldset %legend Projects (#{@team.projects.count}) - %span= link_to 'Add projects', new_admin_team_project_path(@team), class: "btn btn-primary btn-small right", id: :assign_projects_to_team + %span= link_to 'Add projects', new_admin_team_project_path(@team), class: "btn btn-primary btn-small pull-right", id: :assign_projects_to_team - if @team.projects.any? %table#projects_list %thead diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml index d8828183083..87d6309aefd 100644 --- a/app/views/admin/users/index.html.haml +++ b/app/views/admin/users/index.html.haml @@ -1,6 +1,6 @@ %h3.page_title Users - = link_to 'New User', new_admin_user_path, class: "btn btn-small right" + = link_to 'New User', new_admin_user_path, class: "btn btn-small pull-right" %br = form_tag admin_users_path, method: :get, class: 'form-inline' do diff --git a/app/views/admin/users/show.html.haml b/app/views/admin/users/show.html.haml index 69062aa375a..08201abd7d5 100644 --- a/app/views/admin/users/show.html.haml +++ b/app/views/admin/users/show.html.haml @@ -4,7 +4,7 @@ %small Blocked - if @admin_user.admin %small Administrator - = link_to edit_admin_user_path(@admin_user), class: "btn right" do + = link_to edit_admin_user_path(@admin_user), class: "btn pull-right" do %i.icon-edit Edit diff --git a/app/views/blame/_head.html.haml b/app/views/blame/_head.html.haml index 85da18052b4..ef9e6c9c532 100644 --- a/app/views/blame/_head.html.haml +++ b/app/views/blame/_head.html.haml @@ -3,5 +3,5 @@ = render partial: 'shared/ref_switcher', locals: {destination: 'tree', path: params[:path]} = nav_link(controller: :refs) do = link_to 'Source', project_tree_path(@project, @ref) - %li.right + %li.pull-right = render "shared/clone_panel" diff --git a/app/views/commit/show.html.haml b/app/views/commit/show.html.haml index 6bee6493ac6..485f2d1e67c 100644 --- a/app/views/commit/show.html.haml +++ b/app/views/commit/show.html.haml @@ -1,6 +1,6 @@ = render "commits/commit_box" -%p.right.cgray +%p.pull-right.cgray This commit has %span.cgreen #{@commit.stats.additions} additions and diff --git a/app/views/commits/_commit_box.html.haml b/app/views/commits/_commit_box.html.haml index 4767c493ab7..4c80c13ced1 100644 --- a/app/views/commits/_commit_box.html.haml +++ b/app/views/commits/_commit_box.html.haml @@ -1,6 +1,6 @@ .ui-box.ui-box-show .ui-box-head - .right + .pull-right - if @notes_count > 0 %span.btn.disabled.grouped %i.icon-comment diff --git a/app/views/commits/_diffs.html.haml b/app/views/commits/_diffs.html.haml index 5e7d43c99cb..db9180c4057 100644 --- a/app/views/commits/_diffs.html.haml +++ b/app/views/commits/_diffs.html.haml @@ -25,7 +25,7 @@ %span= diff.old_path - if @commit.prev_commit - = link_to project_tree_path(@project, tree_join(@commit.prev_commit_id, diff.new_path)), {:class => 'btn right view-file'} do + = link_to project_tree_path(@project, tree_join(@commit.prev_commit_id, diff.new_path)), {:class => 'btn pull-right view-file'} do View file @ %span.commit-short-id= @commit.short_id(6) - else @@ -33,7 +33,7 @@ - if diff.a_mode && diff.b_mode && diff.a_mode != diff.b_mode %span.file-mode= "#{diff.a_mode} → #{diff.b_mode}" - = link_to project_tree_path(@project, tree_join(@commit.id, diff.new_path)), {:class => 'btn btn-tiny right view-file'} do + = link_to project_tree_path(@project, tree_join(@commit.id, diff.new_path)), {:class => 'btn btn-tiny pull-right view-file'} do View file @ %span.commit-short-id= @commit.short_id(6) diff --git a/app/views/commits/_head.html.haml b/app/views/commits/_head.html.haml index a5f3fdf5c5e..02debe426fe 100644 --- a/app/views/commits/_head.html.haml +++ b/app/views/commits/_head.html.haml @@ -22,7 +22,7 @@ - if current_controller?(:commits) && current_user.private_token - %li.right + %li.pull-right %span.rss-icon = link_to project_commits_path(@project, @ref, {format: :atom, private_token: current_user.private_token}), title: "Feed" do = image_tag "rss_ui.png", title: "feed" diff --git a/app/views/dashboard/_filter.html.haml b/app/views/dashboard/_filter.html.haml index 4624af79948..82e679d5927 100644 --- a/app/views/dashboard/_filter.html.haml +++ b/app/views/dashboard/_filter.html.haml @@ -25,9 +25,9 @@ %li{class: ("active" if params[:project_id] == project.id.to_s)} = link_to dashboard_filter_path(entity, project_id: project.id) do = project.name_with_namespace - %small.right= entities_per_project(project, entity) + %small.pull-right= entities_per_project(project, entity) %fieldset %hr - = link_to "Reset", dashboard_filter_path(entity), class: 'btn right' + = link_to "Reset", dashboard_filter_path(entity), class: 'btn pull-right' diff --git a/app/views/dashboard/_groups.html.haml b/app/views/dashboard/_groups.html.haml index 535f0349212..ba8d3029eaf 100644 --- a/app/views/dashboard/_groups.html.haml +++ b/app/views/dashboard/_groups.html.haml @@ -4,7 +4,7 @@ %small (#{groups.count}) - if current_user.can_create_group? - %span.right + %span.pull-right = link_to new_group_path, class: "btn btn-tiny info" do %i.icon-plus New Group @@ -13,6 +13,6 @@ %li = link_to group_path(id: group.path), class: dom_class(group) do %strong.well-title= truncate(group.name, length: 35) - %span.right.light + %span.pull-right.light - if group.owner == current_user %i.icon-wrench diff --git a/app/views/dashboard/_projects.html.haml b/app/views/dashboard/_projects.html.haml index a5396a0023d..30fb7268014 100644 --- a/app/views/dashboard/_projects.html.haml +++ b/app/views/dashboard/_projects.html.haml @@ -4,7 +4,7 @@ %small (#{@projects_count}) - if current_user.can_create_project? - %span.right + %span.pull-right = link_to new_project_path, class: "btn btn-tiny info" do %i.icon-plus New Project diff --git a/app/views/dashboard/_teams.html.haml b/app/views/dashboard/_teams.html.haml index 1be6e25c54d..f56115856a7 100644 --- a/app/views/dashboard/_teams.html.haml +++ b/app/views/dashboard/_teams.html.haml @@ -3,7 +3,7 @@ Teams %small (#{@teams.count}) - %span.right + %span.pull-right = link_to new_team_path, class: "btn btn-tiny info" do %i.icon-plus New Team @@ -12,7 +12,7 @@ %li = link_to team_path(id: team.path), class: dom_class(team) do %strong.well-title= truncate(team.name, length: 35) - %span.right.light + %span.pull-right.light - if team.owner == current_user %i.icon-wrench - tm = current_user.user_team_user_relationships.find_by_user_team_id(team.id) diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml index 307d0d85ea3..affe01a7ef9 100644 --- a/app/views/dashboard/issues.html.haml +++ b/app/views/dashboard/issues.html.haml @@ -1,7 +1,7 @@ %h3.page_title Issues %small (assigned to you) - %small.right #{@issues.total_count} issues + %small.pull-right #{@issues.total_count} issues %hr diff --git a/app/views/dashboard/merge_requests.html.haml b/app/views/dashboard/merge_requests.html.haml index 0c4d6e0aadf..a311729dd4d 100644 --- a/app/views/dashboard/merge_requests.html.haml +++ b/app/views/dashboard/merge_requests.html.haml @@ -1,7 +1,7 @@ %h3.page_title Merge Requests %small (authored by or assigned to you) - %small.right #{@merge_requests.total_count} merge requests + %small.pull-right #{@merge_requests.total_count} merge requests %hr .row diff --git a/app/views/dashboard/projects.html.haml b/app/views/dashboard/projects.html.haml index 94b319fe24f..8e21b0c7e02 100644 --- a/app/views/dashboard/projects.html.haml +++ b/app/views/dashboard/projects.html.haml @@ -3,7 +3,7 @@ %span (#{@projects.total_count}) - if current_user.can_create_project? - %span.right + %span.pull-right = link_to new_project_path, class: "btn btn-tiny info" do %i.icon-plus New Project @@ -42,7 +42,7 @@ %small.light %strong Last activity: %span= project_last_activity(project) - .right.light + .pull-right.light - if project.owner == current_user %i.icon-wrench - tm = project.team.get_tm(current_user.id) diff --git a/app/views/deploy_keys/_show.html.haml b/app/views/deploy_keys/_show.html.haml index 68b00568c6d..635054350ec 100644 --- a/app/views/deploy_keys/_show.html.haml +++ b/app/views/deploy_keys/_show.html.haml @@ -8,5 +8,5 @@ = time_ago_in_words(key.created_at) ago %td - = link_to 'Remove', project_deploy_key_path(key.project, key), confirm: 'Are you sure?', method: :delete, class: "btn btn-remove delete-key btn-small right" + = link_to 'Remove', project_deploy_key_path(key.project, key), confirm: 'Are you sure?', method: :delete, class: "btn btn-remove delete-key btn-small pull-right" diff --git a/app/views/deploy_keys/show.html.haml b/app/views/deploy_keys/show.html.haml index 4a864fae9d7..227afecb061 100644 --- a/app/views/deploy_keys/show.html.haml +++ b/app/views/deploy_keys/show.html.haml @@ -10,5 +10,5 @@ ← To keys list %hr %pre= @key.key -.right +.pull-right = link_to 'Remove', project_deploy_key_path(@key.project, @key), confirm: 'Are you sure?', method: :delete, class: "btn-remove btn delete-key" diff --git a/app/views/devise/passwords/edit.html.haml b/app/views/devise/passwords/edit.html.haml index 6ca0c5d8c08..e5800025c6d 100644 --- a/app/views/devise/passwords/edit.html.haml +++ b/app/views/devise/passwords/edit.html.haml @@ -9,4 +9,4 @@ = f.password_field :password_confirmation, class: "text bottom", placeholder: "Confirm new password" %div = f.submit "Change my password", class: "btn btn-primary" - .right= render partial: "devise/shared/links" + .pull-right= render partial: "devise/shared/links" diff --git a/app/views/devise/sessions/_new_ldap.html.haml b/app/views/devise/sessions/_new_ldap.html.haml index a4060130552..7968b0e9c9f 100644 --- a/app/views/devise/sessions/_new_ldap.html.haml +++ b/app/views/devise/sessions/_new_ldap.html.haml @@ -25,5 +25,5 @@ %span Remember me %br/ = f.submit "Sign in", :class => "btn-primary btn" - .right + .pull-right = render :partial => "devise/shared/links" diff --git a/app/views/devise/sessions/new.html.haml b/app/views/devise/sessions/new.html.haml index 0a252e25487..7ea41876e44 100644 --- a/app/views/devise/sessions/new.html.haml +++ b/app/views/devise/sessions/new.html.haml @@ -12,7 +12,7 @@ %span Remember me %br/ = f.submit "Sign in", :class => "btn-primary btn wide" - .right + .pull-right = link_to "Forgot your password?", new_password_path(resource_name), :class => "btn" %br/ %br/ diff --git a/app/views/events/_event.html.haml b/app/views/events/_event.html.haml index 191aed0747e..719f6c3787f 100644 --- a/app/views/events/_event.html.haml +++ b/app/views/events/_event.html.haml @@ -1,6 +1,6 @@ - if event.proper? %div.event-item - %span.cgray.right + %span.cgray.pull-right #{time_ago_in_words(event.created_at)} ago. = image_tag gravatar_icon(event.author_email), class: "avatar s24" diff --git a/app/views/groups/_filter.html.haml b/app/views/groups/_filter.html.haml index c8b0ad0f433..c14fc8e5e4b 100644 --- a/app/views/groups/_filter.html.haml +++ b/app/views/groups/_filter.html.haml @@ -25,9 +25,9 @@ %li{class: ("active" if params[:project_id] == project.id.to_s)} = link_to group_filter_path(entity, project_id: project.id) do = project.name_with_namespace - %small.right= entities_per_project(project, entity) + %small.pull-right= entities_per_project(project, entity) %fieldset %hr - = link_to "Reset", group_filter_path(entity), class: 'btn right' + = link_to "Reset", group_filter_path(entity), class: 'btn pull-right' diff --git a/app/views/groups/_people_filter.html.haml b/app/views/groups/_people_filter.html.haml index 79a1b01a5fa..901a037adf3 100644 --- a/app/views/groups/_people_filter.html.haml +++ b/app/views/groups/_people_filter.html.haml @@ -6,9 +6,9 @@ %li{class: ("active" if params[:project_id] == project.id.to_s)} = link_to people_group_path(@group, project_id: project.id) do = project.name_with_namespace - %small.right= project.users.count + %small.pull-right= project.users.count %fieldset %hr - = link_to "Reset", people_group_path(@group), class: 'btn right' + = link_to "Reset", people_group_path(@group), class: 'btn pull-right' diff --git a/app/views/groups/_projects.html.haml b/app/views/groups/_projects.html.haml index b7732c50a32..4fa4a177983 100644 --- a/app/views/groups/_projects.html.haml +++ b/app/views/groups/_projects.html.haml @@ -4,7 +4,7 @@ %small (#{projects.count}) - if can? current_user, :manage_group, @group - %span.right + %span.pull-right = link_to new_project_path(namespace_id: @group.id), class: "btn btn-tiny info" do %i.icon-plus New Project diff --git a/app/views/groups/issues.html.haml b/app/views/groups/issues.html.haml index 9e8642f3b2c..94682bdd51e 100644 --- a/app/views/groups/issues.html.haml +++ b/app/views/groups/issues.html.haml @@ -1,7 +1,7 @@ %h3.page_title Issues %small (assigned to you) - %small.right #{@issues.total_count} issues + %small.pull-right #{@issues.total_count} issues %hr .row diff --git a/app/views/groups/merge_requests.html.haml b/app/views/groups/merge_requests.html.haml index 0c4d6e0aadf..a311729dd4d 100644 --- a/app/views/groups/merge_requests.html.haml +++ b/app/views/groups/merge_requests.html.haml @@ -1,7 +1,7 @@ %h3.page_title Merge Requests %small (authored by or assigned to you) - %small.right #{@merge_requests.total_count} merge requests + %small.pull-right #{@merge_requests.total_count} merge requests %hr .row diff --git a/app/views/groups/people.html.haml b/app/views/groups/people.html.haml index 0bceeaa3ceb..3e4eb082f56 100644 --- a/app/views/groups/people.html.haml +++ b/app/views/groups/people.html.haml @@ -16,5 +16,5 @@ %strong= user.name %span.cgray= user.email - if @group.owner == user - %span.btn.btn-small.disabled.right Group Owner + %span.btn.btn-small.disabled.pull-right Group Owner diff --git a/app/views/help/_layout.html.haml b/app/views/help/_layout.html.haml index 3839be2773c..fa5e3a30b29 100644 --- a/app/views/help/_layout.html.haml +++ b/app/views/help/_layout.html.haml @@ -30,5 +30,5 @@ %li %strong= link_to "Public Access", help_public_access_path - .span9.right + .span9.pull-right = yield diff --git a/app/views/help/index.html.haml b/app/views/help/index.html.haml index 28791b321f1..1a4411c8f30 100644 --- a/app/views/help/index.html.haml +++ b/app/views/help/index.html.haml @@ -1,6 +1,6 @@ %h3.page_title GITLAB - .right + .pull-right %span= Gitlab::Version %small= Gitlab::Revision %hr diff --git a/app/views/hooks/index.html.haml b/app/views/hooks/index.html.haml index 3d814ab4db8..334b0f19301 100644 --- a/app/views/hooks/index.html.haml +++ b/app/views/hooks/index.html.haml @@ -37,6 +37,6 @@ → %span.monospace= hook.url %td - .right + .pull-right = link_to 'Test Hook', test_project_hook_path(@project, hook), class: "btn btn-small grouped" = link_to 'Remove', project_hook_path(@project, hook), confirm: 'Are you sure?', method: :delete, class: "btn btn-remove btn-small grouped" diff --git a/app/views/issues/_filter.html.haml b/app/views/issues/_filter.html.haml index 779e55bb7af..21efaa5357c 100644 --- a/app/views/issues/_filter.html.haml +++ b/app/views/issues/_filter.html.haml @@ -16,5 +16,5 @@ %fieldset %hr - = link_to "Reset", project_issues_path(@project), class: 'btn right' + = link_to "Reset", project_issues_path(@project), class: 'btn pull-right' diff --git a/app/views/issues/_head.html.haml b/app/views/issues/_head.html.haml index 4294503c211..7e0b2cde074 100644 --- a/app/views/issues/_head.html.haml +++ b/app/views/issues/_head.html.haml @@ -5,7 +5,7 @@ = link_to 'Milestones', project_milestones_path(@project), class: "tab" = nav_link(controller: :labels) do = link_to 'Labels', project_labels_path(@project), class: "tab" - %li.right + %li.pull-right %span.rss-icon = link_to project_issues_path(@project, :atom, { private_token: current_user.private_token }) do = image_tag "rss_ui.png", title: "feed" diff --git a/app/views/issues/_issues.html.haml b/app/views/issues/_issues.html.haml index 8821dbb8d98..3bbd293dba2 100644 --- a/app/views/issues/_issues.html.haml +++ b/app/views/issues/_issues.html.haml @@ -4,7 +4,7 @@ - if @issues.present? %li.bottom .left= paginate @issues, remote: true, theme: "gitlab" - .right + .pull-right %span.issue_counter #{@issues.total_count} issues for this filter - else diff --git a/app/views/issues/_show.html.haml b/app/views/issues/_show.html.haml index 9f543ef97d8..fa888618066 100644 --- a/app/views/issues/_show.html.haml +++ b/app/views/issues/_show.html.haml @@ -2,7 +2,7 @@ - if controller.controller_name == 'issues' .issue_check = check_box_tag dom_id(issue,"selected"), nil, false, 'data-id' => issue.id, class: "selected_issue", disabled: !can?(current_user, :modify_issue, issue) - .right + .pull-right - if issue.notes.any? %span.btn.btn-small.disabled.grouped %i.icon-comment diff --git a/app/views/issues/index.html.haml b/app/views/issues/index.html.haml index a3fb0335205..875f29e2600 100644 --- a/app/views/issues/index.html.haml +++ b/app/views/issues/index.html.haml @@ -3,16 +3,16 @@ %h3.page_title Issues %span (<span class=issue_counter>#{@issues.total_count}</span>) - .right + .pull-right .span5 - if can? current_user, :write_issue, @project - = link_to new_project_issue_path(@project, issue: { assignee_id: params[:assignee_id], milestone_id: params[:milestone_id]}), class: "right btn btn-primary", title: "New Issue", id: "new_issue_link" do + = link_to new_project_issue_path(@project, issue: { assignee_id: params[:assignee_id], milestone_id: params[:milestone_id]}), class: "btn btn-primary pull-right", title: "New Issue", id: "new_issue_link" do %i.icon-plus New Issue - = form_tag search_project_issues_path(@project), method: :get, remote: true, id: "issue_search_form", class: :right do + = form_tag search_project_issues_path(@project), method: :get, remote: true, id: "issue_search_form", class: 'pull-right' do = hidden_field_tag :project_id, @project.id, { id: 'project_id' } = hidden_field_tag :status, params[:status] - = search_field_tag :issue_search, nil, { placeholder: 'Search', class: 'issue_search span3 right neib search-text-input' } + = search_field_tag :issue_search, nil, { placeholder: 'Search', class: 'issue_search span3 pull-right neib search-text-input' } .clearfix diff --git a/app/views/issues/show.html.haml b/app/views/issues/show.html.haml index 6bf78929699..474955cc665 100644 --- a/app/views/issues/show.html.haml +++ b/app/views/issues/show.html.haml @@ -5,7 +5,7 @@ created at = @issue.created_at.stamp("Aug 21, 2011") - %span.right + %span.pull-right - if can?(current_user, :admin_project, @project) || @issue.author == current_user - if @issue.closed = link_to 'Reopen', project_issue_path(@project, @issue, issue: {closed: false }, status_only: true), method: :put, class: "btn grouped reopen_issue" @@ -16,7 +16,7 @@ %i.icon-edit Edit -.right +.pull-right .span3#votes= render 'votes/votes_block', votable: @issue .back_link @@ -42,7 +42,7 @@ %cite.cgray and attached to milestone %strong= link_to_gfm truncate(milestone.title, length: 20), project_milestone_path(milestone.project, milestone) - .right + .pull-right - @issue.labels.each do |label| %span.label %i.icon-tag diff --git a/app/views/kaminari/admin/_paginator.html.haml b/app/views/kaminari/admin/_paginator.html.haml index 6f9fb332261..40b330feb3b 100644 --- a/app/views/kaminari/admin/_paginator.html.haml +++ b/app/views/kaminari/admin/_paginator.html.haml @@ -10,7 +10,7 @@ %ul = prev_page_tag unless current_page.first? - each_page do |page| - - if page.left_outer? || page.right_outer? || page.inside_window? + - if page.left_outer? || page.pull-right_outer? || page.inside_window? = page_tag page - elsif !page.was_truncated? = gap_tag diff --git a/app/views/kaminari/gitlab/_paginator.html.haml b/app/views/kaminari/gitlab/_paginator.html.haml index 6dd5a5782a2..2fe4c183d15 100644 --- a/app/views/kaminari/gitlab/_paginator.html.haml +++ b/app/views/kaminari/gitlab/_paginator.html.haml @@ -9,7 +9,7 @@ %nav.gitlab_pagination = prev_page_tag - each_page do |page| - - if page.left_outer? || page.right_outer? || page.inside_window? + - if page.left_outer? || page.pull-right_outer? || page.inside_window? = page_tag page - elsif !page.was_truncated? = gap_tag diff --git a/app/views/keys/_show.html.haml b/app/views/keys/_show.html.haml index 9e85e6228ce..52bbea6fc7b 100644 --- a/app/views/keys/_show.html.haml +++ b/app/views/keys/_show.html.haml @@ -8,5 +8,5 @@ = time_ago_in_words(key.created_at) ago %td - = link_to 'Remove', key, confirm: 'Are you sure?', method: :delete, class: "btn btn-small btn-remove delete-key right" + = link_to 'Remove', key, confirm: 'Are you sure?', method: :delete, class: "btn btn-small btn-remove delete-key pull-right" diff --git a/app/views/keys/index.html.haml b/app/views/keys/index.html.haml index f5a8283a0ce..7730b344a7d 100644 --- a/app/views/keys/index.html.haml +++ b/app/views/keys/index.html.haml @@ -1,6 +1,6 @@ %h3.page_title SSH Keys - = link_to "Add new", new_key_path, class: "btn right" + = link_to "Add new", new_key_path, class: "btn pull-right" %hr %p.slead diff --git a/app/views/keys/show.html.haml b/app/views/keys/show.html.haml index 089d0558b52..059fe5e5806 100644 --- a/app/views/keys/show.html.haml +++ b/app/views/keys/show.html.haml @@ -10,5 +10,5 @@ %hr %pre= @key.key -.right +.pull-right = link_to 'Remove', @key, confirm: 'Are you sure?', method: :delete, class: "btn btn-remove delete-key" diff --git a/app/views/labels/_label.html.haml b/app/views/labels/_label.html.haml index 6e223e8e61d..027b041d58e 100644 --- a/app/views/labels/_label.html.haml +++ b/app/views/labels/_label.html.haml @@ -2,7 +2,7 @@ %strong %i.icon-tag = label.name - .right + .pull-right = link_to project_issues_path(label_name: label.name) do %strong = pluralize(label.count, 'issue') diff --git a/app/views/merge_requests/_filter.html.haml b/app/views/merge_requests/_filter.html.haml index 86148fbcfee..4b48306ed05 100644 --- a/app/views/merge_requests/_filter.html.haml +++ b/app/views/merge_requests/_filter.html.haml @@ -16,5 +16,5 @@ %fieldset %hr - = link_to "Reset", project_merge_requests_path(@project), class: 'btn right' + = link_to "Reset", project_merge_requests_path(@project), class: 'btn pull-right' diff --git a/app/views/merge_requests/_merge_request.html.haml b/app/views/merge_requests/_merge_request.html.haml index cdfc623d0a5..09c55d98465 100644 --- a/app/views/merge_requests/_merge_request.html.haml +++ b/app/views/merge_requests/_merge_request.html.haml @@ -1,5 +1,5 @@ %li{ class: mr_css_classes(merge_request) } - .right + .pull-right .left - if merge_request.merged? %span.btn.btn-small.disabled.grouped diff --git a/app/views/merge_requests/index.html.haml b/app/views/merge_requests/index.html.haml index 8c688e26814..3073c8f6bab 100644 --- a/app/views/merge_requests/index.html.haml +++ b/app/views/merge_requests/index.html.haml @@ -1,5 +1,5 @@ - if can? current_user, :write_merge_request, @project - = link_to new_project_merge_request_path(@project), class: "right btn btn-primary", title: "New Merge Request" do + = link_to new_project_merge_request_path(@project), class: "pull-right btn btn-primary", title: "New Merge Request" do %i.icon-plus New Merge Request %h3.page_title @@ -28,8 +28,8 @@ - if @merge_requests.present? %li.bottom .left= paginate @merge_requests, theme: "gitlab" - .right - %span.cgray.right #{@merge_requests.total_count} merge requests for this filter + .pull-right + %span.cgray.pull-right #{@merge_requests.total_count} merge requests for this filter :javascript $(merge_requestsPage); diff --git a/app/views/merge_requests/show/_mr_title.html.haml b/app/views/merge_requests/show/_mr_title.html.haml index c2ffe8e3770..1b9b7ca2d26 100644 --- a/app/views/merge_requests/show/_mr_title.html.haml +++ b/app/views/merge_requests/show/_mr_title.html.haml @@ -5,7 +5,7 @@ → %span.label_branch= @merge_request.target_branch - %span.right + %span.pull-right - if can?(current_user, :modify_merge_request, @merge_request) - if @merge_request.open? .left.btn-group @@ -23,7 +23,7 @@ %i.icon-edit Edit -.right +.pull-right .span3#votes= render 'votes/votes_block', votable: @merge_request .back_link diff --git a/app/views/milestones/_milestone.html.haml b/app/views/milestones/_milestone.html.haml index 9111ff8b954..00e20117f36 100644 --- a/app/views/milestones/_milestone.html.haml +++ b/app/views/milestones/_milestone.html.haml @@ -1,5 +1,5 @@ %li{class: "milestone milestone-#{milestone.closed ? 'closed' : 'open'}", id: dom_id(milestone) } - .right + .pull-right - if can?(current_user, :admin_milestone, milestone.project) and milestone.open? = link_to edit_project_milestone_path(milestone.project, milestone), class: "btn btn-small edit-milestone-link grouped" do %i.icon-edit diff --git a/app/views/milestones/index.html.haml b/app/views/milestones/index.html.haml index c1dc6da983d..b78f17053fd 100644 --- a/app/views/milestones/index.html.haml +++ b/app/views/milestones/index.html.haml @@ -3,7 +3,7 @@ %h3.page_title Milestones - if can? current_user, :admin_milestone, @project - = link_to "New Milestone", new_project_milestone_path(@project), class: "right btn btn-small", title: "New Milestone" + = link_to "New Milestone", new_project_milestone_path(@project), class: "pull-right btn btn-small", title: "New Milestone" %br %div.ui-box .title diff --git a/app/views/milestones/show.html.haml b/app/views/milestones/show.html.haml index eeefb70e57c..43d82a54dd6 100644 --- a/app/views/milestones/show.html.haml +++ b/app/views/milestones/show.html.haml @@ -8,7 +8,7 @@ = link_to project_milestones_path(@project) do ← To milestones list .span6 - .right + .pull-right - unless @milestone.closed = link_to new_project_issue_path(@project, issue: { milestone_id: @milestone.id }), class: "btn btn-small grouped", title: "New Issue" do %i.icon-plus @@ -43,7 +43,7 @@ #{@milestone.closed_items_count} closed – #{@milestone.open_items_count} open - %span.right= @milestone.expires_at + %span.pull-right= @milestone.expires_at .progress.progress-info .bar{style: "width: #{@milestone.percent_complete}%;"} diff --git a/app/views/notes/_form.html.haml b/app/views/notes/_form.html.haml index a063fb0a6bb..f008712c529 100644 --- a/app/views/notes/_form.html.haml +++ b/app/views/notes/_form.html.haml @@ -19,7 +19,7 @@ = f.submit 'Add Comment', class: "btn comment-btn grouped js-comment-button" %a.btn.grouped.js-close-discussion-note-form Cancel .hint - .right Comments are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. + .pull-right Comments are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. .clearfix .note_options diff --git a/app/views/notes/_note.html.haml b/app/views/notes/_note.html.haml index 9efeb563e0a..9c51da2913c 100644 --- a/app/views/notes/_note.html.haml +++ b/app/views/notes/_note.html.haml @@ -30,7 +30,7 @@ - if note.attachment.url - if note.attachment.image? = image_tag note.attachment.url, class: 'note-image-attach' - .attachment.right + .attachment.pull-right = link_to note.attachment.url, target: "_blank" do %i.icon-attachment = note.attachment_identifier diff --git a/app/views/profiles/account.html.haml b/app/views/profiles/account.html.haml index 71eacd571bd..f907cec5b61 100644 --- a/app/views/profiles/account.html.haml +++ b/app/views/profiles/account.html.haml @@ -12,7 +12,7 @@ %fieldset %legend Private token - %span.cred.right + %span.cred.pull-right keep it secret! .padded = form_for @user, url: reset_private_token_profile_path, method: :put do |f| @@ -56,7 +56,7 @@ %fieldset.update-username %legend Username - %small.cred.right + %small.cred.pull-right Changing your username can have unintended side effects! = form_for @user, url: update_username_profile_path, method: :put, remote: true do |f| .padded diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml index 65b5a5d29fc..8a85716adbc 100644 --- a/app/views/profiles/show.html.haml +++ b/app/views/profiles/show.html.haml @@ -6,7 +6,7 @@ %small = @user.email - .right + .pull-right = link_to destroy_user_session_path, class: "logout", method: :delete do %small %i.icon-signout @@ -46,7 +46,7 @@ = f.text_area :bio, rows: 6, class: "input-xlarge", maxlength: 250 %span.help-block Tell us about yourself in fewer than 250 characters. - .span5.right + .span5.pull-right %fieldset.tips %legend Tips: %ul @@ -76,7 +76,7 @@ %fieldset %legend Personal projects: - %small.right + %small.pull-right %span= current_user.personal_projects.count of %span= current_user.projects_limit @@ -87,7 +87,7 @@ %fieldset %legend SSH public keys: - %span.right + %span.pull-right = link_to pluralize(current_user.keys.count, 'key'), keys_path .padded = link_to "Add Public Key", new_key_path, class: "btn btn-small" diff --git a/app/views/projects/_clone_panel.html.haml b/app/views/projects/_clone_panel.html.haml index 2962ad980b3..e52df19be96 100644 --- a/app/views/projects/_clone_panel.html.haml +++ b/app/views/projects/_clone_panel.html.haml @@ -2,8 +2,8 @@ .row .span7 .form-horizontal= render "shared/clone_panel" - .span4.right - .right + .span4.pull-right + .pull-right - unless @project.empty_repo? - if can? current_user, :download_code, @project = link_to archive_project_repository_path(@project), class: "btn-small btn grouped" do diff --git a/app/views/projects/_form.html.haml b/app/views/projects/_form.html.haml index a3e97fe9b70..254008a42ce 100644 --- a/app/views/projects/_form.html.haml +++ b/app/views/projects/_form.html.haml @@ -81,5 +81,5 @@ = link_to 'Cancel', @project, class: "btn" - unless @project.new_record? - if can?(current_user, :remove_project, @project) - .right + .pull-right = link_to 'Remove Project', @project, confirm: 'Removed project can not be restored! Are you sure?', method: :delete, class: "btn btn-remove" diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml index e7ee8bbb171..9426517876e 100644 --- a/app/views/projects/empty.html.haml +++ b/app/views/projects/empty.html.haml @@ -31,4 +31,4 @@ - if can? current_user, :remove_project, @project .prepend-top-20 - = link_to 'Remove project', @project, confirm: 'Are you sure?', method: :delete, class: "btn btn-remove right" + = link_to 'Remove project', @project, confirm: 'Are you sure?', method: :delete, class: "btn btn-remove pull-right" diff --git a/app/views/public/projects/index.html.haml b/app/views/public/projects/index.html.haml index afdd4c5fd95..21e9d2e6029 100644 --- a/app/views/public/projects/index.html.haml +++ b/app/views/public/projects/index.html.haml @@ -9,7 +9,7 @@ %h5 %i.icon-share = project.name_with_namespace - .right + .pull-right %pre.dark.tiny git clone #{project.http_url_to_repo} diff --git a/app/views/repositories/_feed.html.haml b/app/views/repositories/_feed.html.haml index 44380133718..eaf15ca77d6 100644 --- a/app/views/repositories/_feed.html.haml +++ b/app/views/repositories/_feed.html.haml @@ -15,6 +15,6 @@ = image_tag gravatar_icon(commit.author_email), class: "", width: 16 = gfm escape_once(truncate(commit.title, length: 40)) %td - %span.right.cgray + %span.pull-right.cgray = time_ago_in_words(commit.committed_date) ago diff --git a/app/views/repositories/stats.html.haml b/app/views/repositories/stats.html.haml index bdf047f1e98..dde35ea38aa 100644 --- a/app/views/repositories/stats.html.haml +++ b/app/views/repositories/stats.html.haml @@ -23,7 +23,7 @@ = image_tag gravatar_icon(author.email, 16), class: 'avatar s16' = author.name %small.light= author.email - .right + .pull-right = author.commits diff --git a/app/views/services/_gitlab_ci.html.haml b/app/views/services/_gitlab_ci.html.haml index 822892c8337..732a3d6c3e9 100644 --- a/app/views/services/_gitlab_ci.html.haml +++ b/app/views/services/_gitlab_ci.html.haml @@ -1,7 +1,7 @@ %h3.page_title GitLab CI %small Continuous integration server from GitLab - .right + .pull-right - if @service.active %small.cgreen Enabled - else diff --git a/app/views/services/index.html.haml b/app/views/services/index.html.haml index 2c94f965eec..27dbf502569 100644 --- a/app/views/services/index.html.haml +++ b/app/views/services/index.html.haml @@ -8,7 +8,7 @@ = link_to edit_project_service_path(@project, :gitlab_ci) do GitLab CI %small Continuous integration server from GitLab - .right + .pull-right - if @gitlab_ci_service.try(:active) %small.cgreen %i.icon-ok @@ -21,11 +21,11 @@ %h4 Jenkins CI %small An extendable open source continuous integration server - .right + .pull-right %small Not implemented yet %li.disabled %h4 Campfire %small Web-based group chat tool - .right + .pull-right %small Not implemented yet diff --git a/app/views/snippets/_form.html.haml b/app/views/snippets/_form.html.haml index 1405bd1110f..3b0b8be6f4d 100644 --- a/app/views/snippets/_form.html.haml +++ b/app/views/snippets/_form.html.haml @@ -30,7 +30,7 @@ = f.submit 'Save', class: "btn-save btn" = link_to "Cancel", project_snippets_path(@project), class: " btn" - unless @snippet.new_record? - .right= link_to 'Destroy', [@project, @snippet], confirm: 'Are you sure?', method: :delete, class: "btn right danger delete-snippet", id: "destroy_snippet_#{@snippet.id}" + .pull-right= link_to 'Destroy', [@project, @snippet], confirm: 'Are you sure?', method: :delete, class: "btn pull-right danger delete-snippet", id: "destroy_snippet_#{@snippet.id}" :javascript diff --git a/app/views/snippets/index.html.haml b/app/views/snippets/index.html.haml index db2185745ef..28a533d238f 100644 --- a/app/views/snippets/index.html.haml +++ b/app/views/snippets/index.html.haml @@ -5,7 +5,7 @@ %small share code pastes with others out of git repository - if can? current_user, :write_snippet, @project - = link_to new_project_snippet_path(@project), class: "btn btn-small add_new right", title: "New Snippet" do + = link_to new_project_snippet_path(@project), class: "btn btn-small add_new pull-right", title: "New Snippet" do Add new snippet %br %table diff --git a/app/views/snippets/show.html.haml b/app/views/snippets/show.html.haml index 767b9736545..e6bcd88f830 100644 --- a/app/views/snippets/show.html.haml +++ b/app/views/snippets/show.html.haml @@ -4,7 +4,7 @@ = @snippet.title %small= @snippet.file_name - if can?(current_user, :admin_snippet, @project) || @snippet.author == current_user - = link_to "Edit", edit_project_snippet_path(@project, @snippet), class: "btn btn-small right" + = link_to "Edit", edit_project_snippet_path(@project, @snippet), class: "btn btn-small pull-right" %br %div= render 'blob' diff --git a/app/views/team_members/_show.html.haml b/app/views/team_members/_show.html.haml index c85ec9812a8..b59bb7b1e52 100644 --- a/app/views/team_members/_show.html.haml +++ b/app/views/team_members/_show.html.haml @@ -10,12 +10,12 @@ %br %small.cgray= user.email - .span5.right + .span5.pull-right - if allow_admin .left = form_for(member, as: :team_member, url: project_team_member_path(@project, member.user)) do |f| = f.select :project_access, options_for_select(UsersProject.access_roles, member.project_access), {}, class: "medium project-access-select span2" - .right + .pull-right - if current_user == user %span.btn.disabled This is you! - if @project.namespace_owner == user diff --git a/app/views/team_members/_show_team.html.haml b/app/views/team_members/_show_team.html.haml index ebe6f633d68..f1555f0b87b 100644 --- a/app/views/team_members/_show_team.html.haml +++ b/app/views/team_members/_show_team.html.haml @@ -7,8 +7,8 @@ %br %small.cgray Members: #{team.members.count} - .span5.right - .right + .span5.pull-right + .pull-right - if allow_admin .left = link_to resign_project_team_path(@project, team), method: :delete, confirm: "Are you shure?", class: "btn btn-remove small" do diff --git a/app/views/team_members/index.html.haml b/app/views/team_members/index.html.haml index 6e5090c7799..3264f58cb32 100644 --- a/app/views/team_members/index.html.haml +++ b/app/views/team_members/index.html.haml @@ -7,7 +7,7 @@ %strong= link_to "here", help_permissions_path, class: "vlink" - if can? current_user, :admin_team_member, @project - %span.right + %span.pull-right = link_to import_project_team_members_path(@project), class: "btn btn-small grouped", title: "Import team from another project" do Import team from another project = link_to available_project_teams_path(@project), class: "btn btn-small grouped", title: "Assign project to team of users" do diff --git a/app/views/team_members/show.html.haml b/app/views/team_members/show.html.haml index 99564f8e167..192948eff7d 100644 --- a/app/views/team_members/show.html.haml +++ b/app/views/team_members/show.html.haml @@ -2,7 +2,7 @@ .team_member_show - if can? current_user, :admin_project, @project - = link_to 'Remove from team', project_team_member_path(@project, @member), confirm: 'Are you sure?', method: :delete, class: "right btn btn-remove" + = link_to 'Remove from team', project_team_member_path(@project, @member), confirm: 'Are you sure?', method: :delete, class: "btn btn-remove pull-right" .profile_avatar_holder = image_tag gravatar_icon(@member.email, 60), class: "borders" %h3.page_title diff --git a/app/views/teams/_filter.html.haml b/app/views/teams/_filter.html.haml index 8e358319651..f461fcad42e 100644 --- a/app/views/teams/_filter.html.haml +++ b/app/views/teams/_filter.html.haml @@ -25,9 +25,9 @@ %li{class: ("active" if params[:project_id] == project.id.to_s)} = link_to team_filter_path(entity, project_id: project.id) do = project.name_with_namespace - %small.right= entities_per_project(project, entity) + %small.pull-right= entities_per_project(project, entity) %fieldset %hr - = link_to "Reset", team_filter_path(entity), class: 'btn right' + = link_to "Reset", team_filter_path(entity), class: 'btn pull-right' diff --git a/app/views/teams/_projects.html.haml b/app/views/teams/_projects.html.haml index e72125919b1..5677255b15b 100644 --- a/app/views/teams/_projects.html.haml +++ b/app/views/teams/_projects.html.haml @@ -4,7 +4,7 @@ %small (#{projects.count}) - if can? current_user, :manage_user_team, @team - %span.right + %span.pull-right = link_to new_team_project_path(@team), class: "btn btn-tiny info" do %i.icon-plus Assign Project diff --git a/app/views/teams/issues.html.haml b/app/views/teams/issues.html.haml index 4481e2eaa03..c6a68c37b9c 100644 --- a/app/views/teams/issues.html.haml +++ b/app/views/teams/issues.html.haml @@ -1,7 +1,7 @@ %h3.page_title Issues %small (in Team projects assigned to Team members) - %small.right #{@issues.total_count} issues + %small.pull-right #{@issues.total_count} issues %hr .row diff --git a/app/views/teams/members/_show.html.haml b/app/views/teams/members/_show.html.haml index e2b702ab0d7..6cddb8e4826 100644 --- a/app/views/teams/members/_show.html.haml +++ b/app/views/teams/members/_show.html.haml @@ -10,7 +10,7 @@ %br %small.cgray= user.email - .span6.right + .span6.pull-right - if allow_admin .left.span2 = form_for(member, as: :team_member, url: team_member_path(@team, user)) do |f| @@ -19,7 +19,7 @@ %span = check_box_tag :group_admin, true, @team.admin?(user) Admin access - .right + .pull-right - if current_user == user %span.btn.disabled This is you! - if @team.owner == user diff --git a/app/views/teams/members/index.html.haml b/app/views/teams/members/index.html.haml index 8ce6e5d83c0..87438266cfb 100644 --- a/app/views/teams/members/index.html.haml +++ b/app/views/teams/members/index.html.haml @@ -6,7 +6,7 @@ %strong= link_to "here", help_permissions_path, class: "vlink" - if can? current_user, :manage_user_team, @team - %span.right + %span.pull-right = link_to new_team_member_path(@team), class: "btn btn-primary small grouped", title: "New Team Member" do New Team Member %hr diff --git a/app/views/teams/members/show.html.haml b/app/views/teams/members/show.html.haml index 6e655cee08e..f760c2dae3a 100644 --- a/app/views/teams/members/show.html.haml +++ b/app/views/teams/members/show.html.haml @@ -3,7 +3,7 @@ .team_member_show - if can? current_user, :admin_project, @project - = link_to 'Remove from team', project_team_member_path(project_id: @project, id: @team_member.id), confirm: 'Are you sure?', method: :delete, class: "right btn btn-remove" + = link_to 'Remove from team', project_team_member_path(project_id: @project, id: @team_member.id), confirm: 'Are you sure?', method: :delete, class: "pull-right btn btn-remove" .profile_avatar_holder = image_tag gravatar_icon(user.email, 60), class: "borders" %h3.page_title diff --git a/app/views/teams/merge_requests.html.haml b/app/views/teams/merge_requests.html.haml index c9af529e113..417d1aa6040 100644 --- a/app/views/teams/merge_requests.html.haml +++ b/app/views/teams/merge_requests.html.haml @@ -1,7 +1,7 @@ %h3.page_title Merge Requests %small (authored by or assigned to Team members) - %small.right #{@merge_requests.total_count} merge requests + %small.pull-right #{@merge_requests.total_count} merge requests %hr .row diff --git a/app/views/teams/projects/index.html.haml b/app/views/teams/projects/index.html.haml index de2bee093ec..696ee29c778 100644 --- a/app/views/teams/projects/index.html.haml +++ b/app/views/teams/projects/index.html.haml @@ -5,7 +5,7 @@ %strong= link_to "here", help_permissions_path, class: "vlink" - if current_user.can?(:manage_user_team, @team) && @avaliable_projects.any? - %span.right + %span.pull-right = link_to new_team_project_path(@team), class: "btn btn-primary small grouped", title: "New Team Member" do Assign project to Team diff --git a/app/views/tree/_head.html.haml b/app/views/tree/_head.html.haml index f14526cf23a..32c3882400e 100644 --- a/app/views/tree/_head.html.haml +++ b/app/views/tree/_head.html.haml @@ -3,5 +3,5 @@ = render partial: 'shared/ref_switcher', locals: {destination: 'tree', path: @path} = nav_link(controller: :tree) do = link_to 'Source', project_tree_path(@project, @ref) - %li.right + %li.pull-right = render "shared/clone_panel" diff --git a/app/views/tree/_tree.html.haml b/app/views/tree/_tree.html.haml index b0f775673b5..29a2ed02d31 100644 --- a/app/views/tree/_tree.html.haml +++ b/app/views/tree/_tree.html.haml @@ -24,7 +24,7 @@ %th Name %th Last Update %th Last Commit - %th= link_to "history", project_commits_path(@project, @id), class: "btn btn-tiny right" + %th= link_to "history", project_commits_path(@project, @id), class: "btn btn-tiny pull-right" - if tree.up_dir? %tr.tree-item diff --git a/app/views/users/_profile.html.haml b/app/views/users/_profile.html.haml index ab6538f083b..4981aaba0ac 100644 --- a/app/views/users/_profile.html.haml +++ b/app/views/users/_profile.html.haml @@ -4,20 +4,20 @@ %ul.well-list %li %strong Email - %span.right= mail_to @user.email + %span.pull-right= mail_to @user.email - unless @user.skype.blank? %li %strong Skype - %span.right= @user.skype + %span.pull-right= @user.skype - unless @user.linkedin.blank? %li %strong LinkedIn - %span.right= @user.linkedin + %span.pull-right= @user.linkedin - unless @user.twitter.blank? %li %strong Twitter - %span.right= @user.twitter + %span.pull-right= @user.twitter - unless @user.bio.blank? %li %strong Bio - %span.right= @user.bio + %span.pull-right= @user.bio diff --git a/app/views/users/_projects.html.haml b/app/views/users/_projects.html.haml index f46a0ed1161..73f635f3a08 100644 --- a/app/views/users/_projects.html.haml +++ b/app/views/users/_projects.html.haml @@ -9,7 +9,7 @@ \/ %strong.well-title = truncate(project.name, length: 45) - %span.right.light + %span.pull-right.light - if project.owner == @user %i.icon-wrench - tm = project.team.get_tm(@user.id) diff --git a/app/views/users/show.html.haml b/app/views/users/show.html.haml index 3977de24280..969fed9ce53 100644 --- a/app/views/users/show.html.haml +++ b/app/views/users/show.html.haml @@ -4,7 +4,7 @@ = image_tag gravatar_icon(@user.email, 90), class: "avatar s90" = @user.name - if @user == current_user - .right + .pull-right = link_to profile_path, class: 'btn btn-small' do %i.icon-edit Edit Profile diff --git a/app/views/wikis/edit.html.haml b/app/views/wikis/edit.html.haml index 71f8d6a9b6c..9e221aba47d 100644 --- a/app/views/wikis/edit.html.haml +++ b/app/views/wikis/edit.html.haml @@ -2,7 +2,7 @@ %hr = render 'form' -.right +.pull-right - if can? current_user, :admin_wiki, @project = link_to project_wiki_path(@project, @wiki), confirm: "Are you sure you want to delete this page?", method: :delete, class: "btn btn-small btn-remove" do Delete this page \ No newline at end of file diff --git a/app/views/wikis/show.html.haml b/app/views/wikis/show.html.haml index 245d192efa1..7ff8b5cc01e 100644 --- a/app/views/wikis/show.html.haml +++ b/app/views/wikis/show.html.haml @@ -1,6 +1,6 @@ %h3.page_title = @wiki.title - %span.right + %span.pull-right = link_to pages_project_wikis_path(@project), class: "btn btn-small grouped" do Pages - if can? current_user, :write_wiki, @project -- GitLab From 59b6de93cebe4aaa8cca121e6147fd7c83786f17 Mon Sep 17 00:00:00 2001 From: Sato Hiroyuki <sathiroyuki@gmail.com> Date: Wed, 30 Jan 2013 22:20:00 +0900 Subject: [PATCH 28/55] Improve overlap of lines in network graph --- lib/gitlab/graph/commit.rb | 4 +- lib/gitlab/graph/json_builder.rb | 88 +++++++++++++++++------ vendor/assets/javascripts/branch-graph.js | 25 +++++-- 3 files changed, 91 insertions(+), 26 deletions(-) diff --git a/lib/gitlab/graph/commit.rb b/lib/gitlab/graph/commit.rb index a6bf23a2381..13c8ebc9952 100644 --- a/lib/gitlab/graph/commit.rb +++ b/lib/gitlab/graph/commit.rb @@ -5,12 +5,13 @@ module Gitlab class Commit include ActionView::Helpers::TagHelper - attr_accessor :time, :space, :refs + attr_accessor :time, :space, :refs, :parent_spaces def initialize(commit) @_commit = commit @time = -1 @space = 0 + @parent_spaces = [] end def method_missing(m, *args, &block) @@ -28,6 +29,7 @@ module Gitlab } h[:time] = time h[:space] = space + h[:parent_spaces] = parent_spaces h[:refs] = refs.collect{|r|r.name}.join(" ") unless refs.nil? h[:id] = sha h[:date] = date diff --git a/lib/gitlab/graph/json_builder.rb b/lib/gitlab/graph/json_builder.rb index a3157aa4b4d..b25e313df40 100644 --- a/lib/gitlab/graph/json_builder.rb +++ b/lib/gitlab/graph/json_builder.rb @@ -16,7 +16,6 @@ module Gitlab @commits = collect_commits @days = index_commits - @space = 0 end def to_json(*args) @@ -53,7 +52,7 @@ module Gitlab # # @return [Array<TimeDate>] list of commit dates corelated with time on commits def index_commits - days, heads = [], [] + days, heads, times = [], [], [] map = {} commits.reverse.each_with_index do |c,i| @@ -61,6 +60,7 @@ module Gitlab days[i] = c.committed_date map[c.id] = c heads += c.refs unless c.refs.nil? + times[i] = c end heads.select!{|h| h.is_a? Grit::Head or h.is_a? Grit::Remote} @@ -86,9 +86,62 @@ module Gitlab end end + # find parent spaces for not overlap lines + times.each do |c| + c.parent_spaces.concat(find_free_parent_spaces(c, map, times)) + end + days end + def find_free_parent_spaces(commit, map, times) + spaces = [] + + commit.parents.each do |p| + if map.include?(p.id) then + parent = map[p.id] + + range = if commit.time < parent.time then + commit.time..parent.time + else + parent.time..commit.time + end + + space = if commit.space >= parent.space then + find_free_parent_space(range, map, parent.space, 1, commit.space, times) + else + find_free_parent_space(range, map, parent.space, -1, parent.space, times) + end + + mark_reserved(range, space) + spaces << space + end + end + + spaces + end + + def find_free_parent_space(range, map, space_base, space_step, space_default, times) + if is_overlap?(range, times, space_default) then + find_free_space(range, map, space_base, space_step) + else + space_default + end + end + + def is_overlap?(range, times, overlap_space) + range.each do |i| + if i != range.first && + i != range.last && + times[i].space == overlap_space then + + return true; + end + end + + false + end + # Add space mark on commit and its parents # # @param [Graph::Commit] the commit object. @@ -98,8 +151,9 @@ module Gitlab if leaves.empty? return end - @space = find_free_space(leaves, map) - leaves.each{|l| l.space = @space} + time_range = leaves.last.time..leaves.first.time + space = find_free_space(time_range, map, 1, 2) + leaves.each{|l| l.space = space} # and mark it as reserved min_time = leaves.last.time parents = leaves.last.parents.collect @@ -116,7 +170,7 @@ module Gitlab else max_time = parent_time - 1 end - mark_reserved(min_time..max_time, @space) + mark_reserved(min_time..max_time, space) # Visit branching chains leaves.each do |l| @@ -133,28 +187,22 @@ module Gitlab end end - def find_free_space(leaves, map) - time_range = leaves.last.time..leaves.first.time + def find_free_space(time_range, map, space_base, space_step) reserved = [] for day in time_range reserved += @_reserved[day] end - space = base_space(leaves, map) - while (reserved.include? space) || (space == @space) do - space += 1 - end - - space - end - def base_space(leaves, map) - parents = [] - leaves.each do |l| - parents.concat l.parents.collect.select{|p| map.include? p.id and map[p.id].space.nonzero?} + space = space_base + while reserved.include?(space) do + space += space_step + if space <= 0 then + space_step *= -1 + space = space_base + space_step + end end - space = parents.map{|p| map[p.id].space}.max || 0 - space += 1 + space end # Takes most left subtree branch of commits diff --git a/vendor/assets/javascripts/branch-graph.js b/vendor/assets/javascripts/branch-graph.js index 93849c79e80..76494196e43 100644 --- a/vendor/assets/javascripts/branch-graph.js +++ b/vendor/assets/javascripts/branch-graph.js @@ -103,8 +103,9 @@ for (i = 0; i < this.commitCount; i++) { var x = offsetX + 20 * this.commits[i].time - , y = offsetY + 20 * this.commits[i].space - , c; + , y = offsetY + 10 * this.commits[i].space + , c + , ps; // Draw dot r.circle(x, y, 3).attr({ @@ -115,9 +116,11 @@ // Draw lines for (var j = 0, jj = this.commits[i].parents.length; j < jj; j++) { c = this.preparedCommits[this.commits[i].parents[j][0]]; + ps = this.commits[i].parent_spaces[j]; if (c) { var cx = offsetX + 20 * c.time - , cy = offsetY + 20 * c.space; + , cy = offsetY + 10 * c.space + , psy = offsetY + 10 * ps; if (c.space == this.commits[i].space) { r.path([ "M", x, y, @@ -128,13 +131,25 @@ }); } else if (c.space < this.commits[i].space) { - r.path(["M", x - 5, y + .0001, "l-5-2,0,4,5,-2C", x - 5, y, x - 17, y + 2, x - 20, y - 5, "L", cx, y - 5, cx, cy]) + r.path([ + "M", x - 5, y, + "l-5-2,0,4,5,-2", + "L", x - 10, y, + "L", x - 15, psy, + "L", cx + 5, psy, + "L", cx, cy]) .attr({ stroke: this.colors[this.commits[i].space], "stroke-width": 2 }); } else { - r.path(["M", x - 3, y + 6, "l-4,3,4,2,0,-5L", x - 10, y + 20, "L", x - 10, cy, cx, cy]) + r.path([ + "M", x - 3, y + 6, + "l-4,3,4,2,0,-5", + "L", x - 5, y + 10, + "L", x - 10, psy, + "L", cx + 5, psy, + "L", cx, cy]) .attr({ stroke: this.colors[c.space], "stroke-width": 2 -- GitLab From b742f47e89674c7aaae78b6e4174339480594d1f Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Date: Wed, 30 Jan 2013 16:53:18 +0200 Subject: [PATCH 29/55] remove old alert messages --- app/assets/stylesheets/gitlab_bootstrap/buttons.scss | 1 + app/assets/stylesheets/gitlab_bootstrap/common.scss | 7 ++++++- app/views/admin/groups/edit.html.haml | 2 +- app/views/admin/groups/new.html.haml | 2 +- app/views/admin/hooks/index.html.haml | 2 +- app/views/admin/projects/_form.html.haml | 2 +- app/views/admin/projects/members/_form.html.haml | 2 +- app/views/admin/teams/edit.html.haml | 2 +- app/views/admin/teams/members/_form.html.haml | 2 +- app/views/admin/teams/new.html.haml | 2 +- app/views/admin/teams/projects/_form.html.haml | 2 +- app/views/commit/huge_commit.html.haml | 2 +- app/views/commits/_diffs.html.haml | 2 +- app/views/deploy_keys/_form.html.haml | 2 +- app/views/groups/new.html.haml | 2 +- app/views/hooks/index.html.haml | 2 +- app/views/issues/_form.html.haml | 2 +- app/views/keys/_form.html.haml | 2 +- app/views/merge_requests/_form.html.haml | 2 +- app/views/merge_requests/show/_mr_accept.html.haml | 6 +++--- app/views/merge_requests/show/_mr_ci.html.haml | 2 +- app/views/merge_requests/show/_mr_title.html.haml | 2 +- app/views/milestones/_form.html.haml | 2 +- app/views/profiles/account.html.haml | 2 +- app/views/profiles/show.html.haml | 2 +- app/views/projects/_form.html.haml | 2 +- app/views/projects/_new_form.html.haml | 2 +- app/views/protected_branches/index.html.haml | 2 +- app/views/services/_gitlab_ci.html.haml | 2 +- app/views/snippets/_form.html.haml | 2 +- app/views/team_members/_form.html.haml | 2 +- app/views/teams/edit.html.haml | 2 +- app/views/teams/members/_form.html.haml | 2 +- app/views/teams/new.html.haml | 2 +- app/views/teams/projects/_form.html.haml | 2 +- 35 files changed, 42 insertions(+), 36 deletions(-) diff --git a/app/assets/stylesheets/gitlab_bootstrap/buttons.scss b/app/assets/stylesheets/gitlab_bootstrap/buttons.scss index a20c9b1b31e..03497e32d26 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/buttons.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/buttons.scss @@ -67,6 +67,7 @@ @extend .btn-primary; } + &.btn-close, &.btn-remove { @extend .btn-danger; border-color: #BD362F; diff --git a/app/assets/stylesheets/gitlab_bootstrap/common.scss b/app/assets/stylesheets/gitlab_bootstrap/common.scss index fb2f34179b7..e30492677d0 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/common.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/common.scss @@ -86,9 +86,14 @@ /** ALERT MESSAGES **/ .alert-message { @extend .alert; } -.alert-messag.success { @extend .alert-success; } .alert-message.error { @extend .alert-error; } +.alert.alert-disabled { + background: #EEE; + color: #777; + border-color: #DDD; +} + /** AVATARS **/ img.avatar { float: left; margin-right: 12px; width: 40px; border: 1px solid #ddd; padding: 1px; } img.avatar.s16 { width: 16px; height: 16px; margin-right: 6px; } diff --git a/app/views/admin/groups/edit.html.haml b/app/views/admin/groups/edit.html.haml index 6ec520e74b4..dce044956c3 100644 --- a/app/views/admin/groups/edit.html.haml +++ b/app/views/admin/groups/edit.html.haml @@ -2,7 +2,7 @@ %hr = form_for [:admin, @group] do |f| - if @group.errors.any? - .alert-message.block-message.error + .alert.alert-error %span= @group.errors.full_messages.first .clearfix.group_name_holder = f.label :name do diff --git a/app/views/admin/groups/new.html.haml b/app/views/admin/groups/new.html.haml index f8d1dfcf931..60c6fa5ad09 100644 --- a/app/views/admin/groups/new.html.haml +++ b/app/views/admin/groups/new.html.haml @@ -2,7 +2,7 @@ %hr = form_for [:admin, @group] do |f| - if @group.errors.any? - .alert-message.block-message.error + .alert.alert-error %span= @group.errors.full_messages.first .clearfix = f.label :name do diff --git a/app/views/admin/hooks/index.html.haml b/app/views/admin/hooks/index.html.haml index 838296ccf3a..acbf7a108b8 100644 --- a/app/views/admin/hooks/index.html.haml +++ b/app/views/admin/hooks/index.html.haml @@ -7,7 +7,7 @@ = form_for @hook, as: :hook, url: admin_hooks_path, html: { class: 'form-inline' } do |f| -if @hook.errors.any? - .alert-message.block-message.error + .alert.alert-error - @hook.errors.full_messages.each do |msg| %p= msg .clearfix diff --git a/app/views/admin/projects/_form.html.haml b/app/views/admin/projects/_form.html.haml index 6342802c699..ebf69924a25 100644 --- a/app/views/admin/projects/_form.html.haml +++ b/app/views/admin/projects/_form.html.haml @@ -1,6 +1,6 @@ = form_for [:admin, project] do |f| -if project.errors.any? - .alert-message.block-message.error + .alert.alert-error %ul - project.errors.full_messages.each do |msg| %li= msg diff --git a/app/views/admin/projects/members/_form.html.haml b/app/views/admin/projects/members/_form.html.haml index bbd419be576..8041202980d 100644 --- a/app/views/admin/projects/members/_form.html.haml +++ b/app/views/admin/projects/members/_form.html.haml @@ -1,6 +1,6 @@ = form_for @team_member_relation, as: :team_member, url: admin_project_member_path(@project, @member) do |f| -if @team_member_relation.errors.any? - .alert-message.block-message.error + .alert.alert-error %ul - @team_member_relation.errors.full_messages.each do |msg| %li= msg diff --git a/app/views/admin/teams/edit.html.haml b/app/views/admin/teams/edit.html.haml index d024d82381a..9282398ce5b 100644 --- a/app/views/admin/teams/edit.html.haml +++ b/app/views/admin/teams/edit.html.haml @@ -2,7 +2,7 @@ %hr = form_for @team, url: admin_team_path(@team), method: :put do |f| - if @team.errors.any? - .alert-message.block-message.error + .alert.alert-error %span= @team.errors.full_messages.first .clearfix.team_name_holder = f.label :name do diff --git a/app/views/admin/teams/members/_form.html.haml b/app/views/admin/teams/members/_form.html.haml index 098118a645d..f1388aab4bb 100644 --- a/app/views/admin/teams/members/_form.html.haml +++ b/app/views/admin/teams/members/_form.html.haml @@ -1,6 +1,6 @@ = form_tag admin_team_member_path(@team, @member), method: :put do -if @member.errors.any? - .alert-message.block-message.error + .alert.alert-error %ul - @member.errors.full_messages.each do |msg| %li= msg diff --git a/app/views/admin/teams/new.html.haml b/app/views/admin/teams/new.html.haml index 7483f1bf32d..5d55a7975ee 100644 --- a/app/views/admin/teams/new.html.haml +++ b/app/views/admin/teams/new.html.haml @@ -2,7 +2,7 @@ %hr = form_for @team, url: admin_teams_path do |f| - if @team.errors.any? - .alert-message.block-message.error + .alert.alert-error %span= @team.errors.full_messages.first .clearfix = f.label :name do diff --git a/app/views/admin/teams/projects/_form.html.haml b/app/views/admin/teams/projects/_form.html.haml index 9ba406ea125..5b79d518d42 100644 --- a/app/views/admin/teams/projects/_form.html.haml +++ b/app/views/admin/teams/projects/_form.html.haml @@ -1,6 +1,6 @@ = form_tag admin_team_project_path(@team, @project), method: :put do -if @project.errors.any? - .alert-message.block-message.error + .alert.alert-error %ul - @project.errors.full_messages.each do |msg| %li= msg diff --git a/app/views/commit/huge_commit.html.haml b/app/views/commit/huge_commit.html.haml index ba97a7c572c..7f0bcf38037 100644 --- a/app/views/commit/huge_commit.html.haml +++ b/app/views/commit/huge_commit.html.haml @@ -1,3 +1,3 @@ = render "commits/commit_box" -.alert-message.block-message.error +.alert.alert-error %h4 Commit diffs are too big to be displayed diff --git a/app/views/commits/_diffs.html.haml b/app/views/commits/_diffs.html.haml index db9180c4057..07c37d1e8c5 100644 --- a/app/views/commits/_diffs.html.haml +++ b/app/views/commits/_diffs.html.haml @@ -1,5 +1,5 @@ - if @suppress_diff - .alert-message.block-message + .alert.alert-block %p %strong Warning! Large commit with more then #{Commit::DIFF_SAFE_SIZE} files changed. %p To prevent performance issue we rejected diff information. diff --git a/app/views/deploy_keys/_form.html.haml b/app/views/deploy_keys/_form.html.haml index 4deeb0e8e07..5fb83021dc0 100644 --- a/app/views/deploy_keys/_form.html.haml +++ b/app/views/deploy_keys/_form.html.haml @@ -1,7 +1,7 @@ %div = form_for [@project, @key], url: project_deploy_keys_path do |f| -if @key.errors.any? - .alert-message.block-message.error + .alert.alert-error %ul - @key.errors.full_messages.each do |msg| %li= msg diff --git a/app/views/groups/new.html.haml b/app/views/groups/new.html.haml index 224962df013..73be474e278 100644 --- a/app/views/groups/new.html.haml +++ b/app/views/groups/new.html.haml @@ -2,7 +2,7 @@ %hr = form_for @group do |f| - if @group.errors.any? - .alert-message.block-message.error + .alert.alert-error %span= @group.errors.full_messages.first .clearfix = f.label :name do diff --git a/app/views/hooks/index.html.haml b/app/views/hooks/index.html.haml index 334b0f19301..88a5a7dcffe 100644 --- a/app/views/hooks/index.html.haml +++ b/app/views/hooks/index.html.haml @@ -10,7 +10,7 @@ = form_for [@project, @hook], as: :hook, url: project_hooks_path(@project), html: { class: 'form-inline' } do |f| -if @hook.errors.any? - .alert-message.block-message.error + .alert.alert-error - @hook.errors.full_messages.each do |msg| %p= msg .clearfix diff --git a/app/views/issues/_form.html.haml b/app/views/issues/_form.html.haml index 16d1b163ee8..6d7613a700d 100644 --- a/app/views/issues/_form.html.haml +++ b/app/views/issues/_form.html.haml @@ -2,7 +2,7 @@ %h3.page_title= @issue.new_record? ? "New Issue" : "Edit Issue ##{@issue.id}" = form_for [@project, @issue] do |f| -if @issue.errors.any? - .alert-message.block-message.error + .alert.alert-error - @issue.errors.full_messages.each do |msg| %span= msg %br diff --git a/app/views/keys/_form.html.haml b/app/views/keys/_form.html.haml index b60ad7df0ae..fe26216b1d5 100644 --- a/app/views/keys/_form.html.haml +++ b/app/views/keys/_form.html.haml @@ -1,7 +1,7 @@ %div = form_for @key do |f| -if @key.errors.any? - .alert-message.block-message.error + .alert.alert-error %ul - @key.errors.full_messages.each do |msg| %li= msg diff --git a/app/views/merge_requests/_form.html.haml b/app/views/merge_requests/_form.html.haml index 603f30407b9..816c852d24b 100644 --- a/app/views/merge_requests/_form.html.haml +++ b/app/views/merge_requests/_form.html.haml @@ -1,6 +1,6 @@ = form_for [@project, @merge_request], html: { class: "#{controller.action_name}-merge-request form-horizontal" } do |f| -if @merge_request.errors.any? - .alert-message.block-message.error + .alert.alert-error %ul - @merge_request.errors.full_messages.each do |msg| %li= msg diff --git a/app/views/merge_requests/show/_mr_accept.html.haml b/app/views/merge_requests/show/_mr_accept.html.haml index 27f1c2ab8e1..c2c04b863e7 100644 --- a/app/views/merge_requests/show/_mr_accept.html.haml +++ b/app/views/merge_requests/show/_mr_accept.html.haml @@ -1,5 +1,5 @@ - unless can?(current_user, :accept_mr, @project) - .alert-message + .alert %strong Only masters can accept MR @@ -29,14 +29,14 @@ %strong This repository does not have satellite. Ask administrator to fix this issue .automerge_widget.cannot_be_merged{style: "display:none"} - .alert.alert-info + .alert.alert-disabled %span = link_to "Show how to merge", "#", class: "how_to_merge_link btn btn-small padded", title: "How To Merge" %strong This request can't be merged with GitLab. You should do it manually .automerge_widget.unchecked - .alert-message + .alert %strong %i.icon-refresh Checking for ability to automatically merge… diff --git a/app/views/merge_requests/show/_mr_ci.html.haml b/app/views/merge_requests/show/_mr_ci.html.haml index d46b606ef7f..dd1e78a0205 100644 --- a/app/views/merge_requests/show/_mr_ci.html.haml +++ b/app/views/merge_requests/show/_mr_ci.html.haml @@ -23,7 +23,7 @@ = link_to "Build page", ci_build_details_path(@merge_request) .ci_widget - .alert-message + .alert %strong %i.icon-refresh Checking for CI status for #{@merge_request.last_commit_short_sha} diff --git a/app/views/merge_requests/show/_mr_title.html.haml b/app/views/merge_requests/show/_mr_title.html.haml index 1b9b7ca2d26..8119728dcb9 100644 --- a/app/views/merge_requests/show/_mr_title.html.haml +++ b/app/views/merge_requests/show/_mr_title.html.haml @@ -17,7 +17,7 @@ %li= link_to "Email Patches", project_merge_request_path(@project, @merge_request, format: :patch) %li= link_to "Plain Diff", project_merge_request_path(@project, @merge_request, format: :diff) - = link_to 'Close', project_merge_request_path(@project, @merge_request, merge_request: {closed: true }, status_only: true), method: :put, class: "btn grouped danger", title: "Close merge request" + = link_to 'Close', project_merge_request_path(@project, @merge_request, merge_request: {closed: true }, status_only: true), method: :put, class: "btn grouped btn-close", title: "Close merge request" = link_to edit_project_merge_request_path(@project, @merge_request), class: "btn grouped" do %i.icon-edit diff --git a/app/views/milestones/_form.html.haml b/app/views/milestones/_form.html.haml index 2dc90bb89d0..fbaf64a305c 100644 --- a/app/views/milestones/_form.html.haml +++ b/app/views/milestones/_form.html.haml @@ -7,7 +7,7 @@ = form_for [@project, @milestone], html: {class: "new_milestone form-horizontal"} do |f| -if @milestone.errors.any? - .alert-message.block-message.error + .alert.alert-error %ul - @milestone.errors.full_messages.each do |msg| %li= msg diff --git a/app/views/profiles/account.html.haml b/app/views/profiles/account.html.haml index f907cec5b61..2ad000b815b 100644 --- a/app/views/profiles/account.html.haml +++ b/app/views/profiles/account.html.haml @@ -35,7 +35,7 @@ .padded %p.slead After successful password update you will be redirected to login page where you should login with new password -if @user.errors.any? - .alert-message.block-message.error + .alert.alert-error %ul - @user.errors.full_messages.each do |msg| %li= msg diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml index 8a85716adbc..3cf6330cc3c 100644 --- a/app/views/profiles/show.html.haml +++ b/app/views/profiles/show.html.haml @@ -15,7 +15,7 @@ = form_for @user, url: profile_path, method: :put, html: { class: "edit_user form-horizontal" } do |f| -if @user.errors.any? - %div.alert-message.block-message.error + %div.alert.alert-error %ul - @user.errors.full_messages.each do |msg| %li= msg diff --git a/app/views/projects/_form.html.haml b/app/views/projects/_form.html.haml index 254008a42ce..8d3b1aded5c 100644 --- a/app/views/projects/_form.html.haml +++ b/app/views/projects/_form.html.haml @@ -1,6 +1,6 @@ = form_for(@project, remote: true) do |f| - if @project.errors.any? - .alert-message.block-message.error + .alert.alert-error %ul - @project.errors.full_messages.each do |msg| %li= msg diff --git a/app/views/projects/_new_form.html.haml b/app/views/projects/_new_form.html.haml index b3f2b82eb77..185164955fc 100644 --- a/app/views/projects/_new_form.html.haml +++ b/app/views/projects/_new_form.html.haml @@ -1,6 +1,6 @@ = form_for(@project, remote: true) do |f| - if @project.errors.any? - .alert-message.block-message.error + .alert.alert-error %span= @project.errors.full_messages.first .clearfix.project_name_holder = f.label :name do diff --git a/app/views/protected_branches/index.html.haml b/app/views/protected_branches/index.html.haml index 6e7c638eb0f..15644de552f 100644 --- a/app/views/protected_branches/index.html.haml +++ b/app/views/protected_branches/index.html.haml @@ -14,7 +14,7 @@ - if can? current_user, :admin_project, @project = form_for [@project, @protected_branch] do |f| -if @protected_branch.errors.any? - .alert-message.block-message.error + .alert.alert-error %ul - @protected_branch.errors.full_messages.each do |msg| %li= msg diff --git a/app/views/services/_gitlab_ci.html.haml b/app/views/services/_gitlab_ci.html.haml index 732a3d6c3e9..dfde643849e 100644 --- a/app/views/services/_gitlab_ci.html.haml +++ b/app/views/services/_gitlab_ci.html.haml @@ -16,7 +16,7 @@ %hr = form_for(@service, :as => :service, :url => project_service_path(@project, :gitlab_ci), :method => :put) do |f| - if @service.errors.any? - .alert-message.block-message.error + .alert.alert-error %ul - @service.errors.full_messages.each do |msg| %li= msg diff --git a/app/views/snippets/_form.html.haml b/app/views/snippets/_form.html.haml index 3b0b8be6f4d..77162cdcde3 100644 --- a/app/views/snippets/_form.html.haml +++ b/app/views/snippets/_form.html.haml @@ -4,7 +4,7 @@ .snippet-form-holder = form_for [@project, @snippet] do |f| -if @snippet.errors.any? - .alert-message.block-message.error + .alert.alert-error %ul - @snippet.errors.full_messages.each do |msg| %li= msg diff --git a/app/views/team_members/_form.html.haml b/app/views/team_members/_form.html.haml index 1616ea3c229..ee435c84ca2 100644 --- a/app/views/team_members/_form.html.haml +++ b/app/views/team_members/_form.html.haml @@ -3,7 +3,7 @@ %hr = form_for @user_project_relation, as: :team_member, url: project_team_members_path(@project) do |f| -if @user_project_relation.errors.any? - .alert-message.block-message.error + .alert.alert-error %ul - @user_project_relation.errors.full_messages.each do |msg| %li= msg diff --git a/app/views/teams/edit.html.haml b/app/views/teams/edit.html.haml index 2c565230b85..a3b1c734414 100644 --- a/app/views/teams/edit.html.haml +++ b/app/views/teams/edit.html.haml @@ -2,7 +2,7 @@ %hr = form_for @team, url: teams_path do |f| - if @team.errors.any? - .alert-message.block-message.error + .alert.alert-error %span= @team.errors.full_messages.first .clearfix = f.label :name do diff --git a/app/views/teams/members/_form.html.haml b/app/views/teams/members/_form.html.haml index 701eb4f2233..c22ee78305f 100644 --- a/app/views/teams/members/_form.html.haml +++ b/app/views/teams/members/_form.html.haml @@ -1,6 +1,6 @@ = form_tag admin_team_member_path(@team, @member), method: :put do -if @member.errors.any? - .alert-message.block-message.error + .alert.alert-error %ul - @member.errors.full_messages.each do |msg| %li= msg diff --git a/app/views/teams/new.html.haml b/app/views/teams/new.html.haml index c0363fe39a8..38f61c11c0c 100644 --- a/app/views/teams/new.html.haml +++ b/app/views/teams/new.html.haml @@ -2,7 +2,7 @@ %hr = form_for @team, url: teams_path do |f| - if @team.errors.any? - .alert-message.block-message.error + .alert.alert-error %span= @team.errors.full_messages.first .clearfix = f.label :name do diff --git a/app/views/teams/projects/_form.html.haml b/app/views/teams/projects/_form.html.haml index 763d07a1c7e..d2c89b0c36b 100644 --- a/app/views/teams/projects/_form.html.haml +++ b/app/views/teams/projects/_form.html.haml @@ -1,6 +1,6 @@ = form_tag team_project_path(@team, @project), method: :put do -if @project.errors.any? - .alert-message.block-message.error + .alert.alert-error %ul - @project.errors.full_messages.each do |msg| %li= msg -- GitLab From b096ee327598919b2d78a99ce82e6b0107369604 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Date: Wed, 30 Jan 2013 17:01:58 +0200 Subject: [PATCH 30/55] a bit of split up for gitlab-bootstrap --- app/assets/stylesheets/gitlab_bootstrap.scss | 2 + .../stylesheets/gitlab_bootstrap/avatar.scss | 8 ++ .../stylesheets/gitlab_bootstrap/common.scss | 74 ------------------- .../stylesheets/gitlab_bootstrap/nav.scss | 65 ++++++++++++++++ 4 files changed, 75 insertions(+), 74 deletions(-) create mode 100644 app/assets/stylesheets/gitlab_bootstrap/avatar.scss create mode 100644 app/assets/stylesheets/gitlab_bootstrap/nav.scss diff --git a/app/assets/stylesheets/gitlab_bootstrap.scss b/app/assets/stylesheets/gitlab_bootstrap.scss index f53e0e50bab..2ad1bf944a9 100644 --- a/app/assets/stylesheets/gitlab_bootstrap.scss +++ b/app/assets/stylesheets/gitlab_bootstrap.scss @@ -17,6 +17,8 @@ $baseLineHeight: 18px !default; @import "gitlab_bootstrap/variables.scss"; @import "gitlab_bootstrap/fonts.scss"; @import "gitlab_bootstrap/mixins.scss"; +@import "gitlab_bootstrap/avatar.scss"; +@import "gitlab_bootstrap/nav.scss"; @import "gitlab_bootstrap/common.scss"; @import "gitlab_bootstrap/typography.scss"; @import "gitlab_bootstrap/buttons.scss"; diff --git a/app/assets/stylesheets/gitlab_bootstrap/avatar.scss b/app/assets/stylesheets/gitlab_bootstrap/avatar.scss new file mode 100644 index 00000000000..de1fb1551bf --- /dev/null +++ b/app/assets/stylesheets/gitlab_bootstrap/avatar.scss @@ -0,0 +1,8 @@ +/** AVATARS **/ +img.avatar { float: left; margin-right: 12px; width: 40px; border: 1px solid #ddd; padding: 1px; } +img.avatar.s16 { width: 16px; height: 16px; margin-right: 6px; } +img.avatar.s24 { width: 24px; height: 24px; margin-right: 8px; } +img.avatar.s32 { width: 32px; height: 32px; margin-right: 10px; } +img.avatar.s90 { width: 90px; height: 90px; margin-right: 15px; } +img.lil_av { padding-left: 4px; padding-right: 3px; } +img.small { width: 80px; } diff --git a/app/assets/stylesheets/gitlab_bootstrap/common.scss b/app/assets/stylesheets/gitlab_bootstrap/common.scss index e30492677d0..cb292bc711f 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/common.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/common.scss @@ -21,88 +21,14 @@ .light { color: #888 } .tiny { font-weight: normal } -/** PILLS & TABS**/ -.nav-pills { - .active a { - background: $primary_color; - } - - > li > a { - @include border-radius(0); - } - &.nav-stacked { - > li > a { - border-left: 4px solid #EEE; - padding: 12px; - } - > .active > a { - border-color: #29B; - border-radius: 0; - background: #F1F1F1; - color: $style_color; - font-weight: bold; - } - } -} - -.nav-pills > .active > a > i[class^="icon-"] { background: inherit; } - - - -/** - * nav-tabs - * - */ -.nav-tabs > li > a, .nav-pills > li > a { color: $style_color; } -.nav.nav-tabs { - li { - > a { - padding: 8px 20px; - margin-right: 7px; - line-height: 20px; - border-color: #EEE; - color: #888; - border-bottom: 1px solid #ddd; - .badge { - background-color: #eee; - color: #888; - text-shadow: 0 1px 1px #fff; - } - i[class^="icon-"] { - line-height: 14px; - } - } - &.active { - > a { - border-color: #CCC; - border-bottom: 1px solid #fff; - color: #333; - } - } - } - - &.nav-small-tabs > li > a { padding: 6px 9px; } -} /** ALERT MESSAGES **/ -.alert-message { @extend .alert; } -.alert-message.error { @extend .alert-error; } - .alert.alert-disabled { background: #EEE; color: #777; border-color: #DDD; } -/** AVATARS **/ -img.avatar { float: left; margin-right: 12px; width: 40px; border: 1px solid #ddd; padding: 1px; } -img.avatar.s16 { width: 16px; height: 16px; margin-right: 6px; } -img.avatar.s24 { width: 24px; height: 24px; margin-right: 8px; } -img.avatar.s32 { width: 32px; height: 32px; margin-right: 10px; } -img.avatar.s90 { width: 90px; height: 90px; margin-right: 15px; } -img.lil_av { padding-left: 4px; padding-right: 3px; } -img.small { width: 80px; } - /** HELPERS **/ .nothing_here_message { text-align: center; diff --git a/app/assets/stylesheets/gitlab_bootstrap/nav.scss b/app/assets/stylesheets/gitlab_bootstrap/nav.scss new file mode 100644 index 00000000000..2eaef61ca33 --- /dev/null +++ b/app/assets/stylesheets/gitlab_bootstrap/nav.scss @@ -0,0 +1,65 @@ +/** + * nav-pills + * + */ +.nav-pills { + .active a { + background: $primary_color; + } + + > li > a { + @include border-radius(0); + } + &.nav-stacked { + > li > a { + border-left: 4px solid #EEE; + padding: 12px; + } + > .active > a { + border-color: #29B; + border-radius: 0; + background: #F1F1F1; + color: $style_color; + font-weight: bold; + } + } +} + +.nav-pills > .active > a > i[class^="icon-"] { background: inherit; } + + + +/** + * nav-tabs + * + */ +.nav-tabs > li > a, .nav-pills > li > a { color: $style_color; } +.nav.nav-tabs { + li { + > a { + padding: 8px 20px; + margin-right: 7px; + line-height: 20px; + border-color: #EEE; + color: #888; + border-bottom: 1px solid #ddd; + .badge { + background-color: #eee; + color: #888; + text-shadow: 0 1px 1px #fff; + } + i[class^="icon-"] { + line-height: 14px; + } + } + &.active { + > a { + border-color: #CCC; + border-bottom: 1px solid #fff; + color: #333; + } + } + } + + &.nav-small-tabs > li > a { padding: 6px 9px; } +} -- GitLab From 560985b0f685f810a1ce16ae206fbbf81b8fb704 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Date: Wed, 30 Jan 2013 17:07:44 +0200 Subject: [PATCH 31/55] Fixed link_to_member --- app/helpers/projects_helper.rb | 2 +- app/models/users_project.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/projects_helper.rb b/app/helpers/projects_helper.rb index 4f0a80710cb..05303e86ae8 100644 --- a/app/helpers/projects_helper.rb +++ b/app/helpers/projects_helper.rb @@ -43,7 +43,7 @@ module ProjectsHelper tm = project.team_member_by_id(author) if tm - link_to author_html, project_team_member_path(project, tm), class: "author_link" + link_to author_html, project_team_member_path(project, tm.user_username), class: "author_link" else author_html end.html_safe diff --git a/app/models/users_project.rb b/app/models/users_project.rb index 183878cb30c..94edfd9eddf 100644 --- a/app/models/users_project.rb +++ b/app/models/users_project.rb @@ -33,7 +33,7 @@ class UsersProject < ActiveRecord::Base validates :project_access, inclusion: { in: [GUEST, REPORTER, DEVELOPER, MASTER] }, presence: true validates :project, presence: true - delegate :name, :email, to: :user, prefix: true + delegate :name, :username, :email, to: :user, prefix: true scope :guests, where(project_access: GUEST) scope :reporters, where(project_access: REPORTER) -- GitLab From bfd00caff3010100f367ed60d73f065cc8b21f06 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Date: Wed, 30 Jan 2013 17:13:05 +0200 Subject: [PATCH 32/55] Few usability improvments --- app/views/projects/_project_head.html.haml | 8 ++++---- app/views/team_members/_form.html.haml | 2 +- app/views/team_members/_show.html.haml | 2 +- features/steps/project/project_team_management.rb | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/app/views/projects/_project_head.html.haml b/app/views/projects/_project_head.html.haml index cc215502859..b8c88853a62 100644 --- a/app/views/projects/_project_head.html.haml +++ b/app/views/projects/_project_head.html.haml @@ -13,19 +13,19 @@ = link_to 'Snippets', project_snippets_path(@project), class: "snippets-tab tab" - if can? current_user, :admin_project, @project - = nav_link(controller: :deploy_keys, html_options: {class: 'right'}) do + = nav_link(controller: :deploy_keys, html_options: {class: 'pull-right'}) do = link_to project_deploy_keys_path(@project) do %span Deploy Keys - = nav_link(controller: :hooks, html_options: {class: 'right'}) do + = nav_link(controller: :hooks, html_options: {class: 'pull-right'}) do = link_to project_hooks_path(@project) do %span Hooks - = nav_link(controller: :services, html_options: {class: 'right'}) do + = nav_link(controller: :services, html_options: {class: 'pull-right'}) do = link_to project_services_path(@project) do %span Services - = nav_link(path: 'projects#edit', html_options: {class: 'right'}) do + = nav_link(path: 'projects#edit', html_options: {class: 'pull-right'}) do = link_to edit_project_path(@project), class: "stat-tab tab " do %i.icon-edit Edit diff --git a/app/views/team_members/_form.html.haml b/app/views/team_members/_form.html.haml index ee435c84ca2..05bea2db87e 100644 --- a/app/views/team_members/_form.html.haml +++ b/app/views/team_members/_form.html.haml @@ -19,5 +19,5 @@ .input= select_tag :project_access, options_for_select(Project.access_options, @user_project_relation.project_access), class: "project-access-select chosen" .actions - = f.submit 'Save', class: "btn btn-save" + = f.submit 'Add users', class: "btn btn-create" = link_to "Cancel", project_team_index_path(@project), class: "btn btn-cancel" diff --git a/app/views/team_members/_show.html.haml b/app/views/team_members/_show.html.haml index b59bb7b1e52..3df2caed64a 100644 --- a/app/views/team_members/_show.html.haml +++ b/app/views/team_members/_show.html.haml @@ -19,7 +19,7 @@ - if current_user == user %span.btn.disabled This is you! - if @project.namespace_owner == user - %span.btn.disabled.btn-success Owner + %span.btn.disabled Owner - elsif user.blocked %span.btn.disabled.blocked Blocked - elsif allow_admin diff --git a/features/steps/project/project_team_management.rb b/features/steps/project/project_team_management.rb index 91b3ffeee9a..19352fe0ab8 100644 --- a/features/steps/project/project_team_management.rb +++ b/features/steps/project/project_team_management.rb @@ -24,7 +24,7 @@ class ProjectTeamManagement < Spinach::FeatureSteps select user.name, :from => "user_ids" select "Reporter", :from => "project_access" end - click_button "Save" + click_button "Add users" end Then 'I should see "Mike" in team list as "Reporter"' do -- GitLab From f8a2db53417a345d78d8e6b78367d5bbb9bb601b Mon Sep 17 00:00:00 2001 From: Sato Hiroyuki <sathiroyuki@gmail.com> Date: Thu, 31 Jan 2013 10:37:23 +0900 Subject: [PATCH 33/55] Displaying commit on a new window, when clicking commit on network graph. --- vendor/assets/javascripts/branch-graph.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor/assets/javascripts/branch-graph.js b/vendor/assets/javascripts/branch-graph.js index 93849c79e80..2fc39423b41 100644 --- a/vendor/assets/javascripts/branch-graph.js +++ b/vendor/assets/javascripts/branch-graph.js @@ -260,7 +260,7 @@ cursor: "pointer" }) .click(function(){ - window.location = options.commit_url.replace('%s', commit.id); + window.open(options.commit_url.replace('%s', commit.id), '_blank'); }) .hover(function(){ this.tooltip = r.commitTooltip(x, y + 5, commit); -- GitLab From ad33c398008d9a2ec4a900c1d54f678a47de2cdd Mon Sep 17 00:00:00 2001 From: Sato Hiroyuki <sathiroyuki@gmail.com> Date: Thu, 31 Jan 2013 13:22:08 +0900 Subject: [PATCH 34/55] Fix wrong path of features. --- features/steps/project/project_network_graph.rb | 2 +- features/steps/shared/paths.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/features/steps/project/project_network_graph.rb b/features/steps/project/project_network_graph.rb index 77149bfe2c3..f26deff9367 100644 --- a/features/steps/project/project_network_graph.rb +++ b/features/steps/project/project_network_graph.rb @@ -14,6 +14,6 @@ class ProjectNetworkGraph < Spinach::FeatureSteps Gitlab::Graph::JsonBuilder.stub(max_count: 10) project = Project.find_by_name("Shop") - visit graph_project_path(project) + visit project_graph_path(project, "master") end end diff --git a/features/steps/shared/paths.rb b/features/steps/shared/paths.rb index 42ef40d6b95..97adfd13f30 100644 --- a/features/steps/shared/paths.rb +++ b/features/steps/shared/paths.rb @@ -141,7 +141,7 @@ module SharedPaths # Stub Graph::JsonBuilder max_size to speed up test (10 commits vs. 650) Gitlab::Graph::JsonBuilder.stub(max_count: 10) - visit graph_project_path(@project) + visit project_graph_path(@project, root_ref) end Given "I visit my project's issues page" do -- GitLab From 9da7b2e8d8ed08cb193af2babf150cb8c7715f80 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Date: Thu, 31 Jan 2013 08:42:11 +0200 Subject: [PATCH 35/55] add specs for api -> merge request notes --- spec/requests/api/notes_spec.rb | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/spec/requests/api/notes_spec.rb b/spec/requests/api/notes_spec.rb index ae4fc111f63..ee99d85df4d 100644 --- a/spec/requests/api/notes_spec.rb +++ b/spec/requests/api/notes_spec.rb @@ -6,8 +6,10 @@ describe Gitlab::API do let(:user) { create(:user) } let!(:project) { create(:project, namespace: user.namespace ) } let!(:issue) { create(:issue, project: project, author: user) } + let!(:merge_request) { create(:merge_request, project: project, author: user) } let!(:snippet) { create(:snippet, project: project, author: user) } let!(:issue_note) { create(:note, noteable: issue, project: project, author: user) } + let!(:merge_request_note) { create(:note, noteable: merge_request, project: project, author: user) } let!(:snippet_note) { create(:note, noteable: snippet, project: project, author: user) } let!(:wall_note) { create(:note, project: project, author: user) } before { project.team << [user, :reporter] } @@ -64,6 +66,15 @@ describe Gitlab::API do json_response.first['body'].should == snippet_note.note end end + + context "when noteable is a Merge Request" do + it "should return an array of merge_requests notes" do + get api("/projects/#{project.id}/merge_requests/#{merge_request.id}/notes", user) + response.status.should == 200 + json_response.should be_an Array + json_response.first['body'].should == merge_request_note.note + end + end end describe "GET /projects/:id/noteable/:noteable_id/notes/:note_id" do -- GitLab From bcc0eed3e4565a346d15a17a90722ebb0c3cefab Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Date: Thu, 31 Jan 2013 08:46:59 +0200 Subject: [PATCH 36/55] missing doc for api --- doc/api/notes.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/doc/api/notes.md b/doc/api/notes.md index bb33efb8c25..a4ba2826076 100644 --- a/doc/api/notes.md +++ b/doc/api/notes.md @@ -30,6 +30,19 @@ Parameters: + `id` (required) - The ID of a project +### List merge request notes + +Get a list of merge request notes. + +``` +GET /projects/:id/merge_requests/:merge_request_id/notes +``` + +Parameters: + ++ `id` (required) - The ID of a project ++ `merge_request_id` (required) - The ID of an merge request + ### List issue notes Get a list of issue notes. -- GitLab From 563c55eb7e4db988048bd1b2675ee73e0e601402 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Date: Thu, 31 Jan 2013 08:55:31 +0200 Subject: [PATCH 37/55] fix pagination issue --- app/views/kaminari/admin/_paginator.html.haml | 2 +- app/views/kaminari/gitlab/_paginator.html.haml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/kaminari/admin/_paginator.html.haml b/app/views/kaminari/admin/_paginator.html.haml index 40b330feb3b..6f9fb332261 100644 --- a/app/views/kaminari/admin/_paginator.html.haml +++ b/app/views/kaminari/admin/_paginator.html.haml @@ -10,7 +10,7 @@ %ul = prev_page_tag unless current_page.first? - each_page do |page| - - if page.left_outer? || page.pull-right_outer? || page.inside_window? + - if page.left_outer? || page.right_outer? || page.inside_window? = page_tag page - elsif !page.was_truncated? = gap_tag diff --git a/app/views/kaminari/gitlab/_paginator.html.haml b/app/views/kaminari/gitlab/_paginator.html.haml index 2fe4c183d15..6dd5a5782a2 100644 --- a/app/views/kaminari/gitlab/_paginator.html.haml +++ b/app/views/kaminari/gitlab/_paginator.html.haml @@ -9,7 +9,7 @@ %nav.gitlab_pagination = prev_page_tag - each_page do |page| - - if page.left_outer? || page.pull-right_outer? || page.inside_window? + - if page.left_outer? || page.right_outer? || page.inside_window? = page_tag page - elsif !page.was_truncated? = gap_tag -- GitLab From 193a5624b2daf4d638c382b88001d06535f57f2d Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Date: Thu, 31 Jan 2013 09:11:35 +0200 Subject: [PATCH 38/55] add path and path_with_namespace to api project entity --- app/models/project.rb | 2 +- app/models/user.rb | 2 ++ app/models/user_team.rb | 12 ++++++++++++ app/models/user_team_project_relationship.rb | 12 ++++++++++++ app/models/user_team_user_relationship.rb | 13 +++++++++++++ ...130131070232_remove_private_flag_from_project.rb | 9 +++++++++ db/schema.rb | 3 +-- doc/api/projects.md | 6 ++++++ lib/api/entities.rb | 1 + spec/factories/user_team_project_relationships.rb | 12 ++++++++++++ spec/factories/user_team_user_relationships.rb | 13 +++++++++++++ spec/factories/user_teams.rb | 12 ++++++++++++ spec/models/project_spec.rb | 3 +-- spec/models/user_spec.rb | 2 ++ spec/models/user_team_project_relationship_spec.rb | 12 ++++++++++++ spec/models/user_team_spec.rb | 12 ++++++++++++ spec/models/user_team_user_relationship_spec.rb | 13 +++++++++++++ 17 files changed, 134 insertions(+), 5 deletions(-) create mode 100644 db/migrate/20130131070232_remove_private_flag_from_project.rb diff --git a/app/models/project.rb b/app/models/project.rb index dde15927808..6a3d7ab15d2 100644 --- a/app/models/project.rb +++ b/app/models/project.rb @@ -8,7 +8,6 @@ # description :text # created_at :datetime not null # updated_at :datetime not null -# private_flag :boolean default(TRUE), not null # creator_id :integer # default_branch :string(255) # issues_enabled :boolean default(TRUE), not null @@ -16,6 +15,7 @@ # merge_requests_enabled :boolean default(TRUE), not null # wiki_enabled :boolean default(TRUE), not null # namespace_id :integer +# public :boolean default(FALSE), not null # require "grit" diff --git a/app/models/user.rb b/app/models/user.rb index 5a95deec53d..5b0df09a439 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -31,6 +31,8 @@ # extern_uid :string(255) # provider :string(255) # username :string(255) +# can_create_group :boolean default(TRUE), not null +# can_create_team :boolean default(TRUE), not null # class User < ActiveRecord::Base diff --git a/app/models/user_team.rb b/app/models/user_team.rb index b28a6a041ac..dc8cf9eeb22 100644 --- a/app/models/user_team.rb +++ b/app/models/user_team.rb @@ -1,3 +1,15 @@ +# == Schema Information +# +# Table name: user_teams +# +# id :integer not null, primary key +# name :string(255) +# path :string(255) +# owner_id :integer +# created_at :datetime not null +# updated_at :datetime not null +# + class UserTeam < ActiveRecord::Base attr_accessible :name, :owner_id, :path diff --git a/app/models/user_team_project_relationship.rb b/app/models/user_team_project_relationship.rb index 1b0368c7ecc..a7aa88970c7 100644 --- a/app/models/user_team_project_relationship.rb +++ b/app/models/user_team_project_relationship.rb @@ -1,3 +1,15 @@ +# == Schema Information +# +# Table name: user_team_project_relationships +# +# id :integer not null, primary key +# project_id :integer +# user_team_id :integer +# greatest_access :integer +# created_at :datetime not null +# updated_at :datetime not null +# + class UserTeamProjectRelationship < ActiveRecord::Base attr_accessible :greatest_access, :project_id, :user_team_id diff --git a/app/models/user_team_user_relationship.rb b/app/models/user_team_user_relationship.rb index 63bdc49e5b6..1f7e2625f5f 100644 --- a/app/models/user_team_user_relationship.rb +++ b/app/models/user_team_user_relationship.rb @@ -1,3 +1,16 @@ +# == Schema Information +# +# Table name: user_team_user_relationships +# +# id :integer not null, primary key +# user_id :integer +# user_team_id :integer +# group_admin :boolean +# permission :integer +# created_at :datetime not null +# updated_at :datetime not null +# + class UserTeamUserRelationship < ActiveRecord::Base attr_accessible :group_admin, :permission, :user_id, :user_team_id diff --git a/db/migrate/20130131070232_remove_private_flag_from_project.rb b/db/migrate/20130131070232_remove_private_flag_from_project.rb new file mode 100644 index 00000000000..5754db11558 --- /dev/null +++ b/db/migrate/20130131070232_remove_private_flag_from_project.rb @@ -0,0 +1,9 @@ +class RemovePrivateFlagFromProject < ActiveRecord::Migration + def up + remove_column :projects, :private_flag + end + + def down + add_column :projects, :private_flag, :boolean, default: true, null: false + end +end diff --git a/db/schema.rb b/db/schema.rb index 144f4a57036..0f07d2bc8c5 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended to check this file into your version control system. -ActiveRecord::Schema.define(:version => 20130125090214) do +ActiveRecord::Schema.define(:version => 20130131070232) do create_table "events", :force => true do |t| t.string "target_type" @@ -147,7 +147,6 @@ ActiveRecord::Schema.define(:version => 20130125090214) do t.text "description" t.datetime "created_at", :null => false t.datetime "updated_at", :null => false - t.boolean "private_flag", :default => true, :null => false t.integer "creator_id" t.string "default_branch" t.boolean "issues_enabled", :default => true, :null => false diff --git a/doc/api/projects.md b/doc/api/projects.md index 411286750f8..82bb0c0d561 100644 --- a/doc/api/projects.md +++ b/doc/api/projects.md @@ -22,6 +22,8 @@ GET /projects "created_at": "2012-05-23T08:00:58Z" }, "private": true, + "path": "rails", + "path_with_namespace": "rails/rails", "issues_enabled": false, "merge_requests_enabled": false, "wall_enabled": true, @@ -42,6 +44,8 @@ GET /projects "created_at": "2012-05-23T08:00:58Z" }, "private": true, + "path": "gitlab", + "path_with_namespace": "randx/gitlab", "issues_enabled": true, "merge_requests_enabled": true, "wall_enabled": true, @@ -78,6 +82,8 @@ Parameters: "created_at": "2012-05-23T08:00:58Z" }, "private": true, + "path": "gitlab", + "path_with_namespace": "randx/gitlab", "issues_enabled": true, "merge_requests_enabled": true, "wall_enabled": true, diff --git a/lib/api/entities.rb b/lib/api/entities.rb index 80e2954a344..3637464676b 100644 --- a/lib/api/entities.rb +++ b/lib/api/entities.rb @@ -21,6 +21,7 @@ module Gitlab expose :id, :name, :description, :default_branch expose :owner, using: Entities::UserBasic expose :private_flag, as: :private + expose :path, :path_with_namespace expose :issues_enabled, :merge_requests_enabled, :wall_enabled, :wiki_enabled, :created_at expose :namespace end diff --git a/spec/factories/user_team_project_relationships.rb b/spec/factories/user_team_project_relationships.rb index 93c7b57d0fa..e900d86c2e4 100644 --- a/spec/factories/user_team_project_relationships.rb +++ b/spec/factories/user_team_project_relationships.rb @@ -1,3 +1,15 @@ +# == Schema Information +# +# Table name: user_team_project_relationships +# +# id :integer not null, primary key +# project_id :integer +# user_team_id :integer +# greatest_access :integer +# created_at :datetime not null +# updated_at :datetime not null +# + # Read about factories at https://github.com/thoughtbot/factory_girl FactoryGirl.define do diff --git a/spec/factories/user_team_user_relationships.rb b/spec/factories/user_team_user_relationships.rb index 55179f9a45b..8c729dd8751 100644 --- a/spec/factories/user_team_user_relationships.rb +++ b/spec/factories/user_team_user_relationships.rb @@ -1,3 +1,16 @@ +# == Schema Information +# +# Table name: user_team_user_relationships +# +# id :integer not null, primary key +# user_id :integer +# user_team_id :integer +# group_admin :boolean +# permission :integer +# created_at :datetime not null +# updated_at :datetime not null +# + # Read about factories at https://github.com/thoughtbot/factory_girl FactoryGirl.define do diff --git a/spec/factories/user_teams.rb b/spec/factories/user_teams.rb index f4fe45cbb8a..1a9ae8e885c 100644 --- a/spec/factories/user_teams.rb +++ b/spec/factories/user_teams.rb @@ -1,3 +1,15 @@ +# == Schema Information +# +# Table name: user_teams +# +# id :integer not null, primary key +# name :string(255) +# path :string(255) +# owner_id :integer +# created_at :datetime not null +# updated_at :datetime not null +# + # Read about factories at https://github.com/thoughtbot/factory_girl FactoryGirl.define do diff --git a/spec/models/project_spec.rb b/spec/models/project_spec.rb index 17bc988bf05..6e67ca8233d 100644 --- a/spec/models/project_spec.rb +++ b/spec/models/project_spec.rb @@ -8,7 +8,6 @@ # description :text # created_at :datetime not null # updated_at :datetime not null -# private_flag :boolean default(TRUE), not null # creator_id :integer # default_branch :string(255) # issues_enabled :boolean default(TRUE), not null @@ -16,6 +15,7 @@ # merge_requests_enabled :boolean default(TRUE), not null # wiki_enabled :boolean default(TRUE), not null # namespace_id :integer +# public :boolean default(FALSE), not null # require 'spec_helper' @@ -42,7 +42,6 @@ describe Project do describe "Mass assignment" do it { should_not allow_mass_assignment_of(:namespace_id) } it { should_not allow_mass_assignment_of(:creator_id) } - it { should_not allow_mass_assignment_of(:private_flag) } end describe "Validation" do diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rb index 2ca82edf74e..8ab0a0343bb 100644 --- a/spec/models/user_spec.rb +++ b/spec/models/user_spec.rb @@ -31,6 +31,8 @@ # extern_uid :string(255) # provider :string(255) # username :string(255) +# can_create_group :boolean default(TRUE), not null +# can_create_team :boolean default(TRUE), not null # require 'spec_helper' diff --git a/spec/models/user_team_project_relationship_spec.rb b/spec/models/user_team_project_relationship_spec.rb index 81051d59971..86150cf305f 100644 --- a/spec/models/user_team_project_relationship_spec.rb +++ b/spec/models/user_team_project_relationship_spec.rb @@ -1,3 +1,15 @@ +# == Schema Information +# +# Table name: user_team_project_relationships +# +# id :integer not null, primary key +# project_id :integer +# user_team_id :integer +# greatest_access :integer +# created_at :datetime not null +# updated_at :datetime not null +# + require 'spec_helper' describe UserTeamProjectRelationship do diff --git a/spec/models/user_team_spec.rb b/spec/models/user_team_spec.rb index 2d1b99db6f8..76d47f41498 100644 --- a/spec/models/user_team_spec.rb +++ b/spec/models/user_team_spec.rb @@ -1,3 +1,15 @@ +# == Schema Information +# +# Table name: user_teams +# +# id :integer not null, primary key +# name :string(255) +# path :string(255) +# owner_id :integer +# created_at :datetime not null +# updated_at :datetime not null +# + require 'spec_helper' describe UserTeam do diff --git a/spec/models/user_team_user_relationship_spec.rb b/spec/models/user_team_user_relationship_spec.rb index 309f1975e51..981ad1e8873 100644 --- a/spec/models/user_team_user_relationship_spec.rb +++ b/spec/models/user_team_user_relationship_spec.rb @@ -1,3 +1,16 @@ +# == Schema Information +# +# Table name: user_team_user_relationships +# +# id :integer not null, primary key +# user_id :integer +# user_team_id :integer +# group_admin :boolean +# permission :integer +# created_at :datetime not null +# updated_at :datetime not null +# + require 'spec_helper' describe UserTeamUserRelationship do -- GitLab From 315fd7d746aebe3456d5cc87caf0416cb83ea671 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Date: Thu, 31 Jan 2013 10:08:20 +0200 Subject: [PATCH 39/55] fix routing specs --- spec/routing/project_routing_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/routing/project_routing_spec.rb b/spec/routing/project_routing_spec.rb index 6171141648c..f94bedc79a1 100644 --- a/spec/routing/project_routing_spec.rb +++ b/spec/routing/project_routing_spec.rb @@ -76,7 +76,7 @@ describe ProjectsController, "routing" do end it "to #graph" do - get("/gitlabhq/graph").should route_to('projects#graph', id: 'gitlabhq') + get("/gitlabhq/graph/master").should route_to('graph#show', project_id: 'gitlabhq', id: 'master') end it "to #files" do -- GitLab From 41332212005d2a6d2d2131bc30c29bd29b81453e Mon Sep 17 00:00:00 2001 From: Sato Hiroyuki <sathiroyuki@gmail.com> Date: Thu, 31 Jan 2013 17:29:36 +0900 Subject: [PATCH 40/55] Fix bug of network graph(#2847) and trivial code clean up. --- lib/gitlab/graph/json_builder.rb | 23 +++++++++++++++-------- vendor/assets/javascripts/branch-graph.js | 2 +- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/lib/gitlab/graph/json_builder.rb b/lib/gitlab/graph/json_builder.rb index 90d384449f5..4b3687e06c3 100644 --- a/lib/gitlab/graph/json_builder.rb +++ b/lib/gitlab/graph/json_builder.rb @@ -109,9 +109,9 @@ module Gitlab end space = if commit.space >= parent.space then - find_free_parent_space(range, map, parent.space, 1, commit.space, times) + find_free_parent_space(range, parent.space, 1, commit.space, times) else - find_free_parent_space(range, map, parent.space, -1, parent.space, times) + find_free_parent_space(range, parent.space, -1, parent.space, times) end mark_reserved(range, space) @@ -122,9 +122,9 @@ module Gitlab spaces end - def find_free_parent_space(range, map, space_base, space_step, space_default, times) + def find_free_parent_space(range, space_base, space_step, space_default, times) if is_overlap?(range, times, space_default) then - find_free_space(range, map, space_base, space_step) + find_free_space(range, space_base, space_step) else space_default end @@ -152,11 +152,9 @@ module Gitlab if leaves.empty? return end - time_range = leaves.last.time..leaves.first.time - space = find_free_space(time_range, map, 1, 2) - leaves.each{|l| l.space = space} # and mark it as reserved min_time = leaves.last.time + max_space = 1 parents = leaves.last.parents.collect parents.each do |p| if map.include? p.id @@ -164,6 +162,9 @@ module Gitlab if parent.time < min_time min_time = parent.time end + if max_space < parent.space then + max_space = parent.space + end end end if parent_time.nil? @@ -171,6 +172,11 @@ module Gitlab else max_time = parent_time - 1 end + + time_range = leaves.last.time..leaves.first.time + space = find_free_space(time_range, max_space, 2) + leaves.each{|l| l.space = space} + mark_reserved(min_time..max_time, space) # Visit branching chains @@ -188,11 +194,12 @@ module Gitlab end end - def find_free_space(time_range, map, space_base, space_step) + def find_free_space(time_range, space_base, space_step) reserved = [] for day in time_range reserved += @_reserved[day] end + reserved.uniq! space = space_base while reserved.include?(space) do diff --git a/vendor/assets/javascripts/branch-graph.js b/vendor/assets/javascripts/branch-graph.js index 4ca8680416b..7929d3b2a14 100644 --- a/vendor/assets/javascripts/branch-graph.js +++ b/vendor/assets/javascripts/branch-graph.js @@ -122,7 +122,7 @@ var cx = offsetX + 20 * c.time , cy = offsetY + 10 * c.space , psy = offsetY + 10 * ps; - if (c.space == this.commits[i].space) { + if (c.space == this.commits[i].space && c.space == ps) { r.path([ "M", x, y, "L", cx, cy -- GitLab From 130f60d55b13682cc4ca4cba390535dc10dbca07 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Date: Thu, 31 Jan 2013 11:22:06 +0200 Subject: [PATCH 41/55] a bit of restyling. Replace some images with icons. Simplify note form --- app/assets/images/home_icon.PNG | Bin 596 -> 0 bytes app/assets/images/icon-attachment.png | Bin 450 -> 0 bytes app/assets/javascripts/notes.js | 4 +- app/assets/stylesheets/common.scss | 4 -- app/assets/stylesheets/sections/nav.scss | 12 ++-- app/assets/stylesheets/sections/notes.scss | 58 +++++-------------- app/views/layouts/admin.html.haml | 3 +- app/views/layouts/application.html.haml | 3 +- app/views/layouts/group.html.haml | 3 +- app/views/layouts/profile.html.haml | 3 +- app/views/layouts/project_resource.html.haml | 3 +- app/views/layouts/user_team.html.haml | 3 +- app/views/notes/_form.html.haml | 32 +++++----- app/views/notes/_note.html.haml | 2 +- 14 files changed, 50 insertions(+), 80 deletions(-) delete mode 100644 app/assets/images/home_icon.PNG delete mode 100644 app/assets/images/icon-attachment.png diff --git a/app/assets/images/home_icon.PNG b/app/assets/images/home_icon.PNG deleted file mode 100644 index b1d60d5935760d7f7c448a6ea3e7270fe405a664..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 596 zcmV-a0;~OrP)<h;3K|Lk000e1NJLTq000sI000sQ1^@s6R?d!B00001b5ch_0Itp) z=>Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyV_ z4K@a3G(t}R00GoVL_t(I%bk-wXjMTJgul5yMH`8gAo!CY*xAX$Qna`S6)}aD3N`^d z6%@6Q7+VVwA&qHN5Y%>WX~aSiVj4ljM(~G}Hez1P8;k6d%{4#bsrInv&d$u43+q%w zbRuFXpWAnT&RPQi+Z{=hz<%IlO6hZ5*CUdS0Pj;uF9!3~8e}R-kAO44K43N?woB>) zlfda^!z)pZh#kPR?W4AD0oQ;}z*pdK9`BdmcFHEDL_~}L)4(=KSAiSAX5a#F0yqcQ zHh(cHm;~?+n6o_rOaMa}=pHZw+y*3RPpL$8UDGrTbzPqV9!q+e8C_{h&nzBDdYb{C zr<4u>C?Ylimw|EMA@B{jWZRN{0P`7V1F$u3`Wf&VxDL$NK3>@#wmlA<1$F@!0Rysq z)Aj+NYkL&vWphS>G26#%@0PSvh0a$%cOXF$z<JwKT53jsH`%X2EvA$@?ez~2HjzQF zJtpa??I*xpU}Gz53lXumz5c~^A|>6ieP2?Q8O;J)O8*CWs@D0{`c2dHQ%b*pg?4sU zP4)_<<plNLK>u7-OYf>>o3^yFFU|faX|4e50N;!Io}>@iTxY2j&}#$LOJP>|;(TGy i7vSJvCTGpSPk`SQOT{AUHr@FE0000<MNUMnLSTZy7W7g8 diff --git a/app/assets/images/icon-attachment.png b/app/assets/images/icon-attachment.png deleted file mode 100644 index 168ad8dce3765ac98968def2101ba9f298e9f637..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 450 zcmV;z0X_bSP)<h;3K|Lk000e1NJLTq000mG000mO1^@s6AM^iV0000PbVXQnQ*UN; zcVTj606}DLVr3vnZDD6+Qe|Oed2z{QJOBUzWJyFpRCwBalg~#4VHn4!F_!*=PSGh! zr_v!(tX3(~Eh42+iZ0z!qI65ETcngtS)#R(D6ObdI>ZvO_7I&qMMNxp9=^*Mv+v8t z?9M#%dEe*9G-WawkClQASb=7EhXSla&2y|k*KNIg0#DEl^Uw;@E{U(J1@Ay8$ujiA z5FENr;75MH#h(2@8b)1`y1;f_gBJbofGTu>6=?$YT!K~jf=A_Tr&)qrL^1=rjRe06 z`jDgz4kS5_NakQOsSEWr2A7hgC8?<fp`PFB-d0>tRqw~)0v;qef<H-mU<7Vd<ZM(B z>O~u*N#$RcoWi2on$;#nOF1gI))9-E%qiu64<*$hRO}thTIc*&4NBT^7|t|>3s8p6 z*sNSx$AW~`KEt4jmDfoM32~NA#cwcRWsP#L>XM2*Z&!NzzGKWQ(5GN4=72sj`{-Wa s+$K2i-0M>($*GOs65G933-}jc09s5_9C^sJwg3PC07*qoM6N<$f`59&Qvd(} diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index 8a7e08dd0e8..919c6b7f4a2 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -20,12 +20,12 @@ var NoteList = { if(NoteList.reversed) { var form = $(".js-main-target-form"); - form.find(".buttons, .note_options").hide(); + form.find(".note-form-actions").hide(); var textarea = form.find(".js-note-text"); textarea.css("height", "40px"); textarea.on("focus", function(){ textarea.css("height", "80px"); - form.find(".buttons, .note_options").show(); + form.find(".note-form-actions").show(); }); } diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 1884c39bc61..c9a11d0a1ac 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -338,10 +338,6 @@ li.note { li { border-bottom:none !important; } - .attachment { - padding-left: 20px; - background:url("icon-attachment.png") no-repeat left center; - } } } diff --git a/app/assets/stylesheets/sections/nav.scss b/app/assets/stylesheets/sections/nav.scss index bc19bc75a67..50091cd7365 100644 --- a/app/assets/stylesheets/sections/nav.scss +++ b/app/assets/stylesheets/sections/nav.scss @@ -6,8 +6,7 @@ ul.main_menu { margin: auto; margin: 30px 0; margin-top: 10px; - border-bottom: 1px solid #DDD; - height: 37px; + height: 38px; position: relative; overflow: hidden; .count { @@ -33,6 +32,7 @@ ul.main_menu { margin: 0; display: table-cell; width: 1%; + border-bottom: 2px solid #EEE; &.active { border-bottom: 2px solid #474D57; a { @@ -42,10 +42,8 @@ ul.main_menu { &.home { a { - background: url(home_icon.PNG) no-repeat center center; - text-indent:-9999px; - min-width: 20px; - img { + i { + font-size: 20px; position: relative; top: 4px; } @@ -56,7 +54,7 @@ ul.main_menu { display: block; text-align: center; font-weight: normal; - height: 35px; + height: 36px; line-height: 36px; color: #777; text-shadow: 0 1px 1px white; diff --git a/app/assets/stylesheets/sections/notes.scss b/app/assets/stylesheets/sections/notes.scss index 895e9dfa4e3..648cb210e9c 100644 --- a/app/assets/stylesheets/sections/notes.scss +++ b/app/assets/stylesheets/sections/notes.scss @@ -81,14 +81,6 @@ ul.notes { .attachment { font-size: 14px; margin-top: -20px; - - .icon-attachment { - @extend .icon-paper-clip; - font-size: 24px; - position: relative; - text-align: right; - top: 6px; - } } .note-body { margin-left: 45px; @@ -229,11 +221,6 @@ ul.notes { .discussion { .new_note { margin: 8px 5px 8px 0; - - .note_options { - // because of the smaller width and the extra "cancel" button - margin-top: 8px; - } } } .new_note { @@ -246,37 +233,6 @@ ul.notes { .clearfix { margin-bottom: 0; } - .note_options { - h6 { - @extend .left; - line-height: 20px; - padding-right: 16px; - padding-bottom: 16px; - } - label { - padding: 0; - } - - .attachment { - @extend .pull-right; - position: relative; - width: 350px; - height: 50px; - margin:0 0 5px !important; - - // hide the actual file field - input { - display: none; - } - - .choose-btn { - float: right; - } - } - .notify_options { - @extend .pull-right; - } - } .note_text_and_preview { // makes the "absolute" position for links relative to this position: relative; @@ -315,3 +271,17 @@ ul.notes { @extend .thumbnail; margin-left: 45px; } + + +.note-form-actions { + background: #F9F9F9; + height: 45px; + padding: 0 5px; + + .note-form-option { + margin-top: 8px; + margin-left: 15px; + @extend .pull-left; + @extend .span4; + } +} diff --git a/app/views/layouts/admin.html.haml b/app/views/layouts/admin.html.haml index 28626b9c682..a01886cdabf 100644 --- a/app/views/layouts/admin.html.haml +++ b/app/views/layouts/admin.html.haml @@ -7,7 +7,8 @@ .container %ul.main_menu = nav_link(controller: :dashboard, html_options: {class: 'home'}) do - = link_to "Stats", admin_root_path + = link_to admin_root_path, title: "Stats" do + %i.icon-home = nav_link(controller: :projects) do = link_to "Projects", admin_projects_path = nav_link(controller: :teams) do diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index 261a8608ca4..7ee44238d10 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -7,7 +7,8 @@ .container %ul.main_menu = nav_link(path: 'dashboard#show', html_options: {class: 'home'}) do - = link_to "Home", root_path, title: "Home" + = link_to root_path, title: "Home" do + %i.icon-home = nav_link(path: 'dashboard#projects') do = link_to projects_dashboard_path do Projects diff --git a/app/views/layouts/group.html.haml b/app/views/layouts/group.html.haml index 46bc9ef1457..4395e408649 100644 --- a/app/views/layouts/group.html.haml +++ b/app/views/layouts/group.html.haml @@ -7,7 +7,8 @@ .container %ul.main_menu = nav_link(path: 'groups#show', html_options: {class: 'home'}) do - = link_to "Home", group_path(@group), title: "Home" + = link_to group_path(@group), title: "Home" do + %i.icon-home = nav_link(path: 'groups#issues') do = link_to issues_group_path(@group) do Issues diff --git a/app/views/layouts/profile.html.haml b/app/views/layouts/profile.html.haml index 7852ed6f0e1..57f250c775b 100644 --- a/app/views/layouts/profile.html.haml +++ b/app/views/layouts/profile.html.haml @@ -7,7 +7,8 @@ .container %ul.main_menu = nav_link(path: 'profiles#show', html_options: {class: 'home'}) do - = link_to "Profile", profile_path + = link_to profile_path, title: "Profile" do + %i.icon-home = nav_link(path: 'profiles#account') do = link_to "Account", account_profile_path = nav_link(controller: :keys) do diff --git a/app/views/layouts/project_resource.html.haml b/app/views/layouts/project_resource.html.haml index c19d33ceec9..09ccb1d7b6a 100644 --- a/app/views/layouts/project_resource.html.haml +++ b/app/views/layouts/project_resource.html.haml @@ -12,7 +12,8 @@ .container %ul.main_menu = nav_link(html_options: {class: "home #{project_tab_class}"}) do - = link_to @project.path, project_path(@project), title: "Project" + = link_to project_path(@project), title: "Project" do + %i.icon-home - if @project.repo_exists? - if can? current_user, :download_code, @project diff --git a/app/views/layouts/user_team.html.haml b/app/views/layouts/user_team.html.haml index 2d397e80905..19bbc373f46 100644 --- a/app/views/layouts/user_team.html.haml +++ b/app/views/layouts/user_team.html.haml @@ -7,7 +7,8 @@ .container %ul.main_menu = nav_link(path: 'teams#show', html_options: {class: 'home'}) do - = link_to "Home", team_path(@team), title: "Home" + = link_to team_path(@team), title: "Home" do + %i.icon-home = nav_link(path: 'teams#issues') do = link_to issues_team_path(@team) do diff --git a/app/views/notes/_form.html.haml b/app/views/notes/_form.html.haml index f008712c529..a154c31e5ab 100644 --- a/app/views/notes/_form.html.haml +++ b/app/views/notes/_form.html.haml @@ -15,30 +15,30 @@ = f.text_area :note, size: 255, class: 'note_text js-note-text js-gfm-input turn-on' .note_preview.js-note-preview.turn-off - .buttons - = f.submit 'Add Comment', class: "btn comment-btn grouped js-comment-button" - %a.btn.grouped.js-close-discussion-note-form Cancel .hint .pull-right Comments are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. .clearfix - .note_options - .attachment - %h6 Attachment: - .file_name.js-attachment-filename File name... - %a.choose-btn.btn.btn-small.js-choose-note-attachment-button Choose File ... - .hint Any file up to 10 MB + .note-form-actions + .buttons + = f.submit 'Add Comment', class: "btn comment-btn grouped js-comment-button" + %a.btn.grouped.js-close-discussion-note-form Cancel - = f.file_field :attachment, class: "js-note-attachment-input" - - .notify_options - %h6 Notify via email: + .note-form-option = label_tag :notify do = check_box_tag :notify, 1, !@note.for_commit? - Project team + %span.light Notify team via email .js-notify-commit-author = label_tag :notify_author do = check_box_tag :notify_author, 1 , @note.for_commit? - Commit author - .clearfix + %span.light Notify commit author + .note-form-option + %a.choose-btn.btn.btn-small.js-choose-note-attachment-button + %i.icon-paper-clip + %span Choose File ... + + %span.file_name.js-attachment-filename File name... + = f.file_field :attachment, class: "js-note-attachment-input hide" + + .clearfix diff --git a/app/views/notes/_note.html.haml b/app/views/notes/_note.html.haml index 9c51da2913c..4d3007a0ed1 100644 --- a/app/views/notes/_note.html.haml +++ b/app/views/notes/_note.html.haml @@ -32,6 +32,6 @@ = image_tag note.attachment.url, class: 'note-image-attach' .attachment.pull-right = link_to note.attachment.url, target: "_blank" do - %i.icon-attachment + %i.icon-paper-clip = note.attachment_identifier .clear -- GitLab From 2af323bbd1993b121b2ff7bcc695e2bb10af5a1b Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Date: Thu, 31 Jan 2013 12:08:56 +0200 Subject: [PATCH 42/55] fix active tabs tests --- features/steps/admin/admin_active_tab.rb | 2 +- features/steps/profile/profile_active_tab.rb | 2 +- features/steps/project/project_active_tab.rb | 2 +- features/steps/shared/active_tab.rb | 6 +++++- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/features/steps/admin/admin_active_tab.rb b/features/steps/admin/admin_active_tab.rb index 48ec7bac0d6..f14c5f396be 100644 --- a/features/steps/admin/admin_active_tab.rb +++ b/features/steps/admin/admin_active_tab.rb @@ -4,7 +4,7 @@ class AdminActiveTab < Spinach::FeatureSteps include SharedActiveTab Then 'the active main tab should be Home' do - ensure_active_main_tab('Stats') + ensure_active_main_tab('Home') end Then 'the active main tab should be Projects' do diff --git a/features/steps/profile/profile_active_tab.rb b/features/steps/profile/profile_active_tab.rb index 1924a6fa785..ee9f5f201cf 100644 --- a/features/steps/profile/profile_active_tab.rb +++ b/features/steps/profile/profile_active_tab.rb @@ -4,7 +4,7 @@ class ProfileActiveTab < Spinach::FeatureSteps include SharedActiveTab Then 'the active main tab should be Home' do - ensure_active_main_tab('Profile') + ensure_active_main_tab('Home') end Then 'the active main tab should be Account' do diff --git a/features/steps/project/project_active_tab.rb b/features/steps/project/project_active_tab.rb index a5c80353862..bce67c82962 100644 --- a/features/steps/project/project_active_tab.rb +++ b/features/steps/project/project_active_tab.rb @@ -7,7 +7,7 @@ class ProjectActiveTab < Spinach::FeatureSteps # Main Tabs Then 'the active main tab should be Home' do - ensure_active_main_tab(@project.name) + ensure_active_main_tab('Home') end Then 'the active main tab should be Files' do diff --git a/features/steps/shared/active_tab.rb b/features/steps/shared/active_tab.rb index 884f2d5fb71..446e3b9a8b3 100644 --- a/features/steps/shared/active_tab.rb +++ b/features/steps/shared/active_tab.rb @@ -2,7 +2,11 @@ module SharedActiveTab include Spinach::DSL def ensure_active_main_tab(content) - page.find('ul.main_menu li.active').should have_content(content) + if content == "Home" + page.find('ul.main_menu li.active').should have_css('i.icon-home') + else + page.find('ul.main_menu li.active').should have_content(content) + end end def ensure_active_sub_tab(content) -- GitLab From dfe2a742c2f2b862109a757cf90495ea1fcde70c Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> Date: Thu, 31 Jan 2013 13:13:17 +0200 Subject: [PATCH 43/55] fix notes specs --- spec/requests/notes_on_merge_requests_spec.rb | 8 ++++---- spec/requests/notes_on_wall_spec.rb | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/spec/requests/notes_on_merge_requests_spec.rb b/spec/requests/notes_on_merge_requests_spec.rb index 2b670359a49..0111cf42ac7 100644 --- a/spec/requests/notes_on_merge_requests_spec.rb +++ b/spec/requests/notes_on_merge_requests_spec.rb @@ -22,9 +22,9 @@ describe "On a merge request", js: true do it { within(".js-main-target-form") { should_not have_link("Cancel") } } # notifiactions - it { within(".js-main-target-form") { should have_checked_field("Project team") } } - it { within(".js-main-target-form") { should_not have_checked_field("Commit author") } } - it { within(".js-main-target-form") { should_not have_unchecked_field("Commit author") } } + it { within(".js-main-target-form") { should have_checked_field("Notify team via email") } } + it { within(".js-main-target-form") { should_not have_checked_field("Notify commit author") } } + it { within(".js-main-target-form") { should_not have_unchecked_field("Notify commit author") } } describe "without text" do it { within(".js-main-target-form") { should have_css(".js-note-preview-button", visible: false) } } @@ -125,7 +125,7 @@ describe "On a merge request diff", js: true, focus: true do it { should have_css(".js-close-discussion-note-form", text: "Cancel") } # notification options - it { should have_checked_field("Project team") } + it { should have_checked_field("Notify team via email") } it "shouldn't add a second form for same row" do find("#4735dfc552ad7bf15ca468adc3cad9d05b624490_185_185.line_holder .js-add-diff-note-button").trigger("click") diff --git a/spec/requests/notes_on_wall_spec.rb b/spec/requests/notes_on_wall_spec.rb index 01673f997e9..4adcf74e0b6 100644 --- a/spec/requests/notes_on_wall_spec.rb +++ b/spec/requests/notes_on_wall_spec.rb @@ -21,9 +21,9 @@ describe "On the project wall", js: true do it { within(".js-main-target-form") { should_not have_link("Cancel") } } # notifiactions - it { within(".js-main-target-form") { should have_checked_field("Project team") } } - it { within(".js-main-target-form") { should_not have_checked_field("Commit author") } } - it { within(".js-main-target-form") { should_not have_unchecked_field("Commit author") } } + it { within(".js-main-target-form") { should have_checked_field("Notify team via email") } } + it { within(".js-main-target-form") { should_not have_checked_field("Notify commit author") } } + it { within(".js-main-target-form") { should_not have_unchecked_field("Notify commit author") } } describe "without text" do it { within(".js-main-target-form") { should have_css(".js-note-preview-button", visible: false) } } -- GitLab From 8b4f45c917e76f8624f7f4945a2d944d9228072b Mon Sep 17 00:00:00 2001 From: Mike Wyatt <wyatt.mike@gmail.com> Date: Fri, 25 Jan 2013 12:59:25 -0330 Subject: [PATCH 44/55] example capistrano deploy scripts --- Capfile.example | 3 +++ config/deploy.rb.example | 57 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 Capfile.example create mode 100644 config/deploy.rb.example diff --git a/Capfile.example b/Capfile.example new file mode 100644 index 00000000000..81ca1493119 --- /dev/null +++ b/Capfile.example @@ -0,0 +1,3 @@ +load 'deploy' +load 'deploy/assets' +load 'config/deploy' diff --git a/config/deploy.rb.example b/config/deploy.rb.example new file mode 100644 index 00000000000..eb686048a7f --- /dev/null +++ b/config/deploy.rb.example @@ -0,0 +1,57 @@ +require 'bundler/capistrano' + +set :domain, 'set application domain here' +set :db_adapter, 'mysql' # or postgres +set :mount_point, '/' +set :application, 'gitlab' +set :user, 'gitlab' +set :rails_env, 'production' +set :deploy_to, "/home/#{user}/apps/#{application}" +set :bundle_without, %w[development test] + (%w[mysql postgres] - db_adapter) +set :asset_env, "RAILS_GROUPS=assets RAILS_RELATIVE_URL_ROOT=#{mount_point}" + +set :use_sudo, false + +# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none` +set :scm, :git +set :repository, "git@#{domain}:#{application}.git" +set :deploy_via, :remote_cache + +# Alternatively, you can deploy via copy, if you don't have gitlab in git +#set :scm, :none +#set :repository, '.' +#set :deploy_via, :copy + +role :web, domain +role :app, domain +role :db, domain, primary: true + +namespace :foreman do + desc 'Export the Procfile to Ubuntu upstart scripts' + task :export, roles: :app do + run "cd #{release_path} && sudo foreman export upstart /etc/init -f Procfile -a #{application} -u #{user} -l #{release_path}/log/foreman" + end + + desc 'Start the application services' + task :start, roles: :app do + sudo "start #{application}" + end + + desc 'Stop the application services' + task :stop, roles: :app do + sudo "stop #{application}" + end + + desc 'Restart the application services' + task :restart, roles: :app do + run "sudo start #{application} || sudo restart #{application}" + end +end + +after 'deploy:cold' do + run "cd #{release_path} && #{rake} gitlab:app:setup RAILS_ENV=#{rails_env}" + foreman.restart +end + +after 'deploy:update', 'foreman:export' # Export foreman scripts +after 'deploy:update', 'foreman:restart' # Restart application scripts -- GitLab From e2e589d871f1cbf01726e8cf7557478bb5077b2e Mon Sep 17 00:00:00 2001 From: Mike Wyatt <wyatt.mike@gmail.com> Date: Fri, 25 Jan 2013 13:03:01 -0330 Subject: [PATCH 45/55] fix error in bundle_without --- config/deploy.rb.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/deploy.rb.example b/config/deploy.rb.example index eb686048a7f..8c0f1561136 100644 --- a/config/deploy.rb.example +++ b/config/deploy.rb.example @@ -7,7 +7,7 @@ set :application, 'gitlab' set :user, 'gitlab' set :rails_env, 'production' set :deploy_to, "/home/#{user}/apps/#{application}" -set :bundle_without, %w[development test] + (%w[mysql postgres] - db_adapter) +set :bundle_without, %w[development test] + (%w[mysql postgres] - [db_adapter]) set :asset_env, "RAILS_GROUPS=assets RAILS_RELATIVE_URL_ROOT=#{mount_point}" set :use_sudo, false -- GitLab From a05a8ddd49eb1213a8ff9644feb3d8b5ed0eebb7 Mon Sep 17 00:00:00 2001 From: Mike Wyatt <wyatt.mike@gmail.com> Date: Mon, 28 Jan 2013 15:00:04 -0330 Subject: [PATCH 46/55] use gitlabhq as application name --- config/deploy.rb.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/deploy.rb.example b/config/deploy.rb.example index 8c0f1561136..4f2e776e4af 100644 --- a/config/deploy.rb.example +++ b/config/deploy.rb.example @@ -3,7 +3,7 @@ require 'bundler/capistrano' set :domain, 'set application domain here' set :db_adapter, 'mysql' # or postgres set :mount_point, '/' -set :application, 'gitlab' +set :application, 'gitlabhq' set :user, 'gitlab' set :rails_env, 'production' set :deploy_to, "/home/#{user}/apps/#{application}" -- GitLab From 57d428c91dfe57b142fbf4aa9ffd77f8ce8cbff7 Mon Sep 17 00:00:00 2001 From: Mike Wyatt <wyatt.mike@gmail.com> Date: Mon, 28 Jan 2013 15:01:12 -0330 Subject: [PATCH 47/55] wrap domain use in block for cap-multistage --- config/deploy.rb.example | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/deploy.rb.example b/config/deploy.rb.example index 4f2e776e4af..8910aba3aac 100644 --- a/config/deploy.rb.example +++ b/config/deploy.rb.example @@ -22,9 +22,9 @@ set :deploy_via, :remote_cache #set :repository, '.' #set :deploy_via, :copy -role :web, domain -role :app, domain -role :db, domain, primary: true +role(:web) { domain } +role(:app) { domain } +role(:db, primary: true) { domain } namespace :foreman do desc 'Export the Procfile to Ubuntu upstart scripts' -- GitLab From dfcf476d9f78b4784f216d83cb0240915afb150b Mon Sep 17 00:00:00 2001 From: Mike Wyatt <wyatt.mike@gmail.com> Date: Mon, 28 Jan 2013 15:01:56 -0330 Subject: [PATCH 48/55] use bundler in foreman:export --- config/deploy.rb.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/deploy.rb.example b/config/deploy.rb.example index 8910aba3aac..17352dc0b9f 100644 --- a/config/deploy.rb.example +++ b/config/deploy.rb.example @@ -29,7 +29,7 @@ role(:db, primary: true) { domain } namespace :foreman do desc 'Export the Procfile to Ubuntu upstart scripts' task :export, roles: :app do - run "cd #{release_path} && sudo foreman export upstart /etc/init -f Procfile -a #{application} -u #{user} -l #{release_path}/log/foreman" + run "cd #{release_path} && sudo #{bundle_cmd} exec foreman export upstart /etc/init -f Procfile -a #{application} -u #{user} -l #{release_path}/log/foreman" end desc 'Start the application services' -- GitLab From fdfaaff4b3fc993318e5e31f425cfda3a34e84f5 Mon Sep 17 00:00:00 2001 From: Mike Wyatt <wyatt.mike@gmail.com> Date: Mon, 28 Jan 2013 15:02:35 -0330 Subject: [PATCH 49/55] deploy:[start,stop,restart] is foreman:[start,stop,restart] --- config/deploy.rb.example | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/config/deploy.rb.example b/config/deploy.rb.example index 17352dc0b9f..846a54a59bb 100644 --- a/config/deploy.rb.example +++ b/config/deploy.rb.example @@ -48,10 +48,27 @@ namespace :foreman do end end +namespace :deploy do + desc 'Start the application services' + task :start, roles: :app do + foreman.start + end + + desc 'Stop the application services' + task :stop, roles: :app do + foreman.stop + end + + desc 'Restart the application services' + task :restart, roles: :app do + foreman.restart + end +end + after 'deploy:cold' do run "cd #{release_path} && #{rake} gitlab:app:setup RAILS_ENV=#{rails_env}" foreman.restart end after 'deploy:update', 'foreman:export' # Export foreman scripts -after 'deploy:update', 'foreman:restart' # Restart application scripts +#after 'deploy:update', 'foreman:restart' # Restart application scripts -- GitLab From 84de968fc3908def179471fc8eb02bcf8ccc888c Mon Sep 17 00:00:00 2001 From: Mike Wyatt <wyatt.mike@gmail.com> Date: Mon, 28 Jan 2013 15:02:56 -0330 Subject: [PATCH 50/55] move bundler/capistrano require to Capfile --- Capfile.example | 1 + config/deploy.rb.example | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/Capfile.example b/Capfile.example index 81ca1493119..8863835da4a 100644 --- a/Capfile.example +++ b/Capfile.example @@ -1,3 +1,4 @@ load 'deploy' load 'deploy/assets' +require 'bundler/capistrano' load 'config/deploy' diff --git a/config/deploy.rb.example b/config/deploy.rb.example index 846a54a59bb..03eb59fa89f 100644 --- a/config/deploy.rb.example +++ b/config/deploy.rb.example @@ -1,5 +1,3 @@ -require 'bundler/capistrano' - set :domain, 'set application domain here' set :db_adapter, 'mysql' # or postgres set :mount_point, '/' -- GitLab From 5ebd265fee76e75d1e88cb023c2f2e0f259893a0 Mon Sep 17 00:00:00 2001 From: Mike Wyatt <wyatt.mike@gmail.com> Date: Tue, 29 Jan 2013 10:14:40 -0330 Subject: [PATCH 51/55] use shared_path/log in foreman export --- config/deploy.rb.example | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/config/deploy.rb.example b/config/deploy.rb.example index 03eb59fa89f..1fc88cc9e8f 100644 --- a/config/deploy.rb.example +++ b/config/deploy.rb.example @@ -9,6 +9,7 @@ set :bundle_without, %w[development test] + (%w[mysql postgres] - [db_adapter]) set :asset_env, "RAILS_GROUPS=assets RAILS_RELATIVE_URL_ROOT=#{mount_point}" set :use_sudo, false +default_run_options[:pty] = true # Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none` set :scm, :git @@ -27,7 +28,8 @@ role(:db, primary: true) { domain } namespace :foreman do desc 'Export the Procfile to Ubuntu upstart scripts' task :export, roles: :app do - run "cd #{release_path} && sudo #{bundle_cmd} exec foreman export upstart /etc/init -f Procfile -a #{application} -u #{user} -l #{release_path}/log/foreman" + foreman_export = "foreman export upstart /etc/init -f Procfile -a #{application} -u #{user} -l #{shared_path}/log/foreman" + run "cd #{release_path} && #{sudo} #{fetch :bundle_cmd, 'bundle'} exec #{foreman_export}" end desc 'Start the application services' -- GitLab From 1ca915a1cf58ec8437ec31d7bd0810f9636b8e86 Mon Sep 17 00:00:00 2001 From: Mike Wyatt <wyatt.mike@gmail.com> Date: Tue, 29 Jan 2013 10:15:24 -0330 Subject: [PATCH 52/55] use service instead of start/stop/restart --- config/deploy.rb.example | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/config/deploy.rb.example b/config/deploy.rb.example index 1fc88cc9e8f..7c20c880b4b 100644 --- a/config/deploy.rb.example +++ b/config/deploy.rb.example @@ -34,17 +34,17 @@ namespace :foreman do desc 'Start the application services' task :start, roles: :app do - sudo "start #{application}" + run "#{sudo} service #{application} start" end desc 'Stop the application services' task :stop, roles: :app do - sudo "stop #{application}" + run "#{sudo} service #{application} stop" end desc 'Restart the application services' task :restart, roles: :app do - run "sudo start #{application} || sudo restart #{application}" + run "#{sudo} service #{application} restart" end end -- GitLab From ca3c85bb1785e374e3fd0c39c19ae0a454a8cf6a Mon Sep 17 00:00:00 2001 From: Mike Wyatt <wyatt.mike@gmail.com> Date: Tue, 29 Jan 2013 10:16:04 -0330 Subject: [PATCH 53/55] fix gitlab:setup in deploy:cold --- config/deploy.rb.example | 4 ++-- lib/tasks/gitlab/setup.rake | 10 ++++++---- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/config/deploy.rb.example b/config/deploy.rb.example index 7c20c880b4b..7e8b6b7321f 100644 --- a/config/deploy.rb.example +++ b/config/deploy.rb.example @@ -66,8 +66,8 @@ namespace :deploy do end after 'deploy:cold' do - run "cd #{release_path} && #{rake} gitlab:app:setup RAILS_ENV=#{rails_env}" - foreman.restart + run "cd #{release_path} && #{rake} gitlab:setup force=yes RAILS_ENV=#{rails_env}" + deploy.restart end after 'deploy:update', 'foreman:export' # Export foreman scripts diff --git a/lib/tasks/gitlab/setup.rake b/lib/tasks/gitlab/setup.rake index 5699e5d6188..1a7907c75c7 100644 --- a/lib/tasks/gitlab/setup.rake +++ b/lib/tasks/gitlab/setup.rake @@ -7,10 +7,12 @@ namespace :gitlab do def setup warn_user_is_not_gitlab - puts "This will create the necessary database tables and seed the database." - puts "You will lose any previous data stored in the database." - ask_to_continue - puts "" + unless ENV['force'] == 'yes' + puts "This will create the necessary database tables and seed the database." + puts "You will lose any previous data stored in the database." + ask_to_continue + puts "" + end Rake::Task["db:setup"].invoke Rake::Task["db:seed_fu"].invoke -- GitLab From c951b6dfda2881e28505e40d8f226d10044fbbd8 Mon Sep 17 00:00:00 2001 From: Mike Wyatt <wyatt.mike@gmail.com> Date: Tue, 29 Jan 2013 12:47:51 -0330 Subject: [PATCH 54/55] remove trailing slash from mount_point --- config/deploy.rb.example | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/deploy.rb.example b/config/deploy.rb.example index 7e8b6b7321f..2d91653b4dc 100644 --- a/config/deploy.rb.example +++ b/config/deploy.rb.example @@ -6,7 +6,7 @@ set :user, 'gitlab' set :rails_env, 'production' set :deploy_to, "/home/#{user}/apps/#{application}" set :bundle_without, %w[development test] + (%w[mysql postgres] - [db_adapter]) -set :asset_env, "RAILS_GROUPS=assets RAILS_RELATIVE_URL_ROOT=#{mount_point}" +set :asset_env, "RAILS_GROUPS=assets RAILS_RELATIVE_URL_ROOT=#{mount_point.sub /\/+\Z/, ''}" set :use_sudo, false default_run_options[:pty] = true -- GitLab From 5d9b1ee2a977a4f5f410a35d7a2b2189e592a301 Mon Sep 17 00:00:00 2001 From: Mike Wyatt <wyatt.mike@gmail.com> Date: Tue, 29 Jan 2013 18:27:54 -0330 Subject: [PATCH 55/55] prefer server to multiple role calls --- config/deploy.rb.example | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/config/deploy.rb.example b/config/deploy.rb.example index 2d91653b4dc..88da580dc7f 100644 --- a/config/deploy.rb.example +++ b/config/deploy.rb.example @@ -21,9 +21,7 @@ set :deploy_via, :remote_cache #set :repository, '.' #set :deploy_via, :copy -role(:web) { domain } -role(:app) { domain } -role(:db, primary: true) { domain } +server domain, :app, :web, :db, primary: true namespace :foreman do desc 'Export the Procfile to Ubuntu upstart scripts' -- GitLab