Wikinews:Assistant/add action-test/doc

From Wikinews, the free news source you can write!
Jump to: navigation, search


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}}.

start[edit]

Access: viewable.

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
Arrow east.svg
unsupported
Arrow south.svg yes
do known parameters
identify a table?
no
Arrow east.svg
start/get-action
Arrow south.svg yes Arrow north.svg no
start/table-named
does table exist?
no
Arrow east.svg
does action exist?
Arrow south.svg yes Arrow south.svg yes
start/get-entry start/create-table

start/get-action[edit]

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.

start/table-named[edit]

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.

start/create-table[edit]

Inputs:

  • {{{subject}}} — name of the table page, valid but not yet created.

Function:

Prompts for go-ahead to create table page.

Subpages:

start/get-entry[edit]

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 fields test-page, description, and not-subpage. If not-subpage is true (i.e., non-blank), test-page is the full name of the test page. If not-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.

add-entry[edit]

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
Arrow east.svg
add-entry/error
Arrow south.svg yes
add-entry/preview

add-entry/valid1[edit]

Inputs:

  • {{{subject}}} — the full page name of the test table to which an entry is to be added.
  • {{{SUBJECT-EXISTS}}} — either true or false, 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).

add-entry/check[edit]

Inputs:

  • {{{subject}}} — the full page name of the test table to which an entry is to be added; must begin with Wikinews:Dialog/.
  • {{{SUBJECT-EXISTS}}} — either true or false, 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.

add-entry/valid2[edit]

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.

add-entry/error[edit]

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.

add-entry/preview[edit]

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.

add-entry/add[edit]

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.

add-entry/form[edit]

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: