Add "tag" icon to orbit bar

This commit is contained in:
chris 2013-01-09 21:16:29 +08:00
parent d8f6ebb153
commit 1d405c3ffe
4 changed files with 49 additions and 6 deletions

View File

@ -282,4 +282,9 @@ module ApplicationHelper
end
end
# NTU link
def get_link(site_number)
"http://#{request.host}:2#{site_number}00"
end
end

View File

@ -13,13 +13,21 @@
<!-- <li><a href="<%= desktop_path %>" data-icon="&#xe060;"></a></li> -->
</ul>
<ul class="nav pull-right">
<li class="dropdown">
<a class="dropdown-toggle" data-icon="&#xe02d;" href="#" data-toggle="dropdown"></a>
<ul class="dropdown-menu">
<% t('ntu.site_names').each do |site| %>
<li><%= link_to site[1], get_link(site[0]) %></li>
<% end %>
</ul>
</li>
<li class="dropdown language">
<a class="dropdown-toggle" href="#" data-toggle="dropdown" data-icon="&#xe054;"></a>
<ul class="dropdown-menu language-menu">
<% @site_in_use_locales.each do |locale| %>
<%= content_tag :li, (link_to t(:_locale, :locale => locale), add_locale(remove_locale((referer rescue request.fullpath)), locale)), :class => (I18n.locale.eql?(locale.to_sym) ? 'active' : nil) %>
<% end %>
</ul>
<a class="dropdown-toggle" href="#" data-toggle="dropdown" data-icon="&#xe054;"></a>
<ul class="dropdown-menu language-menu">
<% @site_in_use_locales.each do |locale| %>
<%= content_tag :li, (link_to t(:_locale, :locale => locale), add_locale(remove_locale((referer rescue request.fullpath)), locale)), :class => (I18n.locale.eql?(locale.to_sym) ? 'active' : nil) %>
<% end %>
</ul>
</li>
<li class="search clear" title="<%= t :search_google %>">
<a class="orbit-bar-search" href="#" data-icon="&#xe024;"></a>

15
config/locales/ntu.en.yml Normal file
View File

@ -0,0 +1,15 @@
en:
ntu:
site_names:
"00": "Dean of General Affairs"
"01": "Documentation Division"
"02": "Cashier Division"
"03": "General Service Division"
"04": "General Affairs Division, College of Social Science"
"05": "Property Management Division"
"06": "Procurement Division"
"07": "Facilities Service Division"
"08": "General Service Division"
"09": "Campus Security"
"10": "Construction and Maintenance Division"

View File

@ -0,0 +1,15 @@
zh_tw:
ntu:
site_names:
"00": "總務處"
"01": "文書組"
"02": "出納組"
"03": "事務組"
"04": "社科院總務分處"
"05": "保管組"
"06": "採購組"
"07": "經營管理組"
"08": "事務組"
"09": "駐警隊"
"10": "營繕組"