From 05aaf43e163979d1595985a06b6deb52398f3b6b Mon Sep 17 00:00:00 2001 From: Staicu Ionut Date: Wed, 29 Feb 2012 13:13:06 +0200 Subject: [PATCH 1/7] added a help panel, visible by default for new users (assuming new users doesn't have ssh key added); also, the panel can be triggered from user menu --- app/assets/stylesheets/help_panel.scss | 36 +++++++++++++++++++ app/assets/stylesheets/main.scss | 5 +++ app/views/layouts/_head_panel.html.haml | 48 +++++++++++++++++++++++-- 3 files changed, 87 insertions(+), 2 deletions(-) create mode 100644 app/assets/stylesheets/help_panel.scss diff --git a/app/assets/stylesheets/help_panel.scss b/app/assets/stylesheets/help_panel.scss new file mode 100644 index 00000000000..3b4efcad6ea --- /dev/null +++ b/app/assets/stylesheets/help_panel.scss @@ -0,0 +1,36 @@ +#no_ssh_key_defined { + float:left; + width:100%; + margin: 20px 0 -20px; + .wrapper { + overflow:hidden; + padding:10px; + -moz-border-radius:5px; + border-radius:5px; + border:2px solid #c00; + width: 936px; + margin: 0 auto; + } + dt { + color:#c00; + font-size:18px; + } + ul { + margin:0; + } + .helper { + float:right; + margin:0 0 0 20px; + width:230px; + border:1px solid #ddd; + background:#fafafa; + padding:5px; + max-height:285px; + overflow:auto; + font-size:.8em; + li { + margin:0; list-style:none outside; + } + } +} + diff --git a/app/assets/stylesheets/main.scss b/app/assets/stylesheets/main.scss index 5881880982a..9390cd29653 100644 --- a/app/assets/stylesheets/main.scss +++ b/app/assets/stylesheets/main.scss @@ -116,3 +116,8 @@ $hover: #FDF5D9; * */ @import "highlight.black.scss"; + +/** + * Quick Help zone + */ +@import "help_panel.scss"; diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml index 86ad2bd0cf9..ee759a075c7 100644 --- a/app/views/layouts/_head_panel.html.haml +++ b/app/views/layouts/_head_panel.html.haml @@ -20,10 +20,50 @@ = link_to profile_path, :class => "pic" do = image_tag gravatar_icon(current_user.email) .account-links - = link_to profile_path, :class => "username" do - My profile + = link_to 'My profile', profile_path, :class => "username" + = link_to 'Help', '#', :class => "show_help" = link_to 'Logout', destroy_user_session_path, :class => "logout", :method => :delete +- no_ssh_style = 'display:none' +-if current_user.keys.all.empty? + - no_ssh_style = 'display:block' + +%div#no_ssh_key_defined{ :style => no_ssh_style } + %div.wrapper + %dl.helper + %dt Useful resources + %dd + %ul + %li= link_to( 'Git', 'http://git-scm.com/' ) + %li= link_to( 'Best Clients for OSX', 'http://stackoverflow.com/questions/455698/best-visual-client-for-git-on-mac-os-x' ); + %li= link_to( 'OSX Gir clients roundup', 'http://shiningthrough.co.uk/Mac-OS-X-Git-Clients-Roundup' ); + %li= link_to( 'What is the Best Git GUI (Client) for Windows?', 'http://kylecordes.com/2010/git-gui-client-windows' ); + %li= link_to( 'Git Extensions', 'http://code.google.com/p/gitextensions/' ); + + %dt Articles & Tutorials + %dd + %ul + %li= link_to( 'Git Immersion', 'http://library.edgecase.com/git_immersion/' ); + %li= link_to( 'Think Like a Git', 'http://think-like-a-git.net/epic.html' ); + %li= link_to( 'Git Is Simpler Than You Think', 'http://nfarina.com/post/9868516270/git-is-simpler' ); + + %li= link_to( 'Linus Torvalds on Git', 'http://www.youtube.com/watch?v=4XpnKHJAok8' ); + %li= link_to( 'Git VS SVN: It’s time to stop using Subversion', 'http://altdevblogaday.com/2011/03/09/its-time-to-stop-using-subversion/' ); + %li= link_to( 'Get Started with Git', 'http://www.alistapart.com/articles/get-started-with-git/' ); + + %h2 ATTENTION! + %p It seems that your account is not setup correctly + %p Before you adding any key, make sure you don't have anything related to #{GIT_HOST["host"]} on ~/.ssh/known_hosts file.
If you used Git before (and you already have SSH keys), just skip to the last step (adding ssh key) + %ol + %li Install Git http://git-scm.com/ (on windows use these settings: 1 & 2); + %li edit ~/.gitconfig file and use these configs (update name & email); + %li Generate SSH keys: http://help.github.com/key-setup-redirect/; + %li Add the content of ~/.ssh/id_rsa.pub to this page. + %p + %small + ~/ is your home directory. On Linux/OSX you get there by typing cd ~/ into terminal or console
+ on Windows that is c:\users\YOUR_USER_NAME + :javascript $(function(){ $("#search").autocomplete({ @@ -38,5 +78,9 @@ e.preventDefault(); } }); + $('.show_help').on('click', function(){ + $('#no_ssh_key_defined').slideToggle(100); + return false; + }); }); -- GitLab From 1f276afa7f1f75391b964af600f46edbddcd58e9 Mon Sep 17 00:00:00 2001 From: Staicu Ionut Date: Wed, 29 Feb 2012 13:31:13 +0200 Subject: [PATCH 2/7] small adjustments on help box --- app/assets/stylesheets/help_panel.scss | 10 ++++++++-- app/views/layouts/_head_panel.html.haml | 8 ++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/app/assets/stylesheets/help_panel.scss b/app/assets/stylesheets/help_panel.scss index 3b4efcad6ea..4cfc1f0c37c 100644 --- a/app/assets/stylesheets/help_panel.scss +++ b/app/assets/stylesheets/help_panel.scss @@ -1,7 +1,7 @@ #no_ssh_key_defined { float:left; width:100%; - margin: 20px 0 -20px; + margin: 20px 0 20px; .wrapper { overflow:hidden; padding:10px; @@ -14,6 +14,12 @@ dt { color:#c00; font-size:18px; + margin:10px 0; + cursor:pointer; + &.active {color:#000;} + } + dd { + margin:0; } ul { margin:0; @@ -27,7 +33,7 @@ padding:5px; max-height:285px; overflow:auto; - font-size:.8em; + font-size:.88em; li { margin:0; list-style:none outside; } diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml index ee759a075c7..25099248f8e 100644 --- a/app/views/layouts/_head_panel.html.haml +++ b/app/views/layouts/_head_panel.html.haml @@ -78,9 +78,17 @@ e.preventDefault(); } }); + $('.show_help').on('click', function(){ $('#no_ssh_key_defined').slideToggle(100); return false; }); + + $('#no_ssh_key_defined dt').on('click', function(){ + var t = $(this); + t.addClass('active').siblings('dt').removeClass('active'); + t.next('dd').slideDown(150).siblings('dd').slideUp(150); + }); + $('#no_ssh_key_defined dt:first').click(); }); -- GitLab From 8259c53507ddbd9a12a518a77fafbf27e0e9f3e0 Mon Sep 17 00:00:00 2001 From: Staicu Ionut Date: Wed, 29 Feb 2012 13:37:37 +0200 Subject: [PATCH 3/7] fixed accordion on help panel; added shadow to the panel --- app/assets/stylesheets/help_panel.scss | 3 +++ app/views/layouts/_head_panel.html.haml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/help_panel.scss b/app/assets/stylesheets/help_panel.scss index 4cfc1f0c37c..e1603765d74 100644 --- a/app/assets/stylesheets/help_panel.scss +++ b/app/assets/stylesheets/help_panel.scss @@ -10,6 +10,9 @@ border:2px solid #c00; width: 936px; margin: 0 auto; + -moz-box-shadow:0px 0px 10px rgba(0, 0, 0, .2); + -webkit-box-shadow:0px 0px 10px rgba(0, 0, 0, .2); + box-shadow:0px 0px 10px rgba(0, 0, 0, .2); } dt { color:#c00; diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml index 25099248f8e..c4b2a0d1f78 100644 --- a/app/views/layouts/_head_panel.html.haml +++ b/app/views/layouts/_head_panel.html.haml @@ -81,6 +81,7 @@ $('.show_help').on('click', function(){ $('#no_ssh_key_defined').slideToggle(100); + $('#no_ssh_key_defined dt:first').click(); return false; }); @@ -89,6 +90,5 @@ t.addClass('active').siblings('dt').removeClass('active'); t.next('dd').slideDown(150).siblings('dd').slideUp(150); }); - $('#no_ssh_key_defined dt:first').click(); }); -- GitLab From c61ee184cd7d070abf829b6b884a25caba62a505 Mon Sep 17 00:00:00 2001 From: Staicu Ionut Date: Thu, 1 Mar 2012 15:31:20 +0200 Subject: [PATCH 4/7] removed short instruction on key-less users --- app/views/dashboard/index.html.haml | 8 -------- 1 file changed, 8 deletions(-) diff --git a/app/views/dashboard/index.html.haml b/app/views/dashboard/index.html.haml index 9d7cf6c9645..2244da8ecc0 100644 --- a/app/views/dashboard/index.html.haml +++ b/app/views/dashboard/index.html.haml @@ -1,11 +1,3 @@ -- if current_user.require_ssh_key? - .alert-message.warning - %p - You wont be able to pull/push project code unless you - = link_to new_key_path, :class => "vlink" do - add new key - to your profile - %div.dashboard_category %h3 Projects -- GitLab From 8b59d87935149e95d755476a42954051ad50da75 Mon Sep 17 00:00:00 2001 From: Staicu Ionut Date: Thu, 1 Mar 2012 15:37:54 +0200 Subject: [PATCH 5/7] Alert is different, based on user settings. If user already have a key, the message is less... imperative --- app/views/layouts/_head_panel.html.haml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml index c4b2a0d1f78..0a8cb7c7955 100644 --- a/app/views/layouts/_head_panel.html.haml +++ b/app/views/layouts/_head_panel.html.haml @@ -50,9 +50,11 @@ %li= link_to( 'Linus Torvalds on Git', 'http://www.youtube.com/watch?v=4XpnKHJAok8' ); %li= link_to( 'Git VS SVN: It’s time to stop using Subversion', 'http://altdevblogaday.com/2011/03/09/its-time-to-stop-using-subversion/' ); %li= link_to( 'Get Started with Git', 'http://www.alistapart.com/articles/get-started-with-git/' ); - - %h2 ATTENTION! - %p It seems that your account is not setup correctly + -if current_user.keys.all.empty? + %h2 ATTENTION! + %p It seems that your account is not setup correctly + -else + %h2 General Info %p Before you adding any key, make sure you don't have anything related to #{GIT_HOST["host"]} on ~/.ssh/known_hosts file.
If you used Git before (and you already have SSH keys), just skip to the last step (adding ssh key) %ol %li Install Git http://git-scm.com/ (on windows use these settings: 1 & 2); -- GitLab From cc4f9903ad08b0d41b76be2ae185467bb14ec675 Mon Sep 17 00:00:00 2001 From: Staicu Ionut Date: Thu, 1 Mar 2012 15:55:19 +0200 Subject: [PATCH 6/7] new key form extracts key title based on email within key. if no mail is detected, nothing is filled --- app/views/keys/new.html.haml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/app/views/keys/new.html.haml b/app/views/keys/new.html.haml index 743a3173706..277936c6743 100644 --- a/app/views/keys/new.html.haml +++ b/app/views/keys/new.html.haml @@ -1,3 +1,14 @@ %h3 New key %hr = render 'form' + +:javascript + $('#key_key').on('keyup', function(){ + var title = $('#key_title'), + val = $('#key_key').val(), + key_mail = val.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+|\.[a-zA-Z0-9._-]+)/gi); + + if( key_mail && key_mail.length > 0 && title.val() == '' ){ + $('#key_title').val( key_mail ); + } + }); \ No newline at end of file -- GitLab From f0635e569a4ff0dcfa1d7094f7b6419e871f110c Mon Sep 17 00:00:00 2001 From: Staicu Ionut Date: Mon, 5 Mar 2012 20:14:08 +0200 Subject: [PATCH 7/7] adjusted dead/wrong links --- app/views/layouts/_head_panel.html.haml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml index 0a8cb7c7955..d2cd97f60ce 100644 --- a/app/views/layouts/_head_panel.html.haml +++ b/app/views/layouts/_head_panel.html.haml @@ -43,7 +43,7 @@ %dt Articles & Tutorials %dd %ul - %li= link_to( 'Git Immersion', 'http://library.edgecase.com/git_immersion/' ); + %li= link_to( 'Git Immersion', 'http://gitimmersion.com/' ); %li= link_to( 'Think Like a Git', 'http://think-like-a-git.net/epic.html' ); %li= link_to( 'Git Is Simpler Than You Think', 'http://nfarina.com/post/9868516270/git-is-simpler' ); @@ -59,7 +59,7 @@ %ol %li Install Git http://git-scm.com/ (on windows use these settings: 1 & 2); %li edit ~/.gitconfig file and use these configs (update name & email); - %li Generate SSH keys: http://help.github.com/key-setup-redirect/; + %li Generate SSH keys: http://help.github.com/key-setup-redirect; %li Add the content of ~/.ssh/id_rsa.pub to this page. %p %small -- GitLab