Commit 1e4d15b4 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Password & token split up, icon to button for top panel

parent eb25bfe2
......@@ -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;
}
}
}
......
......@@ -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
......
......@@ -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
......@@ -4,7 +4,7 @@
%p
%strong= key.title
%td
%span.right.cgray
%span.cgray
Added
= time_ago_in_words(key.created_at)
ago
......
......@@ -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})
......@@ -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)
......
......@@ -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
......
......@@ -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
......
.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"
%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"
......@@ -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
......
......@@ -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"
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment