diff --git a/app/models/ability.rb b/app/models/ability.rb index 24b6ad1..3e78183 100644 --- a/app/models/ability.rb +++ b/app/models/ability.rb @@ -68,7 +68,7 @@ class Ability def project_report_rules project_guest_rules + [ :download_code, - :fork_project + :fork_project, :write_project_snippet ] end diff --git a/app/views/layouts/_head_panel.html.haml b/app/views/layouts/_head_panel.html.haml index 2ea6c3e..b214d51 100644 --- a/app/views/layouts/_head_panel.html.haml +++ b/app/views/layouts/_head_panel.html.haml @@ -18,6 +18,9 @@ %li = link_to public_root_path, title: "Public area", class: 'has_bottom_tooltip', 'data-original-title' => 'Public area' do %i.icon-globe + %li + = link_to snippets_path, title: "Snippets area", class: 'has_bottom_tooltip', 'data-original-title' => 'Public area' do + %i.icon-paste - if current_user.is_admin? %li = link_to admin_root_path, title: "Admin area", class: 'has_bottom_tooltip', 'data-original-title' => 'Admin area' do diff --git a/app/views/layouts/snippets.html.haml b/app/views/layouts/snippets.html.haml index 73b502e..147c9d9 100644 --- a/app/views/layouts/snippets.html.haml +++ b/app/views/layouts/snippets.html.haml @@ -4,19 +4,20 @@ %body{class: "#{app_theme} application"} = render "layouts/head_panel", title: "Snippets" = render "layouts/flash" + %nav.main-nav + .container + %ul + = nav_link(path: 'dashboard#show', html_options: {class: 'home'}) do + = link_to root_path, title: "Back to dashboard" do + %i.icon-home + = nav_link(path: 'snippet#new') do + = link_to new_snippet_path do + New snippet + = nav_link(path: 'snippets#user_index') do + = link_to user_snippets_path(@current_user) do + My snippets + = nav_link(path: 'snippets#index') do + = link_to snippets_path do + Discover snippets .container - %ul.main_menu - = nav_link(path: 'dashboard#show', html_options: {class: 'home'}) do - = link_to root_path, title: "Back to dashboard" do - %i.icon-arrow-left - = nav_link(path: 'snippet#new') do - = link_to new_snippet_path do - New snippet - = nav_link(path: 'snippets#user_index') do - = link_to user_snippets_path(@current_user) do - My snippets - = nav_link(path: 'snippets#index') do - = link_to snippets_path do - Discover snippets - .content= yield -- libgit2 0.21.2