Spree 登录页面的额外 html 从何而来?

From where comes extra html for Spree login page?

这是 Spree github 页面的 _login.html.erb 部分内容:

<%= form_for Spree::User.new, as: :spree_user, url: spree.create_new_session_path do |f| %>
  <fieldset id="password-credentials">
    <div class="form-group">
      <%= f.email_field :email, class: 'form-control', tabindex: 1, placeholder: Spree.t(:email) %>
    </div>
    <div class="form-group">
      <%= f.password_field :password, class: 'form-control', tabindex: 2, placeholder: Spree.t(:password) %>
    </div>
    <div class="checkbox">
      <label>
        <%= f.check_box :remember_me %>
        <%= f.label :remember_me, Spree.t(:remember_me) %>
      </label>
    </div>
    <div class="form-group">
      <%= f.submit Spree.t(:login), class: 'btn btn-lg btn-success btn-block', tabindex: 3 %>
    </div>
  </fieldset>
<% end %>

但实际上,当转到该页面时,该表格在标题为 "Login as Existing customer" 的面板中为 built-in。

从哪里来的?

来自不同的模板,位于此处:https://github.com/spree/spree_auth_devise/blob/master/app/views/spree/user_sessions/new.html.erb

如果您在 Spree 的代码中搜索句子 'Login as Existing Customer',您会看到它出现在他们的 locales 中,关键字为 login_as_existing

再挖掘一点,我在上面链接的模板的第五行找到了关键(以及 a couple of other locations). You can replace this in the same way you have the login form, or adjust the locale if you'd prefer different terminology. And a final third option, you can use Spree's deface overrides

有时很难追踪到这些视图,尽管搜索主存储库和任何包含的扩展,您应该能够追踪到任何东西:)