diff --git a/app/assets/stylesheets/help_panel.scss b/app/assets/stylesheets/help_panel.scss
new file mode 100644
index 0000000000000000000000000000000000000000..e1603765d74a1d6e4c20caac76ab93bb791da106
--- /dev/null
+++ b/app/assets/stylesheets/help_panel.scss
@@ -0,0 +1,45 @@
+#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;
+ -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;
+ font-size:18px;
+ margin:10px 0;
+ cursor:pointer;
+ &.active {color:#000;}
+ }
+ dd {
+ margin:0;
+ }
+ 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:.88em;
+ li {
+ margin:0; list-style:none outside;
+ }
+ }
+}
+
diff --git a/app/assets/stylesheets/main.scss b/app/assets/stylesheets/main.scss
index 5881880982ac39e044756bb962990472f0fb97e4..9390cd29653b08a69f73905b70217c7fd56bf465 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/dashboard/index.html.haml b/app/views/dashboard/index.html.haml
index 72fb42ab4e6e593a95ed64f58ec75f70ce1b78b3..8f326f210c509035acaff6cfce6598cf0539480a 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
%span.ico.projects
diff --git a/app/views/keys/new.html.haml b/app/views/keys/new.html.haml
index 743a3173706d9839cced1625ee6ce298aefefe7b..277936c674357f148492507ddacb65002f24b32d 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
diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml
index 86ad2bd0cf98860c4bae4c424b5ffcc5f6e5c136..d2cd97f60ceb5570c07fca69febe3d69749cc03d 100644
--- a/app/views/layouts/_head_panel.html.haml
+++ b/app/views/layouts/_head_panel.html.haml
@@ -20,10 +20,52 @@
= 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://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' );
+
+ %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/' );
+ -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);
+ %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 +80,17 @@
e.preventDefault();
}
});
+
+ $('.show_help').on('click', function(){
+ $('#no_ssh_key_defined').slideToggle(100);
+ $('#no_ssh_key_defined dt:first').click();
+ 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);
+ });
});