Project

General

Profile

Patch #35075 » 0001-Use-named-routes-in-base-layout-and-account-sidebar.patch

Jens Krämer, 2021-04-12 12:02

View differences:

app/views/layouts/base.html.erb
26 26

  
27 27
    <% if User.current.logged? || !Setting.login_required? %>
28 28
        <div class="flyout-menu__search">
29
            <%= form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get ) do %>
29
            <%= form_tag(search_path(id: @project), :method => :get ) do %>
30 30
            <%= hidden_field_tag(controller.default_search_scope, 1, :id => nil) if controller.default_search_scope %>
31 31
            <%= label_tag 'flyout-search', '&#9906;'.html_safe, :class => 'search-magnifier search-magnifier--flyout' %>
32 32
            <%= text_field_tag 'q', @question, :id => 'flyout-search', :class => 'small js-search-input', :placeholder => l(:label_search) %>
......
74 74

  
75 75
    <% if User.current.logged? || !Setting.login_required? %>
76 76
    <div id="quick-search">
77
        <%= form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get ) do %>
77
        <%= form_tag(search_path(id: @project), :method => :get ) do %>
78 78
        <%= hidden_field_tag 'scope', default_search_project_scope, :id => nil %>
79 79
        <%= hidden_field_tag(controller.default_search_scope, 1, :id => nil) if controller.default_search_scope %>
80 80
        <label for='q'>
81
          <%= link_to l(:label_search), {:controller => 'search', :action => 'index', :id => @project, :scope => default_search_project_scope}, :accesskey => accesskey(:search) %>:
81
          <%= link_to l(:label_search), search_path(id: @project, :scope => default_search_project_scope), :accesskey => accesskey(:search) %>:
82 82
        </label>
83 83
        <%= text_field_tag 'q', @question, :size => 20, :class => 'small', :accesskey => accesskey(:quick_search),
84 84
                            :data => {
app/views/my/_sidebar.html.erb
4 4
<%=l(:field_created_on)%>: <%= format_time(@user.created_on) %></p>
5 5

  
6 6
<% if @user.own_account_deletable? %>
7
  <p><%= link_to(l(:button_delete_my_account), {:controller => 'my', :action => 'destroy'}, :class => 'icon icon-del') %></p>
7
  <p><%= link_to(l(:button_delete_my_account), delete_my_account_path, :class => 'icon icon-del') %></p>
8 8
<% end %>
9 9

  
10 10
<h4><%= l(:label_feeds_access_key) %></h4>
config/routes.rb
83 83
  match '/imports/:id/run', :to => 'imports#run', :via => [:get, :post], :as => 'import_run'
84 84

  
85 85
  match 'my/account', :controller => 'my', :action => 'account', :via => [:get, :put]
86
  match 'my/account/destroy', :controller => 'my', :action => 'destroy', :via => [:get, :post]
86
  match 'my/account/destroy', :controller => 'my', :action => 'destroy', :via => [:get, :post], as: :delete_my_account
87 87
  match 'my/page', :controller => 'my', :action => 'page', :via => :get
88 88
  post 'my/page', :to => 'my#update_page'
89 89
  match 'my', :controller => 'my', :action => 'index', :via => :get # Redirects to my/page
......
349 349
  resources :enumerations, :except => :show
350 350
  match 'enumerations/:type', :to => 'enumerations#index', :via => :get
351 351

  
352
  get 'projects/:id/search', :controller => 'search', :action => 'index'
353
  get 'search', :controller => 'search', :action => 'index'
352
  get '(projects/:id)/search', :controller => 'search', :action => 'index', :as => 'search'
354 353

  
355 354

  
356 355
  get  'mail_handler', :to => 'mail_handler#new'
(1-1/2)