diff --git a/app/assets/stylesheets/ui_basic.scss b/app/assets/stylesheets/ui_basic.scss index 251083df38dd58452fce3a0cd8e9c371badcce0b..b60662c0b4b91a887269691e031ac0755da0f2ce 100644 --- a/app/assets/stylesheets/ui_basic.scss +++ b/app/assets/stylesheets/ui_basic.scss @@ -81,20 +81,6 @@ } } - .top_panel_ico { - width: 16px; - height: 16px; - padding: 5px; - margin-right:10px; - float:right; - background: #EEE; - @include border-radius(5px); - border: 1px solid #DDD; - img { - vertical-align:top; - } - } - .project_name { float:left; width:360px; @@ -107,6 +93,14 @@ text-shadow: 0 1px 1px #FFF; } + .fbtn { + float: right; + margin-right:10px; + .btn { + margin-left:8px; + } + } + .search { float: right; margin-right: 55px; @@ -117,6 +111,8 @@ background-repeat: no-repeat; background-position: 10px; padding-left:25px; + @include border-radius(5px); + border:1px solid #ccc; } } } diff --git a/app/assets/stylesheets/ui_mars.scss b/app/assets/stylesheets/ui_mars.scss index 0f7bc9394e1472d9c365291d2e970c89f94c79a2..24951991dd399218c53c08309405fabe536108a5 100644 --- a/app/assets/stylesheets/ui_mars.scss +++ b/app/assets/stylesheets/ui_mars.scss @@ -24,6 +24,29 @@ z-index:10; height:60px; + .fbtn { + float: right; + margin-right:10px; + .btn { + margin-left:8px; + background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #595D63), to(#31363E)); + background-image: -webkit-linear-gradient(#595D63 6.6%, #31363E); + background-image: -moz-linear-gradient(#595D63 6.6%, #31363E); + background-image: -o-linear-gradient(#595D63 6.6%, #31363E); + font-size: 12px; + &:hover { + background-image: -webkit-gradient(linear, 0 0, 0 30, color-stop(0.066, #595D63), to(#2C2F35)); + background-image: -webkit-linear-gradient(#595D63 6.6%, #2C2F35); + background-image: -moz-linear-gradient(#595D63 6.6%, #202227); + background-image: -o-linear-gradient(#595D63 6.6%, #202227); + background-position:0 0; + } + + border: 1px solid #31363E; + color:#D6DADF; + text-shadow: 0 -1px 0 #000000; + } + } .search { float: right; margin-right: 55px; @@ -61,16 +84,14 @@ float:left; h1 { - background: url('logo_mars.png') no-repeat -3px -4px; + background: url('images.png') no-repeat -3px -6px; + width: 65px; + height: 26px; + margin: 6px 0; + padding: 0; + float: left; + text-indent: -1000em; float:left; - margin-left:5px; - font-size:20px; - line-height:36px; - font-weight:normal; - color:#a1a8ae; - text-shadow: 0 1px 1px #111; - padding-left:50px; - padding-top:5px; } } } @@ -93,14 +114,6 @@ padding:15px 0; } } - - .top_panel_ico { - width: 16px; - height: 16px; - padding: 5px; - margin-right:10px; - float:right; - } } /* * End of Application Header diff --git a/app/controllers/profile_controller.rb b/app/controllers/profile_controller.rb index 07d0a53f1c25c1039421f4fab620366f2aa29013..0da463757f35b4c7ed6194b9a6e85d21d9e9a9dc 100644 --- a/app/controllers/profile_controller.rb +++ b/app/controllers/profile_controller.rb @@ -14,6 +14,10 @@ class ProfileController < ApplicationController redirect_to :back end + def token + @user = current_user + end + def password @user = current_user end @@ -32,6 +36,6 @@ class ProfileController < ApplicationController def reset_private_token current_user.reset_authentication_token! - redirect_to profile_password_path + redirect_to profile_token_path end end diff --git a/app/views/keys/_show.html.haml b/app/views/keys/_show.html.haml index 1df9b91dffa5cead7a06cad0c46e82123602a5eb..7035e609f2c7487eaa43d2f43075110f068f3b0d 100644 --- a/app/views/keys/_show.html.haml +++ b/app/views/keys/_show.html.haml @@ -4,7 +4,7 @@ %p %strong= key.title %td - %span.right.cgray + %span.cgray Added = time_ago_in_words(key.created_at) ago diff --git a/app/views/keys/index.html.haml b/app/views/keys/index.html.haml index 2e2bfaab3085c9ee021930ae956fe0bdb25ff9db..61b558a27f55ce3ab6b10d7267df399fcea177b4 100644 --- a/app/views/keys/index.html.haml +++ b/app/views/keys/index.html.haml @@ -4,6 +4,11 @@ %br -%table#keys-table.table +%table#keys-table.admin-table + %thead + %tr + %th Name + %th Added + %th - @keys.each do |key| = render(:partial => 'show', :locals => {:key => key}) diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml index dff7a5dd196e65d19fdd83ba009f7e7e36a2c012..cdb4ebf4a19f5a9e3a342c66c34fadcb5ed4dd5e 100644 --- a/app/views/layouts/_head_panel.html.haml +++ b/app/views/layouts/_head_panel.html.haml @@ -11,12 +11,15 @@ .search = form_tag search_path, :method => :get do |f| = text_field_tag "search", nil, :placeholder => "Search", :class => "search-input" - - if current_user.can_create_project? - = link_to new_project_path, :class => "top_panel_ico", :title => "Create New Project" do - = image_tag "new_project.png", :width => 16 - - if current_user.is_admin? - = link_to admin_root_path, :class => "top_panel_ico", :title => "Admin area" do - = image_tag "admin.PNG", :width => 16 + .fbtn + - if current_user.is_admin? + = link_to admin_root_path, :class => "btn small", :title => "Admin area" do + %i.icon-cog + Admin + - if current_user.can_create_project? + = link_to new_project_path, :class => "btn small", :title => "Create New Project" do + %i.icon-plus + Project .account-box = link_to profile_path, :class => "pic" do = image_tag gravatar_icon(current_user.email) diff --git a/app/views/layouts/profile.html.haml b/app/views/layouts/profile.html.haml index 571612e0bb7c0526acbef361ba7e388e653a4d43..93f7c1827fbf80c1781f2b9722823a1e204677b9 100644 --- a/app/views/layouts/profile.html.haml +++ b/app/views/layouts/profile.html.haml @@ -7,7 +7,8 @@ .container %nav.main_menu = link_to "Profile", profile_path, :class => "home #{current_page?(:controller => "profile", :action => :show) ? "current" : nil}" - = link_to "Password & token", profile_password_path, :class => current_page?(:controller => "profile", :action => :password) ? "current" : nil + = link_to "Password", profile_password_path, :class => current_page?(:controller => "profile", :action => :password) ? "current" : nil + = link_to "Token", profile_token_path, :class => current_page?(:controller => "profile", :action => :token) ? "current" : nil = link_to "Design", profile_design_path, :class => current_page?(:controller => "profile", :action => :design) ? "current" : nil = link_to keys_path, :class => controller.controller_name == "keys" ? "current" : nil do SSH Keys diff --git a/app/views/notes/_form.html.haml b/app/views/notes/_form.html.haml index 8a5dde2f86c045737f53bea75d339394ed170074..ec07411a28ad359dd847cd3f93a600d84be5e649 100644 --- a/app/views/notes/_form.html.haml +++ b/app/views/notes/_form.html.haml @@ -10,7 +10,7 @@ = f.text_area :note, :size => 255 %p.hint Markdown is enabled. - .row + .row.note_advanced_opts .span4 %h5 Notify via email: .clearfix diff --git a/app/views/profile/password.html.haml b/app/views/profile/password.html.haml index 4c86b72728de251d7a6b1274f75c6fe83b0641ac..7ef15470862d9cff41167709607ba149972a1575 100644 --- a/app/views/profile/password.html.haml +++ b/app/views/profile/password.html.haml @@ -1,50 +1,20 @@ -.row - .span6 - .thumbnail - .caption - %h3 Password - %hr - = form_for @user, :url => profile_password_path, :method => :put do |f| - .data - .alert.alert-info - %p After successful password update you will be redirected to login page where you should login with new password - -if @user.errors.any? - .alert-message.block-message.error - %ul - - @user.errors.full_messages.each do |msg| - %li= msg - - .clearfix - = f.label :password - .input= f.password_field :password - .clearfix - = f.label :password_confirmation - .input= f.password_field :password_confirmation - %hr - = f.submit 'Save', :class => "btn" - - .span6.right - .thumbnail - .caption - %h3 - Private token - %span.cred.right - keep it in secret! - %hr - = form_for @user, :url => profile_reset_private_token_path, :method => :put do |f| - .data - .alert.alert-info - %p Private token used to access application resources without authentication. - %hr - %p * required for rss feed - %p.cgray - - if current_user.private_token - = text_field_tag "token", current_user.private_token - - else - You don`t have one yet. Click generate to fix it. - %hr - - if current_user.private_token - = f.submit 'Reset', :confirm => "Are you sure?", :class => "btn" - - else - = f.submit 'Generate', :class => "btn" +%h3 Password +%hr += form_for @user, :url => profile_password_path, :method => :put do |f| + .data + .alert.alert-info + %span After successful password update you will be redirected to login page where you should login with new password + -if @user.errors.any? + .alert-message.block-message.error + %ul + - @user.errors.full_messages.each do |msg| + %li= msg + .clearfix + = f.label :password + .input= f.password_field :password + .clearfix + = f.label :password_confirmation + .input= f.password_field :password_confirmation + .actions + = f.submit 'Save', :class => "btn primary" diff --git a/app/views/profile/token.html.haml b/app/views/profile/token.html.haml new file mode 100644 index 0000000000000000000000000000000000000000..c277adf98e98ae2721dc6c8c57e46fe774435ebe --- /dev/null +++ b/app/views/profile/token.html.haml @@ -0,0 +1,22 @@ +%h3 + Private token + %span.cred.right + keep it in secret! +%hr += form_for @user, :url => profile_reset_private_token_path, :method => :put do |f| + .data + .alert.alert-info + %p Private token used to access application resources without authentication. + %p * required for rss feed + %p.cgray + - if current_user.private_token + = text_field_tag "token", current_user.private_token + - else + You don`t have one yet. Click generate to fix it. + .actions + - if current_user.private_token + = f.submit 'Reset', :confirm => "Are you sure?", :class => "btn" + - else + = f.submit 'Generate', :class => "btn primary" + + diff --git a/app/views/projects/index.html.haml b/app/views/projects/index.html.haml index 3578b71c4f28240c2cc41deeb8c8a31bd6eef0f3..e18f37e17f72262d7e3c348da10f6da610df013e 100644 --- a/app/views/projects/index.html.haml +++ b/app/views/projects/index.html.haml @@ -23,6 +23,7 @@ - if current_user.can_create_project? %span.right = link_to new_project_path, :class => "btn very_small info" do + %i.icon-plus New Project - @projects.each do |project| = link_to project_path(project), :class => dom_class(project) do diff --git a/config/routes.rb b/config/routes.rb index e137ff717e12a9f492596f967175f36fede38a6a..d409d508723a1357770e2ea0ff4bdcfb18c280d6 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -35,6 +35,7 @@ Gitlab::Application.routes.draw do get "errors/githost" get "profile/password", :to => "profile#password" put "profile/password", :to => "profile#password_update" + get "profile/token", :to => "profile#token" put "profile/reset_private_token", :to => "profile#reset_private_token" get "profile", :to => "profile#show" get "profile/design", :to => "profile#design" diff --git a/spec/requests/profile_spec.rb b/spec/requests/profile_spec.rb index ea88a651f8ffe190b75defa77acd7365fbece6b7..6f9af6085aba6feced7b9dd3381ce68102ec92d4 100644 --- a/spec/requests/profile_spec.rb +++ b/spec/requests/profile_spec.rb @@ -30,7 +30,7 @@ describe "Profile" do describe "Reset private token" do before do - visit profile_password_path + visit profile_token_path end it "should reset private token" do