forked from Gitlink/forgeplus
add setting navbar index for new
This commit is contained in:
parent
3367d748b6
commit
19c8587723
|
@ -28,7 +28,7 @@ class SettingsController < ApplicationController
|
|||
|
||||
private
|
||||
def get_navbar
|
||||
@navbar = default_laboratory.navbar.sort_by{|e| e["index"]}
|
||||
@navbar = default_laboratory.navbar.sort_by{|e| e["index"].to_i }
|
||||
# if User.current.logged?
|
||||
# pernal_index = {"name"=>"个人主页", "link"=>get_site_url("url", "#{Rails.application.config_for(:configuration)['platform_url']}/current_user"), "hidden"=>false}
|
||||
# @navbar << pernal_index
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
<tr>
|
||||
<td><%= text_field_tag('navbar[][name]', "", id: nil, class: 'form-control', placeholder: "导航名称") %></td>
|
||||
<td><%= text_field_tag('navbar[][link]', "", id: nil, class: 'form-control', placeholder: "导航链接") %></td>
|
||||
<td><%= number_field_tag('navbar[][index]', "", id: nil, class: 'form-control', placeholder: "顺序") %></td>
|
||||
<td class="text-center">
|
||||
<%= check_box_tag('navbar[][hidden]', 0, false, id: nil, class: 'font-16') %>
|
||||
</td>
|
||||
|
|
|
@ -165,11 +165,11 @@
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody id="laboratories-show-content">
|
||||
<% (setting.navbar || setting.default_navbar).sort_by{|e| e["index"]}.each do |nav| %>
|
||||
<% (setting.navbar || setting.default_navbar).sort_by{|e| e["index"].to_i }.each do |nav| %>
|
||||
<tr>
|
||||
<td><%= text_field_tag('navbar[][name]', nav['name'], id: nil, class: 'form-control') %></td>
|
||||
<td><%= text_field_tag('navbar[][link]', nav['link'], id: nil, class: 'form-control') %></td>
|
||||
<td><%= text_field_tag('navbar[][index]', nav['index'], id: nil, class: 'form-control') %></td>
|
||||
<td><%= number_field_tag('navbar[][index]', nav['index'], id: nil, class: 'form-control') %></td>
|
||||
<td class="text-center">
|
||||
<%= check_box_tag('navbar[][hidden]', 0, !nav['hidden'], id: nil, class: 'font-16') %>
|
||||
</td>
|
||||
|
|
Loading…
Reference in New Issue