diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-08-22 04:56:53 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-08-22 04:56:53 +0400 |
commit | aa50408ecb5c7355d7cac86f7a59f02ae087714c (patch) | |
tree | 90bc5bea2c601800e1beefdb82e4302bebee5f3f | |
parent | 5c7ed6fa26b47ac71ff6ba04720d85df6d74b200 (diff) |
1. Better message if no ssh key
2. SSH Keys Help page
-rw-r--r-- | app/assets/stylesheets/common.scss | 8 | ||||
-rw-r--r-- | app/assets/stylesheets/gitlab_bootstrap.scss | 5 | ||||
-rw-r--r-- | app/views/dashboard/index.html.haml | 11 | ||||
-rw-r--r-- | app/views/help/index.html.haml | 3 | ||||
-rw-r--r-- | app/views/help/permissions.html.haml | 4 | ||||
-rw-r--r-- | app/views/help/ssh.html.haml | 25 | ||||
-rw-r--r-- | app/views/help/system_hooks.html.haml | 4 | ||||
-rw-r--r-- | app/views/help/web_hooks.html.haml | 8 | ||||
-rw-r--r-- | app/views/help/workflow.html.haml | 13 | ||||
-rw-r--r-- | app/views/keys/_form.html.haml | 8 | ||||
-rw-r--r-- | app/views/keys/new.html.haml | 2 | ||||
-rw-r--r-- | app/views/merge_requests/show/_how_to_merge.html.haml | 11 | ||||
-rw-r--r-- | app/views/projects/empty.html.haml | 67 | ||||
-rw-r--r-- | app/views/shared/_no_ssh.html.haml | 8 | ||||
-rw-r--r-- | config/routes.rb | 1 |
15 files changed, 104 insertions, 74 deletions
diff --git a/app/assets/stylesheets/common.scss b/app/assets/stylesheets/common.scss index 6103d05c3ce..3c160358428 100644 --- a/app/assets/stylesheets/common.scss +++ b/app/assets/stylesheets/common.scss @@ -735,3 +735,11 @@ li.note { font-size: 12px; } } + +.error_message { + @extend .cred; + border-bottom: 1px solid #D21; + padding-bottom:20px; + text-align:center; + margin-bottom:10px; +} diff --git a/app/assets/stylesheets/gitlab_bootstrap.scss b/app/assets/stylesheets/gitlab_bootstrap.scss index 8bc63e257b1..03beeaefd20 100644 --- a/app/assets/stylesheets/gitlab_bootstrap.scss +++ b/app/assets/stylesheets/gitlab_bootstrap.scss @@ -4,6 +4,11 @@ body { pre { font-family:'Menlo', 'Liberation Mono', 'Consolas', 'Courier New', 'andale mono','lucida console',monospace; + + &.dark { + background: #333; + color:#f5f5f5; + } } a { diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml index 9fea5acb7cd..ba7d019cb63 100644 --- a/app/views/dashboard/index.html.haml +++ b/app/views/dashboard/index.html.haml @@ -1,14 +1,7 @@ - if @projects.any? .projects .activities.span8 - - if current_user.require_ssh_key? - .alert.alert-error.padded - %span - You wont be able to pull/push project code unless you - %strong - = link_to new_key_path, class: "vlink" do - add new key - to your profile + = render 'shared/no_ssh' - if @events.any? .content_list= render @events - else @@ -57,5 +50,5 @@ If you will be added to project - it will be displayed here -:javascript +:javascript $(function(){ Pager.init(20); }); diff --git a/app/views/help/index.html.haml b/app/views/help/index.html.haml index 66f7c722d67..02549577282 100644 --- a/app/views/help/index.html.haml +++ b/app/views/help/index.html.haml @@ -31,3 +31,6 @@ %li %h5= link_to "Gitlab Markdown", help_markdown_path + + %li + %h5= link_to "SSH keys", help_ssh_path diff --git a/app/views/help/permissions.html.haml b/app/views/help/permissions.html.haml index 7511d15d995..f9287fa0996 100644 --- a/app/views/help/permissions.html.haml +++ b/app/views/help/permissions.html.haml @@ -1,6 +1,6 @@ -%h3 Permissions +%h3.page_title Permissions .back_link - = link_to help_path do + = link_to help_path do ← to index %hr diff --git a/app/views/help/ssh.html.haml b/app/views/help/ssh.html.haml new file mode 100644 index 00000000000..6a5812040e7 --- /dev/null +++ b/app/views/help/ssh.html.haml @@ -0,0 +1,25 @@ +%h3.page_title SSH Keys +.back_link + = link_to help_path do + ← to index +%hr + +%p.slead + SSH key allows you to establish a secure connection between your computer and Gitlab + +%p.slead + To generate a new SSH key just open your terminal and use code below. + +%pre.dark + ssh-keygen -t rsa -C "#{current_user.email}" + + \# Creates a new ssh key using the provided email + \# Generating public/private rsa key pair... + +%p.slead + Next just use code below to dump your public key and add to GITLAB SSH Keys + +%pre.dark + cat ~/.ssh/id_rsa.pub + + \# ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQC6eNtGpNGwstc.... diff --git a/app/views/help/system_hooks.html.haml b/app/views/help/system_hooks.html.haml index 2088208ad47..9fc8cbabf17 100644 --- a/app/views/help/system_hooks.html.haml +++ b/app/views/help/system_hooks.html.haml @@ -1,10 +1,10 @@ %h3 System hooks .back_link - = link_to :back do + = link_to :back do ← back %hr -%p.slead +%p.slead Your Gitlab instance can perform HTTP POST request on next event: create_project, delete_project, create_user, delete_user, change_team_member. %br System Hooks can be used for logging or change information in LDAP server. diff --git a/app/views/help/web_hooks.html.haml b/app/views/help/web_hooks.html.haml index 3acea62cf90..263eadf6583 100644 --- a/app/views/help/web_hooks.html.haml +++ b/app/views/help/web_hooks.html.haml @@ -1,11 +1,11 @@ -%h3 Web hooks +%h3.page_title Web hooks .back_link - = link_to help_path do + = link_to help_path do ← to index %hr -%p.slead - Every Gitlab project can trigger a web server whenever the repo is pushed to. +%p.slead + Every Gitlab project can trigger a web server whenever the repo is pushed to. %br Web Hooks can be used to update an external issue tracker, trigger CI builds, update a backup mirror, or even deploy to your production server. %br diff --git a/app/views/help/workflow.html.haml b/app/views/help/workflow.html.haml index 7db8133b7f3..a3fe3b01d46 100644 --- a/app/views/help/workflow.html.haml +++ b/app/views/help/workflow.html.haml @@ -1,7 +1,6 @@ -- bash_lexer = Pygments::Lexer[:bash] -%h3 Workflow +%h3.page_title Workflow .back_link - = link_to help_path do + = link_to help_path do ← to index %hr @@ -9,25 +8,25 @@ %li %p Clone project .bash - %pre + %pre.dark git clone git@example.com:project-name.git %li %p Create branch with your feature .bash - %pre + %pre.dark git checkout -b $feature_name %li %p Write code. Commit changes .bash - %pre + %pre.dark git commit -am "My feature is ready" %li %p Push your branch to gitlabhq .bash - %pre + %pre.dark git push origin $feature_name %li diff --git a/app/views/keys/_form.html.haml b/app/views/keys/_form.html.haml index ee2eafddf3b..9c6e229bf49 100644 --- a/app/views/keys/_form.html.haml +++ b/app/views/keys/_form.html.haml @@ -11,7 +11,13 @@ .input= f.text_field :title .clearfix = f.label :key - .input= f.text_area :key, class: [:xxlarge, :thin_area] + .input + = f.text_area :key, class: [:xxlarge, :thin_area] + %p.hint + Paste your public key here. Read more about how generate it + = link_to "here", help_ssh_path + + .actions = f.submit 'Save', class: "primary btn" = link_to "Cancel", keys_path, class: "btn" diff --git a/app/views/keys/new.html.haml b/app/views/keys/new.html.haml index 02e782b9f85..fff3805890e 100644 --- a/app/views/keys/new.html.haml +++ b/app/views/keys/new.html.haml @@ -1,4 +1,4 @@ -%h3.page_title New key +%h3.page_title Add an SSH Key %hr = render 'form' diff --git a/app/views/merge_requests/show/_how_to_merge.html.haml b/app/views/merge_requests/show/_how_to_merge.html.haml index c21f2727a47..69881d4352f 100644 --- a/app/views/merge_requests/show/_how_to_merge.html.haml +++ b/app/views/merge_requests/show/_how_to_merge.html.haml @@ -3,13 +3,12 @@ %a.close{href: "#"} × %h3 How To Merge .modal-body - %pre + %pre.dark = preserve do - :erb - git checkout <%= @merge_request.target_branch %> - git fetch origin - git merge origin/<%= @merge_request.source_branch %> - git push origin <%= @merge_request.target_branch %> + git checkout #{@merge_request.target_branch} + git fetch origin + git merge origin/#{@merge_request.source_branch} + git push origin #{@merge_request.target_branch} :javascript diff --git a/app/views/projects/empty.html.haml b/app/views/projects/empty.html.haml index b8d0dad973c..907d5ef4666 100644 --- a/app/views/projects/empty.html.haml +++ b/app/views/projects/empty.html.haml @@ -1,47 +1,30 @@ -- if current_user.require_ssh_key? - .alert-message.block-message.error - %ul - %li You have no ssh keys added to your profile. - %li You wont be able to pull/push repository. - %li Visit profile → keys and add public key of every machine you want to use for work with gitlabhq. - -.alert-message.block-message.error - %ul.unstyled.alert_holder - %li You should push repository to proceed. - %li After push you will be able to browse code, commits etc. - -- bash_lexer = Pygments::Lexer[:bash] += render 'shared/no_ssh' %div.git-empty - %h3 Git global setup: - - setup_str = ["git config --global user.name \"#{current_user.name}\"", - "git config --global user.email \"#{current_user.email}\""].join("\n") - = preserve do - = raw bash_lexer.highlight(setup_str, lexer: 'bash', options: {encoding: 'utf-8'}) - - %br - %br - %h3 Create Repository - - repo_setup_str = ["mkdir #{@project.path}", - "cd #{@project.path}", - "git init", - "touch README", - "git add README", - "git commit -m 'first commit'", - "git remote add origin #{@project.url_to_repo}", - "git push -u origin master"].join("\n") + %h4 Git global setup: + %pre.dark + = preserve do + git config --global user.name "#{current_user.name}" + git config --global user.email "#{current_user.email}" - = preserve do - = raw bash_lexer.highlight(repo_setup_str) + %h4.prepend-top-20 Create Repository + %pre.dark + = preserve do + mkdir #{@project.path} + cd #{@project.path} + git init + touch README + git add README + git commit -m 'first commit' + git remote add origin #{@project.url_to_repo} + git push -u origin master - %br - %br - %h3 Existing Git Repo? - - exist_repo_setup_str = ["cd existing_git_repo", - "git remote add origin #{@project.url_to_repo}", - "git push -u origin master"].join("\n") - = preserve do - = raw bash_lexer.highlight(exist_repo_setup_str) + %h4.prepend-top-20 Existing Git Repo? + %pre.dark + = preserve do + cd existing_git_repo + git remote add origin #{@project.url_to_repo} + git push -u origin master - if can? current_user, :admin_project, @project - .alert-message.block-message.error.prepend-top-20 - = link_to 'Remove project', @project, confirm: 'Are you sure?', method: :delete, class: "btn danger" + .prepend-top-20 + = link_to 'Remove project', @project, confirm: 'Are you sure?', method: :delete, class: "btn danger right" diff --git a/app/views/shared/_no_ssh.html.haml b/app/views/shared/_no_ssh.html.haml new file mode 100644 index 00000000000..b6ab666bc5d --- /dev/null +++ b/app/views/shared/_no_ssh.html.haml @@ -0,0 +1,8 @@ +- if current_user.require_ssh_key? + %h6.error_message + %span + You wont be able to pull/push project code unless you + %strong + = link_to new_key_path, class: "vlink" do + add SSH key + to your profile diff --git a/config/routes.rb b/config/routes.rb index 04e13bc4a86..97594d577a7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -30,6 +30,7 @@ Gitlab::Application.routes.draw do get 'help/web_hooks' => 'help#web_hooks' get 'help/system_hooks' => 'help#system_hooks' get 'help/markdown' => 'help#markdown' + get 'help/ssh' => 'help#ssh' # # Admin Area |