Files
growstuff/app/views/layouts/_nav.haml
T
Brenda Wallace b6006df384 feat: Implement draft autosave and preview functionality in PostEditor
- Added useDraftAutosave hook to handle automatic saving of post drafts.
- Enhanced PostEditor component to include a preview tab that fetches and displays rendered markdown.
- Updated Post model to manage draft state and associated published_at timestamp.
- Introduced card_photo association to Post for representing a primary image.
- Modified post form to support draft saving and publishing actions.
- Updated navigation to include links to drafts.
- Added tests for draft saving, preview functionality, and card photo validation.
- Created migrations for new database fields related to drafts and card photos.
2026-10-28 21:50:26 +13:00

28 lines
1.3 KiB
Plaintext

.sidebar-inset
- if current_member.present?
.flex-column.nav-pills.layout-nav{"role" => "tablist", "aria-orientation"=>"vertical"}
/ %h2.card-title #{model} links
- mine = url_for([current_member, model])
- everyones = url_for(model)
= link_to mine, class: 'nav-link tab', aria: { current: ('page' if current_page?(mine) && params[:drafts].blank?) } do
My #{model.model_name.human.pluralize}
- if model == Post
- drafts = member_posts_path(current_member, drafts: 1)
= link_to drafts, class: 'nav-link tab', aria: { current: ('page' if params[:drafts].present?) } do
= t('.my_drafts')
= link_to everyones, class: 'nav-link tab', aria: { current: ('page' if current_page?(everyones)) } do
Everyone's #{model.model_name.human.pluralize}
- if can?(:create, model)
= link_to url_for([model, action: :new]), class: 'btn' do
Add a #{model.model_name.human}
- if model == Planting
= link_to suggestions_path, class: 'btn' do
= t('.suggest_something')
- else
= render 'shared/signin_signup', to: "record your #{model.to_s.pluralize.downcase}"
%hr/
%p.sidebar-inset
#{ENV['GROWSTUFF_SITE_NAME']} helps you track what you're
harvesting from your home garden and see how productive it is.