From fcbe7a205df580325596cb933388a09ed6980550 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Fri, 19 Jul 2013 09:56:50 +0200 Subject: Mention unofficial #gitlab IRC channel in README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index de773cce0eb..2e2408923de 100644 --- a/README.md +++ b/README.md @@ -147,6 +147,8 @@ or start each component separately * [Mailing list](https://groups.google.com/forum/#!forum/gitlabhq) and [Stack Overflow](http://stackoverflow.com/questions/tagged/gitlab) are the best places to ask questions. For example you can use it if you have questions about: permission denied errors, invisible repos, can't clone/pull/push or with web hooks that don't fire. Please search for similar issues before posting your own, there's a good chance somebody else had the same issue you have now and has resolved it. There are a lot of helpful GitLab users there who may be able to help you quickly. If your particular issue turns out to be a bug, it will find its way from there to a fix. +* [Unofficial #gitlab IRC on Freenode](http://www.freenode.net/) is another way to get in touch with other GitLab users who may be able to help you. + * [Feedback and suggestions forum](http://feedback.gitlab.com) is the place to propose and discuss new features for GitLab. * [Contributing guide](https://github.com/gitlabhq/gitlabhq/blob/master/CONTRIBUTING.md) describes how to submit pull requests and issues. Pull requests and issues not in line with the guidelines in this document will be closed. -- cgit v1.2.1 From 6d0b210ce81d9639db2ada090301b482bd0da7c2 Mon Sep 17 00:00:00 2001 From: Axilleas Pipinellis Date: Mon, 22 Jul 2013 09:18:48 +0300 Subject: Bump version of gitlab-shell to 1.7.0 --- doc/install/installation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/install/installation.md b/doc/install/installation.md index 4eb767e41cf..c5ba1cd34a3 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -119,7 +119,7 @@ GitLab Shell is a ssh access and repository management software developed specia cd gitlab-shell # switch to right version - sudo -u git -H git checkout v1.4.0 + sudo -u git -H git checkout v1.7.0 sudo -u git -H cp config.yml.example config.yml -- cgit v1.2.1 From cb877b7e6f6b036a2811aec7313dab94473774de Mon Sep 17 00:00:00 2001 From: Javier Castro Date: Mon, 22 Jul 2013 15:45:56 -0300 Subject: Fix notifications to handle participants and mentions on commits too --- app/services/notification_service.rb | 14 +++++++------- spec/services/notification_service_spec.rb | 7 +++++-- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index f3dc552a8e7..819b76c279c 100644 --- a/app/services/notification_service.rb +++ b/app/services/notification_service.rb @@ -106,15 +106,15 @@ class NotificationService if note.commit_id.present? opts.merge!(commit_id: note.commit_id) - recipients = [note.commit_author] else opts.merge!(noteable_id: note.noteable_id) - target = note.noteable - if target.respond_to?(:participants) - recipients = target.participants - else - recipients = [] - end + end + + target = note.noteable + if target.respond_to?(:participants) + recipients = target.participants + else + recipients = note.mentioned_users end # Get users who left comment in thread diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb index 76501482303..8ebad41b463 100644 --- a/spec/services/notification_service_spec.rb +++ b/spec/services/notification_service_spec.rb @@ -48,7 +48,7 @@ describe NotificationService do end context 'commit note' do - let(:note) { create :note_on_commit } + let(:note) { create(:note_on_commit, note: '@mention referenced') } before do build_team(note.project) @@ -57,6 +57,7 @@ describe NotificationService do describe :new_note do it do should_email(@u_watcher.id) + should_email(@u_mentioned.id) should_not_email(note.author_id) should_not_email(@u_participating.id) should_not_email(@u_disabled.id) @@ -67,10 +68,12 @@ describe NotificationService do create(:note_on_commit, author: @u_participating, project_id: note.project_id, - commit_id: note.commit_id) + commit_id: note.commit_id, + note: '@mention referenced') should_email(@u_watcher.id) should_email(@u_participating.id) + should_email(@u_mentioned.id) should_not_email(note.author_id) should_not_email(@u_disabled.id) notification.new_note(note) -- cgit v1.2.1 From 1458dea9fe7530b716754ddeb89f032b43b97a1f Mon Sep 17 00:00:00 2001 From: Jack Weeden Date: Mon, 29 Jul 2013 14:16:36 +0100 Subject: Show autocomplete list when editing notes. --- app/assets/javascripts/notes.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/notes.js b/app/assets/javascripts/notes.js index 5e1e4dc4113..5225623c1f0 100644 --- a/app/assets/javascripts/notes.js +++ b/app/assets/javascripts/notes.js @@ -227,10 +227,11 @@ var NoteList = { // Show the attachment delete link note.find(".js-note-attachment-delete").show(); + GitLab.GfmAutoComplete.setup(); + var form = note.find(".note-edit-form"); form.show(); - var textarea = form.find("textarea"); var p = $("

").text(textarea.val()); var hidden_div = $('
').append(p); -- cgit v1.2.1 From 5e35f21605a15414258c5a857f75679f9df2c102 Mon Sep 17 00:00:00 2001 From: Jakub Zienkiewicz Date: Mon, 29 Jul 2013 14:25:33 +0200 Subject: allow all git-upload-* commands for deploy keys --- lib/api/internal.rb | 2 +- spec/requests/api/internal_spec.rb | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/lib/api/internal.rb b/lib/api/internal.rb index a602dc05418..bd28bef2ab2 100644 --- a/lib/api/internal.rb +++ b/lib/api/internal.rb @@ -26,7 +26,7 @@ module API if key.is_a? DeployKey - key.projects.include?(project) && git_cmd == 'git-upload-pack' + key.projects.include?(project) && git_cmd.starts_with?('git-upload-') else user = key.user diff --git a/spec/requests/api/internal_spec.rb b/spec/requests/api/internal_spec.rb index 5a43953d15c..028617aa08e 100644 --- a/spec/requests/api/internal_spec.rb +++ b/spec/requests/api/internal_spec.rb @@ -100,6 +100,32 @@ describe API::API do end end end + + context "deploy key" do + let(:key) { create(:deploy_key) } + + context "added to project" do + before do + key.projects << project + end + + it do + archive(key, project) + + response.status.should == 200 + response.body.should == 'true' + end + end + + context "not added to project" do + it do + archive(key, project) + + response.status.should == 200 + response.body.should == 'false' + end + end + end end def pull(key, project) @@ -121,4 +147,14 @@ describe API::API do action: 'git-receive-pack' ) end + + def archive(key, project) + get( + api("/internal/allowed"), + ref: 'master', + key_id: key.id, + project: project.path_with_namespace, + action: 'git-upload-archive' + ) + end end -- cgit v1.2.1 From e03d01d036bf5f5257d767a1b6ab23f06787a421 Mon Sep 17 00:00:00 2001 From: Jakub Zienkiewicz Date: Mon, 29 Jul 2013 16:05:08 +0200 Subject: extract server-side git commands to constants --- lib/api/internal.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/api/internal.rb b/lib/api/internal.rb index bd28bef2ab2..79f8eb3a543 100644 --- a/lib/api/internal.rb +++ b/lib/api/internal.rb @@ -1,6 +1,10 @@ module API # Internal access API class Internal < Grape::API + + DOWNLOAD_COMMANDS = %w{ git-upload-pack git-upload-archive } + PUSH_COMMANDS = %w{ git-receive-pack } + namespace 'internal' do # # Check if ssh key has access to project code @@ -26,16 +30,16 @@ module API if key.is_a? DeployKey - key.projects.include?(project) && git_cmd.starts_with?('git-upload-') + key.projects.include?(project) && DOWNLOAD_COMMANDS.include?(git_cmd) else user = key.user return false if user.blocked? action = case git_cmd - when 'git-upload-pack', 'git-upload-archive' + when *DOWNLOAD_COMMANDS then :download_code - when 'git-receive-pack' + when *PUSH_COMMANDS then if project.protected_branch?(params[:ref]) :push_code_to_protected_branches -- cgit v1.2.1 From 669ada924b3d058f5ad8bfc6822b1a9e64b3549b Mon Sep 17 00:00:00 2001 From: Javier Castro Date: Mon, 29 Jul 2013 17:34:53 -0300 Subject: Fix test case for notification_service --- spec/services/notification_service_spec.rb | 36 +++++++++++++++--------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/spec/services/notification_service_spec.rb b/spec/services/notification_service_spec.rb index 8ebad41b463..02547254436 100644 --- a/spec/services/notification_service_spec.rb +++ b/spec/services/notification_service_spec.rb @@ -48,7 +48,7 @@ describe NotificationService do end context 'commit note' do - let(:note) { create(:note_on_commit, note: '@mention referenced') } + let(:note) { create(:note_on_commit) } before do build_team(note.project) @@ -56,35 +56,35 @@ describe NotificationService do describe :new_note do it do - should_email(@u_watcher.id) - should_email(@u_mentioned.id) - should_not_email(note.author_id) - should_not_email(@u_participating.id) - should_not_email(@u_disabled.id) + should_email(@u_watcher.id, note) + should_not_email(@u_mentioned.id, note) + should_not_email(note.author_id, note) + should_not_email(@u_participating.id, note) + should_not_email(@u_disabled.id, note) notification.new_note(note) end it do - create(:note_on_commit, + new_note = create(:note_on_commit, author: @u_participating, project_id: note.project_id, commit_id: note.commit_id, note: '@mention referenced') - should_email(@u_watcher.id) - should_email(@u_participating.id) - should_email(@u_mentioned.id) - should_not_email(note.author_id) - should_not_email(@u_disabled.id) - notification.new_note(note) + should_email(@u_watcher.id, new_note) + should_email(@u_mentioned.id, new_note) + should_not_email(new_note.author_id, new_note) + should_not_email(@u_participating.id, new_note) + should_not_email(@u_disabled.id, new_note) + notification.new_note(new_note) end - def should_email(user_id) - Notify.should_receive(:note_commit_email).with(user_id, note.id) + def should_email(user_id, n) + Notify.should_receive(:note_commit_email).with(user_id, n.id) end - def should_not_email(user_id) - Notify.should_not_receive(:note_commit_email).with(user_id, note.id) + def should_not_email(user_id, n) + Notify.should_not_receive(:note_commit_email).with(user_id, n.id) end end end @@ -239,7 +239,7 @@ describe NotificationService do @u_watcher = create(:user, notification_level: Notification::N_WATCH) @u_participating = create(:user, notification_level: Notification::N_PARTICIPATING) @u_disabled = create(:user, notification_level: Notification::N_DISABLED) - @u_mentioned = create(:user, username: 'mention', notification_level: Notification::N_WATCH) + @u_mentioned = create(:user, username: 'mention', notification_level: Notification::N_PARTICIPATING) project.team << [@u_watcher, :master] project.team << [@u_participating, :master] -- cgit v1.2.1 From a4ca5cbaefd859bcdb2cddbf9378172874eca146 Mon Sep 17 00:00:00 2001 From: Jack Weeden Date: Tue, 30 Jul 2013 13:05:24 +0100 Subject: Reenable the create project button after errors Currently if you try to create a project from an existing repo but give it a bad URL, you see the "Import url should be a valid url" error and the form, but the submit button is disabled meaning you can't fix the URL and resubmit the form. This fix just enables the button when the project has an error. Closes #4070 --- app/views/projects/create.js.haml | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/projects/create.js.haml b/app/views/projects/create.js.haml index 52e61f47283..a444b8b59a6 100644 --- a/app/views/projects/create.js.haml +++ b/app/views/projects/create.js.haml @@ -4,5 +4,6 @@ - else :plain $(".project-edit-errors").html("#{escape_javascript(render('errors'))}"); + $('.project-submit').enable(); $('.save-project-loader').hide(); $('.project-edit-container').show(); -- cgit v1.2.1 From b9717ba45e3b306c091946c43718f6019aed7b33 Mon Sep 17 00:00:00 2001 From: Robert Schilling Date: Tue, 30 Jul 2013 19:06:45 +0200 Subject: Add support for reStructured Text markup language --- doc/install/installation.md | 3 +++ doc/update/5.4-to-6.0.md | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/doc/install/installation.md b/doc/install/installation.md index a54dcb5a37e..be6780d741c 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -71,6 +71,9 @@ Make sure you have the right version of Python installed. # If you get a "command not found" error create a link to the python binary sudo ln -s /usr/bin/python /usr/bin/python2 + # For reStructuredText markup language support install required package: + sudo apt-get install python-docutils + **Note:** In order to receive mail notifications, make sure to install a mail server. By default, Debian is shipped with exim4 whereas Ubuntu does not ship with one. The recommended mail server is postfix and you can install it with: diff --git a/doc/update/5.4-to-6.0.md b/doc/update/5.4-to-6.0.md index 42b9ee50d56..ffc152194db 100644 --- a/doc/update/5.4-to-6.0.md +++ b/doc/update/5.4-to-6.0.md @@ -35,7 +35,14 @@ sudo -u git -H git fetch sudo -u git -H git checkout 6-0-dev ``` -### 3. Install libs, migrations, etc. +### 3. Install additional packages + +```bash +# For reStructuredText markup language support install required package: +sudo apt-get install python-docutils +``` + +### 4. Install libs, migrations, etc. ```bash cd /home/git/gitlab @@ -53,12 +60,12 @@ sudo -u git -H bundle exec rake migrate_keys RAILS_ENV=production ``` -### 4. Update config files +### 5. Update config files * Make `/home/git/gitlab/config/gitlab.yml` same as https://github.com/gitlabhq/gitlabhq/blob/5-3-stable/config/gitlab.yml.example but with your settings. * Make `/home/git/gitlab/config/puma.rb` same as https://github.com/gitlabhq/gitlabhq/blob/5-3-stable/config/puma.rb.example but with your settings. -### 5. Update Init script +### 6. Update Init script ```bash sudo rm /etc/init.d/gitlab @@ -66,12 +73,12 @@ sudo curl --output /etc/init.d/gitlab https://raw.github.com/gitlabhq/gitlabhq/5 sudo chmod +x /etc/init.d/gitlab ``` -### 6. Start application +### 7. Start application sudo service gitlab start sudo service nginx restart -### 7. Check application status +### 8. Check application status Check if GitLab and its environment are configured correctly: -- cgit v1.2.1 From e08f977bb92e0ac8fa4f8be8bb2c71e899f782cf Mon Sep 17 00:00:00 2001 From: Robert Schilling Date: Tue, 30 Jul 2013 20:23:30 +0200 Subject: Add 'repository' to path blacklist, fixes #4591 --- lib/gitlab/blacklist.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gitlab/blacklist.rb b/lib/gitlab/blacklist.rb index 59203b2fbd6..d00214a62cb 100644 --- a/lib/gitlab/blacklist.rb +++ b/lib/gitlab/blacklist.rb @@ -3,7 +3,7 @@ module Gitlab extend self def path - %w(admin dashboard groups help profile projects search public assets u s teams merge_requests issues users snippets services) + %w(admin dashboard groups help profile projects search public assets u s teams merge_requests issues users snippets services repository) end end end -- cgit v1.2.1 From a28bc409fcedfbd668ab9be725b451d5c02ba5cb Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 31 Jul 2013 14:33:09 +0300 Subject: Improve project team page usability --- app/views/projects/team_members/_group_members.html.haml | 4 ++-- app/views/projects/team_members/_team.html.haml | 4 ++-- app/views/projects/team_members/index.html.haml | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/app/views/projects/team_members/_group_members.html.haml b/app/views/projects/team_members/_group_members.html.haml index 5c3f813bb20..68f08006854 100644 --- a/app/views/projects/team_members/_group_members.html.haml +++ b/app/views/projects/team_members/_group_members.html.haml @@ -1,7 +1,7 @@ .ui-box .title - %strong #{@group.name} Group - members (#{@group.users_groups.count}) + %strong #{@group.name} + group members (#{@group.users_groups.count}) .pull-right = link_to members_group_path(@group), class: 'btn btn-small' do %i.icon-edit diff --git a/app/views/projects/team_members/_team.html.haml b/app/views/projects/team_members/_team.html.haml index ee660482f3f..2daf6847665 100644 --- a/app/views/projects/team_members/_team.html.haml +++ b/app/views/projects/team_members/_team.html.haml @@ -2,8 +2,8 @@ - can_admin_project = (can? current_user, :admin_project, @project) .ui-box .title - %strong #{@project.name} Project - members (#{members.count}) + %strong #{@project.name} + project members (#{members.count}) %ul.well-list - members.each do |team_member| = render 'team_member', member: team_member, current_user_can_admin_project: can_admin_project diff --git a/app/views/projects/team_members/index.html.haml b/app/views/projects/team_members/index.html.haml index e8ae84bb8f5..30d74e260a9 100644 --- a/app/views/projects/team_members/index.html.haml +++ b/app/views/projects/team_members/index.html.haml @@ -11,6 +11,6 @@ %p.light Read more about project permissions %strong= link_to "here", help_permissions_path, class: "vlink" += render "team", members: @users_projects - if @group = render "group_members" -= render "team", members: @users_projects -- cgit v1.2.1 From c4856e6f8dbc7b7db5cb01c340e211026dda03af Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 31 Jul 2013 16:24:11 +0300 Subject: Semibold headers --- app/assets/stylesheets/gitlab_bootstrap/mixins.scss | 1 - app/assets/stylesheets/gitlab_bootstrap/typography.scss | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/gitlab_bootstrap/mixins.scss b/app/assets/stylesheets/gitlab_bootstrap/mixins.scss index b9abb5e4c67..9ddaaf31c1c 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/mixins.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/mixins.scss @@ -90,7 +90,6 @@ @mixin page-title { color: $style_color; font-size: 20px; - font-weight: normal; line-height: 1.5; margin-top: 0px; margin-bottom: 15px; diff --git a/app/assets/stylesheets/gitlab_bootstrap/typography.scss b/app/assets/stylesheets/gitlab_bootstrap/typography.scss index 69292ca0b64..ba0c40ae0a0 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/typography.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/typography.scss @@ -2,6 +2,10 @@ * Headers * */ +h1, h2, h3, h4, h5, h6 { + font-weight: 500; + line-height: 1.1; +} h1.page-title { @include page-title; -- cgit v1.2.1 From 9f38cf5093f5141717cfa1b1c956ed8ec9135ebe Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 31 Jul 2013 17:05:22 +0300 Subject: Improve Notifications page. Much easier to find muted projects now --- app/helpers/notifications_helper.rb | 11 ++++++ app/views/admin/users/index.html.haml | 2 +- app/views/dashboard/projects.html.haml | 1 + .../profiles/notifications/_settings.html.haml | 2 + app/views/profiles/notifications/show.html.haml | 45 +++++++++++++--------- 5 files changed, 41 insertions(+), 20 deletions(-) diff --git a/app/helpers/notifications_helper.rb b/app/helpers/notifications_helper.rb index 7342393a707..ae3402b2617 100644 --- a/app/helpers/notifications_helper.rb +++ b/app/helpers/notifications_helper.rb @@ -1,2 +1,13 @@ module NotificationsHelper + def notification_icon(notification) + if notification.disabled? + content_tag :i, nil, class: 'icon-circle cred' + elsif notification.participating? + content_tag :i, nil, class: 'icon-circle cblue' + elsif notification.watch? + content_tag :i, nil, class: 'icon-circle cgreen' + else + content_tag :i, nil, class: 'icon-circle-blank cblue' + end + end end diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml index c2dfcb5e6fa..e0647933394 100644 --- a/app/views/admin/users/index.html.haml +++ b/app/views/admin/users/index.html.haml @@ -55,4 +55,4 @@ - else = 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 @users, theme: "gitlab" + = paginate @users, theme: "gitlab" diff --git a/app/views/dashboard/projects.html.haml b/app/views/dashboard/projects.html.haml index 78ba479c5af..705b316dd74 100644 --- a/app/views/dashboard/projects.html.haml +++ b/app/views/dashboard/projects.html.haml @@ -1,3 +1,4 @@ +%h3.page-title My Projects .row .span3 %ul.nav.nav-pills.nav-stacked diff --git a/app/views/profiles/notifications/_settings.html.haml b/app/views/profiles/notifications/_settings.html.haml index 1a4a4a9f916..5f62c8099d0 100644 --- a/app/views/profiles/notifications/_settings.html.haml +++ b/app/views/profiles/notifications/_settings.html.haml @@ -2,6 +2,8 @@ .row .span4 %span + = notification_icon(notification) + - if membership.kind_of? UsersGroup = link_to membership.group.name, membership.group - else diff --git a/app/views/profiles/notifications/show.html.haml b/app/views/profiles/notifications/show.html.haml index 43b1cf6f8df..3b8da833232 100644 --- a/app/views/profiles/notifications/show.html.haml +++ b/app/views/profiles/notifications/show.html.haml @@ -1,19 +1,25 @@ -%h3.page-title Setup your notification level - -%p.light - %strong Disabled - – You will not get any notifications via email -%p.light - %strong Participating - – You will receive only notifications from related resources(ex. from assigned issue or your commit) -%p.light - %strong Watch - – You will receive all notifications from projects in which you participate -%hr +%h3.page-title + Notifications settings + +.alert.alert-info + %p + %i.icon-circle.cred + %strong Disabled + – You will not get any notifications via email + %p + %i.icon-circle.cblue + %strong Participating + – You will receive only notifications from related resources(ex. from assigned issue or your commit) + %p + %i.icon-circle.cgreen + %strong Watch + – You will receive all notifications from projects in which you participate .row .span4 - %h5 Global setting + %h4 + = notification_icon(@notification) + Global setting .span7 = form_tag profile_notifications_path, method: :put, remote: true, class: 'update-notifications' do = hidden_field_tag :notification_type, 'global' @@ -30,20 +36,21 @@ = radio_button_tag :notification_level, Notification::N_WATCH, @notification.watch?, class: 'trigger-submit' %span Watch -%hr +%br = link_to '#', class: 'js-toggle-visibility-link' do - %h6.btn.btn-tiny + %span.btn.btn-tiny %i.icon-chevron-down %span Advanced notifications settings .js-toggle-visibility-container.hide - %h5 Groups: - %ul.well-list + %hr + %h4 Groups: + %ul.bordered-list - @users_groups.each do |users_group| - notification = Notification.new(users_group) = render 'settings', type: 'group', membership: users_group, notification: notification - %h5 Projects: - %ul.well-list + %h4 Projects: + %ul.bordered-list - @users_projects.each do |users_project| - notification = Notification.new(users_project) = render 'settings', type: 'project', membership: users_project, notification: notification -- cgit v1.2.1 From 9b7241dfdd4a3a33e137b9aed9b73d59a07973b1 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 31 Jul 2013 17:39:57 +0300 Subject: Add page titles with for profile area --- app/assets/stylesheets/gitlab_bootstrap/common.scss | 2 +- app/views/profiles/account.html.haml | 7 +++++++ app/views/profiles/design.html.haml | 6 ++++++ app/views/profiles/groups/index.html.haml | 5 +++++ app/views/profiles/history.html.haml | 5 +++++ app/views/profiles/keys/index.html.haml | 6 ++++-- app/views/profiles/notifications/show.html.haml | 4 +++- 7 files changed, 31 insertions(+), 4 deletions(-) diff --git a/app/assets/stylesheets/gitlab_bootstrap/common.scss b/app/assets/stylesheets/gitlab_bootstrap/common.scss index 1d958a05b80..4f531b58a24 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/common.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/common.scss @@ -66,7 +66,7 @@ input[type='text'].danger { text-shadow: 0 1px 1px #fff } -fieldset legend { font-size: 17px; } +fieldset legend { font-size: 15px; } .tab-content { overflow: visible; diff --git a/app/views/profiles/account.html.haml b/app/views/profiles/account.html.haml index 9b1354d9f2c..7951f639bfb 100644 --- a/app/views/profiles/account.html.haml +++ b/app/views/profiles/account.html.haml @@ -1,3 +1,10 @@ +%h3.page-title + Account settings +%p.light + You can change password, username, private token here. + - if current_user.ldap_user? + Some options are unavailable for LDAP accounts +%hr - unless current_user.ldap_user? - if Gitlab.config.omniauth.enabled %fieldset diff --git a/app/views/profiles/design.html.haml b/app/views/profiles/design.html.haml index 9b6cace4e89..75f00ab10a2 100644 --- a/app/views/profiles/design.html.haml +++ b/app/views/profiles/design.html.haml @@ -1,3 +1,9 @@ +%h3.page-title + My appearance settings +%p.light + Appearance settings saved to your profile and available across all devices +%hr + = form_for @user, url: profile_path, remote: true, method: :put do |f| %fieldset.application-theme %legend diff --git a/app/views/profiles/groups/index.html.haml b/app/views/profiles/groups/index.html.haml index 01f73a24f94..860951b871a 100644 --- a/app/views/profiles/groups/index.html.haml +++ b/app/views/profiles/groups/index.html.haml @@ -1,3 +1,8 @@ +%h3.page-title + Group membership +%p.light + Members of group have access to all group projects. +%hr .ui-box .title %strong Groups diff --git a/app/views/profiles/history.html.haml b/app/views/profiles/history.html.haml index aa7006c569b..5e59463ce37 100644 --- a/app/views/profiles/history.html.haml +++ b/app/views/profiles/history.html.haml @@ -1,3 +1,8 @@ +%h3.page-title + Account history +%p.light + You can see all events authored by your account here +%hr .profile_history = render @events %hr diff --git a/app/views/profiles/keys/index.html.haml b/app/views/profiles/keys/index.html.haml index 03413764be4..f2180b9893b 100644 --- a/app/views/profiles/keys/index.html.haml +++ b/app/views/profiles/keys/index.html.haml @@ -1,9 +1,11 @@ +%h3.page-title + My SSH keys %p.light SSH key allows you to establish a secure connection between your computer and GitLab -%p.light + %br Before you can add ssh key you need to = link_to "generate it", help_ssh_path - +%hr .ui-box diff --git a/app/views/profiles/notifications/show.html.haml b/app/views/profiles/notifications/show.html.haml index 3b8da833232..d7963a88d5d 100644 --- a/app/views/profiles/notifications/show.html.haml +++ b/app/views/profiles/notifications/show.html.haml @@ -1,6 +1,8 @@ %h3.page-title Notifications settings - +%p.light + Application use email specified in your profile for notifications +%hr .alert.alert-info %p %i.icon-circle.cred -- cgit v1.2.1 From b19bffc536c85262e85f81237c544e18040742c6 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 31 Jul 2013 17:53:42 +0300 Subject: More descriptions for pages --- app/views/dashboard/issues.html.haml | 9 +++++---- app/views/dashboard/merge_requests.html.haml | 7 ++++--- app/views/dashboard/projects.html.haml | 3 +++ 3 files changed, 12 insertions(+), 7 deletions(-) diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml index 63003c2859b..1041d9d1d51 100644 --- a/app/views/dashboard/issues.html.haml +++ b/app/views/dashboard/issues.html.haml @@ -1,10 +1,11 @@ %h3.page-title - Issues - %span.light - – - Assigned to you + Issues assigned to me %span.pull-right #{@issues.total_count} issues +%p.light + For all issues you should visit project issues page. Or you can use search panel to find specific issue +%hr + .row .span3 = render 'filter', entity: 'issue' diff --git a/app/views/dashboard/merge_requests.html.haml b/app/views/dashboard/merge_requests.html.haml index de5d8018757..77a40b2eef6 100644 --- a/app/views/dashboard/merge_requests.html.haml +++ b/app/views/dashboard/merge_requests.html.haml @@ -1,10 +1,11 @@ %h3.page-title Merge Requests - %span.light - – - Authored by or assigned to you %span.pull-right #{@merge_requests.total_count} merge requests + +%p.light + Only merge requests authored or assigned to you are listed here. +%hr .row .span3 = render 'filter', entity: 'merge_request' diff --git a/app/views/dashboard/projects.html.haml b/app/views/dashboard/projects.html.haml index 705b316dd74..ab090c42218 100644 --- a/app/views/dashboard/projects.html.haml +++ b/app/views/dashboard/projects.html.haml @@ -1,4 +1,7 @@ %h3.page-title My Projects +%p.light + All projects you have access to are listed here. Public projects are not included here unless you have membership in it +%hr .row .span3 %ul.nav.nav-pills.nav-stacked -- cgit v1.2.1 From e6affad928cfcc8f5c8b031bf791b65377eeb25f Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 31 Jul 2013 20:45:25 +0300 Subject: Fix spinach tests --- features/steps/profile/profile_notifications.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/steps/profile/profile_notifications.rb b/features/steps/profile/profile_notifications.rb index 54b02605689..7a41687dfde 100644 --- a/features/steps/profile/profile_notifications.rb +++ b/features/steps/profile/profile_notifications.rb @@ -7,7 +7,7 @@ class ProfileNotifications < Spinach::FeatureSteps end step 'I should see global notifications settings' do - page.should have_content "Setup your notification level" + page.should have_content "Notifications settings" page.should have_content "Global setting" end end -- cgit v1.2.1 From f90c5655447233cf2228223b7625c78f6e3bdb62 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 1 Aug 2013 14:55:30 +0300 Subject: UI changes: removed box shadow for ui-box and file-holder --- app/assets/stylesheets/gitlab_bootstrap/blocks.scss | 3 +-- app/assets/stylesheets/gitlab_bootstrap/files.scss | 6 +++--- app/assets/stylesheets/gitlab_bootstrap/lists.scss | 1 - app/assets/stylesheets/gitlab_bootstrap/tables.scss | 9 ++++----- app/assets/stylesheets/sections/issues.scss | 5 +---- app/assets/stylesheets/sections/nav.scss | 4 ++-- app/assets/stylesheets/themes/ui_mars.scss | 4 ---- 7 files changed, 11 insertions(+), 21 deletions(-) diff --git a/app/assets/stylesheets/gitlab_bootstrap/blocks.scss b/app/assets/stylesheets/gitlab_bootstrap/blocks.scss index 053c275c3bb..16840184d2a 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/blocks.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/blocks.scss @@ -10,11 +10,10 @@ * */ .ui-box { - background: #F9F9F9; + background: #FFF; margin-bottom: 20px; border: 1px solid #CCC; word-wrap: break-word; - @include solid-shade; &.ui-box-show { margin:20px 0; diff --git a/app/assets/stylesheets/gitlab_bootstrap/files.scss b/app/assets/stylesheets/gitlab_bootstrap/files.scss index ec03fd0d844..a0d6682eb8f 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/files.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/files.scss @@ -3,18 +3,18 @@ * */ .file-holder { - border: 1px solid #BBB; + border: 1px solid #CCC; margin-bottom: 1em; - @include solid-shade; .file-title { border-bottom: 1px solid #bbb; @include bg-dark-gray-gradient; + text-shadow: 0 1px 1px #fff; margin: 0; font-weight: normal; font-weight: bold; text-align: left; - color: #666; + color: $style_color; padding: 9px 10px; height: 18px; diff --git a/app/assets/stylesheets/gitlab_bootstrap/lists.scss b/app/assets/stylesheets/gitlab_bootstrap/lists.scss index cc7084d27d5..d23323979bc 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/lists.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/lists.scss @@ -6,7 +6,6 @@ margin: 0; list-style: none; li { - background-color: #FFF; padding: 10px; min-height: 20px; border-bottom: 1px solid #eee; diff --git a/app/assets/stylesheets/gitlab_bootstrap/tables.scss b/app/assets/stylesheets/gitlab_bootstrap/tables.scss index f46ae91b6ab..a1a5139cda9 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/tables.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/tables.scss @@ -1,8 +1,7 @@ table { @extend .table; @extend .table-striped; - @include solid-shade; - border: 1px solid #bbb; + border: 1px solid #CCC; width: 100%; &.low { @@ -20,7 +19,7 @@ table { th { font-weight: bold; vertical-align: middle; - border-bottom: 1px solid #bbb; + border-bottom: 1px solid #CCC; text-shadow: 0 1px 1px #fff; @include bg-dark-gray-gradient; @@ -46,11 +45,11 @@ table { } &:first-child { - border-left: 1px solid #bbb; + border-left: 1px solid #CCC; } &:last-child { - border-right: 1px solid #bbb; + border-right: 1px solid #CCC; } } diff --git a/app/assets/stylesheets/sections/issues.scss b/app/assets/stylesheets/sections/issues.scss index ed7902fec3a..6ebb9b47c90 100644 --- a/app/assets/stylesheets/sections/issues.scss +++ b/app/assets/stylesheets/sections/issues.scss @@ -88,14 +88,11 @@ input.check_all_issues { } .update_selected_issues { - position: relative; - top:5px; margin-left: 4px; - float: left; } .update_issues_text { - padding: 3px; + padding: 5px; line-height: 28px; float: left; color: #479; diff --git a/app/assets/stylesheets/sections/nav.scss b/app/assets/stylesheets/sections/nav.scss index 77ed57a6cfc..54263523e85 100644 --- a/app/assets/stylesheets/sections/nav.scss +++ b/app/assets/stylesheets/sections/nav.scss @@ -7,7 +7,7 @@ ul { margin: auto; - height: 42px; + height: 40px; overflow: hidden; .count { font-weight: normal; @@ -74,7 +74,7 @@ text-align: center; font-weight: normal; height: 38px; - line-height: 36px; + line-height: 34px; color: #777; text-shadow: 0 1px 1px white; padding: 0 10px; diff --git a/app/assets/stylesheets/themes/ui_mars.scss b/app/assets/stylesheets/themes/ui_mars.scss index 44649ea037c..a2b8c21ea11 100644 --- a/app/assets/stylesheets/themes/ui_mars.scss +++ b/app/assets/stylesheets/themes/ui_mars.scss @@ -31,8 +31,4 @@ border-left: 1px solid #666; } } - - .main-nav { - box-shadow: 0 -1px 0 white inset; - } } -- cgit v1.2.1 From 08bcf639a015628f5ddfc34236bc6b84a977957f Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 1 Aug 2013 15:21:43 +0300 Subject: Add titles for blame view and Edit mode --- app/assets/stylesheets/gitlab_bootstrap/blocks.scss | 4 ---- app/views/projects/blame/_head.html.haml | 2 -- app/views/projects/blame/show.html.haml | 14 ++------------ app/views/projects/edit_tree/show.html.haml | 1 + 4 files changed, 3 insertions(+), 18 deletions(-) delete mode 100644 app/views/projects/blame/_head.html.haml diff --git a/app/assets/stylesheets/gitlab_bootstrap/blocks.scss b/app/assets/stylesheets/gitlab_bootstrap/blocks.scss index 16840184d2a..572bc18a3a1 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/blocks.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/blocks.scss @@ -70,10 +70,6 @@ border-top: 1px solid #eee; } - &.white { - background: #fff; - } - ul { margin: 0; } diff --git a/app/views/projects/blame/_head.html.haml b/app/views/projects/blame/_head.html.haml deleted file mode 100644 index 3a883829562..00000000000 --- a/app/views/projects/blame/_head.html.haml +++ /dev/null @@ -1,2 +0,0 @@ -%div.tree-ref-holder - = render 'shared/ref_switcher', destination: 'tree', path: params[:path] diff --git a/app/views/projects/blame/show.html.haml b/app/views/projects/blame/show.html.haml index e9a69390577..cdca8b2e634 100644 --- a/app/views/projects/blame/show.html.haml +++ b/app/views/projects/blame/show.html.haml @@ -1,21 +1,11 @@ -= render "head" +%h3.page-title Blame view #tree-holder.tree-holder - %ul.breadcrumb - %li - %i.icon-angle-right - = link_to project_tree_path(@project, @ref) do - = @project.name - - tree_breadcrumbs(@tree, 6) do |link| - \/ - %li= link - .clear - .file-holder .file-title %i.icon-file %span.file_name - = @blob.name + = @path %small= number_to_human_size @blob.size %span.options= render "projects/blob/actions" .file-content.blame diff --git a/app/views/projects/edit_tree/show.html.haml b/app/views/projects/edit_tree/show.html.haml index 65b6e994884..06396ba992b 100644 --- a/app/views/projects/edit_tree/show.html.haml +++ b/app/views/projects/edit_tree/show.html.haml @@ -1,3 +1,4 @@ +%h3.page-title Edit mode .file-editor = form_tag(project_edit_tree_path(@project, @id), method: :put, class: "form-horizontal") do .file-holder -- cgit v1.2.1 From ce5fca48288043bf1e7077826a9b36a16b3eb5c7 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 1 Aug 2013 15:59:57 +0300 Subject: Fix MR modal --- app/assets/javascripts/merge_requests.js.coffee | 7 +------ app/assets/stylesheets/sections/commits.scss | 4 ++++ app/views/projects/commits/show.html.haml | 2 +- app/views/projects/merge_requests/edit.html.haml | 2 +- app/views/projects/merge_requests/show/_how_to_merge.html.haml | 2 +- app/views/projects/merge_requests/show/_mr_accept.html.haml | 5 +++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/app/assets/javascripts/merge_requests.js.coffee b/app/assets/javascripts/merge_requests.js.coffee index 769a940959b..153198ca5c5 100644 --- a/app/assets/javascripts/merge_requests.js.coffee +++ b/app/assets/javascripts/merge_requests.js.coffee @@ -22,12 +22,7 @@ class MergeRequest this.$('.show-all-commits').on 'click', => this.showAllCommits() - modal = $('#modal_merge_info').modal modal: true, show:false - - $('.how_to_merge_link').bind "click", -> - modal.show() - $('.modal-header .close').bind "click", -> - modal.hide() + modal = $('#modal_merge_info').modal(show: false) # Local jQuery finder $: (selector) -> diff --git a/app/assets/stylesheets/sections/commits.scss b/app/assets/stylesheets/sections/commits.scss index 1a2c5e76706..316dc3d2784 100644 --- a/app/assets/stylesheets/sections/commits.scss +++ b/app/assets/stylesheets/sections/commits.scss @@ -471,3 +471,7 @@ li.commit { } } } + +.commit-breadcrumb { + padding: 0; +} diff --git a/app/views/projects/commits/show.html.haml b/app/views/projects/commits/show.html.haml index d56923fdca4..723c5a1c340 100644 --- a/app/views/projects/commits/show.html.haml +++ b/app/views/projects/commits/show.html.haml @@ -1,7 +1,7 @@ = render "head" - if @path.present? - %ul.breadcrumb + %ul.breadcrumb.commit-breadcrumb %li.light History for = commits_breadcrumbs diff --git a/app/views/projects/merge_requests/edit.html.haml b/app/views/projects/merge_requests/edit.html.haml index 348ebee46e4..67a1541d9bf 100644 --- a/app/views/projects/merge_requests/edit.html.haml +++ b/app/views/projects/merge_requests/edit.html.haml @@ -1,4 +1,4 @@ %h3.page-title - = "Edit merge request #{@merge_request.id}" + = "Edit merge request ##{@merge_request.id}" %hr = render 'form' diff --git a/app/views/projects/merge_requests/show/_how_to_merge.html.haml b/app/views/projects/merge_requests/show/_how_to_merge.html.haml index 7f1e33418de..3864e3bbc35 100644 --- a/app/views/projects/merge_requests/show/_how_to_merge.html.haml +++ b/app/views/projects/merge_requests/show/_how_to_merge.html.haml @@ -1,6 +1,6 @@ %div#modal_merge_info.modal.hide .modal-header - %a.close{href: "#"} × + %a.close{href: "#", "data-dismiss" => "modal"} × %h3 How To Merge .modal-body %p diff --git a/app/views/projects/merge_requests/show/_mr_accept.html.haml b/app/views/projects/merge_requests/show/_mr_accept.html.haml index 01378d99c99..91543717467 100644 --- a/app/views/projects/merge_requests/show/_mr_accept.html.haml +++ b/app/views/projects/merge_requests/show/_mr_accept.html.haml @@ -11,7 +11,8 @@ %p You can accept this request automatically. If you still want to do it manually - - %strong= link_to "click here", "#", class: "how_to_merge_link vlink", title: "How To Merge" + %strong + = link_to "click here", "#modal_merge_info", class: "how_to_merge_link vlink", title: "How To Merge", "data-toggle" => "modal" for instructions .accept_group = f.submit "Accept Merge Request", class: "btn btn-create accept_merge_request" @@ -31,7 +32,7 @@ .automerge_widget.cannot_be_merged{style: "display:none"} .alert.alert-disabled %span - = link_to "Show how to merge", "#", class: "how_to_merge_link btn btn-small padded", title: "How To Merge" + = link_to "Show how to merge", "#modal_merge_info", class: "how_to_merge_link btn btn-small padded", title: "How To Merge", "data-toggle" => "modal"   %strong This request can't be merged with GitLab. You should do it manually -- cgit v1.2.1 From 3e9460b6cb8184aada5932abeeafa6be53459a69 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 1 Aug 2013 16:11:50 +0300 Subject: Fix minor wording --- app/views/groups/edit.html.haml | 6 +++--- app/views/projects/merge_requests/show/_how_to_merge.html.haml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/groups/edit.html.haml b/app/views/groups/edit.html.haml index ba3333832ea..13264b37134 100644 --- a/app/views/groups/edit.html.haml +++ b/app/views/groups/edit.html.haml @@ -20,7 +20,7 @@ .ui-box .title %strong= @group.name - Group Settings: + group settings: %div.form-holder = form_for @group do |f| - if @group.errors.any? @@ -44,7 +44,7 @@ .ui-box .title %strong= @group.name - Projects: + projects: - if can? current_user, :manage_group, @group %span.pull-right = link_to new_project_path(namespace_id: @group.id), class: "btn btn-tiny" do @@ -85,4 +85,4 @@ %p %strong Removed group can not be restored! - = link_to 'Remove Group', @group, confirm: 'Removed group can not be restored! Are you sure?', method: :delete, class: "btn btn-remove btn-small" + = link_to 'Remove Group', @group, confirm: 'Removed group can not be restored! Are you sure?', method: :delete, class: "btn btn-remove" diff --git a/app/views/projects/merge_requests/show/_how_to_merge.html.haml b/app/views/projects/merge_requests/show/_how_to_merge.html.haml index 3864e3bbc35..04d11092bed 100644 --- a/app/views/projects/merge_requests/show/_how_to_merge.html.haml +++ b/app/views/projects/merge_requests/show/_how_to_merge.html.haml @@ -1,7 +1,7 @@ %div#modal_merge_info.modal.hide .modal-header %a.close{href: "#", "data-dismiss" => "modal"} × - %h3 How To Merge + %h3 How to merge .modal-body %p %strong Step 1. -- cgit v1.2.1 From 0be062152a780950d699676c7cf7e6b7154d7db9 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 1 Aug 2013 16:20:18 +0300 Subject: Improve new project page --- app/views/projects/new.html.haml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index e45b2b5757e..dca897dce67 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -8,7 +8,6 @@ Project name is .input = f.text_field :name, placeholder: "Example Project", class: "xxlarge", tabindex: 1, autofocus: true - = f.submit 'Create project', class: "btn btn-create project-submit", tabindex: 4 - if current_user.can_select_namespace? .clearfix @@ -38,14 +37,15 @@ %p.padded New projects are private by default. You choose who can see the project and commit to repository. - %hr + .form-actions + = f.submit 'Create project', class: "btn btn-create project-submit", tabindex: 4 - - if current_user.can_create_group? - .clearfix - .input.light - Need a group for several dependent projects? - = link_to new_group_path, class: "btn btn-tiny" do - Create a group + - if current_user.can_create_group? + .pull-right + .input.light + Need a group for several dependent projects? + = link_to new_group_path, class: "btn btn-tiny" do + Create a group .save-project-loader.hide %center -- cgit v1.2.1 From 942cf323339373911df9b3559df9de8141c2c8d6 Mon Sep 17 00:00:00 2001 From: Sytse Sijbrandij Date: Thu, 1 Aug 2013 21:23:57 +0200 Subject: Better description based on a conversation in the contributor room. --- doc/update/5.4-to-6.0.md | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/doc/update/5.4-to-6.0.md b/doc/update/5.4-to-6.0.md index 42b9ee50d56..d7a5e964e24 100644 --- a/doc/update/5.4-to-6.0.md +++ b/doc/update/5.4-to-6.0.md @@ -9,9 +9,13 @@ So you need to move all your global projects under group/users manually before u #### Teams -We drop teams support as separate entity for 6.0 in favor of group membership. -So now you will be able to manage group members in order to provide access to corresponding projects. - +We deprecate teams as separate entity in 6.0 in favor of group membership. +The old combination of groups and teams was confusing for a lot of people. +And when the members of a team where changed this wasn't reflected in the project permissions. +In GitLab 6.0 you will be able to add members to a group with a permission level for each member. +These group members will have access to the projects in that group. +Any changes to group members will immediately be reflected in the project permissions. +You can even have multiple owners for a group, greatly simplifying administration. ### 0. Backup @@ -81,4 +85,4 @@ To make sure you didn't miss anything run a more thorough check with: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production -If all items are green, then congratulations upgrade complete! \ No newline at end of file +If all items are green, then congratulations upgrade complete! -- cgit v1.2.1 From b8f6d67b96991e8089fb3b139d4e17994af60b17 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 1 Aug 2013 22:35:04 +0300 Subject: Restyle buttons --- .../stylesheets/gitlab_bootstrap/buttons.scss | 128 ++++++++++++--------- 1 file changed, 75 insertions(+), 53 deletions(-) diff --git a/app/assets/stylesheets/gitlab_bootstrap/buttons.scss b/app/assets/stylesheets/gitlab_bootstrap/buttons.scss index 90b041b29db..503de3cfd80 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/buttons.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/buttons.scss @@ -1,59 +1,96 @@ .btn { + display: inline-block; + padding: 6px 12px; + margin-bottom: 0; + font-size: 13px; + line-height: $baseLineHeight; + text-align: center; + vertical-align: middle; + cursor: pointer; + border: 1px solid #BBB; + color: $style_color; + @include border-radius($baseBorderRadius); + @include box-shadow(inset 0 1px 0 rgba(255,255,255,.2)); @include linear-gradient(#f1f1f1, #e1e1e1); text-shadow: 0 1px 1px #FFF; - border-color: #BBB; + text-decoration: none; + &.hover, &:hover { + color: $style_color; background: #f1f1f1; - @include linear-gradient(#fAfAfA, #f1f1f1); border-color: #AAA; - color: #333; + text-decoration: none; + @include linear-gradient(#fAfAfA, #f1f1f1); } - &.btn-primary { - background: #2a79A3; - @include linear-gradient(#47A7b7, #2585b5); - border-color: #2A79A3; - color: #fff; - text-shadow: 0 1px 1px #268; - &:hover { - background: $primary_color; - color: #fff; - } - - &.disabled { - color: #fff; - background: $primary_color; - } + &.active, + &:active { + background-image: none; + outline: 0; + @include box-shadow(inset 0 2px 4px rgba(0,0,0,.15)); } - &.btn-info { - background: #5aB9C3; - border-color: $primary_color; - color: #fff; - text-shadow: 0 1px 1px #268; - &:hover { - background: $primary_color; - color: #fff; - } + &.disabled, + &[disabled] { + cursor: default; + background-image: none; + @include opacity(65); + @include box-shadow(none); + } - &.disabled { - color: #fff; - background: $primary_color; + &.btn-primary { + color: #FFF; + border-color: #189; + text-shadow: 0 1px 1px #189; + @include linear-gradient(#4AC, #289); + + &.hover, + &:hover, + &.disabled, + &[disabled] { + color: #FFF; + background: #389; } } &.btn-success { - &:hover { - background: #51a351; + color: #FFF; + border-color: #1A1; + text-shadow: 0 1px 1px #FFF; + text-shadow: 0 1px 1px #181; + @include linear-gradient(#62C452, #51a351); + + + &.hover, + &:hover, + &.disabled, + &[disabled] { + color: #FFF; + background: #2A2; } + } + + &.btn-danger { + color: #FFF; + text-shadow: 0 1px 1px #811; + border-color: #BD362F; + @include linear-gradient(#EE5F5B, #BD362F); - &.disabled { - color: #fff; - background: #2b2; + + &.hover, + &:hover, + &.disabled, + &[disabled] { + color: #FFF; + background: #A22; } } + &.btn-new { + @extend .btn-success; + } + &.btn-create { @extend .wide; @extend .btn-success; @@ -67,12 +104,6 @@ &.btn-close, &.btn-remove { @extend .btn-danger; - border-color: #BD362F; - - &:hover { - color: #fff; - background: #EE4E49; - } } &.btn-cancel { @@ -84,13 +115,9 @@ padding-right: 20px; } - &.small { - @extend .btn-small; - } - - &.active { - border-color: #aaa; - background-color: #ccc; + &.btn-small { + padding: 2px 10px; + font-size: 12px; } &.btn-tiny { @@ -104,9 +131,4 @@ margin-right: 7px; float: left; } - - &.padded { - margin-right: 3px; - padding: 4px 10px 4px; - } } -- cgit v1.2.1 From e834742407a74c26a443cce888c8ab0c210bf1cd Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 1 Aug 2013 22:35:40 +0300 Subject: Dont load bootstrap buttons. Modified css with new buttons --- app/assets/stylesheets/common.scss | 34 ----------------- app/assets/stylesheets/gitlab_bootstrap.scss | 43 +++++++++++++++++++++- .../stylesheets/gitlab_bootstrap/blocks.scss | 2 + .../stylesheets/gitlab_bootstrap/common.scss | 8 ++++ app/assets/stylesheets/gitlab_bootstrap/forms.scss | 32 ++++++++++++++++ .../stylesheets/gitlab_bootstrap/typography.scss | 7 ---- app/assets/stylesheets/sections/commits.scss | 4 +- app/assets/stylesheets/sections/projects.scss | 11 +++--- app/assets/stylesheets/sections/tree.scss | 2 + app/views/admin/groups/index.html.haml | 2 +- app/views/admin/hooks/index.html.haml | 2 +- app/views/admin/projects/index.html.haml | 2 +- app/views/admin/users/index.html.haml | 2 +- app/views/profiles/groups/index.html.haml | 10 ++--- app/views/profiles/keys/index.html.haml | 4 +- app/views/profiles/show.html.haml | 2 +- app/views/projects/blob/_actions.html.haml | 10 ++--- app/views/projects/compare/_form.html.haml | 4 +- app/views/projects/deploy_keys/index.html.haml | 10 +++-- app/views/projects/edit.html.haml | 4 +- app/views/projects/hooks/index.html.haml | 2 +- app/views/projects/issues/index.html.haml | 4 +- app/views/projects/merge_requests/index.html.haml | 2 +- app/views/projects/milestones/_form.html.haml | 2 +- app/views/projects/milestones/index.html.haml | 2 +- app/views/projects/team_members/index.html.haml | 4 +- app/views/projects/wikis/_form.html.haml | 3 +- app/views/projects/wikis/_nav.html.haml | 2 +- app/views/projects/wikis/git_access.html.haml | 3 +- app/views/snippets/current_user_index.html.haml | 7 ++-- app/views/snippets/index.html.haml | 8 ++-- app/views/snippets/show.html.haml | 2 +- features/steps/profile/profile.rb | 2 +- features/steps/project/project.rb | 2 +- 34 files changed, 143 insertions(+), 97 deletions(-) create mode 100644 app/assets/stylesheets/gitlab_bootstrap/forms.scss diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index abbd6871008..8791324b6a9 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -81,33 +81,6 @@ span.update-author { font-weight: normal; } -form { - @extend .form-horizontal; - - .actions { - @extend .form-actions; - } - - .clearfix { - @extend .control-group; - } - - .input { - @extend .controls; - } - - label { - @extend .control-label; - } - .xlarge { - @extend .input-xlarge; - } - .xxlarge { - @extend .input-xxlarge; - } -} - - .field_with_errors { display: inline; } @@ -127,13 +100,6 @@ ul.breadcrumb { } } -input[type=text] { - &.large_text { - padding: 6px; - font-size: 16px; - } -} - .line_holder { &:hover { td { diff --git a/app/assets/stylesheets/gitlab_bootstrap.scss b/app/assets/stylesheets/gitlab_bootstrap.scss index 2ad1bf944a9..1b24683fd97 100644 --- a/app/assets/stylesheets/gitlab_bootstrap.scss +++ b/app/assets/stylesheets/gitlab_bootstrap.scss @@ -2,11 +2,49 @@ $baseFontSize: 13px !default; $baseLineHeight: 18px !default; -// BOOTSTRAP -@import "bootstrap"; +/** + * BOOTSTRAP + */ +@import "bootstrap/variables"; +@import "bootstrap/mixins"; +@import "bootstrap/reset"; +@import "bootstrap/scaffolding"; +@import "bootstrap/grid"; +@import "bootstrap/layouts"; +@import "bootstrap/type"; +@import "bootstrap/code"; +@import "bootstrap/forms"; +@import "bootstrap/tables"; +@import "bootstrap/sprites"; +@import "bootstrap/dropdowns"; +@import "bootstrap/wells"; +@import "bootstrap/component-animations"; +@import "bootstrap/close"; +@import "bootstrap/button-groups"; +@import "bootstrap/alerts"; +@import "bootstrap/navs"; +@import "bootstrap/navbar"; +@import "bootstrap/breadcrumbs"; +@import "bootstrap/pagination"; +@import "bootstrap/pager"; +@import "bootstrap/modals"; +@import "bootstrap/tooltip"; +@import "bootstrap/popovers"; +@import "bootstrap/thumbnails"; +@import "bootstrap/media"; +@import "bootstrap/labels-badges"; +@import "bootstrap/progress-bars"; +@import "bootstrap/accordion"; +@import "bootstrap/carousel"; +@import "bootstrap/hero-unit"; +@import "bootstrap/utilities"; @import "bootstrap/responsive-utilities"; @import "bootstrap/responsive-1200px-min"; +/** + * Font icons + * + */ @import "font-awesome"; /** @@ -26,3 +64,4 @@ $baseLineHeight: 18px !default; @import "gitlab_bootstrap/files.scss"; @import "gitlab_bootstrap/tables.scss"; @import "gitlab_bootstrap/lists.scss"; +@import "gitlab_bootstrap/forms.scss"; diff --git a/app/assets/stylesheets/gitlab_bootstrap/blocks.scss b/app/assets/stylesheets/gitlab_bootstrap/blocks.scss index 572bc18a3a1..08202211e53 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/blocks.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/blocks.scss @@ -97,6 +97,8 @@ .btn { vertical-align: middle; + padding: 4px 12px; + @include box-shadow(0 0px 1px 1px #f2f2f2); } .nav-pills { diff --git a/app/assets/stylesheets/gitlab_bootstrap/common.scss b/app/assets/stylesheets/gitlab_bootstrap/common.scss index 4f531b58a24..24544d74ac2 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/common.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/common.scss @@ -90,3 +90,11 @@ pre.well-pre { border-radius: 0; color: #555; } + +.input-append .btn.active, .input-prepend .btn.active { + background: #CCC; + border-color: #BBB; + text-shadow: 0 1px 1px #fff; + font-weight: bold; + @include box-shadow(inset 0 2px 4px rgba(0,0,0,.15)); +} diff --git a/app/assets/stylesheets/gitlab_bootstrap/forms.scss b/app/assets/stylesheets/gitlab_bootstrap/forms.scss new file mode 100644 index 00000000000..20564cc1910 --- /dev/null +++ b/app/assets/stylesheets/gitlab_bootstrap/forms.scss @@ -0,0 +1,32 @@ +form { + @extend .form-horizontal; + + .actions { + @extend .form-actions; + } + + .clearfix { + @extend .control-group; + } + + .input { + @extend .controls; + } + + label { + @extend .control-label; + } + .xlarge { + @extend .input-xlarge; + } + .xxlarge { + @extend .input-xxlarge; + } +} + +input { + &.input-xpadding { + padding: 6px 10px; + } +} + diff --git a/app/assets/stylesheets/gitlab_bootstrap/typography.scss b/app/assets/stylesheets/gitlab_bootstrap/typography.scss index ba0c40ae0a0..d3986556376 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/typography.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/typography.scss @@ -52,13 +52,6 @@ a { text-decoration: underline; } - &.btn { - color: $style_color; - &:hover { - color: $style_color; - } - } - &.dark { color: $style_color; } diff --git a/app/assets/stylesheets/sections/commits.scss b/app/assets/stylesheets/sections/commits.scss index 316dc3d2784..35de2826c9b 100644 --- a/app/assets/stylesheets/sections/commits.scss +++ b/app/assets/stylesheets/sections/commits.scss @@ -421,8 +421,8 @@ .commits-compare-switch{ background: url("switch_icon.png") no-repeat center center; - width: 16px; - height: 18px; + width: 22px; + height: 22px; text-indent: -9999px; float: left; margin-right: 9px; diff --git a/app/assets/stylesheets/sections/projects.scss b/app/assets/stylesheets/sections/projects.scss index 505c8d960f4..c6bec5a4d9a 100644 --- a/app/assets/stylesheets/sections/projects.scss +++ b/app/assets/stylesheets/sections/projects.scss @@ -7,11 +7,6 @@ line-height: 20px; padding: 8px; } - .btn { - padding: 6px 10px; - margin-left: 10px; - margin-bottom: 8px; - } } .adv_settings { h6 { margin-left: 40px; } @@ -30,6 +25,10 @@ padding: 4px 7px; border: 1px solid #CCC; margin-bottom: 20px; + + .btn { + padding: 4px 12px; + } } .project_clone_holder { @@ -114,7 +113,7 @@ ul.nav.nav-projects-tabs { .public-clone { background: #333; color: #f5f5f5; - padding: 5px 10px; + padding: 6px 10px; margin: 1px; font-weight: normal; } diff --git a/app/assets/stylesheets/sections/tree.scss b/app/assets/stylesheets/sections/tree.scss index d8f32e49c2d..b8b82bcf68c 100644 --- a/app/assets/stylesheets/sections/tree.scss +++ b/app/assets/stylesheets/sections/tree.scss @@ -104,6 +104,8 @@ } .tree-btn-group { + top: 2px; + .btn { margin-right: 0px; padding: 2px 10px; diff --git a/app/views/admin/groups/index.html.haml b/app/views/admin/groups/index.html.haml index cff0251cd5a..8e45dc76ec6 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 pull-right" + = link_to 'New Group', new_admin_group_path, class: "btn btn-new pull-right" %br = form_tag admin_groups_path, method: :get, class: 'form-inline' do = text_field_tag :name, params[:name], class: "span6" diff --git a/app/views/admin/hooks/index.html.haml b/app/views/admin/hooks/index.html.haml index 316e8235cbe..7c3b999afb3 100644 --- a/app/views/admin/hooks/index.html.haml +++ b/app/views/admin/hooks/index.html.haml @@ -13,7 +13,7 @@ .clearfix = f.label :url, "URL:" .input - = f.text_field :url, class: "text_field xxlarge" + = f.text_field :url, class: "text_field xxlarge input-xpadding"   = f.submit "Add System Hook", class: "btn btn-create" %hr diff --git a/app/views/admin/projects/index.html.haml b/app/views/admin/projects/index.html.haml index d641d366ca7..bc297209ae5 100644 --- a/app/views/admin/projects/index.html.haml +++ b/app/views/admin/projects/index.html.haml @@ -38,7 +38,7 @@ .title Projects (#{@projects.total_count}) .pull-right - = link_to 'New Project', new_project_path, class: "btn btn-small btn-primary wide" + = link_to 'New Project', new_project_path, class: "btn btn-new" %ul.well-list - @projects.each do |project| %li diff --git a/app/views/admin/users/index.html.haml b/app/views/admin/users/index.html.haml index e0647933394..b32f0ae87cc 100644 --- a/app/views/admin/users/index.html.haml +++ b/app/views/admin/users/index.html.haml @@ -30,7 +30,7 @@ .title Users (#{@users.total_count}) .pull-right - = link_to 'New User', new_admin_user_path, class: "btn btn-small wide btn-primary" + = link_to 'New User', new_admin_user_path, class: "btn btn-new" %ul.well-list - @users.each do |user| %li diff --git a/app/views/profiles/groups/index.html.haml b/app/views/profiles/groups/index.html.haml index 860951b871a..63695d7e0b9 100644 --- a/app/views/profiles/groups/index.html.haml +++ b/app/views/profiles/groups/index.html.haml @@ -1,5 +1,10 @@ %h3.page-title Group membership + - if current_user.can_create_group? + %span.pull-right + = link_to new_group_path, class: "btn btn-new" do + %i.icon-plus + New Group %p.light Members of group have access to all group projects. %hr @@ -7,11 +12,6 @@ .title %strong Groups (#{@groups.count}) - - if current_user.can_create_group? - %span.pull-right - = link_to new_group_path, class: "btn btn-small btn-primary" do - %i.icon-plus - New Group %ul.well-list - @groups.each do |group| %li diff --git a/app/views/profiles/keys/index.html.haml b/app/views/profiles/keys/index.html.haml index f2180b9893b..0704874763e 100644 --- a/app/views/profiles/keys/index.html.haml +++ b/app/views/profiles/keys/index.html.haml @@ -1,5 +1,7 @@ %h3.page-title My SSH keys + .pull-right + = link_to "Add SSH Key", new_profile_key_path, class: "btn btn-new" %p.light SSH key allows you to establish a secure connection between your computer and GitLab %br @@ -11,8 +13,6 @@ .ui-box .title SSH Keys (#{@keys.count}) - .pull-right - = link_to "Add SSH Key", new_profile_key_path, class: "btn btn-small btn-primary" %ul.well-list#keys-table = render @keys - if @keys.blank? diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml index dd1186fd37c..25bf7912f1e 100644 --- a/app/views/profiles/show.html.haml +++ b/app/views/profiles/show.html.haml @@ -87,4 +87,4 @@ = link_to "Add Public Key", new_profile_key_path, class: "btn btn-small" .form-actions - = f.submit 'Save', class: "btn btn-save" + = f.submit 'Save changes', class: "btn btn-save" diff --git a/app/views/projects/blob/_actions.html.haml b/app/views/projects/blob/_actions.html.haml index 456c7432c94..5641c528a4f 100644 --- a/app/views/projects/blob/_actions.html.haml +++ b/app/views/projects/blob/_actions.html.haml @@ -1,12 +1,12 @@ .btn-group.tree-btn-group -# only show edit link for text files - if @blob.text? - = link_to "edit", project_edit_tree_path(@project, @id), class: "btn btn-tiny", disabled: !allowed_tree_edit? - = link_to "raw", project_raw_path(@project, @id), class: "btn btn-tiny", target: "_blank" + = link_to "edit", project_edit_tree_path(@project, @id), class: "btn btn-small", disabled: !allowed_tree_edit? + = link_to "raw", project_raw_path(@project, @id), class: "btn btn-small", target: "_blank" -# only show normal/blame view links for text files - if @blob.text? - if current_page? project_blame_path(@project, @id) - = link_to "normal view", project_blob_path(@project, @id), class: "btn btn-tiny" + = link_to "normal view", project_blob_path(@project, @id), class: "btn btn-small" - else - = link_to "blame", project_blame_path(@project, @id), class: "btn btn-tiny" unless @blob.empty? - = link_to "history", project_commits_path(@project, @id), class: "btn btn-tiny" + = link_to "blame", project_blame_path(@project, @id), class: "btn btn-small" unless @blob.empty? + = link_to "history", project_commits_path(@project, @id), class: "btn btn-small" diff --git a/app/views/projects/compare/_form.html.haml b/app/views/projects/compare/_form.html.haml index 0d388651e14..a83380841fa 100644 --- a/app/views/projects/compare/_form.html.haml +++ b/app/views/projects/compare/_form.html.haml @@ -14,9 +14,9 @@ .pull-left - if params[:to] && params[:from] = link_to 'switch', {from: params[:to], to: params[:from]}, {class: 'commits-compare-switch has_tooltip', title: 'Switch base of comparison'} - = text_field_tag :from, params[:from], placeholder: "master", class: "xlarge" + = text_field_tag :from, params[:from], placeholder: "master", class: "xlarge input-xpadding" = "..." - = text_field_tag :to, params[:to], placeholder: "aa8b4ef", class: "xlarge" + = text_field_tag :to, params[:to], placeholder: "aa8b4ef", class: "xlarge input-xpadding" .pull-left   = submit_tag "Compare", class: "btn btn-create commits-compare-btn" diff --git a/app/views/projects/deploy_keys/index.html.haml b/app/views/projects/deploy_keys/index.html.haml index a1fa3475a84..757b8c00eea 100644 --- a/app/views/projects/deploy_keys/index.html.haml +++ b/app/views/projects/deploy_keys/index.html.haml @@ -1,12 +1,14 @@ %p.slead - Deploy keys allow read-only access to repository. They can be used for CI, staging or production servers + Deploy keys allow read-only access to repository -%p - You can create a deploy key or add existing one - = link_to new_project_deploy_key_path(@project), class: "btn btn-primary pull-right", title: "New Deploy Key" do + = link_to new_project_deploy_key_path(@project), class: "btn btn-new pull-right", title: "New Deploy Key" do %i.icon-plus New Deploy Key +%p.light + They can be used for CI, staging or production servers. + You can create a deploy key or add existing one + %hr.clearfix .row diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml index f9fc65a71b4..d273a5c64fb 100644 --- a/app/views/projects/edit.html.haml +++ b/app/views/projects/edit.html.haml @@ -4,7 +4,7 @@ .ui-box.white .title %strong= @project.name - Project Settings: + project settings: .form-holder = form_for(@project, remote: true) do |f| %fieldset @@ -98,7 +98,7 @@ .form-actions - = f.submit 'Save', class: "btn btn-save" + = f.submit 'Save changes', class: "btn btn-save" - if can?(current_user, :change_namespace, @project) .ui-box.ui-box-danger diff --git a/app/views/projects/hooks/index.html.haml b/app/views/projects/hooks/index.html.haml index c4b51d09335..a85f50491d6 100644 --- a/app/views/projects/hooks/index.html.haml +++ b/app/views/projects/hooks/index.html.haml @@ -14,7 +14,7 @@ .clearfix = f.label :url, "URL:" .input - = f.text_field :url, class: "text_field xxlarge" + = f.text_field :url, class: "text_field xxlarge input-xpadding", placeholder: 'http://example.com/trigger-ci.json'   = f.submit "Add Web Hook", class: "btn btn-create" %hr diff --git a/app/views/projects/issues/index.html.haml b/app/views/projects/issues/index.html.haml index ebe124d8906..50df3ee3b7a 100644 --- a/app/views/projects/issues/index.html.haml +++ b/app/views/projects/issues/index.html.haml @@ -6,7 +6,7 @@ .pull-right .span6 - 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: "btn btn-primary pull-right", 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-new pull-right", title: "New Issue", id: "new_issue_link" do %i.icon-plus New Issue = form_tag project_issues_path(@project), method: :get, remote: true, id: "issue_search_form", class: 'pull-right' do @@ -14,7 +14,7 @@ = hidden_field_tag :assignee_id, params[:assignee_id], id: 'search_assignee_id' = hidden_field_tag :milestone_id, params[:milestone_id], id: 'search_milestone_id' = hidden_field_tag :label_name, params[:label_name], id: 'search_label_name' - = search_field_tag :issue_search, nil, { placeholder: 'Search', class: 'issue_search input-xlarge append-right-10 search-text-input' } + = search_field_tag :issue_search, nil, { placeholder: 'Filter by title or description', class: 'input-xpadding issue_search input-xlarge append-right-10 search-text-input' } .row .span3 diff --git a/app/views/projects/merge_requests/index.html.haml b/app/views/projects/merge_requests/index.html.haml index f54a213a3f3..9b9da8d1b8f 100644 --- a/app/views/projects/merge_requests/index.html.haml +++ b/app/views/projects/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: "pull-right btn btn-primary", title: "New Merge Request" do + = link_to new_project_merge_request_path(@project), class: "pull-right btn btn-new", title: "New Merge Request" do %i.icon-plus New Merge Request %h3.page-title diff --git a/app/views/projects/milestones/_form.html.haml b/app/views/projects/milestones/_form.html.haml index 0dc9dab872f..825243e773f 100644 --- a/app/views/projects/milestones/_form.html.haml +++ b/app/views/projects/milestones/_form.html.haml @@ -32,7 +32,7 @@ .form-actions - if @milestone.new_record? - = f.submit 'Create milestone', class: "btn-save btn" + = f.submit 'Create milestone', class: "btn-create btn" = link_to "Cancel", project_milestones_path(@project), class: "btn btn-cancel" -else = f.submit 'Save changes', class: "btn-save btn" diff --git a/app/views/projects/milestones/index.html.haml b/app/views/projects/milestones/index.html.haml index 727fa6149d1..0c0828c9064 100644 --- a/app/views/projects/milestones/index.html.haml +++ b/app/views/projects/milestones/index.html.haml @@ -3,7 +3,7 @@ %h3.page-title Milestones - if can? current_user, :admin_milestone, @project - = link_to new_project_milestone_path(@project), class: "pull-right btn btn-primary", title: "New Milestone" do + = link_to new_project_milestone_path(@project), class: "pull-right btn btn-new", title: "New Milestone" do %i.icon-plus New Milestone diff --git a/app/views/projects/team_members/index.html.haml b/app/views/projects/team_members/index.html.haml index 30d74e260a9..af80ceaed52 100644 --- a/app/views/projects/team_members/index.html.haml +++ b/app/views/projects/team_members/index.html.haml @@ -3,9 +3,9 @@ - if can? current_user, :admin_team_member, @project %span.pull-right - = link_to import_project_team_members_path(@project), class: "btn btn-small grouped", title: "Import team from another project" do + = link_to import_project_team_members_path(@project), class: "btn grouped", title: "Import team from another project" do Import team from another project - = link_to new_project_team_member_path(@project), class: "btn btn-primary small grouped", title: "New Team Member" do + = link_to new_project_team_member_path(@project), class: "btn btn-new grouped", title: "New Team Member" do New Team Member %p.light diff --git a/app/views/projects/wikis/_form.html.haml b/app/views/projects/wikis/_form.html.haml index 464b1508a7e..4a558826f29 100644 --- a/app/views/projects/wikis/_form.html.haml +++ b/app/views/projects/wikis/_form.html.haml @@ -29,8 +29,9 @@ = f.label :commit_message .input= f.text_field :message, class: 'span8' .actions - = f.submit 'Save', class: "btn-save btn" - if @wiki && @wiki.persisted? + = f.submit 'Save changes', class: "btn-save btn" = link_to "Cancel", project_wiki_path(@project, @wiki), class: "btn btn-cancel" - else + = f.submit 'Create page', class: "btn-create btn" = link_to "Cancel", project_wiki_path(@project, :home), class: "btn btn-cancel" diff --git a/app/views/projects/wikis/_nav.html.haml b/app/views/projects/wikis/_nav.html.haml index d62b46a7e5b..89325856acd 100644 --- a/app/views/projects/wikis/_nav.html.haml +++ b/app/views/projects/wikis/_nav.html.haml @@ -12,7 +12,7 @@ - if can?(current_user, :write_wiki, @project) .pull-right - = link_to '#', class: "add-new-wiki btn btn-small btn-primary" do + = link_to '#', class: "add-new-wiki btn btn-new" do %i.icon-plus New Page diff --git a/app/views/projects/wikis/git_access.html.haml b/app/views/projects/wikis/git_access.html.haml index e783a982ddb..dd01bb99041 100644 --- a/app/views/projects/wikis/git_access.html.haml +++ b/app/views/projects/wikis/git_access.html.haml @@ -1,10 +1,9 @@ = render 'nav' %h3.page-title - Git Access + Git access for %strong= @gollum_wiki.path_with_namespace = render 'main_links' -%br .content .project_clone_panel .row diff --git a/app/views/snippets/current_user_index.html.haml b/app/views/snippets/current_user_index.html.haml index b60026f4584..a2a9aef04eb 100644 --- a/app/views/snippets/current_user_index.html.haml +++ b/app/views/snippets/current_user_index.html.haml @@ -1,12 +1,13 @@ %h3.page-title My Snippets - %small share code pastes with others out of git repository .pull-right - = link_to new_snippet_path, class: "btn btn-small add_new grouped btn-primary", title: "New Snippet" do + = link_to new_snippet_path, class: "btn btn-new grouped", title: "New Snippet" do Add new snippet - = link_to snippets_path, class: "btn btn-small grouped" do + = link_to snippets_path, class: "btn grouped" do Discover snippets +%p.light + Share code pastes with others out of git repository %hr .row diff --git a/app/views/snippets/index.html.haml b/app/views/snippets/index.html.haml index c65ed4fb9df..2f6c914a159 100644 --- a/app/views/snippets/index.html.haml +++ b/app/views/snippets/index.html.haml @@ -1,13 +1,15 @@ %h3.page-title Public snippets - %small share code pastes with others out of git repository .pull-right - = link_to new_snippet_path, class: "btn btn-small add_new grouped btn-primary", title: "New Snippet" do + = link_to new_snippet_path, class: "btn btn-new grouped", title: "New Snippet" do Add new snippet - = link_to user_snippets_path(current_user), class: "btn btn-small grouped" do + = link_to user_snippets_path(current_user), class: "btn grouped" do My snippets +%p.light + Public snippets created by you and other users are listed here + %hr = render 'snippets' diff --git a/app/views/snippets/show.html.haml b/app/views/snippets/show.html.haml index 5cf1fefe5f0..37f9e7576f5 100644 --- a/app/views/snippets/show.html.haml +++ b/app/views/snippets/show.html.haml @@ -7,7 +7,7 @@ private .pull-right - = link_to new_snippet_path, class: "btn btn-small add_new grouped btn-primary", title: "New Snippet" do + = link_to new_snippet_path, class: "btn btn-new btn-small", title: "New Snippet" do Add new snippet diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb index 5ff4e8af1cd..9cd4e470250 100644 --- a/features/steps/profile/profile.rb +++ b/features/steps/profile/profile.rb @@ -12,7 +12,7 @@ class Profile < Spinach::FeatureSteps fill_in "user_skype", with: "testskype" fill_in "user_linkedin", with: "testlinkedin" fill_in "user_twitter", with: "testtwitter" - click_button "Save" + click_button "Save changes" @user.reload end diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb index e9ef1495dd1..a96b086fae5 100644 --- a/features/steps/project/project.rb +++ b/features/steps/project/project.rb @@ -9,7 +9,7 @@ class ProjectFeature < Spinach::FeatureSteps end And 'I save project' do - click_button 'Save' + click_button 'Save changes' end Then 'I should see project with new settings' do -- cgit v1.2.1 From eb0590b063fa4ac2fa24e884b76747838e6a631c Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 2 Aug 2013 12:15:30 +0300 Subject: FIx wiki tests. Fixed margin for issues page --- app/assets/stylesheets/gitlab_bootstrap/buttons.scss | 7 +++++++ app/assets/stylesheets/sections/issues.scss | 6 +++++- features/steps/project/project_wiki.rb | 4 ++-- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/gitlab_bootstrap/buttons.scss b/app/assets/stylesheets/gitlab_bootstrap/buttons.scss index 503de3cfd80..9eb32ca95e6 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/buttons.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/buttons.scss @@ -24,10 +24,17 @@ @include linear-gradient(#fAfAfA, #f1f1f1); } + &.focus, + &:focus { + text-decoration: none; + @include box-shadow(inset 0 2px 4px rgba(0,0,0,.15)); + } + &.active, &:active { background-image: none; outline: 0; + text-decoration: none; @include box-shadow(inset 0 2px 4px rgba(0,0,0,.15)); } diff --git a/app/assets/stylesheets/sections/issues.scss b/app/assets/stylesheets/sections/issues.scss index 6ebb9b47c90..5b79b30b5c2 100644 --- a/app/assets/stylesheets/sections/issues.scss +++ b/app/assets/stylesheets/sections/issues.scss @@ -44,7 +44,7 @@ input.check_all_issues { margin: 0; margin-right: 10px; position: relative; - top: 8px; + top: 10px; height: 22px; } @@ -52,6 +52,10 @@ input.check_all_issues { .title { height: 40px; } + + form { + margin: 0; + } } .btn.close_issue { diff --git a/features/steps/project/project_wiki.rb b/features/steps/project/project_wiki.rb index 4c92d5672f7..f0e62e07321 100644 --- a/features/steps/project/project_wiki.rb +++ b/features/steps/project/project_wiki.rb @@ -17,7 +17,7 @@ class ProjectWiki < Spinach::FeatureSteps Given 'I create the Wiki Home page' do fill_in "Content", with: '[link test](test)' - click_on "Save" + click_on "Create page" end Then 'I should see the newly created wiki page' do @@ -43,7 +43,7 @@ class ProjectWiki < Spinach::FeatureSteps And 'I change the content' do fill_in "Content", with: 'Updated Wiki Content' - click_on "Save" + click_on "Save changes" end Then 'I should see the updated content' do -- cgit v1.2.1 From 6af4223a27555b4a1e4471fdc7829071ab0db9e1 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 2 Aug 2013 12:49:20 +0300 Subject: Fixed Diff suppressed link for MR --- app/assets/javascripts/main.js.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/main.js.coffee b/app/assets/javascripts/main.js.coffee index f65211c5d13..f22c7a28f35 100644 --- a/app/assets/javascripts/main.js.coffee +++ b/app/assets/javascripts/main.js.coffee @@ -119,7 +119,7 @@ $ -> # Commit show suppressed diff - $(".supp_diff_link").bind "click", -> + $(".content").on "click", ".supp_diff_link", -> $(@).next('table').show() $(@).remove() -- cgit v1.2.1 From 7683efc6be4a57fe2105916879dc8c50f4024086 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 2 Aug 2013 13:44:25 +0300 Subject: Added ability to close milestone with opened issues. UI for milestone page improved --- .gitignore | 1 + app/assets/stylesheets/gitlab_bootstrap/lists.scss | 9 +++++ app/views/dashboard/projects.html.haml | 2 +- app/views/projects/milestones/_milestone.html.haml | 3 +- app/views/projects/milestones/show.html.haml | 46 ++++++++++------------ 5 files changed, 33 insertions(+), 28 deletions(-) diff --git a/.gitignore b/.gitignore index 1210ac3b44a..60e17328880 100644 --- a/.gitignore +++ b/.gitignore @@ -30,3 +30,4 @@ vendor/bundle/* rails_best_practices_output.html doc/code/* .secret +*.log diff --git a/app/assets/stylesheets/gitlab_bootstrap/lists.scss b/app/assets/stylesheets/gitlab_bootstrap/lists.scss index d23323979bc..83066b5beec 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/lists.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/lists.scss @@ -83,4 +83,13 @@ ul.bordered-list { a { color: #777; } } } + + &.top-list { + li:first-child { + padding-top: 0; + h4, h5 { + margin-top: 0; + } + } + } } diff --git a/app/views/dashboard/projects.html.haml b/app/views/dashboard/projects.html.haml index ab090c42218..8fd0744a63f 100644 --- a/app/views/dashboard/projects.html.haml +++ b/app/views/dashboard/projects.html.haml @@ -36,7 +36,7 @@ = label.name .span9 - %ul.bordered-list.my-projects + %ul.bordered-list.my-projects.top-list - @projects.each do |project| %li %h4.project-title diff --git a/app/views/projects/milestones/_milestone.html.haml b/app/views/projects/milestones/_milestone.html.haml index 894fa6c1133..bc3368b765c 100644 --- a/app/views/projects/milestones/_milestone.html.haml +++ b/app/views/projects/milestones/_milestone.html.haml @@ -4,8 +4,7 @@ = link_to edit_project_milestone_path(milestone.project, milestone), class: "btn btn-small edit-milestone-link grouped" do %i.icon-edit Edit - - if milestone.can_be_closed? - = link_to 'Close', project_milestone_path(@project, milestone, milestone: {state_event: :close }), method: :put, remote: true, class: "btn btn-small btn-remove" + = link_to 'Close Milestone', project_milestone_path(@project, milestone, milestone: {state_event: :close }), method: :put, remote: true, class: "btn btn-small btn-remove" %h4 = link_to_gfm truncate(milestone.title, length: 100), project_milestone_path(milestone.project, milestone) - if milestone.expired? and not milestone.closed? diff --git a/app/views/projects/milestones/show.html.haml b/app/views/projects/milestones/show.html.haml index 7be3ba2f758..8a5c2a938b1 100644 --- a/app/views/projects/milestones/show.html.haml +++ b/app/views/projects/milestones/show.html.haml @@ -1,32 +1,23 @@ = render "projects/issues/head" -.row - .span6 - %h3.page-title - Milestone ##{@milestone.id} - %small - = @milestone.expires_at - .back-link - = link_to project_milestones_path(@project) do - ← To milestones list - .span6 - .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 - 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 btn-small grouped" do - %i.icon-edit - Edit +%h3.page-title + Milestone ##{@milestone.id} + %small + = @milestone.expires_at + .pull-right + - if can?(current_user, :admin_milestone, @project) + = link_to edit_project_milestone_path(@project, @milestone), class: "btn grouped" do + %i.icon-edit + Edit + = link_to 'Close Milestone', project_milestone_path(@project, @milestone, milestone: {state_event: :close }), method: :put, class: "btn btn-remove" +- if @milestone.issues.any? && @milestone.can_be_closed? + .alert.alert-success + %span All issues for this milestone are closed. You may close milestone now. +.back-link + = link_to project_milestones_path(@project) do + ← To milestones list -- if @milestone.can_be_closed? - %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: {state_event: :close }), method: :put, class: "btn btn-small btn-remove" .ui-box.ui-box-show .ui-box-head @@ -69,6 +60,11 @@ Participants %span.badge= @users.count + .pull-right + = 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 btn-small edit-milestone-link grouped" .tab-content .tab-pane.active#tab-issues -- cgit v1.2.1 From 4e82d1752ff8595ad35e9eac69134a6bdf18e626 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 2 Aug 2013 15:20:55 +0300 Subject: Fixed Fixed issue when project default branch selected from non-exists and UI does not allow to change it --- app/views/projects/edit.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml index d273a5c64fb..dec75ef9abc 100644 --- a/app/views/projects/edit.html.haml +++ b/app/views/projects/edit.html.haml @@ -22,7 +22,7 @@ .input = f.text_area :description, placeholder: "awesome project", class: "span5", rows: 3, maxlength: 250 - - unless @project.empty_repo? + - if @project.repository.branch_names.any? .clearfix = f.label :default_branch, "Default Branch" .input= f.select(:default_branch, @repository.branch_names, {}, {class: 'chosen'}) -- cgit v1.2.1 From f003ad59dd43bb0e80f23b805c3d1b0f9d0108b1 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Fri, 2 Aug 2013 15:50:04 +0300 Subject: Restyle breadcrumbs --- app/assets/stylesheets/common.scss | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 8791324b6a9..2ab3a1b3b52 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -94,9 +94,7 @@ ul.breadcrumb { } a { - color: #474D57; - font-weight: bold; - font-size: 14px; + font-size: 16px; } } -- cgit v1.2.1 From 1dda34f306a94a4046d7150f5dc11a6fde360dd0 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Fri, 2 Aug 2013 15:43:30 +0200 Subject: Delete duplicate keys in migrate_keys task --- lib/tasks/migrate/migrate_keys.rake | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/tasks/migrate/migrate_keys.rake b/lib/tasks/migrate/migrate_keys.rake index b13d984907b..969ba6dc15e 100644 --- a/lib/tasks/migrate/migrate_keys.rake +++ b/lib/tasks/migrate/migrate_keys.rake @@ -1,15 +1,20 @@ desc "GITLAB | Migrate SSH Keys" task migrate_keys: :environment do puts "This will add fingerprint to ssh keys in db" + puts "If you have duplicate keys https://github.com/gitlabhq/gitlabhq/issues/4453 all but the first will be deleted".yellow ask_to_continue Key.find_each(batch_size: 20) do |key| if key.valid? && key.save print '.' + elsif key.fingerprint.present? + puts "\nDeleting #{key.inspect}".yellow + key.destroy else print 'F' end end + print "\n" end -- cgit v1.2.1 From d0d10992bc7045c0ffbf07c45aad2f061f88bbc3 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sat, 3 Aug 2013 11:30:07 +0300 Subject: Fix edit project page when repo does not exist --- app/views/projects/edit.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml index dec75ef9abc..ac8affbdc32 100644 --- a/app/views/projects/edit.html.haml +++ b/app/views/projects/edit.html.haml @@ -22,7 +22,7 @@ .input = f.text_area :description, placeholder: "awesome project", class: "span5", rows: 3, maxlength: 250 - - if @project.repository.branch_names.any? + - if @project.repository.exists? && @project.repository.branch_names.any? .clearfix = f.label :default_branch, "Default Branch" .input= f.select(:default_branch, @repository.branch_names, {}, {class: 'chosen'}) -- cgit v1.2.1 From 2d681c0d1ed14bf23c041aa04fa3e77caceda9a1 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sat, 3 Aug 2013 11:32:17 +0300 Subject: Add dealing with newlines for editor in installation.md --- doc/install/installation.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/install/installation.md b/doc/install/installation.md index 5964044ca99..2311b89cdeb 100644 --- a/doc/install/installation.md +++ b/doc/install/installation.md @@ -196,6 +196,7 @@ You can change `5-3-stable` to `master` if you want the *bleeding edge* version, # Edit user.email according to what is set in gitlab.yml sudo -u git -H git config --global user.name "GitLab" sudo -u git -H git config --global user.email "gitlab@localhost" + sudo -u git -H git config --global core.autocrlf input **Important Note:** Make sure to edit both `gitlab.yml` and `unicorn.rb` to match your setup. -- cgit v1.2.1 From 9efdebaf128e88788948efce7e1008783c8fcb79 Mon Sep 17 00:00:00 2001 From: Robert Schilling Date: Sat, 3 Aug 2013 14:40:43 +0200 Subject: Improve markup detection, fixes #4695 --- app/helpers/tree_helper.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/helpers/tree_helper.rb b/app/helpers/tree_helper.rb index d41f8377559..a77db475234 100644 --- a/app/helpers/tree_helper.rb +++ b/app/helpers/tree_helper.rb @@ -39,12 +39,12 @@ module TreeHelper # # Returns boolean def markup?(filename) - filename.end_with?(*%w(.textile .rdoc .org .creole - .mediawiki .rst .asciidoc .pod)) + filename.downcase.end_with?(*%w(.textile .rdoc .org .creole + .mediawiki .rst .asciidoc .pod)) end def gitlab_markdown?(filename) - filename.end_with?(*%w(.mdown .md .markdown)) + filename.downcase.end_with?(*%w(.mdown .md .markdown)) end def plain_text_readme? filename -- cgit v1.2.1 From 73c163fb1d2ec95c0590afd0a8fa12c57de17155 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 4 Aug 2013 13:16:27 +0300 Subject: Modify style for .slead --- app/assets/stylesheets/gitlab_bootstrap/common.scss | 8 +++++++- app/views/help/index.html.haml | 2 -- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/app/assets/stylesheets/gitlab_bootstrap/common.scss b/app/assets/stylesheets/gitlab_bootstrap/common.scss index 24544d74ac2..cd652590089 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/common.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/common.scss @@ -48,7 +48,13 @@ line-height: 36px; } -p.slead { color: #456; font-size: 16px; margin-bottom: 12px; font-weight: 200; line-height: 24px; } +.slead { + color: #666; + font-size: 14px; + margin-bottom: 12px; + font-weight: normal; + line-height: 24px; +} /** FORMS **/ input[type='search'].search-text-input { diff --git a/app/views/help/index.html.haml b/app/views/help/index.html.haml index e5c3b577f91..ff01136f5bb 100644 --- a/app/views/help/index.html.haml +++ b/app/views/help/index.html.haml @@ -8,8 +8,6 @@ %br Fast, secure and stable solution based on Ruby on Rails. -%br - .row .span4 .ui-box -- cgit v1.2.1 From 53a7568098618dcd78242864c16187eda61aa562 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 4 Aug 2013 16:22:06 +0300 Subject: Fix sending 2 emails on issue close --- app/services/notification_service.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/services/notification_service.rb b/app/services/notification_service.rb index 58ba9150d72..7330749caec 100644 --- a/app/services/notification_service.rb +++ b/app/services/notification_service.rb @@ -102,6 +102,9 @@ class NotificationService # ignore wall messages return true unless note.noteable_type.present? + # ignore gitlab service messages + return true if note.note =~ /\A_Status changed to closed_/ + opts = { noteable_type: note.noteable_type, project_id: note.project_id } if note.commit_id.present? -- cgit v1.2.1 From 49709b1d8a7530ba02bb279eff0fb16cfc7eaf35 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 4 Aug 2013 16:27:32 +0300 Subject: Fix broken user link in email --- lib/gitlab/markdown.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/gitlab/markdown.rb b/lib/gitlab/markdown.rb index e9c4df220c9..95bb22cfc27 100644 --- a/lib/gitlab/markdown.rb +++ b/lib/gitlab/markdown.rb @@ -167,7 +167,7 @@ module Gitlab def reference_user(identifier) if member = @project.team_members.find { |user| user.username == identifier } - link_to("@#{identifier}", user_path(identifier), html_options.merge(class: "gfm gfm-team_member #{html_options[:class]}")) if member + link_to("@#{identifier}", user_url(identifier), html_options.merge(class: "gfm gfm-team_member #{html_options[:class]}")) if member end end -- cgit v1.2.1 From 5d4afc0f2b2cf29cbd0bc38a76a06deafc479130 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 4 Aug 2013 16:35:18 +0300 Subject: Add warnings about removing team classes --- app/models/deprecated/user_team.rb | 2 ++ app/models/deprecated/user_team_project_relationship.rb | 2 ++ app/models/deprecated/user_team_user_relationship.rb | 2 ++ 3 files changed, 6 insertions(+) diff --git a/app/models/deprecated/user_team.rb b/app/models/deprecated/user_team.rb index a036cedc4c7..822884297d4 100644 --- a/app/models/deprecated/user_team.rb +++ b/app/models/deprecated/user_team.rb @@ -1,3 +1,5 @@ +# Will be removed in 6.1 with tables +# # == Schema Information # # Table name: user_teams diff --git a/app/models/deprecated/user_team_project_relationship.rb b/app/models/deprecated/user_team_project_relationship.rb index 991510be936..e93223f3e24 100644 --- a/app/models/deprecated/user_team_project_relationship.rb +++ b/app/models/deprecated/user_team_project_relationship.rb @@ -1,3 +1,5 @@ +# Will be removed in 6.1 with tables +# # == Schema Information # # Table name: user_team_project_relationships diff --git a/app/models/deprecated/user_team_user_relationship.rb b/app/models/deprecated/user_team_user_relationship.rb index 1f7e2625f5f..ae4c789994a 100644 --- a/app/models/deprecated/user_team_user_relationship.rb +++ b/app/models/deprecated/user_team_user_relationship.rb @@ -1,3 +1,5 @@ +# Will be removed in 6.1 with tables +# # == Schema Information # # Table name: user_team_user_relationships -- cgit v1.2.1 From 0675552463c5afccd81bbfe1ff276d19d0d79446 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 4 Aug 2013 16:46:46 +0300 Subject: It was hard to click on small edit icon for comment --- app/views/projects/notes/_note.html.haml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/views/projects/notes/_note.html.haml b/app/views/projects/notes/_note.html.haml index 1389d899310..fbc924c4e1d 100644 --- a/app/views/projects/notes/_note.html.haml +++ b/app/views/projects/notes/_note.html.haml @@ -8,8 +8,11 @@ - if(note.author_id == current_user.id) || can?(current_user, :admin_note, @project) = link_to "#", title: "Edit comment", class: "js-note-edit" do %i.icon-edit + Edit +   = link_to project_note_path(@project, note), title: "Remove comment", method: :delete, confirm: 'Are you sure you want to remove this comment?', remote: true, class: "danger js-note-delete" do %i.icon-trash.cred + Remove = image_tag gravatar_icon(note.author_email), class: "avatar s32" = link_to_member(@project, note.author, avatar: false) %span.note-last-update -- cgit v1.2.1 From 65197b8a8a74f662313ac0885aced49b9d243e9d Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 4 Aug 2013 17:14:15 +0300 Subject: Sanitize issues title in autocomplete for comment --- app/assets/javascripts/gfm_auto_complete.js.coffee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/gfm_auto_complete.js.coffee b/app/assets/javascripts/gfm_auto_complete.js.coffee index c8c57b91e03..e22761e57a4 100644 --- a/app/assets/javascripts/gfm_auto_complete.js.coffee +++ b/app/assets/javascripts/gfm_auto_complete.js.coffee @@ -44,7 +44,7 @@ GitLab.GfmAutoComplete = tpl: @Issues.template callbacks: before_save: (issues) -> - $.map issues, (i) -> id: i.id, title: i.title, search: "#{i.id} #{i.title}" + $.map issues, (i) -> id: i.id, title: sanitize(i.title), search: "#{i.id} #{i.title}" input.one "focus", => $.getJSON(@dataSource).done (data) -> -- cgit v1.2.1 From b99f357e96f683643b1e739b12a1ba972303d0aa Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 4 Aug 2013 17:18:49 +0300 Subject: Dont allow file edit for non-branches ref --- app/helpers/tree_helper.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/app/helpers/tree_helper.rb b/app/helpers/tree_helper.rb index a77db475234..73d36d0801c 100644 --- a/app/helpers/tree_helper.rb +++ b/app/helpers/tree_helper.rb @@ -57,6 +57,8 @@ module TreeHelper end def allowed_tree_edit? + return false unless @repository.branch_names.include?(@ref) + if @project.protected_branch? @ref can?(current_user, :push_code_to_protected_branches, @project) else -- cgit v1.2.1 From e06352979de1a3344d0ab34c5f0ecf7ed73da66f Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 4 Aug 2013 19:00:41 +0300 Subject: st_diff field for Note --- db/migrate/20130804151314_add_st_diff_to_note.rb | 5 +++++ db/schema.rb | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20130804151314_add_st_diff_to_note.rb diff --git a/db/migrate/20130804151314_add_st_diff_to_note.rb b/db/migrate/20130804151314_add_st_diff_to_note.rb new file mode 100644 index 00000000000..3f9abb975c3 --- /dev/null +++ b/db/migrate/20130804151314_add_st_diff_to_note.rb @@ -0,0 +1,5 @@ +class AddStDiffToNote < ActiveRecord::Migration + def change + add_column :notes, :st_diff, :text, :null => true + end +end diff --git a/db/schema.rb b/db/schema.rb index 4ada3d07263..e80b61e0bbc 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 => 20130624162710) do +ActiveRecord::Schema.define(:version => 20130804151314) do create_table "deploy_keys_projects", :force => true do |t| t.integer "deploy_key_id", :null => false @@ -147,6 +147,7 @@ ActiveRecord::Schema.define(:version => 20130624162710) do t.string "line_code" t.string "commit_id" t.integer "noteable_id" + t.text "st_diff" end add_index "notes", ["author_id"], :name => "index_notes_on_author_id" -- cgit v1.2.1 From 2d75b454ef87a87bff942dc31837687919113468 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 4 Aug 2013 19:01:57 +0300 Subject: Store diff with line note. It makes possible to see inline notes with proper diff even if MR diff changed --- app/models/note.rb | 30 +++++++++++++++++++++-------- lib/tasks/migrate/migrate_inline_notes.rake | 16 +++++++++++++++ 2 files changed, 38 insertions(+), 8 deletions(-) create mode 100644 lib/tasks/migrate/migrate_inline_notes.rake diff --git a/app/models/note.rb b/app/models/note.rb index c23aab03bcc..b0875a0761b 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -50,6 +50,9 @@ class Note < ActiveRecord::Base scope :inc_author_project, ->{ includes(:project, :author) } scope :inc_author, ->{ includes(:author) } + serialize :st_diff + before_create :set_diff, if: ->(n) { n.noteable_type == 'MergeRequest' && n.line_code.present? } + def self.create_status_change_note(noteable, author, status) create({ noteable: noteable, @@ -67,22 +70,33 @@ class Note < ActiveRecord::Base nil end - def diff - if noteable.diffs.present? - noteable.diffs.select do |d| - if d.new_path - Digest::SHA1.hexdigest(d.new_path) == diff_file_index - end - end.first + def find_diff + return nil unless noteable.diffs.present? + + @diff ||= noteable.diffs.find do |d| + Digest::SHA1.hexdigest(d.new_path) == diff_file_index if d.new_path end end + def set_diff + # First lets find notes with same diff + # before iterating over all mr diffs + diff = self.noteable.notes.where(line_code: self.line_code).last.try(:diff) + diff ||= find_diff + + self.st_diff = diff.to_hash if diff + end + + def diff + @diff ||= Gitlab::Git::Diff.new(st_diff) if st_diff.respond_to?(:map) + end + def diff_file_index line_code.split('_')[0] end def diff_file_name - diff.new_path + diff.new_path if diff end def diff_new_line diff --git a/lib/tasks/migrate/migrate_inline_notes.rake b/lib/tasks/migrate/migrate_inline_notes.rake new file mode 100644 index 00000000000..ec338259abc --- /dev/null +++ b/lib/tasks/migrate/migrate_inline_notes.rake @@ -0,0 +1,16 @@ +desc "GITLAB | Migrate inline notes" +task migrate_inline_notes: :environment do + Note.where(noteable_type: 'MergeRequest').find_each(batch_size: 100) do |note| + begin + note.set_diff + if note.save + print '.' + else + print 'F' + end + rescue + print 'F' + end + end +end + -- cgit v1.2.1 From 8f05fbbab5754b2a05547bae7ed3f9c409d8a640 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 4 Aug 2013 19:35:47 +0300 Subject: Dont show comment on diff if diff line was changed after comment left --- app/helpers/commits_helper.rb | 4 +++- app/models/note.rb | 11 +++++++++++ app/views/projects/commits/_text_file.html.haml | 4 ++-- .../projects/notes/_diff_notes_with_reply.html.haml | 20 +++++++++++--------- 4 files changed, 27 insertions(+), 12 deletions(-) diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index 111e1cda19c..f808ac764d4 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -38,6 +38,8 @@ module CommitsHelper lines_arr = ::Gitlab::InlineDiff.processing diff_arr lines_arr.each do |line| + raw_line = line.dup + next if line.match(/^\-\-\- \/dev\/null/) next if line.match(/^\+\+\+ \/dev\/null/) next if line.match(/^\-\-\- a/) @@ -58,7 +60,7 @@ module CommitsHelper else type = identification_type(line) line_code = build_line_anchor(diff, line_new, line_old) - yield(full_line, type, line_code, line_new, line_old) + yield(full_line, type, line_code, line_new, line_old, raw_line) end diff --git a/app/models/note.rb b/app/models/note.rb index b0875a0761b..8714db2e10e 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -99,10 +99,21 @@ class Note < ActiveRecord::Base diff.new_path if diff end + def diff_old_line + line_code.split('_')[1].to_i + end + def diff_new_line line_code.split('_')[2].to_i end + def diff_line + if diff + @diff_line ||= diff.diff.lines.select { |line| line =~ /\A\+/ }[diff_new_line] || + diff.diff.lines.select { |line| line =~ /\A\-/ }[diff_old_line] + end + end + def discussion_id @discussion_id ||= [:discussion, noteable_type.try(:underscore), noteable_id || commit_id, line_code].join("-").to_sym end diff --git a/app/views/projects/commits/_text_file.html.haml b/app/views/projects/commits/_text_file.html.haml index bfc3180a84c..3e9a80325b8 100644 --- a/app/views/projects/commits/_text_file.html.haml +++ b/app/views/projects/commits/_text_file.html.haml @@ -3,7 +3,7 @@ %a.supp_diff_link Diff suppressed. Click to show %table.text-file{class: "#{'hide' if too_big}"} - - each_diff_line(diff, index) do |line, type, line_code, line_new, line_old| + - each_diff_line(diff, index) do |line, type, line_code, line_new, line_old, raw_line| %tr.line_holder{ id: line_code, class: "#{type}" } - if type == "match" %td.old_line= "..." @@ -20,4 +20,4 @@ - if @reply_allowed - comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at) - unless comments.empty? - = render "projects/notes/diff_notes_with_reply", notes: comments + = render "projects/notes/diff_notes_with_reply", notes: comments, raw_line: raw_line diff --git a/app/views/projects/notes/_diff_notes_with_reply.html.haml b/app/views/projects/notes/_diff_notes_with_reply.html.haml index 5a1a945f399..1364ad209b6 100644 --- a/app/views/projects/notes/_diff_notes_with_reply.html.haml +++ b/app/views/projects/notes/_diff_notes_with_reply.html.haml @@ -1,11 +1,13 @@ - note = notes.first # example note -%tr.notes_holder - %td.notes_line{ colspan: 2 } - %span.btn.disabled - %i.icon-comment - = notes.count - %td.notes_content - %ul.notes{ rel: note.discussion_id } - = render notes +-# Check if line want not changed since comment was left +- if !defined?(raw_line) || raw_line == note.diff_line + %tr.notes_holder + %td.notes_line{ colspan: 2 } + %span.btn.disabled + %i.icon-comment + = notes.count + %td.notes_content + %ul.notes{ rel: note.discussion_id } + = render notes - = render "projects/notes/discussion_reply_button", note: note + = render "projects/notes/discussion_reply_button", note: note -- cgit v1.2.1 From af5faaf0e1e001558302704a421eb01f5e7a26ea Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Sun, 4 Aug 2013 20:43:49 +0300 Subject: Move diff parsing to own class. Correctly identify note diff line --- app/helpers/commits_helper.rb | 58 +--------------- app/models/note.rb | 19 ++++-- app/views/projects/commits/_text_file.html.haml | 2 +- .../notes/_diff_notes_with_reply.html.haml | 2 +- app/views/projects/notes/_discussion.html.haml | 2 +- doc/update/5.4-to-6.0.md | 1 + lib/gitlab/diff_parser.rb | 77 ++++++++++++++++++++++ lib/tasks/migrate/migrate_inline_notes.rake | 2 +- 8 files changed, 99 insertions(+), 64 deletions(-) create mode 100644 lib/gitlab/diff_parser.rb diff --git a/app/helpers/commits_helper.rb b/app/helpers/commits_helper.rb index f808ac764d4..ae1021aa52f 100644 --- a/app/helpers/commits_helper.rb +++ b/app/helpers/commits_helper.rb @@ -15,63 +15,9 @@ module CommitsHelper commit_person_link(commit, options.merge(source: :committer)) end - def identification_type(line) - if line[0] == "+" - "new" - elsif line[0] == "-" - "old" - else - nil - end - end - - def build_line_anchor(diff, line_new, line_old) - "#{hexdigest(diff.new_path)}_#{line_old}_#{line_new}" - end - def each_diff_line(diff, index) - diff_arr = diff.diff.lines.to_a - - line_old = 1 - line_new = 1 - type = nil - - lines_arr = ::Gitlab::InlineDiff.processing diff_arr - lines_arr.each do |line| - raw_line = line.dup - - next if line.match(/^\-\-\- \/dev\/null/) - next if line.match(/^\+\+\+ \/dev\/null/) - next if line.match(/^\-\-\- a/) - next if line.match(/^\+\+\+ b/) - - full_line = html_escape(line.gsub(/\n/, '')) - full_line = ::Gitlab::InlineDiff.replace_markers full_line - - if line.match(/^@@ -/) - type = "match" - - line_old = line.match(/\-[0-9]*/)[0].to_i.abs rescue 0 - line_new = line.match(/\+[0-9]*/)[0].to_i.abs rescue 0 - - next if line_old == 1 && line_new == 1 #top of file - yield(full_line, type, nil, nil, nil) - next - else - type = identification_type(line) - line_code = build_line_anchor(diff, line_new, line_old) - yield(full_line, type, line_code, line_new, line_old, raw_line) - end - - - if line[0] == "+" - line_new += 1 - elsif line[0] == "-" - line_old += 1 - else - line_new += 1 - line_old += 1 - end + Gitlab::DiffParser.new(diff).each do |full_line, type, line_code, line_new, line_old| + yield(full_line, type, line_code, line_new, line_old) end end diff --git a/app/models/note.rb b/app/models/note.rb index 8714db2e10e..697c9d03a93 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -51,7 +51,7 @@ class Note < ActiveRecord::Base scope :inc_author, ->{ includes(:author) } serialize :st_diff - before_create :set_diff, if: ->(n) { n.noteable_type == 'MergeRequest' && n.line_code.present? } + before_create :set_diff, if: ->(n) { n.line_code.present? } def self.create_status_change_note(noteable, author, status) create({ @@ -81,7 +81,7 @@ class Note < ActiveRecord::Base def set_diff # First lets find notes with same diff # before iterating over all mr diffs - diff = self.noteable.notes.where(line_code: self.line_code).last.try(:diff) + diff = Note.where(noteable_id: self.noteable_id, noteable_type: self.noteable_type, line_code: self.line_code).last.try(:diff) diff ||= find_diff self.st_diff = diff.to_hash if diff @@ -91,6 +91,12 @@ class Note < ActiveRecord::Base @diff ||= Gitlab::Git::Diff.new(st_diff) if st_diff.respond_to?(:map) end + def active? + # TODO: determine if discussion is outdated + # according to recent MR diff or not + true + end + def diff_file_index line_code.split('_')[0] end @@ -108,10 +114,15 @@ class Note < ActiveRecord::Base end def diff_line + return @diff_line if @diff_line + if diff - @diff_line ||= diff.diff.lines.select { |line| line =~ /\A\+/ }[diff_new_line] || - diff.diff.lines.select { |line| line =~ /\A\-/ }[diff_old_line] + Gitlab::DiffParser.new(diff).each do |full_line, type, line_code, line_new, line_old| + @diff_line = full_line if line_code == self.line_code + end end + + @diff_line end def discussion_id diff --git a/app/views/projects/commits/_text_file.html.haml b/app/views/projects/commits/_text_file.html.haml index 3e9a80325b8..c724213878a 100644 --- a/app/views/projects/commits/_text_file.html.haml +++ b/app/views/projects/commits/_text_file.html.haml @@ -20,4 +20,4 @@ - if @reply_allowed - comments = @line_notes.select { |n| n.line_code == line_code }.sort_by(&:created_at) - unless comments.empty? - = render "projects/notes/diff_notes_with_reply", notes: comments, raw_line: raw_line + = render "projects/notes/diff_notes_with_reply", notes: comments, line: line diff --git a/app/views/projects/notes/_diff_notes_with_reply.html.haml b/app/views/projects/notes/_diff_notes_with_reply.html.haml index 1364ad209b6..9537ab18caa 100644 --- a/app/views/projects/notes/_diff_notes_with_reply.html.haml +++ b/app/views/projects/notes/_diff_notes_with_reply.html.haml @@ -1,6 +1,6 @@ - note = notes.first # example note -# Check if line want not changed since comment was left -- if !defined?(raw_line) || raw_line == note.diff_line +- if !defined?(line) || line == note.diff_line %tr.notes_holder %td.notes_line{ colspan: 2 } %span.btn.disabled diff --git a/app/views/projects/notes/_discussion.html.haml b/app/views/projects/notes/_discussion.html.haml index 14d81bbb5ce..5cb1fd0ebf9 100644 --- a/app/views/projects/notes/_discussion.html.haml +++ b/app/views/projects/notes/_discussion.html.haml @@ -36,7 +36,7 @@ ago .discussion-body - if note.for_diff_line? - - if note.diff + - if note.active? .content .file= render "projects/notes/discussion_diff", discussion_notes: discussion_notes, note: note - else diff --git a/doc/update/5.4-to-6.0.md b/doc/update/5.4-to-6.0.md index 37e8983df8f..be6fa98ae7a 100644 --- a/doc/update/5.4-to-6.0.md +++ b/doc/update/5.4-to-6.0.md @@ -61,6 +61,7 @@ sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production sudo -u git -H bundle exec rake migrate_groups RAILS_ENV=production sudo -u git -H bundle exec rake migrate_global_projects RAILS_ENV=production sudo -u git -H bundle exec rake migrate_keys RAILS_ENV=production +sudo -u git -H bundle exec rake migrate_inline_notes RAILS_ENV=production ``` diff --git a/lib/gitlab/diff_parser.rb b/lib/gitlab/diff_parser.rb new file mode 100644 index 00000000000..fb27280c4a4 --- /dev/null +++ b/lib/gitlab/diff_parser.rb @@ -0,0 +1,77 @@ +module Gitlab + class DiffParser + include Enumerable + + attr_reader :lines, :new_path + + def initialize(diff) + @lines = diff.diff.lines.to_a + @new_path = diff.new_path + end + + def each + line_old = 1 + line_new = 1 + type = nil + + lines_arr = ::Gitlab::InlineDiff.processing lines + lines_arr.each do |line| + raw_line = line.dup + + next if line.match(/^\-\-\- \/dev\/null/) + next if line.match(/^\+\+\+ \/dev\/null/) + next if line.match(/^\-\-\- a/) + next if line.match(/^\+\+\+ b/) + + full_line = html_escape(line.gsub(/\n/, '')) + full_line = ::Gitlab::InlineDiff.replace_markers full_line + + if line.match(/^@@ -/) + type = "match" + + line_old = line.match(/\-[0-9]*/)[0].to_i.abs rescue 0 + line_new = line.match(/\+[0-9]*/)[0].to_i.abs rescue 0 + + next if line_old == 1 && line_new == 1 #top of file + yield(full_line, type, nil, nil, nil) + next + else + type = identification_type(line) + line_code = generate_line_code(new_path, line_new, line_old) + yield(full_line, type, line_code, line_new, line_old, raw_line) + end + + + if line[0] == "+" + line_new += 1 + elsif line[0] == "-" + line_old += 1 + else + line_new += 1 + line_old += 1 + end + end + end + + private + + def identification_type(line) + if line[0] == "+" + "new" + elsif line[0] == "-" + "old" + else + nil + end + end + + def generate_line_code(path, line_new, line_old) + "#{Digest::SHA1.hexdigest(path)}_#{line_old}_#{line_new}" + end + + def html_escape str + replacements = { '&' => '&', '>' => '>', '<' => '<', '"' => '"', "'" => ''' } + str.gsub(/[&"'><]/, replacements) + end + end +end diff --git a/lib/tasks/migrate/migrate_inline_notes.rake b/lib/tasks/migrate/migrate_inline_notes.rake index ec338259abc..e21fa0e8ce8 100644 --- a/lib/tasks/migrate/migrate_inline_notes.rake +++ b/lib/tasks/migrate/migrate_inline_notes.rake @@ -1,6 +1,6 @@ desc "GITLAB | Migrate inline notes" task migrate_inline_notes: :environment do - Note.where(noteable_type: 'MergeRequest').find_each(batch_size: 100) do |note| + Note.where('line_code IS NOT NULL').find_each(batch_size: 100) do |note| begin note.set_diff if note.save -- cgit v1.2.1 From ad6208c579a9858c4280ab692f2bfefcfb285fc6 Mon Sep 17 00:00:00 2001 From: Jesse Read Date: Sun, 4 Aug 2013 18:04:20 -0400 Subject: Update new_user_email.html.haml Fixed template to include the word 'the'. --- app/views/notify/new_user_email.html.haml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/notify/new_user_email.html.haml b/app/views/notify/new_user_email.html.haml index fc2c02ef827..09518cd3c7f 100644 --- a/app/views/notify/new_user_email.html.haml +++ b/app/views/notify/new_user_email.html.haml @@ -4,7 +4,7 @@ - if Gitlab.config.gitlab.signup_enabled Your account has been created successfully. - else - The Administrator created an account for you. Now you are a member of company GitLab application. + The Administrator created an account for you. Now you are a member of the company GitLab application. %p login.......................................... %code= @user['email'] -- cgit v1.2.1 From 171ce67a0c36145ebb123f0df0ef15681272a159 Mon Sep 17 00:00:00 2001 From: Jesse Read Date: Sun, 4 Aug 2013 18:04:47 -0400 Subject: Update new_user_email.text.erb Fixed template to include the word 'the'. --- app/views/notify/new_user_email.text.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/notify/new_user_email.text.erb b/app/views/notify/new_user_email.text.erb index 70fe0e0736a..50ed595b38a 100644 --- a/app/views/notify/new_user_email.text.erb +++ b/app/views/notify/new_user_email.text.erb @@ -1,6 +1,6 @@ Hi <%= @user.name %>! -The Administrator created an account for you. Now you are a member of company GitLab application. +The Administrator created an account for you. Now you are a member of the company GitLab application. login.................. <%= @user.email %> <% if @user.created_by_id %> -- cgit v1.2.1 From 02e859a23470d799a77963503687789d4a410a0c Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 5 Aug 2013 12:26:33 +0300 Subject: move backup logic to lib. Fixed removing outdated backups --- .gitignore | 1 + lib/backup/manager.rb | 106 +++++++++++++++++++++++++++++++++++++++++++ lib/tasks/gitlab/backup.rake | 102 +++-------------------------------------- 3 files changed, 114 insertions(+), 95 deletions(-) create mode 100644 lib/backup/manager.rb diff --git a/.gitignore b/.gitignore index 60e17328880..de8b77ffd4b 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ rails_best_practices_output.html doc/code/* .secret *.log +public/uploads.* diff --git a/lib/backup/manager.rb b/lib/backup/manager.rb new file mode 100644 index 00000000000..258a0fb2589 --- /dev/null +++ b/lib/backup/manager.rb @@ -0,0 +1,106 @@ +module Backup + class Manager + def pack + # saving additional informations + s = {} + s[:db_version] = "#{ActiveRecord::Migrator.current_version}" + s[:backup_created_at] = Time.now + s[:gitlab_version] = %x{git rev-parse HEAD}.gsub(/\n/,"") + s[:tar_version] = %x{tar --version | head -1}.gsub(/\n/,"") + + Dir.chdir(Gitlab.config.backup.path) + + File.open("#{Gitlab.config.backup.path}/backup_information.yml", "w+") do |file| + file << s.to_yaml.gsub(/^---\n/,'') + end + + # create archive + print "Creating backup archive: #{s[:backup_created_at].to_i}_gitlab_backup.tar ... " + if Kernel.system("tar -cf #{s[:backup_created_at].to_i}_gitlab_backup.tar repositories/ db/ uploads/ backup_information.yml") + puts "done".green + else + puts "failed".red + end + end + + def cleanup + print "Deleting tmp directories ... " + if Kernel.system("rm -rf repositories/ db/ uploads/ backup_information.yml") + puts "done".green + else + puts "failed".red + end + end + + def remove_old + # delete backups + print "Deleting old backups ... " + keep_time = Gitlab.config.backup.keep_time.to_i + path = Gitlab.config.backup.path + + if keep_time > 0 + removed = 0 + file_list = Dir.glob(Rails.root.join(path, "*_gitlab_backup.tar")) + file_list.map! { |f| $1.to_i if f =~ /(\d+)_gitlab_backup.tar/ } + file_list.sort.each do |timestamp| + if Time.at(timestamp) < (Time.now - keep_time) + if system("rm #{timestamp}_gitlab_backup.tar") + removed += 1 + end + end + end + puts "done. (#{removed} removed)".green + else + puts "skipping".yellow + end + end + + def unpack + Dir.chdir(Gitlab.config.backup.path) + + # check for existing backups in the backup dir + file_list = Dir.glob("*_gitlab_backup.tar").each.map { |f| f.split(/_/).first.to_i } + puts "no backups found" if file_list.count == 0 + if file_list.count > 1 && ENV["BACKUP"].nil? + puts "Found more than one backup, please specify which one you want to restore:" + puts "rake gitlab:backup:restore BACKUP=timestamp_of_backup" + exit 1 + end + + tar_file = ENV["BACKUP"].nil? ? File.join("#{file_list.first}_gitlab_backup.tar") : File.join(ENV["BACKUP"] + "_gitlab_backup.tar") + + unless File.exists?(tar_file) + puts "The specified backup doesn't exist!" + exit 1 + end + + print "Unpacking backup ... " + unless Kernel.system("tar -xf #{tar_file}") + puts "failed".red + exit 1 + else + puts "done".green + end + + settings = YAML.load_file("backup_information.yml") + ENV["VERSION"] = "#{settings[:db_version]}" if settings[:db_version].to_i > 0 + + # backups directory is not always sub of Rails root and able to execute the git rev-parse below + begin + Dir.chdir(Rails.root) + + # restoring mismatching backups can lead to unexpected problems + if settings[:gitlab_version] != %x{git rev-parse HEAD}.gsub(/\n/, "") + puts "GitLab version mismatch:".red + puts " Your current HEAD differs from the HEAD in the backup!".red + puts " Please switch to the following revision and try again:".red + puts " revision: #{settings[:gitlab_version]}".red + exit 1 + end + ensure + # chdir back to original intended dir + Dir.chdir(Gitlab.config.backup.path) + end + end + end +end diff --git a/lib/tasks/gitlab/backup.rake b/lib/tasks/gitlab/backup.rake index d071938acb5..2eff1260b61 100644 --- a/lib/tasks/gitlab/backup.rake +++ b/lib/tasks/gitlab/backup.rake @@ -11,49 +11,10 @@ namespace :gitlab do Rake::Task["gitlab:backup:repo:create"].invoke Rake::Task["gitlab:backup:uploads:create"].invoke - - # saving additional informations - s = {} - s[:db_version] = "#{ActiveRecord::Migrator.current_version}" - s[:backup_created_at] = Time.now - s[:gitlab_version] = %x{git rev-parse HEAD}.gsub(/\n/,"") - s[:tar_version] = %x{tar --version | head -1}.gsub(/\n/,"") - - Dir.chdir(Gitlab.config.backup.path) - - File.open("#{Gitlab.config.backup.path}/backup_information.yml", "w+") do |file| - file << s.to_yaml.gsub(/^---\n/,'') - end - - # create archive - print "Creating backup archive: #{s[:backup_created_at].to_i}_gitlab_backup.tar ... " - if Kernel.system("tar -cf #{s[:backup_created_at].to_i}_gitlab_backup.tar repositories/ db/ uploads/ backup_information.yml") - puts "done".green - else - puts "failed".red - end - - # cleanup: remove tmp files - print "Deleting tmp directories ... " - if Kernel.system("rm -rf repositories/ db/ uploads/ backup_information.yml") - puts "done".green - else - puts "failed".red - end - - # delete backups - print "Deleting old backups ... " - if Gitlab.config.backup.keep_time > 0 - file_list = Dir.glob("*_gitlab_backup.tar").map { |f| f.split(/_/).first.to_i } - file_list.sort.each do |timestamp| - if Time.at(timestamp) < (Time.now - Gitlab.config.backup.keep_time) - %x{rm #{timestamp}_gitlab_backup.tar} - end - end - puts "done".green - else - puts "skipping".yellow - end + backup = Backup::Manager.new + backup.pack + backup.cleanup + backup.remove_old end # Restore backup of GitLab system @@ -61,64 +22,15 @@ namespace :gitlab do task restore: :environment do warn_user_is_not_gitlab - Dir.chdir(Gitlab.config.backup.path) - - # check for existing backups in the backup dir - file_list = Dir.glob("*_gitlab_backup.tar").each.map { |f| f.split(/_/).first.to_i } - puts "no backups found" if file_list.count == 0 - if file_list.count > 1 && ENV["BACKUP"].nil? - puts "Found more than one backup, please specify which one you want to restore:" - puts "rake gitlab:backup:restore BACKUP=timestamp_of_backup" - exit 1 - end - - tar_file = ENV["BACKUP"].nil? ? File.join("#{file_list.first}_gitlab_backup.tar") : File.join(ENV["BACKUP"] + "_gitlab_backup.tar") - - unless File.exists?(tar_file) - puts "The specified backup doesn't exist!" - exit 1 - end - - print "Unpacking backup ... " - unless Kernel.system("tar -xf #{tar_file}") - puts "failed".red - exit 1 - else - puts "done".green - end - - settings = YAML.load_file("backup_information.yml") - ENV["VERSION"] = "#{settings[:db_version]}" if settings[:db_version].to_i > 0 - - # backups directory is not always sub of Rails root and able to execute the git rev-parse below - begin - Dir.chdir(Rails.root) - - # restoring mismatching backups can lead to unexpected problems - if settings[:gitlab_version] != %x{git rev-parse HEAD}.gsub(/\n/, "") - puts "GitLab version mismatch:".red - puts " Your current HEAD differs from the HEAD in the backup!".red - puts " Please switch to the following revision and try again:".red - puts " revision: #{settings[:gitlab_version]}".red - exit 1 - end - ensure - # chdir back to original intended dir - Dir.chdir(Gitlab.config.backup.path) - end + backup = Backup::Manager.new + backup.unpack Rake::Task["gitlab:backup:db:restore"].invoke Rake::Task["gitlab:backup:repo:restore"].invoke Rake::Task["gitlab:backup:uploads:restore"].invoke Rake::Task["gitlab:shell:setup"].invoke - # cleanup: remove tmp files - print "Deleting tmp directories ... " - if Kernel.system("rm -rf repositories/ db/ uploads/ backup_information.yml") - puts "done".green - else - puts "failed".red - end + backup.cleanup end namespace :repo do -- cgit v1.2.1 From d602d5b1b05036788c67c13510c34725c68116ea Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 5 Aug 2013 12:32:24 +0300 Subject: Fix find_diff for note when noteable is nil --- app/models/note.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/note.rb b/app/models/note.rb index 697c9d03a93..b3b9bd760ee 100644 --- a/app/models/note.rb +++ b/app/models/note.rb @@ -71,7 +71,7 @@ class Note < ActiveRecord::Base end def find_diff - return nil unless noteable.diffs.present? + return nil unless noteable && noteable.diffs.present? @diff ||= noteable.diffs.find do |d| Digest::SHA1.hexdigest(d.new_path) == diff_file_index if d.new_path -- cgit v1.2.1 From b92655663c9f066de6a67217ad9a55f38e20cffd Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 5 Aug 2013 16:51:04 +0300 Subject: Update main calls to gitlab_git --- Gemfile | 2 +- Gemfile.lock | 16 ++++++++++------ app/models/merge_request.rb | 2 +- app/models/repository.rb | 14 ++++++++++---- lib/extracts_path.rb | 4 ---- 5 files changed, 22 insertions(+), 16 deletions(-) diff --git a/Gemfile b/Gemfile index e679f3ee1aa..f5e05a1c8eb 100644 --- a/Gemfile +++ b/Gemfile @@ -23,7 +23,7 @@ gem 'omniauth-github' # Extracting information from a git repository # Provide access to Gitlab::Git library -gem 'gitlab_git', '~> 1.4.1' +gem 'gitlab_git', path: '../gitlab_git'#'~> 1.4.1' # Ruby/Rack Git Smart-HTTP Server Handler gem 'gitlab-grack', '~> 1.0.1', require: 'grack' diff --git a/Gemfile.lock b/Gemfile.lock index 6eedadc74c6..444a3dc8ba1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,6 +12,14 @@ GIT specs: raphael-rails (2.1.0) +PATH + remote: ../gitlab_git + specs: + gitlab_git (1.4.1) + activesupport (~> 3.2.13) + github-linguist (~> 2.3.4) + gitlab-grit (~> 2.6.0) + GEM remote: https://rubygems.org/ specs: @@ -176,10 +184,6 @@ GEM gitlab-pygments.rb (0.3.2) posix-spawn (~> 0.3.6) yajl-ruby (~> 1.1.0) - gitlab_git (1.4.1) - activesupport (~> 3.2.13) - github-linguist (~> 2.3.4) - gitlab-grit (~> 2.6.0) gitlab_meta (6.0) gitlab_omniauth-ldap (1.0.3) net-ldap (~> 0.3.1) @@ -275,7 +279,7 @@ GEM minitest (4.7.4) modernizr (2.6.2) sprockets (~> 2.0) - multi_json (1.7.7) + multi_json (1.7.8) multi_xml (0.5.4) multipart-post (1.2.0) mysql2 (0.3.11) @@ -568,7 +572,7 @@ DEPENDENCIES gitlab-gollum-lib (~> 1.0.1) gitlab-grack (~> 1.0.1) gitlab-pygments.rb (~> 0.3.2) - gitlab_git (~> 1.4.1) + gitlab_git! gitlab_meta (= 6.0) gitlab_omniauth-ldap (= 1.0.3) gon diff --git a/app/models/merge_request.rb b/app/models/merge_request.rb index 2a476355404..9cd883f421b 100644 --- a/app/models/merge_request.rb +++ b/app/models/merge_request.rb @@ -137,7 +137,7 @@ class MergeRequest < ActiveRecord::Base end def unmerged_diffs - project.repository.diffs_between(source_branch, target_branch) + Gitlab::Git::Diff.between(project.repository, source_branch, target_branch) end def last_commit diff --git a/app/models/repository.rb b/app/models/repository.rb index 588cabfbae0..cd33782a4cc 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -18,19 +18,25 @@ class Repository end def commit(id = nil) - commit = raw_repository.commit(id) + commit = Gitlab::Git::Commit.find(raw_repository, id) commit = Commit.new(commit) if commit commit end def commits(ref, path = nil, limit = nil, offset = nil) - commits = raw_repository.commits(ref, path, limit, offset) + commits = Gitlab::Git::Commit.where( + repo: raw_repository, + ref: ref, + path: path, + limit: limit, + offset: offset, + ) commits = Commit.decorate(commits) if commits.present? commits end - def commits_between(target, source) - commits = raw_repository.commits_between(target, source) + def commits_between(from, to) + commits = Gitlab::Git::Commit.between(raw_repository, from, to) commits = Commit.decorate(commits) if commits.present? commits end diff --git a/lib/extracts_path.rb b/lib/extracts_path.rb index a81c80cfc6f..d1035240cb6 100644 --- a/lib/extracts_path.rb +++ b/lib/extracts_path.rb @@ -95,13 +95,9 @@ module ExtractsPath # resolved (e.g., when a user inserts an invalid path or ref). def assign_ref_vars @id = get_id - @ref, @path = extract_ref(@id) - @repo = @project.repository - @commit = @repo.commit(@ref) - @tree = Tree.new(@repo, @commit.id, @ref, @path) @hex_path = Digest::SHA1.hexdigest(@path) @logs_path = logs_file_project_ref_path(@project, @ref, @path) -- cgit v1.2.1 From bb5e50e0f78ec0dc68d637a43b6ea9889ef1a10d Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 5 Aug 2013 16:55:15 +0300 Subject: Fix edit files --- app/controllers/projects/edit_tree_controller.rb | 2 +- lib/gitlab/satellite/edit_file_action.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/projects/edit_tree_controller.rb b/app/controllers/projects/edit_tree_controller.rb index 11c97291296..3b945fc7126 100644 --- a/app/controllers/projects/edit_tree_controller.rb +++ b/app/controllers/projects/edit_tree_controller.rb @@ -10,7 +10,7 @@ class Projects::EditTreeController < Projects::ApplicationController before_filter :edit_requirements, only: [:show, :update] def show - @last_commit = @project.repository.last_commit_for(@ref, @path).sha + @last_commit = Gitlab::Git::Commit.last_for_path(@project.repository, @ref, @path).sha end def update diff --git a/lib/gitlab/satellite/edit_file_action.rb b/lib/gitlab/satellite/edit_file_action.rb index 07570965b1a..d793d0ba8dc 100644 --- a/lib/gitlab/satellite/edit_file_action.rb +++ b/lib/gitlab/satellite/edit_file_action.rb @@ -49,7 +49,7 @@ module Gitlab protected def can_edit?(last_commit) - current_last_commit = @project.repository.last_commit_for(ref, file_path).sha + current_last_commit = Gitlab::Git::Commit.last_for_path(@project.repository, ref, file_path).sha last_commit == current_last_commit end end -- cgit v1.2.1 From 88c741dde062e320ad007a2c5ccb4e7bdc6cdacf Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 5 Aug 2013 17:59:58 +0300 Subject: Refactor recent branches page --- app/controllers/projects/branches_controller.rb | 4 ++++ app/controllers/projects/repositories_controller.rb | 4 ---- app/models/repository.rb | 6 ++++++ app/views/projects/branches/_filter.html.haml | 17 +++++++++++++++++ app/views/projects/branches/index.html.haml | 2 +- app/views/projects/branches/recent.html.haml | 8 ++++++++ app/views/projects/commits/_head.html.haml | 2 +- app/views/projects/protected_branches/index.html.haml | 2 +- app/views/projects/repositories/_filter.html.haml | 17 ----------------- app/views/projects/repositories/show.html.haml | 9 --------- config/routes.rb | 7 ++++++- 11 files changed, 44 insertions(+), 34 deletions(-) create mode 100644 app/views/projects/branches/_filter.html.haml create mode 100644 app/views/projects/branches/recent.html.haml delete mode 100644 app/views/projects/repositories/_filter.html.haml delete mode 100644 app/views/projects/repositories/show.html.haml diff --git a/app/controllers/projects/branches_controller.rb b/app/controllers/projects/branches_controller.rb index 97dbb2bc0c0..aa6914414ce 100644 --- a/app/controllers/projects/branches_controller.rb +++ b/app/controllers/projects/branches_controller.rb @@ -11,6 +11,10 @@ class Projects::BranchesController < Projects::ApplicationController @branches = Kaminari.paginate_array(@repository.branches).page(params[:page]).per(30) end + def recent + @branches = @repository.recent_branches + end + def create @repository.add_branch(params[:branch_name], params[:ref]) diff --git a/app/controllers/projects/repositories_controller.rb b/app/controllers/projects/repositories_controller.rb index 7e6c7016ecf..20e2a9311ee 100644 --- a/app/controllers/projects/repositories_controller.rb +++ b/app/controllers/projects/repositories_controller.rb @@ -4,10 +4,6 @@ class Projects::RepositoriesController < Projects::ApplicationController before_filter :authorize_code_access! before_filter :require_non_empty_project - def show - @activities = @repository.commits_with_refs(20) - end - def stats @stats = Gitlab::Git::Stats.new(@repository.raw, @repository.root_ref) @graph = @stats.graph diff --git a/app/models/repository.rb b/app/models/repository.rb index cd33782a4cc..a2fd91bbec1 100644 --- a/app/models/repository.rb +++ b/app/models/repository.rb @@ -49,6 +49,12 @@ class Repository tags.find { |tag| tag.name == name } end + def recent_branches(limit = 20) + branches.sort do |a, b| + a.commit.committed_date <=> b.commit.committed_date + end[0..limit] + end + def add_branch(branch_name, ref) Rails.cache.delete(cache_key(:branch_names)) diff --git a/app/views/projects/branches/_filter.html.haml b/app/views/projects/branches/_filter.html.haml new file mode 100644 index 00000000000..7ea11a74a2b --- /dev/null +++ b/app/views/projects/branches/_filter.html.haml @@ -0,0 +1,17 @@ +%ul.nav.nav-pills.nav-stacked + = nav_link(path: 'branches#recent') do + = link_to 'Recent', recent_project_branches_path(@project) + = nav_link(path: 'protected_branches#index') do + = link_to project_protected_branches_path(@project) do + Protected + %i.icon-lock + = nav_link(path: 'branches#index') do + = link_to 'All branches', project_branches_path(@project) + + +%hr +- if can? current_user, :push_code, @project + = link_to new_project_branch_path(@project), class: 'btn btn-create' do + %i.icon-add-sign + New branch + diff --git a/app/views/projects/branches/index.html.haml b/app/views/projects/branches/index.html.haml index 4cfafe1a7af..7a0eda6408a 100644 --- a/app/views/projects/branches/index.html.haml +++ b/app/views/projects/branches/index.html.haml @@ -1,7 +1,7 @@ = render "projects/commits/head" .row .span3 - = render "projects/repositories/filter" + = render "filter" .span9 - unless @branches.empty? %ul.bordered-list diff --git a/app/views/projects/branches/recent.html.haml b/app/views/projects/branches/recent.html.haml new file mode 100644 index 00000000000..6cafb47364b --- /dev/null +++ b/app/views/projects/branches/recent.html.haml @@ -0,0 +1,8 @@ += render "projects/commits/head" +.row + .span3 + = render "filter" + .span9 + %ul.bordered-list + - @branches.each do |branch| + = render "projects/branches/branch", branch: branch diff --git a/app/views/projects/commits/_head.html.haml b/app/views/projects/commits/_head.html.haml index 06d69eb5f75..c16abac7f17 100644 --- a/app/views/projects/commits/_head.html.haml +++ b/app/views/projects/commits/_head.html.haml @@ -7,7 +7,7 @@ = link_to 'Compare', project_compare_index_path(@project) = nav_link(html_options: {class: branches_tab_class}) do - = link_to project_repository_path(@project) do + = link_to recent_project_branches_path(@project) do Branches %span.badge= @repository.branches.length diff --git a/app/views/projects/protected_branches/index.html.haml b/app/views/projects/protected_branches/index.html.haml index 9cadb6fb126..8930ec4b30a 100644 --- a/app/views/projects/protected_branches/index.html.haml +++ b/app/views/projects/protected_branches/index.html.haml @@ -1,7 +1,7 @@ = render "projects/commits/head" .row .span3 - = render "projects/repositories/filter" + = render "projects/branches/filter" .span9 .alert.alert-info %p Protected branches designed to prevent push for all except #{link_to "masters", help_permissions_path, class: "vlink"}. diff --git a/app/views/projects/repositories/_filter.html.haml b/app/views/projects/repositories/_filter.html.haml deleted file mode 100644 index 660d9d25a35..00000000000 --- a/app/views/projects/repositories/_filter.html.haml +++ /dev/null @@ -1,17 +0,0 @@ -%ul.nav.nav-pills.nav-stacked - = nav_link(path: 'repositories#show') do - = link_to 'Recent', project_repository_path(@project) - = nav_link(path: 'protected_branches#index') do - = link_to project_protected_branches_path(@project) do - Protected - %i.icon-lock - = nav_link(path: 'branches#index') do - = link_to 'All branches', project_branches_path(@project) - - -%hr -- if can? current_user, :push_code, @project - = link_to new_project_branch_path(@project), class: 'btn btn-create' do - %i.icon-add-sign - New branch - diff --git a/app/views/projects/repositories/show.html.haml b/app/views/projects/repositories/show.html.haml deleted file mode 100644 index 611d0eddc4c..00000000000 --- a/app/views/projects/repositories/show.html.haml +++ /dev/null @@ -1,9 +0,0 @@ -= render "projects/commits/head" -.row - .span3 - = render "filter" - .span9 - %ul.bordered-list - - @activities.each do |update| - = render "projects/branches/branch", branch: update.head - diff --git a/config/routes.rb b/config/routes.rb index d303a57d304..c83e18ce4f0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -225,8 +225,13 @@ Gitlab::Application.routes.draw do end end + resources :branches, only: [:index, :new, :create, :destroy] do + collection do + get :recent + end + end + resources :tags, only: [:index, :new, :create, :destroy] - resources :branches, only: [:index, :new, :create, :destroy] resources :protected_branches, only: [:index, :create, :destroy] resources :refs, only: [] do -- cgit v1.2.1 From 128ef337078298966e499365e7dcb6272606b3b5 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 5 Aug 2013 18:16:37 +0300 Subject: use rubygems for gitlab_git gem --- Gemfile | 2 +- Gemfile.lock | 14 +++++--------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/Gemfile b/Gemfile index f5e05a1c8eb..c865e9f6dd1 100644 --- a/Gemfile +++ b/Gemfile @@ -23,7 +23,7 @@ gem 'omniauth-github' # Extracting information from a git repository # Provide access to Gitlab::Git library -gem 'gitlab_git', path: '../gitlab_git'#'~> 1.4.1' +gem "gitlab_git", "~> 2.0.0.pre" # Ruby/Rack Git Smart-HTTP Server Handler gem 'gitlab-grack', '~> 1.0.1', require: 'grack' diff --git a/Gemfile.lock b/Gemfile.lock index 444a3dc8ba1..b4a2626149f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,14 +12,6 @@ GIT specs: raphael-rails (2.1.0) -PATH - remote: ../gitlab_git - specs: - gitlab_git (1.4.1) - activesupport (~> 3.2.13) - github-linguist (~> 2.3.4) - gitlab-grit (~> 2.6.0) - GEM remote: https://rubygems.org/ specs: @@ -184,6 +176,10 @@ GEM gitlab-pygments.rb (0.3.2) posix-spawn (~> 0.3.6) yajl-ruby (~> 1.1.0) + gitlab_git (2.0.0.pre) + activesupport (~> 3.2.13) + github-linguist (~> 2.3.4) + gitlab-grit (~> 2.6.0) gitlab_meta (6.0) gitlab_omniauth-ldap (1.0.3) net-ldap (~> 0.3.1) @@ -572,7 +568,7 @@ DEPENDENCIES gitlab-gollum-lib (~> 1.0.1) gitlab-grack (~> 1.0.1) gitlab-pygments.rb (~> 0.3.2) - gitlab_git! + gitlab_git (~> 2.0.0.pre) gitlab_meta (= 6.0) gitlab_omniauth-ldap (= 1.0.3) gon -- cgit v1.2.1 From 1e3f09b21f124b15eebf71a23c12cfa41f1e5372 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 5 Aug 2013 18:29:44 +0300 Subject: Fix tests --- spec/controllers/commit_controller_spec.rb | 2 +- spec/features/security/project_access_spec.rb | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/spec/controllers/commit_controller_spec.rb b/spec/controllers/commit_controller_spec.rb index 87c54143a05..6773e84cbf5 100644 --- a/spec/controllers/commit_controller_spec.rb +++ b/spec/controllers/commit_controller_spec.rb @@ -3,7 +3,7 @@ require 'spec_helper' describe Projects::CommitController do let(:project) { create(:project_with_code) } let(:user) { create(:user) } - let(:commit) { project.repository.last_commit_for("master") } + let(:commit) { project.repository.commit("master") } before do sign_in(user) diff --git a/spec/features/security/project_access_spec.rb b/spec/features/security/project_access_spec.rb index 6bc04726a9d..d567fab9958 100644 --- a/spec/features/security/project_access_spec.rb +++ b/spec/features/security/project_access_spec.rb @@ -175,8 +175,8 @@ describe "Application access" do it { should be_denied_for :visitor } end - describe "GET /project_code/repository" do - subject { project_repository_path(project) } + describe "GET /project_code/branches/recent" do + subject { recent_project_branches_path(project) } it { should be_allowed_for master } it { should be_allowed_for reporter } @@ -186,7 +186,7 @@ describe "Application access" do it { should be_denied_for :visitor } end - describe "GET /project_code/repository/branches" do + describe "GET /project_code/branches" do subject { project_branches_path(project) } before do @@ -202,7 +202,7 @@ describe "Application access" do it { should be_denied_for :visitor } end - describe "GET /project_code/repository/tags" do + describe "GET /project_code/tags" do subject { project_tags_path(project) } before do @@ -417,8 +417,8 @@ describe "Application access" do it { should be_denied_for :visitor } end - describe "GET /project_code/repository" do - subject { project_repository_path(project) } + describe "GET /project_code/branches/recent" do + subject { recent_project_branches_path(project) } it { should be_allowed_for master } it { should be_allowed_for reporter } @@ -428,7 +428,7 @@ describe "Application access" do it { should be_denied_for :visitor } end - describe "GET /project_code/repository/branches" do + describe "GET /project_code/branches" do subject { project_branches_path(project) } before do @@ -444,7 +444,7 @@ describe "Application access" do it { should be_denied_for :visitor } end - describe "GET /project_code/repository/tags" do + describe "GET /project_code/tags" do subject { project_tags_path(project) } before do -- cgit v1.2.1 From a2501d158646e2a9eb9c17c3c88a9a24a74ea24b Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 5 Aug 2013 19:08:51 +0300 Subject: more space for days in network graph --- app/assets/javascripts/branch-graph.js.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/branch-graph.js.coffee b/app/assets/javascripts/branch-graph.js.coffee index 6e069f264f1..5f5be07194a 100644 --- a/app/assets/javascripts/branch-graph.js.coffee +++ b/app/assets/javascripts/branch-graph.js.coffee @@ -62,16 +62,16 @@ class BranchGraph cuday = 0 cumonth = "" - r.rect(0, 0, 26, @barHeight).attr fill: "#222" - r.rect(26, 0, 20, @barHeight).attr fill: "#444" + r.rect(0, 0, 30, @barHeight).attr fill: "#222" + r.rect(30, 0, 25, @barHeight).attr fill: "#444" for day, mm in @days if cuday isnt day[0] # Dates - r.text(36, @offsetY + @unitTime * mm, day[0]) + r.text(40, @offsetY + @unitTime * mm, day[0]) .attr( font: "12px Monaco, monospace" - fill: "#DDD" + fill: "#BBB" ) cuday = day[0] -- cgit v1.2.1 From 498a9ce3d2744d9af7811f2b1d8bef8aeeb78eaf Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Mon, 5 Aug 2013 19:10:20 +0300 Subject: more space for months names in network graph --- app/assets/javascripts/branch-graph.js.coffee | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/assets/javascripts/branch-graph.js.coffee b/app/assets/javascripts/branch-graph.js.coffee index 5f5be07194a..318538509a5 100644 --- a/app/assets/javascripts/branch-graph.js.coffee +++ b/app/assets/javascripts/branch-graph.js.coffee @@ -62,13 +62,13 @@ class BranchGraph cuday = 0 cumonth = "" - r.rect(0, 0, 30, @barHeight).attr fill: "#222" - r.rect(30, 0, 25, @barHeight).attr fill: "#444" + r.rect(0, 0, 40, @barHeight).attr fill: "#222" + r.rect(40, 0, 30, @barHeight).attr fill: "#444" for day, mm in @days if cuday isnt day[0] # Dates - r.text(40, @offsetY + @unitTime * mm, day[0]) + r.text(55, @offsetY + @unitTime * mm, day[0]) .attr( font: "12px Monaco, monospace" fill: "#BBB" @@ -77,7 +77,7 @@ class BranchGraph if cumonth isnt day[1] # Months - r.text(13, @offsetY + @unitTime * mm, day[1]) + r.text(20, @offsetY + @unitTime * mm, day[1]) .attr( font: "12px Monaco, monospace" fill: "#EEE" -- cgit v1.2.1 From 0b747a0f4ab3917ea1593b0f25169e600cd1059f Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 6 Aug 2013 17:58:45 +0300 Subject: Minor UI improvements --- app/views/projects/deploy_keys/index.html.haml | 14 +++++++------- app/views/projects/team_members/import.html.haml | 9 ++++----- app/views/projects/team_members/index.html.haml | 4 ++-- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/app/views/projects/deploy_keys/index.html.haml b/app/views/projects/deploy_keys/index.html.haml index 757b8c00eea..3e797691241 100644 --- a/app/views/projects/deploy_keys/index.html.haml +++ b/app/views/projects/deploy_keys/index.html.haml @@ -1,4 +1,4 @@ -%p.slead +%h3.page-title Deploy keys allow read-only access to repository = link_to new_project_deploy_key_path(@project), class: "btn btn-new pull-right", title: "New Deploy Key" do @@ -13,9 +13,9 @@ .row .span5.enabled-keys - %h5.cgreen - Enabled deploy keys - %small for this project + %h5 + %strong.cgreen Enabled deploy keys + for this project %ul.bordered-list = render @enabled_keys - if @enabled_keys.blank? @@ -23,10 +23,10 @@ %p.nothing_here_message Create #{link_to 'new deploy key', new_project_deploy_key_path(@project)} or add existing one .span5.available-keys %h5 - Available deploy keys - %small from projects you are able to manage + %strong Deploy keys + from projects available for you %ul.bordered-list = render @available_keys - if @available_keys.blank? .light-well - %p.nothing_here_message All deploy keys created in projects you own will be displayed here + %p.nothing_here_message All deploy keys created in projects you participate will be displayed here diff --git a/app/views/projects/team_members/import.html.haml b/app/views/projects/team_members/import.html.haml index c293cb4beef..6a17e0c2cb0 100644 --- a/app/views/projects/team_members/import.html.haml +++ b/app/views/projects/team_members/import.html.haml @@ -1,15 +1,14 @@ %h3.page-title - = "Import team from another project" + = "Import members from another project" +%p.light + Only project members will be improted. Group members will be skipped. %hr -%p.slead - Read more about project team import #{link_to "here", '#', class: 'vlink'}. = form_tag apply_import_project_team_members_path(@project), method: 'post' do - %p.slead Choose project you want to use as team source: .padded = label_tag :source_project_id, "Project" .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 btn-save" + = submit_tag 'Import project members', class: "btn btn-create" = link_to "Cancel", project_team_index_path(@project), class: "btn btn-cancel" diff --git a/app/views/projects/team_members/index.html.haml b/app/views/projects/team_members/index.html.haml index af80ceaed52..88325587f44 100644 --- a/app/views/projects/team_members/index.html.haml +++ b/app/views/projects/team_members/index.html.haml @@ -3,10 +3,10 @@ - if can? current_user, :admin_team_member, @project %span.pull-right - = link_to import_project_team_members_path(@project), class: "btn grouped", title: "Import team from another project" do - Import team from another project = link_to new_project_team_member_path(@project), class: "btn btn-new grouped", title: "New Team Member" do New Team Member + = link_to import_project_team_members_path(@project), class: "btn grouped", title: "Import team from another project" do + Import members %p.light Read more about project permissions -- cgit v1.2.1 From f8137075d5a615e968a4b63af13e1c51c36153df Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 6 Aug 2013 18:03:13 +0300 Subject: Show correct group membership in profile --- app/controllers/profiles/groups_controller.rb | 2 +- app/views/profiles/groups/index.html.haml | 10 +++++++--- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/app/controllers/profiles/groups_controller.rb b/app/controllers/profiles/groups_controller.rb index 793d2a32954..e276d07b489 100644 --- a/app/controllers/profiles/groups_controller.rb +++ b/app/controllers/profiles/groups_controller.rb @@ -2,7 +2,7 @@ class Profiles::GroupsController < ApplicationController layout "profile" def index - @groups = current_user.authorized_groups.page(params[:page]).per(20) + @user_groups = current_user.users_groups.page(params[:page]).per(20) end def leave diff --git a/app/views/profiles/groups/index.html.haml b/app/views/profiles/groups/index.html.haml index 63695d7e0b9..c7c657a92a6 100644 --- a/app/views/profiles/groups/index.html.haml +++ b/app/views/profiles/groups/index.html.haml @@ -11,9 +11,10 @@ .ui-box .title %strong Groups - (#{@groups.count}) + (#{@user_groups.count}) %ul.well-list - - @groups.each do |group| + - @user_groups.each do |user_group| + - group = user_group.group %li .pull-right - if can?(current_user, :manage_group, group) @@ -28,4 +29,7 @@ = link_to group, class: 'group-name' do = group.name -= paginate @groups + as #{user_group.human_access} + + += paginate @user_groups -- cgit v1.2.1 From 6eabf90b804e199f6a9c2b96ac4b293405da9897 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 6 Aug 2013 18:45:45 +0300 Subject: Ability to edit group member permissions --- app/assets/javascripts/behaviors/toggler_behavior.coffee | 5 +++++ app/assets/javascripts/extensions/jquery.js.coffee | 4 ++++ app/controllers/users_groups_controller.rb | 3 ++- app/views/users_groups/_users_group.html.haml | 14 +++++++++----- app/views/users_groups/update.js.haml | 2 ++ 5 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 app/views/users_groups/update.js.haml diff --git a/app/assets/javascripts/behaviors/toggler_behavior.coffee b/app/assets/javascripts/behaviors/toggler_behavior.coffee index d2181e7b759..c01db203619 100644 --- a/app/assets/javascripts/behaviors/toggler_behavior.coffee +++ b/app/assets/javascripts/behaviors/toggler_behavior.coffee @@ -11,3 +11,8 @@ $ -> container = $(".js-toggle-visibility-container") container.toggleClass("hide") e.preventDefault() + + $("body").on "click", ".js-toggle-button", (e) -> + $(@).disableButton() + $(@).closest(".js-toggle-container").find(".js-toggle-content").show() + e.preventDefault() diff --git a/app/assets/javascripts/extensions/jquery.js.coffee b/app/assets/javascripts/extensions/jquery.js.coffee index 8a997fe318e..40fb6cb9fc3 100644 --- a/app/assets/javascripts/extensions/jquery.js.coffee +++ b/app/assets/javascripts/extensions/jquery.js.coffee @@ -7,3 +7,7 @@ $.fn.enableButton = -> $(@).removeAttr('disabled'). removeClass('disabled') +$.fn.disableButton = -> + $(@).attr('disabled', 'disabled'). + addClass('disabled') + diff --git a/app/controllers/users_groups_controller.rb b/app/controllers/users_groups_controller.rb index 36eb8dbbfa4..df13b86fdcd 100644 --- a/app/controllers/users_groups_controller.rb +++ b/app/controllers/users_groups_controller.rb @@ -13,7 +13,8 @@ class UsersGroupsController < ApplicationController end def update - # TODO: implement + @member = @group.users_groups.find(params[:id]) + @member.update_attributes(params[:users_group]) end def destroy diff --git a/app/views/users_groups/_users_group.html.haml b/app/views/users_groups/_users_group.html.haml index d3d08dd5dea..c8d306838f7 100644 --- a/app/views/users_groups/_users_group.html.haml +++ b/app/views/users_groups/_users_group.html.haml @@ -1,6 +1,6 @@ - user = member.user - return unless user -%li{class: dom_class(member)} +%li{class: "#{dom_class(member)} js-toggle-container", id: dom_id(member)} = image_tag gravatar_icon(user.email, 16), class: "avatar s16" %strong= user.name %span.cgray= user.username @@ -8,12 +8,16 @@ %span.label.label-success It's you %span.pull-right - - if @group.owners.include?(user) - %span.label.label-info Group Owner - - else - = member.human_access + %strong= member.human_access - if show_controls && user != @group.owner && user != current_user + = link_to '#', class: "btn-tiny btn js-toggle-button", title: 'Edit access level' do + %i.icon-edit = link_to group_users_group_path(@group, member), confirm: remove_user_from_group_message(@group, user), method: :delete, remote: true, class: "btn-tiny btn btn-remove", title: 'Remove user from group' do %i.icon-minus.icon-white + .edit-member.hide.js-toggle-content + = form_for [@group, member], remote: true do |f| + .alert.prepend-top-20 + = f.select :group_access, options_for_select(UsersGroup.group_access_roles, member.group_access) + = f.submit 'Save', class: 'btn btn-save' diff --git a/app/views/users_groups/update.js.haml b/app/views/users_groups/update.js.haml new file mode 100644 index 00000000000..5bad48abafd --- /dev/null +++ b/app/views/users_groups/update.js.haml @@ -0,0 +1,2 @@ +:plain + $("##{dom_id(@member)}").replaceWith('#{escape_javascript(render(@member, member: @member, show_controls: true))}'); -- cgit v1.2.1 From 65eddc00adaa89b93cda204634af84538a91e8ad Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 6 Aug 2013 18:49:37 +0300 Subject: toggle content instead of disabling button for group members editing --- app/assets/javascripts/behaviors/toggler_behavior.coffee | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/assets/javascripts/behaviors/toggler_behavior.coffee b/app/assets/javascripts/behaviors/toggler_behavior.coffee index c01db203619..7e438c51c1c 100644 --- a/app/assets/javascripts/behaviors/toggler_behavior.coffee +++ b/app/assets/javascripts/behaviors/toggler_behavior.coffee @@ -13,6 +13,5 @@ $ -> e.preventDefault() $("body").on "click", ".js-toggle-button", (e) -> - $(@).disableButton() - $(@).closest(".js-toggle-container").find(".js-toggle-content").show() + $(@).closest(".js-toggle-container").find(".js-toggle-content").toggle() e.preventDefault() -- cgit v1.2.1 From 21c70354f609c292d302c433f9f9bcea31674ab9 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 6 Aug 2013 20:12:20 +0300 Subject: Restyle group members page a bit --- app/views/groups/_new_group_member.html.haml | 9 ++++--- app/views/groups/members.html.haml | 36 +++++++++++++--------------- 2 files changed, 22 insertions(+), 23 deletions(-) diff --git a/app/views/groups/_new_group_member.html.haml b/app/views/groups/_new_group_member.html.haml index 87c9c3264e0..2e17ff12a18 100644 --- a/app/views/groups/_new_group_member.html.haml +++ b/app/views/groups/_new_group_member.html.haml @@ -1,13 +1,16 @@ = form_for @users_group, url: group_users_groups_path(@group) do |f| %fieldset - %legend= "New Group member(s) for #{@group.name}" + %legend + New member(s) for + %strong #{@group.name} + group - %h6 1. Choose users you want in the group + %p 1. Choose users you want in the group .clearfix = f.label :user_ids, "People" .input= users_select_tag(:user_ids, multiple: true, class: 'input-large') - %h6 2. Set access level for them + %p 2. Set access level for them .clearfix = f.label :group_access, "Group Access" .input= select_tag :group_access, options_for_select(UsersGroup.group_access_roles, @users_group.group_access), class: "project-access-select chosen" diff --git a/app/views/groups/members.html.haml b/app/views/groups/members.html.haml index 82a16e53c6e..77bab11b331 100644 --- a/app/views/groups/members.html.haml +++ b/app/views/groups/members.html.haml @@ -1,21 +1,17 @@ +%h3.page-title + Group members +%p.light + Members of group have access to all group projects. +%hr - can_manage_group = current_user.can? :manage_group, @group -.row - .span6 - - if can_manage_group - = render "new_group_member" - - else - .light-well - %h4.nothing_here_message - Only group owners can manage group members - .span6 - .ui-box - .title - %strong #{@group.name} - Group Members - %small - (#{@members.count}) - %ul.well-list - - @members.each do |member| - = render 'users_groups/users_group', member: member, show_controls: can_manage_group - %p.light - Group members get access to all projects in this group +.ui-box + .title + %strong #{@group.name} + group members + %small + (#{@members.count}) + %ul.well-list + - @members.each do |member| + = render 'users_groups/users_group', member: member, show_controls: can_manage_group +- if can_manage_group + = render "new_group_member" -- cgit v1.2.1 From 512cd02335de9de22aab688743a01fa868229f0d Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 6 Aug 2013 21:12:01 +0300 Subject: Dashboard/Group issues and mr pages refactoring --- app/assets/stylesheets/gitlab_bootstrap/nav.scss | 7 ++++++ app/contexts/filter_context.rb | 2 +- app/helpers/dashboard_helper.rb | 11 ++++----- app/helpers/groups_helper.rb | 16 ------------- app/views/dashboard/_filter.html.haml | 27 ---------------------- app/views/dashboard/issues.html.haml | 21 ++--------------- app/views/dashboard/merge_requests.html.haml | 2 +- app/views/groups/issues.html.haml | 16 ++----------- app/views/groups/merge_requests.html.haml | 2 +- app/views/shared/_filter.html.haml | 29 ++++++++++++++++++++++++ app/views/shared/_issues.html.haml | 19 ++++++++++++++++ 11 files changed, 66 insertions(+), 86 deletions(-) delete mode 100644 app/views/dashboard/_filter.html.haml create mode 100644 app/views/shared/_filter.html.haml create mode 100644 app/views/shared/_issues.html.haml diff --git a/app/assets/stylesheets/gitlab_bootstrap/nav.scss b/app/assets/stylesheets/gitlab_bootstrap/nav.scss index de077303617..f75d643aa0f 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/nav.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/nav.scss @@ -10,6 +10,7 @@ > li > a { @include border-radius(0); } + &.nav-stacked { > li > a { border-left: 4px solid #EEE; @@ -30,6 +31,12 @@ } } } + + &.nav-pills-small { + > li > a { + padding: 8px 12px; + } + } } .nav-pills > .active > a > i[class^="icon-"] { background: inherit; } diff --git a/app/contexts/filter_context.rb b/app/contexts/filter_context.rb index 401d19b31c8..cd054e0c2c3 100644 --- a/app/contexts/filter_context.rb +++ b/app/contexts/filter_context.rb @@ -11,7 +11,7 @@ class FilterContext end def apply_filter items - if params[:project_id] + if params[:project_id].present? items = items.where(project_id: params[:project_id]) end diff --git a/app/helpers/dashboard_helper.rb b/app/helpers/dashboard_helper.rb index e3be07c9fe0..35c7bcbd2cf 100644 --- a/app/helpers/dashboard_helper.rb +++ b/app/helpers/dashboard_helper.rb @@ -1,5 +1,5 @@ module DashboardHelper - def dashboard_filter_path(entity, options={}) + def filter_path(entity, options={}) exist_opts = { status: params[:status], project_id: params[:project_id], @@ -7,12 +7,9 @@ module DashboardHelper options = exist_opts.merge(options) - case entity - when 'issue' then - issues_dashboard_path(options) - when 'merge_request' - merge_requests_dashboard_path(options) - end + path = request.path + path << "?#{options.to_param}" + path end def entities_per_project project, entity diff --git a/app/helpers/groups_helper.rb b/app/helpers/groups_helper.rb index 2ffbff7af8d..8573c59dc94 100644 --- a/app/helpers/groups_helper.rb +++ b/app/helpers/groups_helper.rb @@ -1,20 +1,4 @@ module GroupsHelper - def group_filter_path(entity, options={}) - exist_opts = { - status: params[:status], - project_id: params[:project_id], - } - - options = exist_opts.merge(options) - - case entity - when 'issue' then - issues_group_path(@group, options) - when 'merge_request' - merge_requests_group_path(@group, options) - end - end - def remove_user_from_group_message(group, user) "You are going to remove #{user.name} from #{group.name} Group. Are you sure?" end diff --git a/app/views/dashboard/_filter.html.haml b/app/views/dashboard/_filter.html.haml deleted file mode 100644 index d3208e6aad6..00000000000 --- a/app/views/dashboard/_filter.html.haml +++ /dev/null @@ -1,27 +0,0 @@ -= form_tag dashboard_filter_path(entity), method: 'get' do - %fieldset - %ul.nav.nav-pills.nav-stacked - %li{class: ("active" if !params[:status])} - = link_to dashboard_filter_path(entity, status: nil) do - Open - %li{class: ("active" if params[:status] == 'closed')} - = link_to dashboard_filter_path(entity, status: 'closed') do - Closed - %li{class: ("active" if params[:status] == 'all')} - = link_to dashboard_filter_path(entity, status: 'all') do - All - - %fieldset - %legend Projects: - %ul.nav.nav-pills.nav-stacked - - @projects.each do |project| - - unless entities_per_project(project, entity).zero? - %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.pull-right= entities_per_project(project, entity) - - %fieldset - %hr - = link_to "Reset", dashboard_filter_path(entity), class: 'btn pull-right' - diff --git a/app/views/dashboard/issues.html.haml b/app/views/dashboard/issues.html.haml index 1041d9d1d51..8b736fb5039 100644 --- a/app/views/dashboard/issues.html.haml +++ b/app/views/dashboard/issues.html.haml @@ -8,23 +8,6 @@ .row .span3 - = render 'filter', entity: 'issue' + = render 'shared/filter', entity: 'issue' .span9 - - if @issues.any? - - @issues.group_by(&:project).each do |group| - %div.ui-box - - project = group[0] - .title - = link_to_project project -   - %i.icon-angle-right -   - = link_to 'issues', project_issues_path(project) - - %ul.well-list.issues-list - - group[1].each do |issue| - = render 'projects/issues/issue', issue: issue - %hr - = paginate @issues, theme: "gitlab" - - else - %p.nothing_here_message Nothing to show here + = render 'shared/issues' diff --git a/app/views/dashboard/merge_requests.html.haml b/app/views/dashboard/merge_requests.html.haml index 77a40b2eef6..6ffe54028b5 100644 --- a/app/views/dashboard/merge_requests.html.haml +++ b/app/views/dashboard/merge_requests.html.haml @@ -8,6 +8,6 @@ %hr .row .span3 - = render 'filter', entity: 'merge_request' + = render 'shared/filter', entity: 'merge_request' .span9 = render 'shared/merge_requests' diff --git a/app/views/groups/issues.html.haml b/app/views/groups/issues.html.haml index 5c76f1c22ed..2785f92e41b 100644 --- a/app/views/groups/issues.html.haml +++ b/app/views/groups/issues.html.haml @@ -6,18 +6,6 @@ %hr .row .span3 - = render 'filter', entity: 'issue' + = render 'shared/filter', entity: 'issue' .span9 - - if @issues.any? - - @issues.group_by(&:project).each do |group| - %div.ui-box - - project = group[0] - .title - = link_to_project project - %ul.well-list.issues-list - - group[1].each do |issue| - = render 'projects/issues/issue', issue: issue - %hr - = paginate @issues, theme: "gitlab" - - else - %p.nothing_here_message Nothing to show here + = render 'shared/issues' diff --git a/app/views/groups/merge_requests.html.haml b/app/views/groups/merge_requests.html.haml index eb8497c03f1..93a07f4ed89 100644 --- a/app/views/groups/merge_requests.html.haml +++ b/app/views/groups/merge_requests.html.haml @@ -6,6 +6,6 @@ %hr .row .span3 - = render 'filter', entity: 'merge_request' + = render 'shared/filter', entity: 'merge_request' .span9 = render 'shared/merge_requests' diff --git a/app/views/shared/_filter.html.haml b/app/views/shared/_filter.html.haml new file mode 100644 index 00000000000..fc3232e0e0e --- /dev/null +++ b/app/views/shared/_filter.html.haml @@ -0,0 +1,29 @@ += form_tag filter_path(entity), method: 'get' do + %fieldset + %ul.nav.nav-pills.nav-stacked + %li{class: ("active" if params[:status].blank?)} + = link_to filter_path(entity, status: nil) do + Open + %li{class: ("active" if params[:status] == 'closed')} + = link_to filter_path(entity, status: 'closed') do + Closed + %li{class: ("active" if params[:status] == 'all')} + = link_to filter_path(entity, status: 'all') do + All + + %fieldset + %legend Projects: + %ul.nav.nav-pills.nav-pills-small.nav-stacked + - @projects.each do |project| + - unless entities_per_project(project, entity).zero? + %li{class: ("active" if params[:project_id] == project.id.to_s)} + = link_to filter_path(entity, project_id: project.id) do + = project.name_with_namespace + %small.pull-right= entities_per_project(project, entity) + + %fieldset + - if params[:status].present? || params[:project_id].present? + = link_to filter_path(entity, status: nil, project_id: nil), class: 'pull-right cgray' do + %i.icon-remove + Clear filter + diff --git a/app/views/shared/_issues.html.haml b/app/views/shared/_issues.html.haml new file mode 100644 index 00000000000..33f8f5f4ad1 --- /dev/null +++ b/app/views/shared/_issues.html.haml @@ -0,0 +1,19 @@ +- if @issues.any? + - @issues.group_by(&:project).each do |group| + %div.ui-box + - project = group[0] + .title + = link_to_project project +   + %i.icon-angle-right +   + = link_to 'issues', project_issues_path(project) + + %ul.well-list.issues-list + - group[1].each do |issue| + = render 'projects/issues/issue', issue: issue + %hr + = paginate @issues, theme: "gitlab" +- else + %p.nothing_here_message Nothing to show here + -- cgit v1.2.1 From 27b7aeddfbd4b927c45d574c2c1cc846abe0cca2 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Tue, 6 Aug 2013 21:22:41 +0300 Subject: More compact lists for dashboard issues, mr --- app/assets/stylesheets/gitlab_bootstrap/blocks.scss | 16 ++++++++++++++++ app/views/shared/_issues.html.haml | 7 ++----- app/views/shared/_merge_requests.html.haml | 2 +- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/app/assets/stylesheets/gitlab_bootstrap/blocks.scss b/app/assets/stylesheets/gitlab_bootstrap/blocks.scss index 08202211e53..bbce30f347a 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/blocks.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/blocks.scss @@ -15,6 +15,22 @@ border: 1px solid #CCC; word-wrap: break-word; + &.small-box { + margin-bottom: 10px; + + .title { + font-size: 13px; + line-height: 30px; + + a { + color: #666; + &:hover { + text-decoration: underline; + } + } + } + } + &.ui-box-show { margin:20px 0; background: #FFF; diff --git a/app/views/shared/_issues.html.haml b/app/views/shared/_issues.html.haml index 33f8f5f4ad1..9fa574cebc0 100644 --- a/app/views/shared/_issues.html.haml +++ b/app/views/shared/_issues.html.haml @@ -1,13 +1,10 @@ - if @issues.any? - @issues.group_by(&:project).each do |group| - %div.ui-box + .ui-box.small-box - project = group[0] .title = link_to_project project -   - %i.icon-angle-right -   - = link_to 'issues', project_issues_path(project) + = link_to 'show all', project_issues_path(project), class: 'pull-right' %ul.well-list.issues-list - group[1].each do |issue| diff --git a/app/views/shared/_merge_requests.html.haml b/app/views/shared/_merge_requests.html.haml index 935a7a7f7c0..c83620dd7f4 100644 --- a/app/views/shared/_merge_requests.html.haml +++ b/app/views/shared/_merge_requests.html.haml @@ -1,6 +1,6 @@ - if @merge_requests.any? - @merge_requests.group_by(&:project).each do |group| - .ui-box + .ui-box.small-box - project = group[0] .title = link_to_project project -- cgit v1.2.1 From bc3a4d319469887ad6667a9b7726963cbe72eabc Mon Sep 17 00:00:00 2001 From: Itxaka Serrano Date: Tue, 6 Aug 2013 21:24:29 +0200 Subject: added python api wrapper --- doc/api/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/api/README.md b/doc/api/README.md index 49bda6725e7..8e4eb296b40 100644 --- a/doc/api/README.md +++ b/doc/api/README.md @@ -87,3 +87,4 @@ When listing resources you can pass the following parameters: + [php-gitlab-api](https://github.com/m4tthumphrey/php-gitlab-api) - PHP + [Ruby Wrapper](https://github.com/NARKOZ/gitlab) - Ruby ++ [python-gitlab](https://github.com/Itxaka/python-gitlab) - Python -- cgit v1.2.1 From a43a38039476598fe1e959b29d7033a5b1b1c8d0 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 Aug 2013 22:51:36 +0300 Subject: Increase amount of search results for issues, mr, projects --- app/contexts/search_context.rb | 6 +++--- app/views/shared/_issues.html.haml | 1 - app/views/shared/_merge_requests.html.haml | 1 - 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/app/contexts/search_context.rb b/app/contexts/search_context.rb index 22cda709f69..9e49e44496b 100644 --- a/app/contexts/search_context.rb +++ b/app/contexts/search_context.rb @@ -11,7 +11,7 @@ class SearchContext return result unless query.present? projects = Project.where(id: project_ids) - result[:projects] = projects.search(query).limit(10) + result[:projects] = projects.search(query).limit(20) # Search inside singe project project = projects.first if projects.length == 1 @@ -19,8 +19,8 @@ class SearchContext if params[:search_code].present? result[:blobs] = project.repository.search_files(query, params[:repository_ref]) unless project.empty_repo? else - result[:merge_requests] = MergeRequest.where(project_id: project_ids).search(query).limit(10) - result[:issues] = Issue.where(project_id: project_ids).search(query).limit(10) + result[:merge_requests] = MergeRequest.where(project_id: project_ids).search(query).limit(20) + result[:issues] = Issue.where(project_id: project_ids).search(query).limit(20) result[:wiki_pages] = [] end result diff --git a/app/views/shared/_issues.html.haml b/app/views/shared/_issues.html.haml index 9fa574cebc0..6f4852d8785 100644 --- a/app/views/shared/_issues.html.haml +++ b/app/views/shared/_issues.html.haml @@ -9,7 +9,6 @@ %ul.well-list.issues-list - group[1].each do |issue| = render 'projects/issues/issue', issue: issue - %hr = paginate @issues, theme: "gitlab" - else %p.nothing_here_message Nothing to show here diff --git a/app/views/shared/_merge_requests.html.haml b/app/views/shared/_merge_requests.html.haml index c83620dd7f4..eed52d61530 100644 --- a/app/views/shared/_merge_requests.html.haml +++ b/app/views/shared/_merge_requests.html.haml @@ -7,7 +7,6 @@ %ul.well-list.mr-list - group[1].each do |merge_request| = render 'projects/merge_requests/merge_request', merge_request: merge_request - %hr = paginate @merge_requests, theme: "gitlab" - else -- cgit v1.2.1 From 49fa9907ae55be4922929def98afb9be29281c1e Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 Aug 2013 23:20:10 +0300 Subject: use control-group classes for inline forms in admin area --- app/views/admin/groups/edit.html.haml | 12 ++++---- app/views/admin/groups/new.html.haml | 8 +++--- app/views/admin/hooks/index.html.haml | 4 +-- app/views/admin/users/_form.html.haml | 52 +++++++++++++++++------------------ 4 files changed, 38 insertions(+), 38 deletions(-) diff --git a/app/views/admin/groups/edit.html.haml b/app/views/admin/groups/edit.html.haml index f4d931f480f..027f663891a 100644 --- a/app/views/admin/groups/edit.html.haml +++ b/app/views/admin/groups/edit.html.haml @@ -4,21 +4,21 @@ - if @group.errors.any? .alert.alert-error %span= @group.errors.full_messages.first - .clearfix.group_name_holder + .control-group.group_name_holder = f.label :name do Group name is - .input + .controls = f.text_field :name, placeholder: "Example Group", class: "xxlarge" - .clearfix.group-description-holder + .control-group.group-description-holder = f.label :description, "Details" - .input + .controls = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 - .clearfix.group_name_holder + .control-group.group_name_holder = f.label :path do %span.cred Group path is - .input + .controls = f.text_field :path, placeholder: "example-group", class: "xxlarge danger" %ul.cred %li Changing group path can have unintended side effects. diff --git a/app/views/admin/groups/new.html.haml b/app/views/admin/groups/new.html.haml index 483c40b1791..dcb91d586e6 100644 --- a/app/views/admin/groups/new.html.haml +++ b/app/views/admin/groups/new.html.haml @@ -4,14 +4,14 @@ - if @group.errors.any? .alert.alert-error %span= @group.errors.full_messages.first - .clearfix + .control-group = f.label :name do Group name is - .input + .controls = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" - .clearfix.group-description-holder + .control-group.group-description-holder = f.label :description, "Details" - .input + .controls = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 .form-actions diff --git a/app/views/admin/hooks/index.html.haml b/app/views/admin/hooks/index.html.haml index 7c3b999afb3..0830bc32b91 100644 --- a/app/views/admin/hooks/index.html.haml +++ b/app/views/admin/hooks/index.html.haml @@ -10,9 +10,9 @@ .alert.alert-error - @hook.errors.full_messages.each do |msg| %p= msg - .clearfix + .control-group = f.label :url, "URL:" - .input + .controls = f.text_field :url, class: "text_field xxlarge input-xpadding"   = f.submit "Add System Hook", class: "btn btn-create" diff --git a/app/views/admin/users/_form.html.haml b/app/views/admin/users/_form.html.haml index 4f7f05c84f1..0e7f5cb3f9f 100644 --- a/app/views/admin/users/_form.html.haml +++ b/app/views/admin/users/_form.html.haml @@ -8,28 +8,28 @@ %fieldset %legend Account - .clearfix + .control-group = f.label :name - .input + .controls = f.text_field :name, required: true, autocomplete: "off" %span.help-inline * required - .clearfix + .control-group = f.label :username - .input + .controls = f.text_field :username, required: true, autocomplete: "off" %span.help-inline * required - .clearfix + .control-group = f.label :email - .input + .controls = f.text_field :email, required: true, autocomplete: "off" %span.help-inline * required - if @user.new_record? %fieldset %legend Password - .clearfix + .control-group = f.label :password - .input + .controls %strong A temporary password will be generated and sent to user. %br @@ -37,33 +37,33 @@ - else %fieldset %legend Password - .clearfix + .control-group = f.label :password - .input= f.password_field :password, disabled: f.object.force_random_password - .clearfix + .controls= f.password_field :password, disabled: f.object.force_random_password + .control-group = f.label :password_confirmation - .input= f.password_field :password_confirmation, disabled: f.object.force_random_password + .controls= f.password_field :password_confirmation, disabled: f.object.force_random_password %fieldset %legend Access .row .span8 - .clearfix + .control-group = f.label :projects_limit - .input= f.number_field :projects_limit + .controls= f.number_field :projects_limit - .clearfix + .control-group = f.label :can_create_group - .input= f.check_box :can_create_group + .controls= f.check_box :can_create_group - .clearfix + .control-group = f.label :can_create_team - .input= f.check_box :can_create_team + .controls= f.check_box :can_create_team - .clearfix + .control-group = f.label :admin do %strong.cred Administrator - .input= f.check_box :admin + .controls= f.check_box :admin .span4 - unless @user.new_record? .alert.alert-error @@ -75,15 +75,15 @@ = link_to 'Block User', block_admin_user_path(@user), confirm: 'USER WILL BE BLOCKED! Are you sure?', method: :put, class: "btn btn-small btn-remove" %fieldset %legend Profile - .clearfix + .control-group = f.label :skype - .input= f.text_field :skype - .clearfix + .controls= f.text_field :skype + .control-group = f.label :linkedin - .input= f.text_field :linkedin - .clearfix + .controls= f.text_field :linkedin + .control-group = f.label :twitter - .input= f.text_field :twitter + .controls= f.text_field :twitter .actions - if @user.new_record? -- cgit v1.2.1 From f2082edb6058b5ff665ff84c465b6d75f58b6c54 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 Aug 2013 23:22:46 +0300 Subject: use control-group classes for inline forms in issues/mr --- app/views/projects/issues/_form.html.haml | 18 +++++++++--------- app/views/projects/merge_requests/_form.html.haml | 10 +++++----- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/app/views/projects/issues/_form.html.haml b/app/views/projects/issues/_form.html.haml index b711d861125..b3a1bb4d93a 100644 --- a/app/views/projects/issues/_form.html.haml +++ b/app/views/projects/issues/_form.html.haml @@ -8,18 +8,18 @@ %br .ui-box.ui-box-show .ui-box-head - .clearfix + .control-group = f.label :title do %strong= "Subject *" - .input + .controls = f.text_field :title, maxlength: 255, class: "xxlarge js-gfm-input", autofocus: true, required: true .ui-box-body - .clearfix + .control-group .issue_assignee.pull-left = f.label :assignee_id do %i.icon-user Assign to - .input + .controls .pull-left = f.select(:assignee_id, @project.team.members.sort_by(&:name).map {|p| [ p.name, p.id ] }, { include_blank: "Select a user" }, {class: 'chosen'}) .pull-right @@ -29,20 +29,20 @@ = f.label :milestone_id do %i.icon-time Milestone - .input= f.select(:milestone_id, @project.milestones.active.all.collect {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" }, {class: 'chosen'}) + .controls= f.select(:milestone_id, @project.milestones.active.all.collect {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" }, {class: 'chosen'}) .ui-box-bottom - .clearfix + .control-group = f.label :label_list do %i.icon-tag Labels - .input + .controls = f.text_field :label_list, maxlength: 2000, class: "xxlarge" %p.hint Separate labels with commas. - .clearfix + .control-group = f.label :description, "Details" - .input + .controls = f.text_area :description, class: "xxlarge js-gfm-input", rows: 14 %p.hint Issues are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. diff --git a/app/views/projects/merge_requests/_form.html.haml b/app/views/projects/merge_requests/_form.html.haml index 86c442142bf..5eabb4b32c3 100644 --- a/app/views/projects/merge_requests/_form.html.haml +++ b/app/views/projects/merge_requests/_form.html.haml @@ -31,21 +31,21 @@ %i.icon-paper-clip Details .merge-request-form-info - .clearfix + .control-group = f.label :title do %strong= "Title *" - .input= f.text_field :title, class: "input-xxlarge pad js-gfm-input", maxlength: 255, rows: 5, required: true - .clearfix + .controls= f.text_field :title, class: "input-xxlarge pad js-gfm-input", maxlength: 255, rows: 5, required: true + .control-group .left = f.label :assignee_id do %i.icon-user Assign to - .input= f.select(:assignee_id, @project.team.members.sort_by(&:name).map {|p| [ p.name, p.id ] }, { include_blank: "Select user" }, {class: 'chosen span3'}) + .controls= f.select(:assignee_id, @project.team.members.sort_by(&:name).map {|p| [ p.name, p.id ] }, { include_blank: "Select user" }, {class: 'chosen span3'}) .left = f.label :milestone_id do %i.icon-time Milestone - .input= f.select(:milestone_id, @project.milestones.active.all.map {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" }, {class: 'chosen'}) + .controls= f.select(:milestone_id, @project.milestones.active.all.map {|p| [ p.title, p.id ] }, { include_blank: "Select milestone" }, {class: 'chosen'}) .form-actions -- cgit v1.2.1 From a3b0dc2e17de0ec5ea5327ac6b84659aeb84d252 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 Aug 2013 23:24:34 +0300 Subject: use control-group classes for inline forms in profile and group pages --- app/views/groups/_new_group_member.html.haml | 8 ++++---- app/views/groups/edit.html.haml | 8 ++++---- app/views/groups/new.html.haml | 12 ++++++------ app/views/profiles/account.html.haml | 16 ++++++++-------- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/app/views/groups/_new_group_member.html.haml b/app/views/groups/_new_group_member.html.haml index 2e17ff12a18..234392c03e1 100644 --- a/app/views/groups/_new_group_member.html.haml +++ b/app/views/groups/_new_group_member.html.haml @@ -6,14 +6,14 @@ group %p 1. Choose users you want in the group - .clearfix + .control-group = f.label :user_ids, "People" - .input= users_select_tag(:user_ids, multiple: true, class: 'input-large') + .controls= users_select_tag(:user_ids, multiple: true, class: 'input-large') %p 2. Set access level for them - .clearfix + .control-group = f.label :group_access, "Group Access" - .input= select_tag :group_access, options_for_select(UsersGroup.group_access_roles, @users_group.group_access), class: "project-access-select chosen" + .controls= select_tag :group_access, options_for_select(UsersGroup.group_access_roles, @users_group.group_access), class: "project-access-select chosen" .form-actions = f.submit 'Add users into group', class: "btn btn-create" diff --git a/app/views/groups/edit.html.haml b/app/views/groups/edit.html.haml index 13264b37134..2017be5aaf3 100644 --- a/app/views/groups/edit.html.haml +++ b/app/views/groups/edit.html.haml @@ -26,15 +26,15 @@ - if @group.errors.any? .alert.alert-error %span= @group.errors.full_messages.first - .clearfix + .control-group = f.label :name do Group name is - .input + .controls = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" - .clearfix.group-description-holder + .control-group.group-description-holder = f.label :description, "Details" - .input + .controls = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 .form-actions diff --git a/app/views/groups/new.html.haml b/app/views/groups/new.html.haml index 4aa58dedc4a..ccf610b8c36 100644 --- a/app/views/groups/new.html.haml +++ b/app/views/groups/new.html.haml @@ -2,19 +2,19 @@ - if @group.errors.any? .alert.alert-error %span= @group.errors.full_messages.first - .clearfix + .control-group = f.label :name do Group name is - .input + .controls = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" - .clearfix.group-description-holder + .control-group.group-description-holder = f.label :description, "Details" - .input + .controls = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 - .clearfix - .input + .control-group + .controls %ul %li Group is kind of directory for several projects %li All created groups are private diff --git a/app/views/profiles/account.html.haml b/app/views/profiles/account.html.haml index 7951f639bfb..f1cd8fe3fbf 100644 --- a/app/views/profiles/account.html.haml +++ b/app/views/profiles/account.html.haml @@ -27,15 +27,15 @@ - @user.errors.full_messages.each do |msg| %li= msg - .clearfix + .control-group = f.label :password - .input= f.password_field :password, required: true - .clearfix + .controls= f.password_field :password, required: true + .control-group = f.label :password_confirmation - .input + .controls = f.password_field :password_confirmation, required: true - .clearfix - .input + .control-group + .controls = f.submit 'Save password', class: "btn btn-save" @@ -70,7 +70,7 @@ = form_for @user, url: update_username_profile_path, method: :put, remote: true do |f| .padded = f.label :username - .input + .controls = f.text_field :username, required: true   %span.loading-gif.hide= image_tag "ajax_loader.gif" @@ -83,7 +83,7 @@ %ul.cred %li It will change web url for personal projects. %li It will change the git path to repositories for personal projects. - .input + .controls = f.submit 'Save username', class: "btn btn-save" - if gitlab_config.signup_enabled -- cgit v1.2.1 From c52f9e1a32e76ae7ea48a939baf162e20de67a82 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 Aug 2013 23:28:02 +0300 Subject: use control-group classes for inline forms in project new/edit pages --- app/views/profiles/keys/_form.html.haml | 8 ++++---- app/views/projects/edit.html.haml | 22 +++++++++++----------- app/views/projects/new.html.haml | 22 +++++++++++----------- app/views/snippets/_form.html.haml | 12 ++++++------ 4 files changed, 32 insertions(+), 32 deletions(-) diff --git a/app/views/profiles/keys/_form.html.haml b/app/views/profiles/keys/_form.html.haml index 7ba8e20a44f..292dda4d974 100644 --- a/app/views/profiles/keys/_form.html.haml +++ b/app/views/profiles/keys/_form.html.haml @@ -6,12 +6,12 @@ - @key.errors.full_messages.each do |msg| %li= msg - .clearfix + .control-group = f.label :title - .input= f.text_field :title - .clearfix + .controls= f.text_field :title + .control-group = f.label :key - .input + .controls %p.light Paste your public key here. Read more about how generate it #{link_to "here", help_ssh_path} = f.text_area :key, class: [:xxlarge, :thin_area] diff --git a/app/views/projects/edit.html.haml b/app/views/projects/edit.html.haml index ac8affbdc32..11df63d5ac7 100644 --- a/app/views/projects/edit.html.haml +++ b/app/views/projects/edit.html.haml @@ -8,24 +8,24 @@ .form-holder = form_for(@project, remote: true) do |f| %fieldset - .clearfix.project_name_holder + .control-group.project_name_holder = f.label :name do Project name is - .input + .controls = f.text_field :name, placeholder: "Example Project", class: "span5" - .clearfix + .control-group = f.label :description do Project description %span.light (optional) - .input + .controls = f.text_area :description, placeholder: "awesome project", class: "span5", rows: 3, maxlength: 250 - if @project.repository.exists? && @project.repository.branch_names.any? - .clearfix + .control-group = f.label :default_branch, "Default Branch" - .input= f.select(:default_branch, @repository.branch_names, {}, {class: 'chosen'}) + .controls= f.select(:default_branch, @repository.branch_names, {}, {class: 'chosen'}) - if can?(current_user, :change_public_mode, @project) @@ -66,11 +66,11 @@ - if Project.issues_tracker.values.count > 1 .control-group = f.label :issues_tracker, "Issues tracker", class: 'control-label' - .input= f.select(:issues_tracker, Project.issues_tracker.values, {}, { disabled: !@project.issues_enabled }) + .controls= f.select(:issues_tracker, Project.issues_tracker.values, {}, { disabled: !@project.issues_enabled }) - .clearfix + .control-group = f.label :issues_tracker_id, "Project name or id in issues tracker", class: 'control-label' - .input= f.text_field :issues_tracker_id, disabled: !@project.can_have_issues_tracker_id? + .controls= f.text_field :issues_tracker_id, disabled: !@project.can_have_issues_tracker_id? .control-group = f.label :merge_requests_enabled, "Merge Requests", class: 'control-label' @@ -110,7 +110,7 @@ = f.label :namespace_id do %span Namespace .controls - .clearfix + .control-group = f.select :namespace_id, namespaces_options(@project.namespace_id), {prompt: 'Choose a project namespace'}, {class: 'chosen'} %ul %li Be careful. Changing project namespace can have unintended side effects @@ -130,7 +130,7 @@ = f.label :path do %span Path .controls - .clearfix + .control-group = f.text_field :path %ul %li Be careful. Rename of project repo can have unintended side effects diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index dca897dce67..90bc93adde7 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -3,36 +3,36 @@ = render 'projects/errors' .project-edit-content = form_for @project, remote: true do |f| - .clearfix.project_name_holder + .control-group.project_name_holder = f.label :name do Project name is - .input + .controls = f.text_field :name, placeholder: "Example Project", class: "xxlarge", tabindex: 1, autofocus: true - if current_user.can_select_namespace? - .clearfix + .control-group = f.label :namespace_id do %span Namespace - .input + .controls = f.select :namespace_id, namespaces_options(params[:namespace_id] || :current_user), {}, {class: 'chosen', tabindex: 2} - .clearfix - .input + .control-group + .controls = link_to "#", class: 'appear-link' do %i.icon-upload-alt %span Import existing repository? - .clearfix.appear-data.import-url-data + .control-group.appear-data.import-url-data = f.label :import_url do %span Import existing repo - .input + .controls = f.text_field :import_url, class: 'xlarge', placeholder: 'https://github.com/randx/six.git' .light URL must be cloneable - .clearfix + .control-group = f.label :description do Description %span.light (optional) - .input + .controls = f.text_area :description, placeholder: "awesome project", class: "span5", rows: 3, maxlength: 250, tabindex: 3 %p.padded @@ -42,7 +42,7 @@ - if current_user.can_create_group? .pull-right - .input.light + .controls.light Need a group for several dependent projects? = link_to new_group_path, class: "btn btn-tiny" do Create a group diff --git a/app/views/snippets/_form.html.haml b/app/views/snippets/_form.html.haml index e5c63afe980..fa0d5157a2e 100644 --- a/app/views/snippets/_form.html.haml +++ b/app/views/snippets/_form.html.haml @@ -9,16 +9,16 @@ - @snippet.errors.full_messages.each do |msg| %li= msg - .clearfix + .control-group = f.label :title - .input= f.text_field :title, placeholder: "Example Snippet", class: 'input-xlarge', required: true - .clearfix + .controls= f.text_field :title, placeholder: "Example Snippet", class: 'input-xlarge', required: true + .control-group = f.label "Private?" - .input= f.check_box :private, {class: ''} - .clearfix + .controls= f.check_box :private, {class: ''} + .control-group .file-editor = f.label :file_name, "File" - .input + .controls .file-holder.snippet .file-title = f.text_field :file_name, placeholder: "example.rb", class: 'snippet-file-name', required: true -- cgit v1.2.1 From df437f419ba92f376f95917b235930311b4c9946 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 Aug 2013 23:30:40 +0300 Subject: use control-group classes for inline forms in project area pages --- app/views/profiles/passwords/new.html.haml | 12 ++++++------ app/views/projects/deploy_keys/_form.html.haml | 8 ++++---- app/views/projects/hooks/index.html.haml | 4 ++-- app/views/projects/milestones/_form.html.haml | 2 +- app/views/projects/snippets/_form.html.haml | 12 ++++++------ app/views/projects/team_members/_form.html.haml | 8 ++++---- app/views/projects/wikis/_form.html.haml | 6 +++--- 7 files changed, 26 insertions(+), 26 deletions(-) diff --git a/app/views/profiles/passwords/new.html.haml b/app/views/profiles/passwords/new.html.haml index c92424160b3..a4e7dadd16a 100644 --- a/app/views/profiles/passwords/new.html.haml +++ b/app/views/profiles/passwords/new.html.haml @@ -10,13 +10,13 @@ - @user.errors.full_messages.each do |msg| %li= msg - .clearfix + .control-group = f.label :password - .input= f.password_field :password, required: true - .clearfix + .controls= f.password_field :password, required: true + .control-group = f.label :password_confirmation - .input + .controls = f.password_field :password_confirmation, required: true - .clearfix - .input + .control-group + .controls = f.submit 'Set new password', class: "btn btn-create" diff --git a/app/views/projects/deploy_keys/_form.html.haml b/app/views/projects/deploy_keys/_form.html.haml index 71bf309dd8b..d3e517b87fd 100644 --- a/app/views/projects/deploy_keys/_form.html.haml +++ b/app/views/projects/deploy_keys/_form.html.haml @@ -6,12 +6,12 @@ - @key.errors.full_messages.each do |msg| %li= msg - .clearfix + .control-group = f.label :title - .input= f.text_field :title - .clearfix + .controls= f.text_field :title + .control-group = f.label :key - .input + .controls = f.text_area :key, class: [:xxlarge, :thin_area] %p.hint Paste a machine public key here. Read more about how generate it diff --git a/app/views/projects/hooks/index.html.haml b/app/views/projects/hooks/index.html.haml index a85f50491d6..eed76a7366d 100644 --- a/app/views/projects/hooks/index.html.haml +++ b/app/views/projects/hooks/index.html.haml @@ -11,9 +11,9 @@ .alert.alert-error - @hook.errors.full_messages.each do |msg| %p= msg - .clearfix + .control-group = f.label :url, "URL:" - .input + .controls = f.text_field :url, class: "text_field xxlarge input-xpadding", placeholder: 'http://example.com/trigger-ci.json'   = f.submit "Add Web Hook", class: "btn btn-create" diff --git a/app/views/projects/milestones/_form.html.haml b/app/views/projects/milestones/_form.html.haml index 825243e773f..78e4cd2243e 100644 --- a/app/views/projects/milestones/_form.html.haml +++ b/app/views/projects/milestones/_form.html.haml @@ -26,7 +26,7 @@ .span6 .control-group = f.label :due_date, "Due Date", class: "control-label" - .input= f.hidden_field :due_date + .controls= f.hidden_field :due_date .controls .datepicker diff --git a/app/views/projects/snippets/_form.html.haml b/app/views/projects/snippets/_form.html.haml index a8aa5460f2e..14a42f34f25 100644 --- a/app/views/projects/snippets/_form.html.haml +++ b/app/views/projects/snippets/_form.html.haml @@ -9,16 +9,16 @@ - @snippet.errors.full_messages.each do |msg| %li= msg - .clearfix + .control-group = f.label :title - .input= f.text_field :title, placeholder: "Example Snippet", class: 'input-xlarge', required: true - .clearfix + .controls= f.text_field :title, placeholder: "Example Snippet", class: 'input-xlarge', required: true + .control-group = f.label "Lifetime" - .input= f.select :expires_at, lifetime_select_options, {}, {class: 'chosen span2'} - .clearfix + .controls= f.select :expires_at, lifetime_select_options, {}, {class: 'chosen span2'} + .control-group .file-editor = f.label :file_name, "File" - .input + .controls .file-holder.snippet .file-title = f.text_field :file_name, placeholder: "example.rb", class: 'snippet-file-name', required: true diff --git a/app/views/projects/team_members/_form.html.haml b/app/views/projects/team_members/_form.html.haml index 0eb106ee93f..d7dba22c8c6 100644 --- a/app/views/projects/team_members/_form.html.haml +++ b/app/views/projects/team_members/_form.html.haml @@ -9,15 +9,15 @@ %li= msg %h6 1. Choose people you want in the team - .clearfix + .control-group = f.label :user_ids, "People" - .input + .controls = users_select_tag(:user_ids, multiple: true) %h6 2. Set access level for them - .clearfix + .control-group = f.label :project_access, "Project Access" - .input= select_tag :project_access, options_for_select(Project.access_options, @user_project_relation.project_access), class: "project-access-select chosen" + .controls= select_tag :project_access, options_for_select(Project.access_options, @user_project_relation.project_access), class: "project-access-select chosen" .actions = f.submit 'Add users', class: "btn btn-create" diff --git a/app/views/projects/wikis/_form.html.haml b/app/views/projects/wikis/_form.html.haml index 4a558826f29..85c3b72fbf1 100644 --- a/app/views/projects/wikis/_form.html.haml +++ b/app/views/projects/wikis/_form.html.haml @@ -15,7 +15,7 @@ = f.select :format, options_for_select(GollumWiki::MARKUPS, {selected: @wiki.format}), {}, class: "pull-right input-medium" = f.label :format, class: "pull-right", style: "padding-right: 20px;" .ui-box-body - .input + .controls %span.cgray Wiki content is parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. To link to a (new) page you can just type @@ -24,10 +24,10 @@ .ui-box-bottom = f.label :content - .input= f.text_area :content, class: 'span8 js-gfm-input' + .controls= f.text_area :content, class: 'span8 js-gfm-input' .ui-box-bottom = f.label :commit_message - .input= f.text_field :message, class: 'span8' + .controls= f.text_field :message, class: 'span8' .actions - if @wiki && @wiki.persisted? = f.submit 'Save changes', class: "btn-save btn" -- cgit v1.2.1 From e3f9bd231b0b071e4586b5134bae99367380a6bf Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 Aug 2013 23:32:20 +0300 Subject: use control-group classes for inline forms in rest pages --- app/views/projects/team_members/import.html.haml | 2 +- app/views/public/projects/index.html.haml | 2 +- app/views/search/show.html.haml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/projects/team_members/import.html.haml b/app/views/projects/team_members/import.html.haml index 6a17e0c2cb0..f6ca345f078 100644 --- a/app/views/projects/team_members/import.html.haml +++ b/app/views/projects/team_members/import.html.haml @@ -6,7 +6,7 @@ = form_tag apply_import_project_team_members_path(@project), method: 'post' do .padded = label_tag :source_project_id, "Project" - .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) + .controls= 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 project members', class: "btn btn-create" diff --git a/app/views/public/projects/index.html.haml b/app/views/public/projects/index.html.haml index e933268973a..7fea017acec 100644 --- a/app/views/public/projects/index.html.haml +++ b/app/views/public/projects/index.html.haml @@ -7,7 +7,7 @@ .pull-right = form_tag public_projects_path, method: :get, class: 'form-inline' do |f| .search-holder - .input + .controls = search_field_tag :search, params[:search], placeholder: "gitlab-ci", class: "span3 search-text-input", id: "projects_search" = submit_tag 'Search', class: "btn btn-primary wide" diff --git a/app/views/search/show.html.haml b/app/views/search/show.html.haml index f9647377961..ed939024d94 100644 --- a/app/views/search/show.html.haml +++ b/app/views/search/show.html.haml @@ -2,7 +2,7 @@ .search-holder = label_tag :search do %span Looking for - .input + .controls = search_field_tag :search, params[:search], placeholder: "issue 143", class: "input-xxlarge search-text-input", id: "dashboard_search" = hidden_field_tag :project_id, params[:project_id] = hidden_field_tag :group_id, params[:group_id] -- cgit v1.2.1 From 846e59505eefab7bd04227edcdc55c6033d42ec5 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 Aug 2013 23:35:24 +0300 Subject: Replace .actions with .form-actions --- app/assets/stylesheets/gitlab_bootstrap/forms.scss | 15 ++++----------- app/views/admin/users/_form.html.haml | 2 +- app/views/profiles/keys/_form.html.haml | 2 +- app/views/projects/deploy_keys/_form.html.haml | 2 +- app/views/projects/issues/_form.html.haml | 2 +- app/views/projects/team_members/_form.html.haml | 2 +- app/views/projects/team_members/import.html.haml | 2 +- app/views/projects/wikis/_form.html.haml | 2 +- 8 files changed, 11 insertions(+), 18 deletions(-) diff --git a/app/assets/stylesheets/gitlab_bootstrap/forms.scss b/app/assets/stylesheets/gitlab_bootstrap/forms.scss index 20564cc1910..b498ce160a6 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/forms.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/forms.scss @@ -1,21 +1,14 @@ form { @extend .form-horizontal; - .actions { - @extend .form-actions; - } - - .clearfix { - @extend .control-group; + label { + @extend .control-label; } - .input { - @extend .controls; + .actions { + @extend .form-actions; } - label { - @extend .control-label; - } .xlarge { @extend .input-xlarge; } diff --git a/app/views/admin/users/_form.html.haml b/app/views/admin/users/_form.html.haml index 0e7f5cb3f9f..1365404edad 100644 --- a/app/views/admin/users/_form.html.haml +++ b/app/views/admin/users/_form.html.haml @@ -85,7 +85,7 @@ = f.label :twitter .controls= f.text_field :twitter - .actions + .form-actions - if @user.new_record? = f.submit 'Create user', class: "btn btn-create" = link_to 'Cancel', admin_users_path, class: "btn btn-cancel" diff --git a/app/views/profiles/keys/_form.html.haml b/app/views/profiles/keys/_form.html.haml index 292dda4d974..f41ae1c2591 100644 --- a/app/views/profiles/keys/_form.html.haml +++ b/app/views/profiles/keys/_form.html.haml @@ -17,7 +17,7 @@ = f.text_area :key, class: [:xxlarge, :thin_area] - .actions + .form-actions = f.submit 'Add key', class: "btn btn-create" = link_to "Cancel", profile_keys_path, class: "btn btn-cancel" diff --git a/app/views/projects/deploy_keys/_form.html.haml b/app/views/projects/deploy_keys/_form.html.haml index d3e517b87fd..84a81ac58b1 100644 --- a/app/views/projects/deploy_keys/_form.html.haml +++ b/app/views/projects/deploy_keys/_form.html.haml @@ -17,7 +17,7 @@ Paste a machine public key here. Read more about how generate it = link_to "here", help_ssh_path - .actions + .form-actions = f.submit 'Create', class: "btn-create btn" = link_to "Cancel", project_deploy_keys_path(@project), class: "btn btn-cancel" diff --git a/app/views/projects/issues/_form.html.haml b/app/views/projects/issues/_form.html.haml index b3a1bb4d93a..a03453c162f 100644 --- a/app/views/projects/issues/_form.html.haml +++ b/app/views/projects/issues/_form.html.haml @@ -47,7 +47,7 @@ %p.hint Issues are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. - .actions + .form-actions - if @issue.new_record? = f.submit 'Submit new issue', class: "btn btn-create" -else diff --git a/app/views/projects/team_members/_form.html.haml b/app/views/projects/team_members/_form.html.haml index d7dba22c8c6..8dd2faa219b 100644 --- a/app/views/projects/team_members/_form.html.haml +++ b/app/views/projects/team_members/_form.html.haml @@ -19,6 +19,6 @@ = f.label :project_access, "Project Access" .controls= select_tag :project_access, options_for_select(Project.access_options, @user_project_relation.project_access), class: "project-access-select chosen" - .actions + .form-actions = 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/projects/team_members/import.html.haml b/app/views/projects/team_members/import.html.haml index f6ca345f078..36ebe27805b 100644 --- a/app/views/projects/team_members/import.html.haml +++ b/app/views/projects/team_members/import.html.haml @@ -8,7 +8,7 @@ = label_tag :source_project_id, "Project" .controls= 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 + .form-actions = submit_tag 'Import project members', class: "btn btn-create" = link_to "Cancel", project_team_index_path(@project), class: "btn btn-cancel" diff --git a/app/views/projects/wikis/_form.html.haml b/app/views/projects/wikis/_form.html.haml index 85c3b72fbf1..c8c02818e25 100644 --- a/app/views/projects/wikis/_form.html.haml +++ b/app/views/projects/wikis/_form.html.haml @@ -28,7 +28,7 @@ .ui-box-bottom = f.label :commit_message .controls= f.text_field :message, class: 'span8' - .actions + .form-actions - if @wiki && @wiki.persisted? = f.submit 'Save changes', class: "btn-save btn" = link_to "Cancel", project_wiki_path(@project, @wiki), class: "btn btn-cancel" -- cgit v1.2.1 From b2152847b162577ca3d58afcee3486537e0b6b81 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 Aug 2013 23:40:29 +0300 Subject: Replace xlarge and xxlarge classes --- app/assets/stylesheets/gitlab_bootstrap/forms.scss | 11 ----------- app/views/admin/groups/edit.html.haml | 6 +++--- app/views/admin/groups/new.html.haml | 4 ++-- app/views/groups/edit.html.haml | 4 ++-- app/views/groups/new.html.haml | 4 ++-- app/views/profiles/account.html.haml | 2 +- app/views/projects/compare/_form.html.haml | 4 ++-- app/views/projects/issues/_form.html.haml | 6 +++--- app/views/projects/network/_head.html.haml | 2 +- app/views/projects/new.html.haml | 2 +- 10 files changed, 17 insertions(+), 28 deletions(-) diff --git a/app/assets/stylesheets/gitlab_bootstrap/forms.scss b/app/assets/stylesheets/gitlab_bootstrap/forms.scss index b498ce160a6..ad14b003c73 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/forms.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/forms.scss @@ -4,17 +4,6 @@ form { label { @extend .control-label; } - - .actions { - @extend .form-actions; - } - - .xlarge { - @extend .input-xlarge; - } - .xxlarge { - @extend .input-xxlarge; - } } input { diff --git a/app/views/admin/groups/edit.html.haml b/app/views/admin/groups/edit.html.haml index 027f663891a..8ed463a8191 100644 --- a/app/views/admin/groups/edit.html.haml +++ b/app/views/admin/groups/edit.html.haml @@ -8,18 +8,18 @@ = f.label :name do Group name is .controls - = f.text_field :name, placeholder: "Example Group", class: "xxlarge" + = f.text_field :name, placeholder: "Example Group", class: "input-xxlarge" .control-group.group-description-holder = f.label :description, "Details" .controls - = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 + = f.text_area :description, maxlength: 250, class: "input-xxlarge js-gfm-input", rows: 4 .control-group.group_name_holder = f.label :path do %span.cred Group path is .controls - = f.text_field :path, placeholder: "example-group", class: "xxlarge danger" + = f.text_field :path, placeholder: "example-group", class: "input-xxlarge danger" %ul.cred %li Changing group path can have unintended side effects. %li Renaming group path will rename directory for all related projects diff --git a/app/views/admin/groups/new.html.haml b/app/views/admin/groups/new.html.haml index dcb91d586e6..0ae35eb6b43 100644 --- a/app/views/admin/groups/new.html.haml +++ b/app/views/admin/groups/new.html.haml @@ -8,11 +8,11 @@ = f.label :name do Group name is .controls - = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" + = f.text_field :name, placeholder: "Ex. OpenSource", class: "input-xxlarge left" .control-group.group-description-holder = f.label :description, "Details" .controls - = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 + = f.text_area :description, maxlength: 250, class: "input-xxlarge js-gfm-input", rows: 4 .form-actions = f.submit 'Create group', class: "btn btn-create" diff --git a/app/views/groups/edit.html.haml b/app/views/groups/edit.html.haml index 2017be5aaf3..fe66f89626f 100644 --- a/app/views/groups/edit.html.haml +++ b/app/views/groups/edit.html.haml @@ -30,12 +30,12 @@ = f.label :name do Group name is .controls - = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" + = f.text_field :name, placeholder: "Ex. OpenSource", class: "input-xxlarge left" .control-group.group-description-holder = f.label :description, "Details" .controls - = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 + = f.text_area :description, maxlength: 250, class: "input-xxlarge js-gfm-input", rows: 4 .form-actions = f.submit 'Save group', class: "btn btn-save" diff --git a/app/views/groups/new.html.haml b/app/views/groups/new.html.haml index ccf610b8c36..02049bb2ee6 100644 --- a/app/views/groups/new.html.haml +++ b/app/views/groups/new.html.haml @@ -6,12 +6,12 @@ = f.label :name do Group name is .controls - = f.text_field :name, placeholder: "Ex. OpenSource", class: "xxlarge left" + = f.text_field :name, placeholder: "Ex. OpenSource", class: "input-xxlarge left" .control-group.group-description-holder = f.label :description, "Details" .controls - = f.text_area :description, maxlength: 250, class: "xxlarge js-gfm-input", rows: 4 + = f.text_area :description, maxlength: 250, class: "input-xxlarge js-gfm-input", rows: 4 .control-group .controls diff --git a/app/views/profiles/account.html.haml b/app/views/profiles/account.html.haml index f1cd8fe3fbf..b8325e5d9e7 100644 --- a/app/views/profiles/account.html.haml +++ b/app/views/profiles/account.html.haml @@ -54,7 +54,7 @@ It can be used for atom feed or API %p.cgray - if current_user.private_token - = text_field_tag "token", current_user.private_token, class: "xxlarge large_text" + = text_field_tag "token", current_user.private_token, class: "input-xxlarge large_text" = 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. diff --git a/app/views/projects/compare/_form.html.haml b/app/views/projects/compare/_form.html.haml index a83380841fa..ee733f80954 100644 --- a/app/views/projects/compare/_form.html.haml +++ b/app/views/projects/compare/_form.html.haml @@ -14,9 +14,9 @@ .pull-left - if params[:to] && params[:from] = link_to 'switch', {from: params[:to], to: params[:from]}, {class: 'commits-compare-switch has_tooltip', title: 'Switch base of comparison'} - = text_field_tag :from, params[:from], placeholder: "master", class: "xlarge input-xpadding" + = text_field_tag :from, params[:from], placeholder: "master", class: "input-xlarge input-xpadding" = "..." - = text_field_tag :to, params[:to], placeholder: "aa8b4ef", class: "xlarge input-xpadding" + = text_field_tag :to, params[:to], placeholder: "aa8b4ef", class: "input-xlarge input-xpadding" .pull-left   = submit_tag "Compare", class: "btn btn-create commits-compare-btn" diff --git a/app/views/projects/issues/_form.html.haml b/app/views/projects/issues/_form.html.haml index a03453c162f..2672fbb2cde 100644 --- a/app/views/projects/issues/_form.html.haml +++ b/app/views/projects/issues/_form.html.haml @@ -12,7 +12,7 @@ = f.label :title do %strong= "Subject *" .controls - = f.text_field :title, maxlength: 255, class: "xxlarge js-gfm-input", autofocus: true, required: true + = f.text_field :title, maxlength: 255, class: "input-xxlarge js-gfm-input", autofocus: true, required: true .ui-box-body .control-group .issue_assignee.pull-left @@ -37,13 +37,13 @@ %i.icon-tag Labels .controls - = f.text_field :label_list, maxlength: 2000, class: "xxlarge" + = f.text_field :label_list, maxlength: 2000, class: "input-xxlarge" %p.hint Separate labels with commas. .control-group = f.label :description, "Details" .controls - = f.text_area :description, class: "xxlarge js-gfm-input", rows: 14 + = f.text_area :description, class: "input-xxlarge js-gfm-input", rows: 14 %p.hint Issues are parsed with #{link_to "GitLab Flavored Markdown", help_markdown_path, target: '_blank'}. diff --git a/app/views/projects/network/_head.html.haml b/app/views/projects/network/_head.html.haml index 59ce787e187..ed9fcaace25 100644 --- a/app/views/projects/network/_head.html.haml +++ b/app/views/projects/network/_head.html.haml @@ -15,7 +15,7 @@ .control-group = label_tag :search , "Looking for commit:", class: 'control-label light' .controls - = text_field_tag :q, @options[:q], placeholder: "Input SHA", class: "search-input xlarge" + = text_field_tag :q, @options[:q], placeholder: "Input SHA", class: "search-input input-xlarge" = button_tag type: 'submit', class: 'btn vtop' do %i.icon-search - @options.each do |key, value| diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index 90bc93adde7..38eb6d401c5 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -7,7 +7,7 @@ = f.label :name do Project name is .controls - = f.text_field :name, placeholder: "Example Project", class: "xxlarge", tabindex: 1, autofocus: true + = f.text_field :name, placeholder: "Example Project", class: "input-xxlarge", tabindex: 1, autofocus: true - if current_user.can_select_namespace? .control-group -- cgit v1.2.1 From 89d0d75c528b7b39471966db260c002383ccb9db Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Wed, 7 Aug 2013 23:54:26 +0300 Subject: Better filter var for MR. show reset filter only if makes sense --- app/contexts/merge_requests_load_context.rb | 2 +- app/views/projects/issues/_filter.html.haml | 7 +++++-- .../projects/merge_requests/_filter.html.haml | 23 +++++++++++----------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/app/contexts/merge_requests_load_context.rb b/app/contexts/merge_requests_load_context.rb index fd44572c0eb..fc7318e5c1e 100644 --- a/app/contexts/merge_requests_load_context.rb +++ b/app/contexts/merge_requests_load_context.rb @@ -2,7 +2,7 @@ # based on filtering passed via params for @project class MergeRequestsLoadContext < BaseContext def execute - type = params[:f] + type = params[:status] merge_requests = project.merge_requests diff --git a/app/views/projects/issues/_filter.html.haml b/app/views/projects/issues/_filter.html.haml index 8495c323cb8..663d786634d 100644 --- a/app/views/projects/issues/_filter.html.haml +++ b/app/views/projects/issues/_filter.html.haml @@ -18,6 +18,9 @@ All %fieldset - %hr - = link_to "Reset", project_issues_path(@project), class: 'btn pull-right' + - if %w(status milestone_id assignee_id label_name).select { |k| params[k].present? }.any? + = link_to project_issues_path(@project), class: 'cgray pull-right' do + %i.icon-remove + Clear filter + diff --git a/app/views/projects/merge_requests/_filter.html.haml b/app/views/projects/merge_requests/_filter.html.haml index 4b48306ed05..9f09a7e7bb1 100644 --- a/app/views/projects/merge_requests/_filter.html.haml +++ b/app/views/projects/merge_requests/_filter.html.haml @@ -1,20 +1,21 @@ = form_tag project_issues_path(@project), method: 'get' do %fieldset %ul.nav.nav-pills.nav-stacked - %li{class: ("active" if (params[:f] == 'open' || !params[:f]))} - = link_to project_merge_requests_path(@project, f: 'open', milestone_id: params[:milestone_id]) do + %li{class: ("active" if (params[:status] == 'open' || !params[:status]))} + = link_to project_merge_requests_path(@project, status: 'open', milestone_id: params[:milestone_id]) do Open - %li{class: ("active" if params[:f] == "closed")} - = link_to project_merge_requests_path(@project, f: "closed", milestone_id: params[:milestone_id]) do + %li{class: ("active" if params[:status] == "closed")} + = link_to project_merge_requests_path(@project, status: "closed", milestone_id: params[:milestone_id]) do Closed - %li{class: ("active" if params[:f] == 'assigned-to-me')} - = link_to project_merge_requests_path(@project, f: 'assigned-to-me', milestone_id: params[:milestone_id]) do + %li{class: ("active" if params[:status] == 'assigned-to-me')} + = link_to project_merge_requests_path(@project, status: 'assigned-to-me', milestone_id: params[:milestone_id]) do Assigned To Me - %li{class: ("active" if params[:f] == 'all')} - = link_to project_merge_requests_path(@project, f: 'all', milestone_id: params[:milestone_id]) do + %li{class: ("active" if params[:status] == 'all')} + = link_to project_merge_requests_path(@project, status: 'all', milestone_id: params[:milestone_id]) do All %fieldset - %hr - = link_to "Reset", project_merge_requests_path(@project), class: 'btn pull-right' - + - if %w(status milestone_id assignee_id label_name).select { |k| params[k].present? }.any? + = link_to project_merge_requests_path(@project), class: 'cgray pull-right' do + %i.icon-remove + Clear filter -- cgit v1.2.1 From 4e6f131c8a7446b54f908c4f87f0b2dfda4c5750 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 8 Aug 2013 10:27:52 +0300 Subject: fix tests --- features/steps/project/project_wiki.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/steps/project/project_wiki.rb b/features/steps/project/project_wiki.rb index f0e62e07321..7aba412d751 100644 --- a/features/steps/project/project_wiki.rb +++ b/features/steps/project/project_wiki.rb @@ -5,7 +5,7 @@ class ProjectWiki < Spinach::FeatureSteps include SharedPaths Given 'I click on the Cancel button' do - within(:css, ".actions") do + within(:css, ".form-actions") do click_on "Cancel" end end -- cgit v1.2.1 From 348e9a741324fe5ceaac849d342afe93957b44b9 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Mon, 5 Aug 2013 14:23:25 +0200 Subject: Add information about the contributing process --- CONTRIBUTING.md | 6 ++++ PROCESS.md | 103 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 109 insertions(+) create mode 100644 PROCESS.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 2a6eb71b654..9d9be5bdc21 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,6 +2,12 @@ This guide details how to use issues and pull requests to improve GitLab. +- [Closing policy for issues and pull requests](#closing-policy-for-issues-and-pull-requests) +- [Issue tracker](#issue-tracker) +- [Pull requests](#pull-requests) + +If you want to know how the GitLab team handles contributions have a look at [the GitLab contributing process](PROCESS.md). + ## Closing policy for issues and pull requests GitLab is a popular open source project and the capacity to deal with issues and pull requests is limited. Out of respect for our volunteers, issues and pull requests not in line with the guidelines listed in this document may be closed without notice. diff --git a/PROCESS.md b/PROCESS.md new file mode 100644 index 00000000000..17684ae5c71 --- /dev/null +++ b/PROCESS.md @@ -0,0 +1,103 @@ +# GitLab Contributing Process + +## Purpose of describing the contributing process + +Below we describe the contributing process for two reasons. Contributors know what to expect from maintainers (initial, response within xx days, friendly treatment, etc). And maintainers know what to expect from contributors (use latest version, confirm the issue is addressed, friendly treatment, etc). + +## How we handle issues + +The priority should be mentioning people that can help and assigning workflow labels. Workflow labels are purposely not very detailed since that would be hard to keep updated as you would need to reevaluate them after every comment. We optionally use functional labels on demand when want to group related issues to get an overview (for example all issues related to RVM, to tackle them in one go) and to add details to the issue. + +If an issue is complex and needs the attention of a specific person, assignment is a good option but assigning issues might discourage other people from contributing to that issue. We need all the contributions we can get so this should never be discouraged. Also, an assigned person might not have time for a few weeks, so others should feel free to takeover. + +Priority (from high to low): + +1. Mentioning people (very important) +2. Workflow labels +3. Functional labels (less important) +4. Assigning issues (optional) + +## Workflow labels + +- _Awaiting feedback_: Feedback pending from the reporter +- _Awaiting confirmation of fix_: The issue should already be solved in **master** (generally you can avoid this workflow item and just close the issue right away) +- _Attached PR_: There is a PR attached and the discussion should happen there + - We need to let issues stay in sync with the PR's. We can do this with a "Closing #XXXX" or "Fixes #XXXX" comment in the PR. We can't close the issue when there is a pull request because sometimes a PR is not good and we just close the PR, then the issue must stay. +- _Awaiting developer action/feedback_: Issue needs to be fixed or clarified by a developer + +## Functional labels + +These labels describe what development specialities are involved such as: PostgreSQL, UX, LDAP. + +## Label colors +- Light orange `#fef2c0`: workflow labels for issue team members (awaiting feedback, awaiting confirmation of fix) +- Bright orange `#eb6420`: workflow labels for core team members (attached PR, awaiting developer action/feedback) +- Light blue `#82C5FF`: functional labels +- Green labels `#009800`: issues that can generally be ignored. For example, issues given the following labels normally can be closed immediately: + - Feature request (see copy & paste response: [Feature requests](#feature-requests)) + - Support (see copy & paste response: [Support requests and configuration questions](#support-requests-and-configuration-questions) + +## Common actions + +### Issue team +- Looks for issues without workflow labels and triages issue +- Monitors pull requests +- Closes invalid issues and pull requests with a comment (duplicates, [feature requests](#feature-requests), [fixed in newer version](#issue-fixed-in-newer-version), [issue report for old version](#issue-report-for-old-version), not a problem in GitLab, etc.) +- Assigns appropriate [labels](#how-we-handle-issues) +- Asks for feedback from issue reporter/pull request initiator ([invalid issue reports](#improperly-formatted-issue), [format code](#code-format), etc.) +- Asks for feedback from the relevant developer(s) based on the [list of members and their specialities](http://gitlab.org/team/) +- Monitors all issues/pull requests for feedback (but especially ones commented on since automatically watching them): +- Assigns issues to developers if they indicate they are fixing it +- Assigns pull requests to developers if they indicate they will take care of merge +- Closes issues with no feedback from the reporter for two weeks +- Closes stale pull requests + +### Development team + +- Responds to issues and pull requests the issue team mentions them in +- Monitors for new issues in _Awaiting developer action/feedback_ with no developer activity (once a week) +- Monitors for new pull requests (at least once a week) +- Manages their work queue by looking at issues and pull requests assigned to them +- Close fixed issues (via commit messages or manually) +- Codes [new features](http://feedback.gitlab.com/forums/176466-general/filters/top)! +- Response guidelines +- Be kind to people trying to contribute. Be aware that people can be a non-native or a native English speaker, they might not understand thing or they might be very sensitive to how your word things. Use emoji to express your feelings (hearth, star, smile, etc.). Some good tips about giving feedback to pull requests is in the [Thoughtbot code review guide](https://github.com/thoughtbot/guides/tree/master/code-review). + +## Copy & paste responses + +### Improperly formatted issue + +Thanks for the issue report. Please reformat your issue to conform to the issue tracker guidelines found in our \[contributing guidelines\]\(https://github.com/gitlabhq/gitlabhq/blob/master/CONTRIBUTING.md#issue-tracker-guidelines). + +### Feature requests + +Thanks for your interest in GitLab. We don't use the GitHub issue tracker for feature requests. Please use http://feedback.gitlab.com/ for this purpose or create a pull request implementing this feature. Have a look at the \[contribution guidelines\]\(https://github.com/gitlabhq/gitlabhq/blob/master/CONTRIBUTING.md) for more information. + +### Issue report for old version + +Thanks for the issue report but we only support issues for the latest stable version of GitLab. I'm closing this issue but if you still experience this problem in the latest stable version, please open a new issue (but also reference the old issue(s)). Make sure to also include the necessary debugging information conforming to the issue tracker guidelines found in our \[contributing guidelines\]\(https://github.com/gitlabhq/gitlabhq/blob/master/CONTRIBUTING.md#issue-tracker-guidelines). + +### Support requests and configuration questions + +Thanks for your interest in GitLab. We don't use the GitHub issue tracker for support requests and configuration questions. Please use the \[support forum\]\(https://groups.google.com/forum/#!forum/gitlabhq), \[Stack Overflow\]\(http://stackoverflow.com/questions/tagged/gitlab), the unofficial #gitlab IRC channel on Freenode or the http://www.gitlab.com paid services for this purpose. Have a look at the \[contribution guidelines\]\(https://github.com/gitlabhq/gitlabhq/blob/master/CONTRIBUTING.md) for more information. + +### Code format + +Please use ``` to format console output, logs, and code as it's very hard to read otherwise. + +### Issue fixed in newer version + +Thanks for the issue report. This issue has already been fixed in newer versions of GitLab. Due to the size of this project and our limited resources we are only able to support the latest stable release as outlined in our \[contributing guidelines\]\(https://github.com/gitlabhq/gitlabhq/blob/master/CONTRIBUTING.md#issue-tracker). In order to get this bug fix and enjoy many new features please \[upgrade\]\(http://blog.gitlab.org/). If you still experience issues at that time please open a new issue following our issue tracker guidelines found in the \[contributing guidelines\]\(https://github.com/gitlabhq/gitlabhq/blob/master/CONTRIBUTING.md#issue-tracker-guidelines). + +### Improperly formatted pull request + +Thanks for your interest in improving the GitLab codebase! Please update your pull request according to the \[contributing guidelines\]\(https://github.com/gitlabhq/gitlabhq/blob/master/CONTRIBUTING.md#pull-request-guidelines). + +### Inactivity close of an issue + +It's been at least 2 weeks (and a new release) since we heard from you. I'm closing this issue but if you still experience this problem, please open a new issue (but also reference the old issue(s)). Make sure to also include the necessary debugging information conforming to the issue tracker guidelines found in our \[contributing guidelines\]\(https://github.com/gitlabhq/gitlabhq/blob/master/CONTRIBUTING.md#issue-tracker-guidelines). + +### Inactivity close of a pull request + +This pull request has been closed because a request for more information has not been reacted to for more than 2 weeks. If you respond and conform to the pull request guidelines in our \[contributing guidelines\]\(https://github.com/gitlabhq/gitlabhq/blob/master/CONTRIBUTING.md#pull-requests) we will reopen this pull request. + -- cgit v1.2.1 From f79b210061724fa1460fbb10853467182031c2c5 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 8 Aug 2013 11:40:42 +0300 Subject: Fix wiki popup for new page --- app/assets/javascripts/dispatcher.js.coffee | 4 +++- app/assets/javascripts/wikis.js.coffee | 7 ------- app/views/projects/wikis/_nav.html.haml | 2 +- 3 files changed, 4 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/dispatcher.js.coffee b/app/assets/javascripts/dispatcher.js.coffee index d490233c2ec..b0b947dd476 100644 --- a/app/assets/javascripts/dispatcher.js.coffee +++ b/app/assets/javascripts/dispatcher.js.coffee @@ -39,7 +39,9 @@ class Dispatcher switch path.first() when 'admin' then new Admin() - when 'wikis' then new Wikis() + when 'projects' + new Wikis() if path[1] == 'wikis' + initSearch: -> autocomplete_json = $('.search-autocomplete-json').data('autocomplete-opts') diff --git a/app/assets/javascripts/wikis.js.coffee b/app/assets/javascripts/wikis.js.coffee index f2867c8026e..17e790e5b7c 100644 --- a/app/assets/javascripts/wikis.js.coffee +++ b/app/assets/javascripts/wikis.js.coffee @@ -1,10 +1,5 @@ class Wikis constructor: -> - modal = $('#modal-new-wiki').modal({modal: true, show:false}) - - $('.add-new-wiki').bind "click", -> - modal.show() - $('.build-new-wiki').bind "click", -> field = $('#new_wiki_path') slug = field.val() @@ -13,7 +8,5 @@ class Wikis if(slug.length > 0) location.href = path + "/" + slug - $('.modal-header .close').bind "click", -> - modal.hide() @Wikis = Wikis diff --git a/app/views/projects/wikis/_nav.html.haml b/app/views/projects/wikis/_nav.html.haml index 89325856acd..0a7e51e974c 100644 --- a/app/views/projects/wikis/_nav.html.haml +++ b/app/views/projects/wikis/_nav.html.haml @@ -12,7 +12,7 @@ - if can?(current_user, :write_wiki, @project) .pull-right - = link_to '#', class: "add-new-wiki btn btn-new" do + = link_to '#modal-new-wiki', class: "add-new-wiki btn btn-new", "data-toggle" => "modal" do %i.icon-plus New Page -- cgit v1.2.1 From acc21d30fb7a38e8ae069116a37d67b535da3996 Mon Sep 17 00:00:00 2001 From: Dmitriy Zaporozhets Date: Thu, 8 Aug 2013 11:57:34 +0300 Subject: Increase input padding. Minor ui fixes --- app/assets/stylesheets/gitlab_bootstrap/blocks.scss | 4 ++++ app/assets/stylesheets/gitlab_bootstrap/forms.scss | 15 +++++++++++++++ app/assets/stylesheets/sections/projects.scss | 12 ------------ app/views/admin/hooks/index.html.haml | 2 +- app/views/profiles/account.html.haml | 2 +- app/views/profiles/keys/_form.html.haml | 4 ++-- app/views/projects/deploy_keys/_form.html.haml | 6 +++--- app/views/projects/hooks/index.html.haml | 2 +- app/views/projects/new.html.haml | 15 ++++++++------- app/views/projects/wikis/_form.html.haml | 10 ++++++---- app/views/projects/wikis/_new.html.haml | 2 +- 11 files changed, 42 insertions(+), 32 deletions(-) diff --git a/app/assets/stylesheets/gitlab_bootstrap/blocks.scss b/app/assets/stylesheets/gitlab_bootstrap/blocks.scss index bbce30f347a..0c561552dcb 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/blocks.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/blocks.scss @@ -34,6 +34,10 @@ &.ui-box-show { margin:20px 0; background: #FFF; + + .control-group { + margin-bottom: 0; + } } &.ui-box-danger { diff --git a/app/assets/stylesheets/gitlab_bootstrap/forms.scss b/app/assets/stylesheets/gitlab_bootstrap/forms.scss index ad14b003c73..bc8fbc2e24e 100644 --- a/app/assets/stylesheets/gitlab_bootstrap/forms.scss +++ b/app/assets/stylesheets/gitlab_bootstrap/forms.scss @@ -12,3 +12,18 @@ input { } } +.control-group { + .control-label { + padding-top: 6px; + } + .controls { + input, textarea { + padding: 6px 10px; + } + + input[type="radio"], input[type="checkbox"] { + margin-top: 6px; + } + } +} + diff --git a/app/assets/stylesheets/sections/projects.scss b/app/assets/stylesheets/sections/projects.scss index c6bec5a4d9a..027b51f48f0 100644 --- a/app/assets/stylesheets/sections/projects.scss +++ b/app/assets/stylesheets/sections/projects.scss @@ -1,17 +1,5 @@ .new_project, .edit_project { - .project_name_holder { - input, - label { - font-size: 16px; - line-height: 20px; - padding: 8px; - } - } - .adv_settings { - h6 { margin-left: 40px; } - } - fieldset.features { .control-label { font-weight: bold; diff --git a/app/views/admin/hooks/index.html.haml b/app/views/admin/hooks/index.html.haml index 0830bc32b91..8f302dce5d4 100644 --- a/app/views/admin/hooks/index.html.haml +++ b/app/views/admin/hooks/index.html.haml @@ -13,7 +13,7 @@ .control-group = f.label :url, "URL:" .controls - = f.text_field :url, class: "text_field xxlarge input-xpadding" + = f.text_field :url, class: "text_field input-xxlarge input-xpadding"   = f.submit "Add System Hook", class: "btn btn-create" %hr diff --git a/app/views/profiles/account.html.haml b/app/views/profiles/account.html.haml index b8325e5d9e7..122ff1b4a01 100644 --- a/app/views/profiles/account.html.haml +++ b/app/views/profiles/account.html.haml @@ -54,7 +54,7 @@ It can be used for atom feed or API %p.cgray - if current_user.private_token - = text_field_tag "token", current_user.private_token, class: "input-xxlarge large_text" + = text_field_tag "token", current_user.private_token, class: "input-xxlarge large_text input-xpadding" = 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. diff --git a/app/views/profiles/keys/_form.html.haml b/app/views/profiles/keys/_form.html.haml index f41ae1c2591..3a0b6cd48a1 100644 --- a/app/views/profiles/keys/_form.html.haml +++ b/app/views/profiles/keys/_form.html.haml @@ -8,13 +8,13 @@ .control-group = f.label :title - .controls= f.text_field :title + .controls= f.text_field :title, class: "input-xlarge" .control-group = f.label :key .controls %p.light Paste your public key here. Read more about how generate it #{link_to "here", help_ssh_path} - = f.text_area :key, class: [:xxlarge, :thin_area] + = f.text_area :key, class: "input-xxlarge thin_area" .form-actions diff --git a/app/views/projects/deploy_keys/_form.html.haml b/app/views/projects/deploy_keys/_form.html.haml index 84a81ac58b1..00b41e657b6 100644 --- a/app/views/projects/deploy_keys/_form.html.haml +++ b/app/views/projects/deploy_keys/_form.html.haml @@ -8,14 +8,14 @@ .control-group = f.label :title - .controls= f.text_field :title + .controls= f.text_field :title, class: 'input-xlarge' .control-group = f.label :key .controls - = f.text_area :key, class: [:xxlarge, :thin_area] - %p.hint + %p.light Paste a machine public key here. Read more about how generate it = link_to "here", help_ssh_path + = f.text_area :key, class: "input-xxlarge thin_area" .form-actions = f.submit 'Create', class: "btn-create btn" diff --git a/app/views/projects/hooks/index.html.haml b/app/views/projects/hooks/index.html.haml index eed76a7366d..53e54103617 100644 --- a/app/views/projects/hooks/index.html.haml +++ b/app/views/projects/hooks/index.html.haml @@ -14,7 +14,7 @@ .control-group = f.label :url, "URL:" .controls - = f.text_field :url, class: "text_field xxlarge input-xpadding", placeholder: 'http://example.com/trigger-ci.json' + = f.text_field :url, class: "text_field input-xxlarge input-xpadding", placeholder: 'http://example.com/trigger-ci.json'   = f.submit "Add Web Hook", class: "btn btn-create" %hr diff --git a/app/views/projects/new.html.haml b/app/views/projects/new.html.haml index 38eb6d401c5..d309f0686e0 100644 --- a/app/views/projects/new.html.haml +++ b/app/views/projects/new.html.haml @@ -1,13 +1,16 @@ -.project-edit-container +%p.slead + New projects are private by default. You choose who can see the project and commit to repository. +%hr +.project-edit-container.prepend-top-10 .project-edit-errors = render 'projects/errors' .project-edit-content = form_for @project, remote: true do |f| .control-group.project_name_holder = f.label :name do - Project name is + %strong Project name is .controls - = f.text_field :name, placeholder: "Example Project", class: "input-xxlarge", tabindex: 1, autofocus: true + = f.text_field :name, placeholder: "Example Project", class: "input-xlarge", tabindex: 1, autofocus: true - if current_user.can_select_namespace? .control-group @@ -25,7 +28,7 @@ = f.label :import_url do %span Import existing repo .controls - = f.text_field :import_url, class: 'xlarge', placeholder: 'https://github.com/randx/six.git' + = f.text_field :import_url, class: 'input-xlarge', placeholder: 'https://github.com/randx/six.git' .light URL must be cloneable .control-group @@ -33,10 +36,8 @@ Description %span.light (optional) .controls - = f.text_area :description, placeholder: "awesome project", class: "span5", rows: 3, maxlength: 250, tabindex: 3 + = f.text_area :description, placeholder: "awesome project", class: "input-xlarge", rows: 3, maxlength: 250, tabindex: 3 - %p.padded - New projects are private by default. You choose who can see the project and commit to repository. .form-actions = f.submit 'Create project', class: "btn btn-create project-submit", tabindex: 4 diff --git a/app/views/projects/wikis/_form.html.haml b/app/views/projects/wikis/_form.html.haml index c8c02818e25..16061c9dcbb 100644 --- a/app/views/projects/wikis/_form.html.haml +++ b/app/views/projects/wikis/_form.html.haml @@ -23,11 +23,13 @@ \. .ui-box-bottom - = f.label :content - .controls= f.text_area :content, class: 'span8 js-gfm-input' + .control-group + = f.label :content + .controls= f.text_area :content, class: 'span8 js-gfm-input' .ui-box-bottom - = f.label :commit_message - .controls= f.text_field :message, class: 'span8' + .control-group + = f.label :commit_message + .controls= f.text_field :message, class: 'span8' .form-actions - if @wiki && @wiki.persisted? = f.submit 'Save changes', class: "btn-save btn" diff --git a/app/views/projects/wikis/_new.html.haml b/app/views/projects/wikis/_new.html.haml index c52fbcb58f6..f64772b2001 100644 --- a/app/views/projects/wikis/_new.html.haml +++ b/app/views/projects/wikis/_new.html.haml @@ -1,6 +1,6 @@ %div#modal-new-wiki.modal.hide .modal-header - %a.close{href: "#"} × + %a.close{href: "#", "data-dismiss" => "modal"} × %h3.page-title New Wiki Page .modal-body = label_tag :new_wiki_path do -- cgit v1.2.1