Project

General

Profile

Feature #31353 » 0001-wip-antonio-edition-0.9em-topbar-fontsize.patch

Anonymous, 2019-09-29 16:01

View differences:

app/views/layouts/base.html.erb (working copy)
60 60

  
61 61
<div id="wrapper2">
62 62
<div id="wrapper3">
63
<div id="top-menu">
64
    <div id="account">
65
        <%= render_menu :account_menu -%>
66
    </div>
67
    <%= content_tag('div', "#{l(:label_logged_as)} #{link_to_user(User.current, :format => :username)}".html_safe, :id => 'loggedas') if User.current.logged? %>
63
<nav id="top-menu">
64
  <nav class="general-menu">
68 65
    <%= render_menu :top_menu if User.current.logged? || !Setting.login_required? -%>
69
</div>
66
  </nav>
67
  <nav class="profile-menu">
68
    <ul class="nav-list">
69
      <% if User.current.logged? || !Setting.login_required? %>
70
        <li class="nav-item">
71
          <div id="quick-search">
72
              <%= form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get ) do %>
73
              <%= hidden_field_tag 'scope', default_search_project_scope, :id => nil %>
74
              <%= hidden_field_tag(controller.default_search_scope, 1, :id => nil) if controller.default_search_scope %>
75
              <label for='q'>
76
                <%= link_to l(:label_search), {:controller => 'search', :action => 'index', :id => @project, :scope => default_search_project_scope}, :accesskey => accesskey(:search) %>:
77
              </label>
78
              <%= text_field_tag 'q', @question, :size => 20, :class => 'small', :accesskey => accesskey(:quick_search),
79
                                  :data => {
80
                                      :auto_complete => true,
81
                                      :issues_url => auto_complete_issues_path(:q => '')
82
                                  } %>
83
              <% end %>
84
          </div>
85
        </li>
86
        <li class="nav-item">
87
          <%= render_project_jump_box %>
88
        </li>
89
      <% end %>
90
      <% if User.current.logged? %>
91
        <li class="nav-item avatar-menu drdn">
92
          <a href="#" class="drdn-trigger" onclick="toggleNewObjectDropdown(); return false;">
93
            <%= Setting.gravatar_enabled? ? avatar(User.current, :size => '22') : User.current.login.to_s %>
94
            <span class="icon-only icon-expended" ></span>
95
          </a>
96
          <div class="drdn-content">
97
            <div class="drdn-items">
98
              <ul id="loggedas"><li>
99
                  <span class="name"><%= User.current.name %></span>
100
                  <%= link_to("@" + User.current.login, user_url(User.current)) %>
101
              </li></ul>
102
              <span class="divider"></span>
103
              <%= render_menu(:account_menu, nil, :class => 'account-menu') -%>
104
            </div>
105
          </div>
106
        </li>
107
        <% else %>
108
        <li class="nav-item">
109
          <div id="account">
110
            <%= render_menu :account_menu -%>
111
          </div>
112
        </li
113
      <% end %>
114
     </ul>
115
  </nav>
116
</nav>
70 117

  
71 118
<div id="header">
72 119

  
73 120
    <a href="#" class="mobile-toggle-button js-flyout-menu-toggle-button"></a>
74 121

  
75
    <% if User.current.logged? || !Setting.login_required? %>
76
    <div id="quick-search">
77
        <%= form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get ) do %>
78
        <%= hidden_field_tag 'scope', default_search_project_scope, :id => nil %>
79
        <%= hidden_field_tag(controller.default_search_scope, 1, :id => nil) if controller.default_search_scope %>
80
        <label for='q'>
81
          <%= link_to l(:label_search), {:controller => 'search', :action => 'index', :id => @project, :scope => default_search_project_scope}, :accesskey => accesskey(:search) %>:
82
        </label>
83
        <%= text_field_tag 'q', @question, :size => 20, :class => 'small', :accesskey => accesskey(:quick_search),
84
                            :data => {
85
                                :auto_complete => true,
86
                                :issues_url => auto_complete_issues_path(:q => '')
87
                            } %>
88
        <% end %>
89
        <%= render_project_jump_box %>
90
    </div>
91
    <% end %>
92

  
93 122
    <h1><%= page_header_title %></h1>
94 123

  
95 124
    <% if display_main_menu?(@project) %>
96
    <div id="main-menu" class="tabs">
125
    <nav id="main-menu" class="tabs">
97 126
        <%= render_main_menu(@project) %>
98 127
        <div class="tabs-buttons" style="display:none;">
99 128
            <button class="tab-left" onclick="moveTabLeft(this); return false;"></button>
100 129
            <button class="tab-right" onclick="moveTabRight(this); return false;"></button>
101 130
        </div>
102
    </div>
131
    </nav>
103 132
    <% end %>
104 133
</div>
105 134

  
lib/redmine/menu_manager.rb (working copy)
110 110
        menu_name.present? && Redmine::MenuManager.items(menu_name).children.present?
111 111
      end
112 112

  
113
      def render_menu(menu, project=nil)
113
      def render_menu(menu, project=nil, options={})
114 114
        links = []
115 115
        menu_items_for(menu, project) do |node|
116 116
          links << render_menu_node(node, project)
117 117
        end
118
        links.empty? ? nil : content_tag('ul', links.join.html_safe)
118
        default_options = {:class => 'nav-list'}
119
        options = default_options.merge(options)
120
        links.empty? ? nil : content_tag('ul', links.join.html_safe, options)
119 121
      end
120 122

  
121 123
      def render_menu_node(node, project=nil)
......
124 126
        else
125 127
          caption, url, selected = extract_node_details(node, project)
126 128
          return content_tag('li',
127
                               render_single_menu_node(node, caption, url, selected))
129
                               render_single_menu_node(node, caption, url, selected), :class => 'nav-item')
128 130
        end
129 131
      end
130 132

  
......
132 134
        caption, url, selected = extract_node_details(node, project)
133 135

  
134 136
        html = [].tap do |html|
135
          html << '<li>'
137
          html << '<li class="nav-item">'
136 138
          # Parent
137 139
          html << render_single_menu_node(node, caption, url, selected)
138 140

  
public/javascripts/application.js (working copy)
892 892
  $('input[data-disables], input[data-enables], input[data-shows]').each(toggleDisabledOnChange);
893 893
}
894 894

  
895
function toggleNewObjectDropdown() {
896
  var dropdown = $('#new-object + ul.menu-children');
895
function toggleNewObjectDropdown(element) {
896
  var dropdown = $(element).next('.menu-children');
897 897
  if(dropdown.hasClass('visible')){
898 898
    dropdown.removeClass('visible');
899 899
  }else{
public/stylesheets/application.css (working copy)
15 15
#wrapper {background: white;overflow: hidden;}
16 16
#wrapper3 { display: flex; flex-direction: column; }
17 17

  
18
#top-menu {background: #3E5B76; color: #fff; height:1.8em; font-size: 0.8em; padding: 2px 2px 0px 6px;}
19
#top-menu ul {margin: 0;  padding: 0;}
20
#top-menu li {
21
  float:left;
22
  list-style-type:none;
23
  margin: 0px 0px 0px 0px;
24
  padding: 0px 0px 0px 0px;
25
  white-space:nowrap;
18
#top-menu *, *::before, *::after {
19
  box-sizing: border-box;
26 20
}
27
#top-menu a {color: #fff; margin-right: 8px; font-weight: bold;}
28
#top-menu #loggedas { float: right; margin-right: 0.5em; color: #fff; }
29

  
30
#account {float:right;}
31

  
32
#header {min-height:5.3em;margin:0;background-color:#628DB6;color:#f8f8f8; padding: 4px 8px 20px 6px; position:relative;}
21
#top-menu {background: #3E5B76; padding: 0px 6px 0px 6px; display: flex; font-size: 0.9em;}
22
#top-menu > nav {
23
  line-height: 24px;
24
  padding: 6px 0 6px 0;
25
}
26
#top-menu .general-menu {
27
  align-items: stretch;
28
  flex: 1 1 auto;
29
}
30
#top-menu .profile-menu {
31
  flex: 0 0 auto;
32
  border-top: 0;
33
}
34
#top-menu ul.nav-list > li.nav-item {
35
  margin-right: 8px;
36
}
37
#top-menu ul.nav-list > li.nav-item:last-child {
38
  margin-right: 0;
39
}
40
#top-menu ul.nav-list li.nav-item > a {
41
  color: #fff;
42
}
43
#top-menu .profile-menu li.avatar-menu .drdn-content {
44
  padding-top: 5px;
45
}
46
#top-menu .profile-menu li.avatar-menu li {
47
  flex-direction: column;
48
}
49
#top-menu .profile-menu li.avatar-menu li a {
50
  width: 100%;
51
  display: block;
52
  padding: 4px;
53
}
54
#top-menu .profile-menu li.avatar-menu:hover > a {
55
  text-decoration: none;
56
}
57
#top-menu .profile-menu li.avatar-menu img.gravatar {
58
  border: 1px solid #dfdfdf;
59
  margin-right: 4px;
60
}
61
#top-menu .profile-menu li.avatar-menu:hover img.gravatar {
62
  border: 1px solid #fff;
63
}
64
#top-menu .profile-menu li.avatar-menu ul {
65
  padding: 0;
66
  min-width: 200px;
67
}
68
#loggedas span.name {
69
  font-weight: 600;
70
  padding: 4px;
71
}
72
#loggedas span.login {
73
  display: block;
74
}
75
#header {min-height:5.3em;margin:0;background-color:#628DB6;color:#f8f8f8; padding: 4px 8px 0 6px;}
33 76
#header a {color:#f8f8f8;}
34 77
#header h1 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
35 78
#header h1 .breadcrumbs { display:block; font-size: .5em; font-weight: normal; }
36 79

  
37
#quick-search {float:right;}
38
#quick-search #q {width:130px; height:24px; box-sizing:border-box; vertical-align:middle; border:1px solid #ccc; border-radius:3px;}
80
#quick-search label, #quick-search label a {color: #fff;}
81
#quick-search #q {width:130px; height:24px;}
39 82

  
40
#main-menu {position: absolute;  bottom: 0px;  left:6px; margin-right: -500px; width: 100%;}
41
#main-menu ul {margin: 0;  padding: 0; width: 100%; white-space: nowrap;}
42
#main-menu li {
43
  float:none;
44
  list-style-type:none;
45
  margin: 0px 2px 0px 0px;
46
  padding: 0px 0px 0px 0px;
47
  white-space:nowrap;
48
  display:inline-block;
49
}
50
#main-menu li a {
51
  display: block;
83
#main-menu {margin-right: -500px; width: 100%;}
84
#main-menu li.nav-item a {
52 85
  color: #fff;
53 86
  text-decoration: none;
54 87
  font-weight: bold;
55
  margin: 0;
88
  display: block;
56 89
  padding: 4px 10px 4px 10px;
57 90
  border-top-left-radius: 3px;
58 91
  border-top-right-radius: 3px;
......
149 182

  
150 183
a#toggle-completed-versions {color:#999;}
151 184

  
185
/***** Navigation *****/
186
nav ul.nav-list {
187
  margin: 0;
188
  padding: 0;
189
  width: 100%;
190
  white-space: nowrap;
191
  display: flex;
192
  flex-direction: row;
193
}
194
nav ul.nav-list li.nav-item {
195
  list-style-type: none;
196
  margin: 0;
197
  padding: 0;
198
  white-space: nowrap;
199
}
200
nav ul.nav-list li.nav-item > a {
201
  padding: 4px;
202
}
152 203
/***** Dropdown *****/
153 204
.drdn {position:relative;}
154 205
.drdn-trigger {
......
165 216
  display:none;
166 217
  position:absolute;
167 218
  right:0px;
168
  top:25px;
219
  top:28px;
169 220
  min-width:100px;
170 221
  background-color:#fff;
171 222
  border:1px solid #ccc;
172
  border-radius:4px;
223
  border-radius:3px;
173 224
  color:#555;
174 225
  z-index:99;
226
  overflow: hidden;
175 227
}
228
.drdn-content .divider {
229
  height: 1px;
230
  background-color: #ccc;
231
  padding: 0;
232
  margin: 0;
233
  border: 0;
234
}
176 235
.drdn.expanded .drdn-content {display:block;}
177 236

  
178 237
.drdn-content .quick-search {margin:8px;}
......
182 241
div + .drdn-items {border-top:1px solid #ccc;}
183 242
.drdn-items>* {
184 243
  display:block;
185
  border:1px solid #fff;
186 244
  overflow:hidden;
187 245
  text-overflow: ellipsis;
188 246
  white-space:nowrap;
......
207 265
  border: none;
208 266
}
209 267
.drdn-items>span {color:#999;}
210

  
211 268
.contextual .drdn-content {top:18px;}
212 269
.contextual .drdn-items {padding:2px;}
213 270
.contextual .drdn-items>a:hover {color:#2A5685; border:1px solid #628db6; background-color:#eef5fd; border-radius:3px;}
......
216 273
#project-jump .drdn-trigger {
217 274
  width:100%;
218 275
  height:24px;
276
  line-height: 16px;
219 277
  display:inline-block;
220 278
  padding:3px 18px 3px 6px;
221 279
  border-radius:3px;
222 280
  border:1px solid #ccc;
223
  margin:0 !important;
224 281
  vertical-align:middle;
225 282
  color:#555;
226 283
  background:#fff url(../images/arrow_down.png) no-repeat 97% 50%;
227 284
}
228 285
#project-jump .drdn.expanded .drdn-trigger {background-image:url(../images/arrow_up.png);}
229 286
#project-jump .drdn-content {width:280px;}
230
#project-jump .drdn-items>* {color:#555 !important;}
231
#project-jump .drdn-items>a:hover {background-color:#759FCF; color:#fff !important;}
287
#project-jump .drdn-items>*, .avatar-menu .drdn-items * {color:#555 !important;}
288
#project-jump .drdn-items>a:hover, .avatar-menu .drdn-items a:hover {background-color:#759FCF; color:#fff !important; text-decoration: none;}
232 289

  
233 290
/***** Tables *****/
234 291
table.list, .table-list { border: 1px solid #e4e4e4; width: 100%; margin-bottom: 4px; border-radius: 3px; border-spacing: 0; overflow: hidden;}
(6-6/15)