Commit cd567ee40b660a5ff571d882ad1492f68dc07e23

Authored by Dmitriy Zaporozhets
1 parent fbd5296e

Titled dashboard, admin, profile areas. Wider top panel. Restored search input

app/assets/stylesheets/common.scss
@@ -97,7 +97,7 @@ $blue_link: "#2fa0bb"; @@ -97,7 +97,7 @@ $blue_link: "#2fa0bb";
97 min-width:$min_app_width; 97 min-width:$min_app_width;
98 max-width:$max_app_width; 98 max-width:$max_app_width;
99 margin:auto; 99 margin:auto;
100 - margin-top:52px; 100 + margin-top:62px;
101 } 101 }
102 102
103 .container-fluid > .sidebar { 103 .container-fluid > .sidebar {
app/assets/stylesheets/top_panel.scss
@@ -11,24 +11,25 @@ body header { @@ -11,24 +11,25 @@ body header {
11 -moz-box-shadow: 0 -1px 0 white inset; 11 -moz-box-shadow: 0 -1px 0 white inset;
12 -webkit-box-shadow: 0 -1px 0 white inset; 12 -webkit-box-shadow: 0 -1px 0 white inset;
13 13
14 - height:50px; 14 + height:60px;
15 15
16 .wrapper { 16 .wrapper {
17 margin:auto; 17 margin:auto;
18 min-width:$min_app_width; 18 min-width:$min_app_width;
19 max-width:$max_app_width; 19 max-width:$max_app_width;
20 position:relative; 20 position:relative;
21 - padding:10px $app_padding; 21 + padding:15px $app_padding;
22 } 22 }
23 23
24 .project_name { 24 .project_name {
25 float:left; 25 float:left;
26 width:400px; 26 width:400px;
  27 + margin:0;
27 margin-right:30px; 28 margin-right:30px;
28 - font-size:16px; 29 + font-size:20px;
  30 + line-height:28px;
29 font-weight:bold; 31 font-weight:bold;
30 - padding:8px;  
31 - color:#333; 32 + color:#666;
32 text-shadow: 0 1px 1px #FFF; 33 text-shadow: 0 1px 1px #FFF;
33 } 34 }
34 35
@@ -118,7 +119,7 @@ body header { @@ -118,7 +119,7 @@ body header {
118 header .account-box{ 119 header .account-box{
119 position: absolute; 120 position: absolute;
120 right: 0; 121 right: 0;
121 - top: 8px; 122 + top: 13px;
122 z-index: 10000; 123 z-index: 10000;
123 width: 128px; 124 width: 128px;
124 font-size: 11px; 125 font-size: 11px;
app/helpers/application_helper.rb
@@ -71,11 +71,11 @@ module ApplicationHelper @@ -71,11 +71,11 @@ module ApplicationHelper
71 71
72 if @project && !@project.new_record? 72 if @project && !@project.new_record?
73 project_nav = [ 73 project_nav = [
74 - { :label => "#{@project.code} / Issues", :url => project_issues_path(@project) },  
75 - { :label => "#{@project.code} / Wall", :url => wall_project_path(@project) },  
76 - { :label => "#{@project.code} / Tree", :url => tree_project_ref_path(@project, @project.root_ref) },  
77 - { :label => "#{@project.code} / Commits", :url => project_commits_path(@project) },  
78 - { :label => "#{@project.code} / Team", :url => team_project_path(@project) } 74 + { :label => "#{@project.name} / Issues", :url => project_issues_path(@project) },
  75 + { :label => "#{@project.name} / Wall", :url => wall_project_path(@project) },
  76 + { :label => "#{@project.name} / Tree", :url => tree_project_ref_path(@project, @project.root_ref) },
  77 + { :label => "#{@project.name} / Commits", :url => project_commits_path(@project) },
  78 + { :label => "#{@project.name} / Team", :url => team_project_path(@project) }
79 ] 79 ]
80 end 80 end
81 81
@@ -83,11 +83,15 @@ module ApplicationHelper @@ -83,11 +83,15 @@ module ApplicationHelper
83 end 83 end
84 84
85 def project_layout 85 def project_layout
86 - @project && !@project.new_record? 86 + layout == "project"
  87 + end
  88 +
  89 + def admin_layout
  90 + layout == "admin"
87 end 91 end
88 92
89 def profile_layout 93 def profile_layout
90 - controller.controller_name == "dashboard" || current_page?(projects_path) || controller.controller_name == "profile" || controller.controller_name == "keys" 94 + layout == "profile"
91 end 95 end
92 96
93 def help_layout 97 def help_layout
@@ -97,4 +101,8 @@ module ApplicationHelper @@ -97,4 +101,8 @@ module ApplicationHelper
97 def ldap_enable? 101 def ldap_enable?
98 Devise.omniauth_providers.include?(:ldap) 102 Devise.omniauth_providers.include?(:ldap)
99 end 103 end
  104 +
  105 + def layout
  106 + controller.send :_layout
  107 + end
100 end 108 end
app/views/layouts/_head_panel.html.haml
@@ -6,9 +6,8 @@ @@ -6,9 +6,8 @@
6 = link_to root_path, :class => "home", :title => "Home" do 6 = link_to root_path, :class => "home", :title => "Home" do
7 = image_tag "logo.png", :width => 100 7 = image_tag "logo.png", :width => 100
8 8
9 - - if project_layout  
10 - .project_name  
11 - = truncate @project.name, :length => 35 9 + %h1.project_name= title
  10 + .search= text_field_tag "search", nil, :placeholder => "Search", :class => "search-input xlarge"
12 11
13 12
14 .account-box 13 .account-box
@@ -18,3 +17,20 @@ @@ -18,3 +17,20 @@
18 = link_to profile_path, :class => "username" do 17 = link_to profile_path, :class => "username" do
19 My profile 18 My profile
20 = link_to 'Logout', destroy_user_session_path, :class => "logout", :method => :delete 19 = link_to 'Logout', destroy_user_session_path, :class => "logout", :method => :delete
  20 +
  21 +:javascript
  22 + $(function(){
  23 + $("#search").autocomplete({
  24 + source: #{raw search_autocomplete_source},
  25 + select: function(event, ui) { location.href = ui.item.url }
  26 + });
  27 +
  28 + $(document).keypress(function(e) {
  29 + if( $(e.target).is(":input") ) return;
  30 + switch(e.which) {
  31 + case 115: focusSearch();
  32 + e.preventDefault();
  33 + }
  34 + });
  35 + });
  36 +
app/views/layouts/admin.html.haml
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
2 %html{ :lang => "en"} 2 %html{ :lang => "en"}
3 = render "layouts/head" 3 = render "layouts/head"
4 %body.admin 4 %body.admin
5 - = render :partial => "layouts/flash"  
6 - = render :partial => "layouts/head_panel" 5 + = render "layouts/flash"
  6 + = render "layouts/head_panel", :title => "Admin area"
7 .container-fluid 7 .container-fluid
8 .sidebar 8 .sidebar
9 .fixed 9 .fixed
app/views/layouts/application.html.haml
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
2 %html{ :lang => "en"} 2 %html{ :lang => "en"}
3 = render "layouts/head" 3 = render "layouts/head"
4 %body.application 4 %body.application
5 - = render :partial => "layouts/flash"  
6 - = render :partial => "layouts/head_panel" 5 + = render "layouts/flash"
  6 + = render "layouts/head_panel", :title => "Dashboard"
7 .container-fluid 7 .container-fluid
8 .sidebar 8 .sidebar
9 = render :partial => "layouts/app_side" 9 = render :partial => "layouts/app_side"
app/views/layouts/profile.html.haml
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
2 %html{ :lang => "en"} 2 %html{ :lang => "en"}
3 = render "layouts/head" 3 = render "layouts/head"
4 %body.profile 4 %body.profile
5 - = render :partial => "layouts/flash"  
6 - = render :partial => "layouts/head_panel" 5 + = render "layouts/flash"
  6 + = render "layouts/head_panel", :title => "Profile"
7 .container-fluid 7 .container-fluid
8 .sidebar 8 .sidebar
9 %aside 9 %aside
app/views/layouts/project.html.haml
@@ -2,8 +2,8 @@ @@ -2,8 +2,8 @@
2 %html{ :lang => "en"} 2 %html{ :lang => "en"}
3 = render "layouts/head" 3 = render "layouts/head"
4 %body.project 4 %body.project
5 - = render :partial => "layouts/flash"  
6 - = render :partial => "layouts/head_panel" 5 + = render "layouts/flash"
  6 + = render "layouts/head_panel", :title => @project.name
7 .container-fluid 7 .container-fluid
8 .sidebar= render :partial => "layouts/project_side" 8 .sidebar= render :partial => "layouts/project_side"
9 .content 9 .content