Wikinews:Assistant:Add action-test/doc
This page is documentation for the Add action-test assistant. |
This page is documentation for the Add action-test assistant. |
This is a dialog-based assistant for adding an entry to the table of tests for a dialog action.
The starting point for the assistant is Wikinews:Assistant:Add action-test/start.
The dialog action page name must have prefix "Wikinews:Dialog/
". The table page name appends "/test
" to the action page name. The table consists of calls to {{dialog/action page/test top}}, {{dialog/action page/test entry}}, and {{dialog/action page/test bottom}}.
Inputs:
subject
— if provided, the name of the table page.action-page
— if provided when subject isn't, the name of the action page.SUBJECT-CONTENT
— if available, content of the table page.not-subpage
— if non-blank, the test page is not a subpage of the table.reconsider
— if non-blank, treat the choice of action page as unsettled.
is dialog supported? | no |
unsupported |
yes | ||
do known parameters identify a table? |
no |
start/get-action |
yes | no | |
start/table-named does table exist? |
no |
does action exist? |
yes | yes | |
start/get-entry | start/create-table |
Access: template.
Inputs:
intro
— paragraph to appear above the input box and button.subject
— if provided, possible table name.
Function:
- Prompts for action-page; button sends it to start.
Access: template.
Inputs:
subject
— name of the table page, with correct form.SUBJECT-CONTENT
— if available, content of the table page.not-subpage
— if non-blank, the test page is not a subpage of the table.
Function:
- Implements part of the logic shown for start.
Access: template.
Inputs:
subject
— name of the table page, valid but not yet created.
Function:
- Prompts for go-ahead to create table page.
Subpages:
Access: template.
Inputs:
subject
— name of the table page, known to exist.SUBJECT-CONTENT
— if available, content of the table page.not-subpage
— if non-blank, the test page is not a subpage of the table.
Function:
- Prompts for test-page; button sends request to add-entry. If
SUBJECT-CONTENT
is used at all, it is used only for advice, not for constructing new page content. Data is entered in fieldstest-page
,description
, andnot-subpage
. Ifnot-subpage
is true (i.e., non-blank),test-page
is the full name of the test page. Ifnot-subpage
is blank,test-page
only specifies the subpage suffix to add to the table name, excluding slash. The test page must exist.description
may be blank.
Access: viewable.
Inputs:
subject
— name of the table page, ostensibly known to exist.SUBJECT-EXISTS
— non-blank to confirm that the table page exists.SUBJECT-CONTENT
— content of the table page.not-subpage
— if non-blank, the test page is not a subpage of the table.test-page
— name of the test page to be added to the table, omitting table-page prefix unless not-subpage.description
— description of the test page for use in the table.
add-entry/valid1 is the request valid? |
no |
add-entry/error |
yes | ||
add-entry/preview |
Access: template.
Inputs:
subject
— the full page name of the test table to which an entry is to be added.SUBJECT-EXISTS
— eithertrue
orfalse
, depending on whether the test table page exists.SUBJECT-CONTENT
— the raw content of the test table page.test-fullpage
— the full name of the test page to be added to the table; needn't exist.description
— description of the test page for use in the table.
Function:
- Takes input collected elsewhere (so the input only has to be template-expanded once), assesses it via add-entry/check, and passes the results on to add-entry/valid2 (so that add-entry/check only has to be called once).
Access: template.
Inputs:
subject
— the full page name of the test table to which an entry is to be added; must begin withWikinews:Dialog/
.SUBJECT-EXISTS
— eithertrue
orfalse
, depending on whether the test table page exists.SUBJECT-CONTENT
— the raw content of the test table page.test-fullpage
— the full name of the test page to be added to the table; needn't exist.
Function:
- This template checks that the table exists, that it contains exactly one call to {{dialog/action page/test bottom}}, and that it does not already contain a call to {{dialog/action page/test entry}} for
test-fullpage
. If any of these conditions is not met, generates an error message, otherwise generates the empty string.
Access: template.
Inputs:
subject
— the full page name of the test table to which an entry is to be added.SUBJECT-CONTENT
— the raw content of the test table page.test-fullpage
— the full name of the test page to be added to the table; needn't exist.description
— description of the test page for use in the table.error-message
— the result from add-entry/check, blank if validated or non-blank if not validated.
Function:
- Passes data from add-entry/valid1 to either add-entry/error or add-entry/preview.
Access: template.
Inputs:
subject
— the full page name of the test table to which an entry is to be added.error-message
— the result from add-entry/check, blank if validated or non-blank if not validated.
Function:
- Displays an error message and offers a button to return to start.
Access: template.
Inputs:
subject
— the full page name of the test table to which an entry is to be added.SUBJECT-CONTENT
— the raw content of the test table page.test-fullpage
— the full name of the test page to be added to the table; needn't exist.description
— description of the test page for use in the table.
Function:
- Provides a preview of the table via add-entry/add and offers button to commit or return to start. The preview is actually generated at add-entry since {{dialog/init}} has to appear directly on the displayed page.
Access: template.
Inputs:
SUBJECT-CONTENT
— the raw content of the test table page.test-fullpage
— the full name of the test page to be added to the table; needn't exist.description
— description of the test page for use in the table.
Function:
- This template adds the proposed new entry to the wiki markup of the test table page.
Access: form.
Inputs:
subject
— the full page name of the test table to which an entry is to be added.test-fullpage
— the full name of the test page to be added to the table; needn't exist.description
— description of the test page for use in the table.
Function:
- Edit form to add the entry.
Subpage: