Commit 8404ab46 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Add shortcut for project activity page

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent c2f02fc1
......@@ -64,6 +64,7 @@ class Dispatcher
shortcut_handler = new ShortcutsNavigation()
when 'projects:activity'
new Activities()
shortcut_handler = new ShortcutsNavigation()
when 'projects:show'
shortcut_handler = new ShortcutsNavigation()
when 'groups:show'
......
......@@ -4,6 +4,7 @@ class @ShortcutsNavigation extends Shortcuts
constructor: ->
super()
Mousetrap.bind('g p', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-project'))
Mousetrap.bind('g e', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-project-activity'))
Mousetrap.bind('g f', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-tree'))
Mousetrap.bind('g c', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-commits'))
Mousetrap.bind('g n', -> ShortcutsNavigation.findAndFollowLink('.shortcuts-network'))
......
......@@ -79,6 +79,12 @@
%td.shortcut
.key g
.key p
%td
Go to the project's home page
%tr
%td.shortcut
.key g
.key e
%td
Go to the project's activity feed
%tr
......
......@@ -4,8 +4,8 @@
= icon('home fw')
%span
Project
= nav_link(path: 'projects#activity', html_options: {class: 'activity'}) do
= link_to activity_project_path(@project), title: 'Project', data: {placement: 'right'} do
= nav_link(path: 'projects#activity') do
= link_to activity_project_path(@project), title: 'Project Activity', class: 'shortcuts-project-activity', data: {placement: 'right'} do
= icon('dashboard fw')
%span
Activity
......
......@@ -46,7 +46,13 @@ Feature: Project Shortcuts
Then the active main tab should be Wiki
@javascript
Scenario: Navigate to project feed
Scenario: Navigate to project home
Given I visit my project's files page
Given I press "g" and "p"
Then the active main tab should be Home
@javascript
Scenario: Navigate to project feed
Given I visit my project's files page
Given I press "g" and "e"
Then the active main tab should be Activity
......@@ -33,4 +33,9 @@ class Spinach::Features::ProjectShortcuts < Spinach::FeatureSteps
find('body').native.send_key('g')
find('body').native.send_key('w')
end
step 'I press "g" and "e"' do
find('body').native.send_key('g')
find('body').native.send_key('e')
end
end
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