@@ -213,155 +213,155 @@ const NewTobiraPage = <T extends TobiraFormProps>({
213213
214214return < >
215215< ModalContent >
216- < p className = "tab-description" > { t ( "EVENTS.SERIES.NEW.TOBIRA.DESCRIPTION" ) } </ p >
217- { ! error && < >
218- < div className = "obj-container padded" >
219- < div className = "obj" >
220- < header >
221- < span > { t ( "EVENTS.SERIES.NEW.TOBIRA.SELECT_PAGE" ) } </ span >
222- </ header >
223- < div className = "breadcrumb" >
224- { formik . values . breadcrumbs . map ( ( breadcrumb , key ) => (
225- < ButtonLikeAnchor
226- key = { key }
227- className = "breadcrumb-link"
228- onClick = { ( ) => back ( key ) }
216+ < p className = "tab-description" > { t ( "EVENTS.SERIES.NEW.TOBIRA.DESCRIPTION" ) } </ p >
217+ { ! error && < >
218+ < div className = "obj-container padded" >
219+ < div className = "obj" >
220+ < header >
221+ < span > { t ( "EVENTS.SERIES.NEW.TOBIRA.SELECT_PAGE" ) } </ span >
222+ </ header >
223+ < div className = "breadcrumb" >
224+ { formik . values . breadcrumbs . map ( ( breadcrumb , key ) => (
225+ < ButtonLikeAnchor
226+ key = { key }
227+ className = "breadcrumb-link"
228+ onClick = { ( ) => back ( key ) }
229+ >
230+ { breadcrumb . segment === ""
231+ ? t ( "EVENTS.SERIES.NEW.TOBIRA.HOMEPAGE" )
232+ : breadcrumb . title
233+ }
234+ </ ButtonLikeAnchor >
235+ ) ) }
236+ </ div >
237+ < table className = "main-tbl highlight-hover" >
238+ < thead >
239+ < tr >
240+ { currentPage . children . length > 0 && < th className = "small" /> }
241+ < th >
242+ { t ( "EVENTS.SERIES.NEW.TOBIRA.PAGE_TITLE" ) /* Title */ }
243+ </ th >
244+ < th >
245+ { t ( "EVENTS.SERIES.NEW.TOBIRA.PATH_SEGMENT" ) /* Path segment */ }
246+ </ th >
247+ < th >
248+ { t ( "EVENTS.SERIES.NEW.TOBIRA.SUBPAGES" ) /* Sub-pages */ }
249+ </ th >
250+ { editing && < th /> }
251+ </ tr >
252+ </ thead >
253+ < tbody >
254+ { currentPage . children . map ( ( page , key ) => < tr key = { key } >
255+ < Tooltip
256+ title = { t ( "EVENTS.SERIES.NEW.TOBIRA.MOUNT_DISCLAIMER" ) }
257+ active = { ! ! page . blocks ?. length }
258+ placement = "left"
229259>
230- { breadcrumb . segment === ""
231- ? t ( "EVENTS.SERIES.NEW.TOBIRA.HOMEPAGE" )
232- : breadcrumb . title
233- }
234- </ ButtonLikeAnchor >
235- ) ) }
236- </ div >
237- < table className = "main-tbl highlight-hover" >
238- < thead >
239- < tr >
240- { currentPage . children . length > 0 && < th className = "small" /> }
241- < th >
242- { t ( "EVENTS.SERIES.NEW.TOBIRA.PAGE_TITLE" ) /* Title */ }
243- </ th >
244- < th >
245- { t ( "EVENTS.SERIES.NEW.TOBIRA.PATH_SEGMENT" ) /* Path segment */ }
246- </ th >
247- < th >
248- { t ( "EVENTS.SERIES.NEW.TOBIRA.SUBPAGES" ) /* Sub-pages */ }
249- </ th >
250- { editing && < th /> }
251- </ tr >
252- </ thead >
253- < tbody >
254- { currentPage . children . map ( ( page , key ) => < tr key = { key } >
255- < Tooltip
256- title = { t ( "EVENTS.SERIES.NEW.TOBIRA.MOUNT_DISCLAIMER" ) }
257- active = { ! ! page . blocks ?. length }
258- placement = "left"
259- >
260- < td >
261- < input
262- type = "checkbox"
263- checked = { checkboxActive ( page , key ) }
264- disabled = { ! ! page . blocks ?. length }
265- onChange = { ( ) => page . blocks ?. length || select ( page ) }
266- />
267- </ td >
268- </ Tooltip >
269260< td >
261+ < input
262+ type = "checkbox"
263+ checked = { checkboxActive ( page , key ) }
264+ disabled = { ! ! page . blocks ?. length }
265+ onChange = { ( ) => page . blocks ?. length || select ( page ) }
266+ />
267+ </ td >
268+ </ Tooltip >
269+ < td >
270+ { page . new
271+ ? < input
272+ placeholder = { t ( "EVENTS.SERIES.NEW.TOBIRA.PAGE_TITLE" ) }
273+ disabled = { checkboxActive ( page , key ) }
274+ value = { checkboxActive ( page , key )
275+ ? t ( "EVENTS.SERIES.NEW.TOBIRA.TITLE_OF_SERIES" )
276+ : ( page . title ?? "" )
277+ }
278+ onChange = { e => setPage ( key , e , "title" ) }
279+ />
280+ : < ButtonLikeAnchor
281+ className = {
282+ ( ! page . blocks ?. length
283+ ? "tobira-selectable"
284+ : "tobira-button-disabled"
285+ )
286+ }
287+ disabled = { ! ! page . blocks ?. length }
288+ onClick = { ( ) => page . blocks ?. length || select ( page ) }
289+ > { checkboxActive ( page , key ) && formik . values . selectedPage
290+ ? t ( "EVENTS.SERIES.NEW.TOBIRA.TITLE_OF_SERIES" )
291+ : page . title
292+ } </ ButtonLikeAnchor >
293+ }
294+ </ td >
295+ < td >
296+ < code className = "tobira-path" >
270297{ page . new
271298? < input
272- placeholder = { t ( "EVENTS.SERIES.NEW.TOBIRA.PAGE_TITLE" ) }
273- disabled = { checkboxActive ( page , key ) }
274- value = { checkboxActive ( page , key )
275- ? t ( "EVENTS.SERIES.NEW.TOBIRA.TITLE_OF_SERIES" )
276- : ( page . title ?? "" )
277- }
278- onChange = { e => setPage ( key , e , "title" ) }
299+ placeholder = { t ( "EVENTS.SERIES.NEW.TOBIRA.PATH_SEGMENT" ) }
300+ value = { page . segment ?? "" }
301+ onChange = { e => setPage ( key , e , "segment" ) }
279302/>
280- : < ButtonLikeAnchor
281- className = {
282- ( ! page . blocks ?. length
283- ? "tobira-selectable"
284- : "tobira-button-disabled"
285- )
286- }
287- disabled = { ! ! page . blocks ?. length }
288- onClick = { ( ) => page . blocks ?. length || select ( page ) }
289- > { checkboxActive ( page , key ) && formik . values . selectedPage
290- ? t ( "EVENTS.SERIES.NEW.TOBIRA.TITLE_OF_SERIES" )
291- : page . title
292- } </ ButtonLikeAnchor >
303+ : < span style = { { fontWeight : "inherit" } } >
304+ { page . segment }
305+ </ span >
293306}
294- </ td >
295- < td >
296- < code className = "tobira-path" >
297- { page . new
298- ? < input
299- placeholder = { t ( "EVENTS.SERIES.NEW.TOBIRA.PATH_SEGMENT" ) }
300- value = { page . segment ?? "" }
301- onChange = { e => setPage ( key , e , "segment" ) }
302- />
303- : < span style = { { fontWeight : "inherit" } } >
304- { page . segment }
305- </ span >
306- }
307- </ code >
308- </ td >
309- < td >
310- { ( ( ! page . new || isValid ) && page . title ) && < ButtonLikeAnchor
311- className = "details-link"
312- onClick = { ( ) => goto ( page ) }
313- >
314- { t ( "EVENTS.SERIES.NEW.TOBIRA.SUBPAGES" ) }
315- </ ButtonLikeAnchor > }
316- </ td >
317- { editing && < td >
318- { page . new && < ButtonLikeAnchor
319- onClick = { ( ) => {
320- dispatch ( setTobiraPage ( {
321- ...currentPage ,
322- children : currentPage . children . filter ( ( _ , idx ) => (
323- idx !== currentPage . children . length - 1
324- ) ) ,
325- } ) ) ;
326- select ( undefined ) ;
327- } }
328- title = { t ( "EVENTS.SERIES.NEW.TOBIRA.CANCEL" ) }
329- className = "remove"
330- /> }
331- </ td > }
332- </ tr > ) }
333- { ! editing && < tr >
334- < td colSpan = { 4 } >
335- < ButtonLikeAnchor
336- onClick = { ( ) => addChild ( ) }
337- >
338- + { t ( "EVENTS.SERIES.NEW.TOBIRA.ADD_SUBPAGE" ) }
339- </ ButtonLikeAnchor >
340- </ td >
341- </ tr > }
342- </ tbody >
343- </ table >
344- </ div >
345- { /* Notifications */ }
346- < Notifications context = { NOTIFICATION_CONTEXT_TOBIRA } />
307+ </ code >
308+ </ td >
309+ < td >
310+ { ( ( ! page . new || isValid ) && page . title ) && < ButtonLikeAnchor
311+ className = "details-link"
312+ onClick = { ( ) => goto ( page ) }
313+ >
314+ { t ( "EVENTS.SERIES.NEW.TOBIRA.SUBPAGES" ) }
315+ </ ButtonLikeAnchor > }
316+ </ td >
317+ { editing && < td >
318+ { page . new && < ButtonLikeAnchor
319+ onClick = { ( ) => {
320+ dispatch ( setTobiraPage ( {
321+ ...currentPage ,
322+ children : currentPage . children . filter ( ( _ , idx ) => (
323+ idx !== currentPage . children . length - 1
324+ ) ) ,
325+ } ) ) ;
326+ select ( undefined ) ;
327+ } }
328+ title = { t ( "EVENTS.SERIES.NEW.TOBIRA.CANCEL" ) }
329+ className = "remove"
330+ /> }
331+ </ td > }
332+ </ tr > ) }
333+ { ! editing && < tr >
334+ < td colSpan = { 4 } >
335+ < ButtonLikeAnchor
336+ onClick = { ( ) => addChild ( ) }
337+ >
338+ + { t ( "EVENTS.SERIES.NEW.TOBIRA.ADD_SUBPAGE" ) }
339+ </ ButtonLikeAnchor >
340+ </ td >
341+ </ tr > }
342+ </ tbody >
343+ </ table >
347344</ div >
345+ { /* Notifications */ }
346+ < Notifications context = { NOTIFICATION_CONTEXT_TOBIRA } />
347+ </ div >
348348
349- < p style = { { margin : "12px 0" , fontSize : 12 } } >
350- { ( ! ! formik . values . selectedPage && formik . values . selectedPage ?. path !== "" && isValid )
351- ? < >
352- { t ( "EVENTS.SERIES.NEW.TOBIRA.SELECTED_PAGE" ) } :
353- < code className = "tobira-path" >
354- { formik . values . selectedPage ?. path }
355- </ code >
356- </ >
357- : ( mode . edit && ! mode . mount
358- ? t ( "EVENTS.SERIES.NEW.TOBIRA.NO_PAGE_SELECTED_EDIT" )
359- : t ( "EVENTS.SERIES.NEW.TOBIRA.NO_PAGE_SELECTED" )
360- )
361- }
362- </ p >
363- { ! mode . edit && < p style = { { fontSize : 12 } } > { t ( "EVENTS.SERIES.NEW.TOBIRA.DIRECT_LINK" ) } </ p > }
364- </ > }
349+ < p style = { { margin : "12px 0" , fontSize : 12 } } >
350+ { ( ! ! formik . values . selectedPage && formik . values . selectedPage ?. path !== "" && isValid )
351+ ? < >
352+ { t ( "EVENTS.SERIES.NEW.TOBIRA.SELECTED_PAGE" ) } :
353+ < code className = "tobira-path" >
354+ { formik . values . selectedPage ?. path }
355+ </ code >
356+ </ >
357+ : ( mode . edit && ! mode . mount
358+ ? t ( "EVENTS.SERIES.NEW.TOBIRA.NO_PAGE_SELECTED_EDIT" )
359+ : t ( "EVENTS.SERIES.NEW.TOBIRA.NO_PAGE_SELECTED" )
360+ )
361+ }
362+ </ p >
363+ { ! mode . edit && < p style = { { fontSize : 12 } } > { t ( "EVENTS.SERIES.NEW.TOBIRA.DIRECT_LINK" ) } </ p > }
364+ </ > }
365365</ ModalContent >
366366{ /* Render buttons for saving or resetting updated path */ }
367367{ mode . edit && < SaveEditFooter
0 commit comments