我如何使padrino-admin頁面生成器生成漂亮的自定義頁面?Padrino管理頁面的自定義模板
默認情況下padrino管理員產生很醜陋的管理頁面,完全不可維護:
.group
=f.label :title
=f.error_message_on :title
=f.text_field :title, :class => :text_field
%span.description Ex: a simple text
.group
=f.label :name
=f.error_message_on :name
=f.text_field :name, :class => :text_field
%span.description Ex: a simple text
--- more annoyingly redundant frak
.group.navform.wat-cf
=f.submit pat(:save), :class => :button
=f.submit pat(:cancel), :onclick => "window.location='#{url(:pages, :index)}';return false", :class => :button
我寫了一個漂亮的AdminFormBuilder < AbstractFormBuilder
,與set :default_builder, 'AdminFormBuilder'
連接它時,它產生的很短的代碼相同的管理頁面:
= f.inputs :name, :surname, :email
= f.inputs :password, :password_confirmation, :as => :password
= f.input :role, :as => :select, :options => access_control.roles, :descr => 'a simple text'
= f.submits
現在我想要padrino g admin_page
生成更多這樣的網頁。我該怎麼辦?
將與第二個選項。 Padrino應用程序樹中自定義管理模板的*權限*位置是什麼? – ujifgc
'vendor/templates' – DAddYE
謝謝,小補丁在這裏:https://github.com/ujifgc/padrino-framework/commit/b07399bdfbc15d05682237c64580e77558ac9fce – ujifgc