Commit 8cadeb67 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

nav views refactoring

parent 19ab03f4
/* .main-nav {
* Main Menu of Application
*
*/
ul.main_menu {
margin: auto;
margin: 30px 0; margin: 30px 0;
margin-top: 10px; margin-top: 10px;
height: 38px; border-bottom: 1px solid #E1E1E1;
position: relative;
overflow: hidden; ul {
.count { margin: auto;
height: 39px;
position: relative; position: relative;
top: -1px; top: 3px;
display: inline-block; overflow: hidden;
height: 15px; .count {
margin: 0 0 0 5px; position: relative;
padding: 0 8px 1px 8px; top: -1px;
height: auto; display: inline-block;
font-size: 0.82em; height: 15px;
line-height: 14px; margin: 0 0 0 5px;
text-align: center; padding: 0 8px 1px 8px;
color: #777; height: auto;
} font-size: 0.82em;
.label { line-height: 14px;
background: $hover; text-align: center;
text-shadow: none; color: #777;
color: $style_color; }
} .label {
li { background: $hover;
list-style-type: none; text-shadow: none;
margin: 0; color: $style_color;
display: table-cell;
width: 1%;
border-bottom: 2px solid #EEE;
&.active {
border-bottom: 2px solid #474D57;
a {
color: $style_color;
}
} }
li {
list-style-type: none;
margin: 0;
display: table-cell;
width: 1%;
&.active {
border-bottom: 3px solid #777;
a {
color: $style_color;
font-weight: bolder;
}
}
&.home { &.home {
a { a {
i { i {
font-size: 20px; font-size: 20px;
position: relative; position: relative;
top: 4px; top: 4px;
}
} }
} }
} }
} a {
a { display: block;
display: block; text-align: center;
text-align: center; font-weight: normal;
font-weight: normal; height: 36px;
height: 36px; line-height: 34px;
line-height: 36px; color: #777;
color: #777; text-shadow: 0 1px 1px white;
text-shadow: 0 1px 1px white; padding: 0 10px;
padding: 0 10px; }
} }
} }
/*
* End of Main Menu
*
*/
...@@ -4,24 +4,8 @@ ...@@ -4,24 +4,8 @@
%body{class: "#{app_theme} admin"} %body{class: "#{app_theme} admin"}
= render "layouts/head_panel", title: "Admin area" = render "layouts/head_panel", title: "Admin area"
= render "layouts/flash" = render "layouts/flash"
.container %nav.main-nav
%ul.main_menu .container= render 'layouts/nav/admin'
= nav_link(controller: :dashboard, html_options: {class: 'home'}) do
= link_to admin_root_path, title: "Stats" do
%i.icon-home
= nav_link(controller: :projects) do
= link_to "Projects", admin_projects_path
= nav_link(controller: :teams) do
= link_to "Teams", admin_teams_path
= nav_link(controller: :groups) do
= link_to "Groups", admin_groups_path
= nav_link(controller: :users) do
= link_to "Users", admin_users_path
= nav_link(controller: :logs) do
= link_to "Logs", admin_logs_path
= nav_link(controller: :hooks) do
= link_to "Hooks", admin_hooks_path
= nav_link(controller: :resque) do
= link_to "Background Jobs", admin_resque_path
.container
.content= yield .content= yield
...@@ -4,25 +4,8 @@ ...@@ -4,25 +4,8 @@
%body{class: "#{app_theme} application"} %body{class: "#{app_theme} application"}
= render "layouts/head_panel", title: "Dashboard" = render "layouts/head_panel", title: "Dashboard"
= render "layouts/flash" = render "layouts/flash"
.container %nav.main-nav
%ul.main_menu .container= render 'layouts/nav/dashboard'
= nav_link(path: 'dashboard#show', html_options: {class: 'home'}) do
= link_to root_path, title: "Home" do
%i.icon-home
= nav_link(path: 'dashboard#projects') do
= link_to projects_dashboard_path do
Projects
= nav_link(path: 'dashboard#issues') do
= link_to issues_dashboard_path do
Issues
%span.count= current_user.assigned_issues.opened.count
= nav_link(path: 'dashboard#merge_requests') do
= link_to merge_requests_dashboard_path do
Merge Requests
%span.count= current_user.cared_merge_requests.opened.count
= nav_link(path: 'search#show') do
= link_to "Search", search_path
= nav_link(controller: :help) do
= link_to "Help", help_path
.container
.content= yield .content= yield
...@@ -4,25 +4,8 @@ ...@@ -4,25 +4,8 @@
%body{class: "#{app_theme} application"} %body{class: "#{app_theme} application"}
= render "layouts/head_panel", title: "group: #{@group.name}" = render "layouts/head_panel", title: "group: #{@group.name}"
= render "layouts/flash" = render "layouts/flash"
.container %nav.main-nav
%ul.main_menu .container= render 'layouts/nav/group'
= nav_link(path: 'groups#show', html_options: {class: 'home'}) do
= link_to group_path(@group), title: "Home" do
%i.icon-home
= nav_link(path: 'groups#issues') do
= link_to issues_group_path(@group) do
Issues
%span.count= current_user.assigned_issues.opened.of_group(@group).count
= nav_link(path: 'groups#merge_requests') do
= link_to merge_requests_group_path(@group) do
Merge Requests
%span.count= current_user.cared_merge_requests.opened.of_group(@group).count
= nav_link(path: 'groups#people') do
= link_to "People", people_group_path(@group)
- if can?(current_user, :manage_group, @group)
= nav_link(path: 'groups#edit') do
= link_to edit_group_path(@group), class: "tab " do
Settings
.container
.content= yield .content= yield
%ul
= nav_link(controller: :dashboard, html_options: {class: 'home'}) do
= link_to admin_root_path, title: "Stats" do
%i.icon-home
= nav_link(controller: :projects) do
= link_to "Projects", admin_projects_path
= nav_link(controller: :teams) do
= link_to "Teams", admin_teams_path
= nav_link(controller: :groups) do
= link_to "Groups", admin_groups_path
= nav_link(controller: :users) do
= link_to "Users", admin_users_path
= nav_link(controller: :logs) do
= link_to "Logs", admin_logs_path
= nav_link(controller: :hooks) do
= link_to "Hooks", admin_hooks_path
= nav_link(controller: :resque) do
= link_to "Background Jobs", admin_resque_path
%ul
= nav_link(path: 'dashboard#show', html_options: {class: 'home'}) do
= link_to root_path, title: "Home" do
%i.icon-home
= nav_link(path: 'dashboard#projects') do
= link_to projects_dashboard_path do
Projects
= nav_link(path: 'dashboard#issues') do
= link_to issues_dashboard_path do
Issues
%span.count= current_user.assigned_issues.opened.count
= nav_link(path: 'dashboard#merge_requests') do
= link_to merge_requests_dashboard_path do
Merge Requests
%span.count= current_user.cared_merge_requests.opened.count
= nav_link(path: 'search#show') do
= link_to "Search", search_path
= nav_link(controller: :help) do
= link_to "Help", help_path
%ul
= nav_link(path: 'groups#show', html_options: {class: 'home'}) do
= link_to group_path(@group), title: "Home" do
%i.icon-home
= nav_link(path: 'groups#issues') do
= link_to issues_group_path(@group) do
Issues
%span.count= current_user.assigned_issues.opened.of_group(@group).count
= nav_link(path: 'groups#merge_requests') do
= link_to merge_requests_group_path(@group) do
Merge Requests
%span.count= current_user.cared_merge_requests.opened.of_group(@group).count
= nav_link(path: 'groups#people') do
= link_to "People", people_group_path(@group)
- if can?(current_user, :manage_group, @group)
= nav_link(path: 'groups#edit') do
= link_to edit_group_path(@group), class: "tab " do
Settings
%ul
= nav_link(path: 'profiles#show', html_options: {class: 'home'}) do
= link_to profile_path, title: "Profile" do
%i.icon-home
= nav_link(path: 'profiles#account') do
= link_to "Account", account_profile_path
= nav_link(controller: :notifications) do
= link_to "Notifications", profile_notifications_path
= nav_link(controller: :keys) do
= link_to keys_path do
SSH Keys
%span.count= current_user.keys.count
= nav_link(path: 'profiles#design') do
= link_to "Design", design_profile_path
= nav_link(path: 'profiles#history') do
= link_to "History", history_profile_path
%ul
= nav_link(path: 'projects#show', html_options: {class: "home"}) do
= link_to project_path(@project), title: "Project" do
%i.icon-home
- unless @project.empty_repo?
- if can? current_user, :download_code, @project
= nav_link(controller: %w(tree blob blame)) do
= link_to 'Files', project_tree_path(@project, @ref || @repository.root_ref)
= nav_link(controller: %w(commit commits compare repositories protected_branches)) do
= link_to "Commits", project_commits_path(@project, @ref || @repository.root_ref)
= nav_link(controller: %w(graph)) do
= link_to "Network", project_graph_path(@project, @ref || @repository.root_ref)
- if @project.issues_enabled
= nav_link(controller: %w(issues milestones labels)) do
= link_to url_for_project_issues do
Issues
- if @project.used_default_issues_tracker?
%span.count.issue_counter= @project.issues.opened.count
- if @project.repo_exists? && @project.merge_requests_enabled
= nav_link(controller: :merge_requests) do
= link_to project_merge_requests_path(@project) do
Merge Requests
%span.count.merge_counter= @project.merge_requests.opened.count
- if @project.wiki_enabled
= nav_link(controller: :wikis) do
= link_to 'Wiki', project_wiki_path(@project, :home)
- if @project.wall_enabled
= nav_link(controller: :walls) do
= link_to 'Wall', project_wall_path(@project)
- if @project.snippets_enabled
= nav_link(controller: :snippets) do
= link_to 'Snippets', project_snippets_path(@project)
- if can? current_user, :admin_project, @project
= nav_link(html_options: {class: "#{project_tab_class}"}) do
= link_to edit_project_path(@project), class: "stat-tab tab " do
Settings
%ul
= nav_link(path: 'teams#show', html_options: {class: 'home'}) do
= link_to team_path(@team), title: "Home" do
%i.icon-home
= nav_link(path: 'teams#issues') do
= link_to issues_team_path(@team) do
Issues
%span.count= Issue.opened.of_user_team(@team).count
= nav_link(path: 'teams#merge_requests') do
= link_to merge_requests_team_path(@team) do
Merge Requests
%span.count= MergeRequest.opened.of_user_team(@team).count
= nav_link(controller: [:members]) do
= link_to team_members_path(@team), class: "team-tab tab" do
Members
%span.count= @team.members.count
- if can? current_user, :admin_user_team, @team
= nav_link(path: 'teams#edit') do
= link_to edit_team_path(@team), class: "stat-tab tab " do
Settings
...@@ -4,22 +4,8 @@ ...@@ -4,22 +4,8 @@
%body{class: "#{app_theme} profile"} %body{class: "#{app_theme} profile"}
= render "layouts/head_panel", title: "Profile" = render "layouts/head_panel", title: "Profile"
= render "layouts/flash" = render "layouts/flash"
.container %nav.main-nav
%ul.main_menu .container= render 'layouts/nav/profile'
= nav_link(path: 'profiles#show', html_options: {class: 'home'}) do
= link_to profile_path, title: "Profile" do
%i.icon-home
= nav_link(path: 'profiles#account') do
= link_to "Account", account_profile_path
= nav_link(controller: :notifications) do
= link_to "Notifications", profile_notifications_path
= nav_link(controller: :keys) do
= link_to keys_path do
SSH Keys
%span.count= current_user.keys.count
= nav_link(path: 'profiles#design') do
= link_to "Design", design_profile_path
= nav_link(path: 'profiles#history') do
= link_to "History", history_profile_path
.container
.content= yield .content= yield
...@@ -7,49 +7,8 @@ ...@@ -7,49 +7,8 @@
- if can?(current_user, :download_code, @project) - if can?(current_user, :download_code, @project)
= render 'shared/no_ssh' = render 'shared/no_ssh'
.container %nav.main-nav
%ul.main_menu .container= render 'layouts/nav/project'
= nav_link(path: 'projects#show', html_options: {class: "home"}) do
= link_to project_path(@project), title: "Project" do
%i.icon-home
- unless @project.empty_repo?
- if can? current_user, :download_code, @project
= nav_link(controller: %w(tree blob blame)) do
= link_to 'Files', project_tree_path(@project, @ref || @repository.root_ref)
= nav_link(controller: %w(commit commits compare repositories protected_branches)) do
= link_to "Commits", project_commits_path(@project, @ref || @repository.root_ref)
= nav_link(controller: %w(graph)) do
= link_to "Network", project_graph_path(@project, @ref || @repository.root_ref)
- if @project.issues_enabled
= nav_link(controller: %w(issues milestones labels)) do
= link_to url_for_project_issues do
Issues
- if @project.used_default_issues_tracker?
%span.count.issue_counter= @project.issues.opened.count
- if @project.repo_exists? && @project.merge_requests_enabled
= nav_link(controller: :merge_requests) do
= link_to project_merge_requests_path(@project) do
Merge Requests
%span.count.merge_counter= @project.merge_requests.opened.count
- if @project.wiki_enabled
= nav_link(controller: :wikis) do
= link_to 'Wiki', project_wiki_path(@project, :home)
- if @project.wall_enabled
= nav_link(controller: :walls) do
= link_to 'Wall', project_wall_path(@project)
- if @project.snippets_enabled
= nav_link(controller: :snippets) do
= link_to 'Snippets', project_snippets_path(@project)
- if can? current_user, :admin_project, @project
= nav_link(html_options: {class: "#{project_tab_class}"}) do
= link_to edit_project_path(@project), class: "stat-tab tab " do
Settings
.container
.content= yield .content= yield
...@@ -4,30 +4,8 @@ ...@@ -4,30 +4,8 @@
%body{class: "#{app_theme} application"} %body{class: "#{app_theme} application"}
= render "layouts/head_panel", title: "team: #{@team.name}" = render "layouts/head_panel", title: "team: #{@team.name}"
= render "layouts/flash" = render "layouts/flash"
.container %nav.main-nav
%ul.main_menu .container= render 'layouts/nav/team'
= nav_link(path: 'teams#show', html_options: {class: 'home'}) do
= link_to team_path(@team), title: "Home" do
%i.icon-home
= nav_link(path: 'teams#issues') do
= link_to issues_team_path(@team) do
Issues
%span.count= Issue.opened.of_user_team(@team).count
= nav_link(path: 'teams#merge_requests') do
= link_to merge_requests_team_path(@team) do
Merge Requests
%span.count= MergeRequest.opened.of_user_team(@team).count
= nav_link(controller: [:members]) do
= link_to team_members_path(@team), class: "team-tab tab" do
Members
%span.count= @team.members.count
- if can? current_user, :admin_user_team, @team
= nav_link(path: 'teams#edit') do
= link_to edit_team_path(@team), class: "stat-tab tab " do
Settings
.container
.content= yield .content= yield
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