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

This commit is contained in:
Dmitriy Zaporozhets 2012-05-19 12:00:46 +03:00
parent eb25bfe2b2
commit 1e4d15b406
13 changed files with 108 additions and 92 deletions

View file

@ -4,7 +4,7 @@
%p
%strong= key.title
%td
%span.right.cgray
%span.cgray
Added
= time_ago_in_words(key.created_at)
ago

View file

@ -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})

View file

@ -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)

View file

@ -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

View file

@ -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

View file

@ -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"

View file

@ -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"

View file

@ -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