EBernhardson has submitted this change and it was merged.

Change subject: Rename summaries to headers
......................................................................


Rename summaries to headers

Change-Id: I936cef6f58f4cd4472eb47d887639fc89adb4697
---
M DATA_ABSTRACTION
M EXECUTION
M Flow.i18n.php
M Flow.php
M Hooks.php
M INITIAL_WORKFLOWS
M Resources.php
M container.php
A db_patches/patch-summary2header.sql
M flow.sql
R includes/Block/Header.php
M includes/Data/RecentChanges.php
M includes/Data/RevisionStorage.php
R includes/Model/Header.php
M includes/RecentChanges/Formatter.php
M includes/WorkflowLoader.php
M modules/base/ext.flow.base.js
R modules/header/header.js
R modules/header/styles/base.less
R modules/header/styles/settings/colors.less
M special/SpecialFlow.php
R templates/edit-header.html.php
A templates/header.html.php
D templates/summary.html.php
24 files changed, 164 insertions(+), 154 deletions(-)

Approvals:
  EBernhardson: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/DATA_ABSTRACTION b/DATA_ABSTRACTION
index 7a3e602..54ff14a 100644
--- a/DATA_ABSTRACTION
+++ b/DATA_ABSTRACTION
@@ -68,7 +68,7 @@
 ==== Limit ourselves to just user to user conversations, what are the actions? 
====
 
 Render user board:
-* Find most recent summary content attached to users discussion workflow
+* Find most recent header content attached to users discussion workflow
 * Find all workflows user is subscribed to, sorted by last updated date, along 
with the timestamp of the most recently read items of that workflow
 ** Somehow the user needs to be able to subscribe to a 'discussion' object, 
but not have the actual discussion object listed in their board.  The 
subscription to the discussion will be used for subscribing the user to new 
topics on that discussion.
 * Find post tree/content for all topics we are rendering to the board
@@ -79,13 +79,13 @@
 * Some sort of mark specific-topics read via api?
 
 Actions on a topic:
-* Need to be able to query a 'Topic History' of date/author/update summary
+* Need to be able to query a 'Topic History' of date/author/update header
 * (un)Subscribe to topic
 * Close topic 
 * Delete topic
 * Mark All Read
 * Change topic title
-** Should topic titles be stored as a summary, so they have revision info and 
all?
+** Should topic titles be stored as a header, so they have revision info and 
all?
 
 Actions on a post:
 * Revision history list
@@ -180,8 +180,8 @@
 $topicListManager = ...;
 $list = $topicListManager->get( $objectId ); // same id as its backing flow 
object
 
-$summaryManager = ...;
-$summary = $summaryManager->get( $objectId ); // same id as its backing flow 
object
+$headerManager = ...;
+$header = $headerManager->get( $objectId ); // same id as its backing flow 
object
 How do they interact?
 
 post -> flow object -> update timestamp
@@ -199,8 +199,8 @@
            JOIN flow_tree_node ON node_ancestor = :topicId
           WHERE fpr_post_id = :postId
                - But only for topics, and maybe topic lists like discussion 
workflow (another join...)
-       - SELECT MAX(id) FROM flow_summary_revision WHERE fpr_object_id = 
:objectId
-               - But only for workflow types that define summarys
+       - SELECT MAX(id) FROM flow_header_revision WHERE fpr_object_id = 
:objectId
+               - But only for workflow types that define headers
        - Whatever else ... basically its completely arbitrary depending on the 
blocks involved
        - Is updating the active objects with a timestamp on every update too 
much?
                - Can only be done in cache, could use redis for some more 
resilience
@@ -271,10 +271,10 @@
 
 
 // read/write
-$summaryRevision' = array(
+$headerRevision' = array(
                new UniqueIndex( 'rev_id' ),
                new SecondaryIndex( 'fsr_object_id', array(
-                       'sort' => array( 'SummaryRevision', 
'sortNewestToOldest' ),
+                       'sort' => array( 'HeaderRevision', 'sortNewestToOldest' 
),
                        'limit' => 20,
                ) ),
        ),
diff --git a/EXECUTION b/EXECUTION
index 5e846f5..8118afd 100644
--- a/EXECUTION
+++ b/EXECUTION
@@ -39,7 +39,7 @@
 Think of blocks as individual controllers?  They receive an action(request) 
from a user
 and do something with it.  They also provide data to the rendering layer.
 
-=== Summary ===
+=== Header ===
 
 Accepted Actions:
 * edit
diff --git a/Flow.i18n.php b/Flow.i18n.php
index aebcb8c..df3a4f1 100644
--- a/Flow.i18n.php
+++ b/Flow.i18n.php
@@ -10,7 +10,7 @@
 $messages['en'] = array(
        'flow-desc' => 'Workflow management system',
        'flow-specialpage' => '$1 – Flow',
-       'flow-edit-summary-link' => 'Edit summary',
+       'flow-edit-header-link' => 'Edit header',
 
        'flow-post-moderated-toggle-show' => '[Show]',
        'flow-post-moderated-toggle-hide' => '[Hide]',
@@ -70,7 +70,7 @@
        'flow-error-invalid-postId' => '"postId" parameter was invalid. The 
specified post could not be found.',
        'flow-error-restore-failure' => 'Restoration of this item failed.',
 
-       'flow-summaryedit-submit' => 'Save summary',
+       'flow-headeredit-submit' => 'Save header',
 
        'flow-edit-title-submit' => 'Change title',
 
@@ -79,8 +79,8 @@
        'flow-rev-message-new-post' => 'Topic created',
        'flow-rev-message-hid-post' => 'Hid post',
        'flow-rev-message-edit-title' => 'Edited topic title',
-       'flow-rev-message-create-summary' => 'Created summary',
-       'flow-rev-message-edit-summary' => 'Edited summary',
+       'flow-rev-message-create-header' => 'Created header',
+       'flow-rev-message-edit-header' => 'Edited header',
        'flow-rev-message-restored-post' => 'Unhid post',
        'flow-rev-message-hid-post' => 'Hid post',
        'flow-rev-message-deleted-post' => 'Deleted post',
@@ -149,6 +149,9 @@
 {{Identical|Show}}',
        'flow-post-moderated-toggle-hide' => 'Text for link used to hide a 
moderated post.
 {{Identical|Hide}}',
+       'flow-disclaimer' => 'Used as disclaimer text at the bottom of the 
form.',
+       'flow-post-moderated-toggle-show' => 'Text for link used to display a 
moderated post',
+       'flow-post-moderated-toggle-hide' => 'Text for link used to hide a 
moderated post',
        'flow-post-hidden' => 'Used as username/content if the post was hidden.
 
 Translate this as "post which was hidden".',
@@ -274,15 +277,15 @@
        'flow-error-restore-failure' => 'Used as error message when restoring a 
post.
 
 "this item" seems to refer "this post".',
-       'flow-summaryedit-submit' => 'Used as label for the Submit button.',
+       'flow-headeredit-submit' => 'Used as label for the Submit button.',
        'flow-edit-title-submit' => 'Used as label for the Submit button.',
        'flow-rev-message-edit-post' => 'Used as a revision comment when a post 
has been edited',
        'flow-rev-message-reply' => 'Used as a revision comment when a new 
reply has been posted.',
        'flow-rev-message-new-post' => 'Used as revision comment when the topic 
has been created.',
        'flow-rev-message-hid-post' => 'Used as revision comment when a post 
has been hidden',
        'flow-rev-message-edit-title' => 'Used as revision comment when a post 
has been edited',
-       'flow-rev-message-create-summary' => 'Used as revision comment when a 
summary has been created',
-       'flow-rev-message-edit-summary' => 'Used as revision comment when a 
summary has been edited',
+       'flow-rev-message-create-header' => 'Used as revision comment when a 
header has been created',
+       'flow-rev-message-edit-header' => 'Used as revision comment when a 
header has been edited',
        'flow-rev-message-restored-post' => 'Used as revision comment when a 
post has been restored(un-hidden)',
        'flow-rev-message-deleted-post' => 'Used as revision comment when a 
post has been deleted',
        'flow-rev-message-censored-post' => 'Used as revision comment when a 
post has been censored(oversighted)',
diff --git a/Flow.php b/Flow.php
index 27cf47c..7c320a0 100755
--- a/Flow.php
+++ b/Flow.php
@@ -78,7 +78,7 @@
 $wgAutoloadClasses['Flow\Model\Metadata'] = $dir . 
'includes/Model/Metadata.php';
 $wgAutoloadClasses['Flow\Model\AbstractRevision'] = $dir . 
'includes/Model/AbstractRevision.php';
 $wgAutoloadClasses['Flow\Model\PostRevision'] = $dir . 
'includes/Model/PostRevision.php';
-$wgAutoloadClasses['Flow\Model\Summary'] = $dir . 'includes/Model/Summary.php';
+$wgAutoloadClasses['Flow\Model\Header'] = $dir . 'includes/Model/Header.php';
 $wgAutoloadClasses['Flow\Model\TopicListEntry'] = $dir . 
'includes/Model/TopicListEntry.php';
 $wgAutoloadClasses['Flow\Model\Workflow'] = $dir . 
'includes/Model/Workflow.php';
 $wgAutoloadClasses['Flow\Model\UUID'] = "$dir/includes/Model/UUID.php";
@@ -110,19 +110,18 @@
 $wgAutoloadClasses['Flow\Data\Pager'] = $dir . 'includes/Data/Pager.php';
 $wgAutoloadClasses['Flow\Data\PagerPage'] = $dir . 
'includes/Data/PagerPage.php';
 $wgAutoloadClasses['Flow\Data\PostRevisionRecentChanges'] = $dir . 
'includes/Data/RecentChanges.php';
-$wgAutoloadClasses['Flow\Data\SummaryRecentChanges'] = $dir . 
'includes/Data/RecentChanges.php';
+$wgAutoloadClasses['Flow\Data\HeaderRecentChanges'] = $dir . 
'includes/Data/RecentChanges.php';
 $wgAutoloadClasses['Flow\RecentChanges\Formatter'] = $dir . 
'includes/RecentChanges/Formatter.php';
 
 // database interaction for singular models
 $wgAutoloadClasses['Flow\Data\PostRevisionStorage'] = $dir . 
'includes/Data/RevisionStorage.php';
-$wgAutoloadClasses['Flow\Data\SummaryRevisionStorage'] = $dir . 
'includes/Data/RevisionStorage.php';
+$wgAutoloadClasses['Flow\Data\HeaderRevisionStorage'] = $dir . 
'includes/Data/RevisionStorage.php';
 
 // The individual workflow pieces
 $wgAutoloadClasses['Flow\Block\Block'] = $dir . 'includes/Block/Block.php';
 $wgAutoloadClasses['Flow\Block\AbstractBlock'] = $dir . 
'includes/Block/Block.php';
 $wgAutoloadClasses['Flow\Block\BlockView'] = $dir . 'includes/Block/Block.php';
-$wgAutoloadClasses['Flow\Block\SummaryBlock'] = $dir . 
'includes/Block/Summary.php';
-$wgAutoloadClasses['Flow\Block\SummaryView'] = $dir . 
'includes/Block/Summary.php';
+$wgAutoloadClasses['Flow\Block\HeaderBlock'] = $dir . 
'includes/Block/Header.php';
 $wgAutoloadClasses['Flow\Block\TopicListBlock'] = $dir . 
'includes/Block/TopicList.php';
 $wgAutoloadClasses['Flow\Block\TopicListView'] = $dir . 
'includes/Block/TopicList.php';
 $wgAutoloadClasses['Flow\Block\TopicBlock'] = $dir . 
'includes/Block/Topic.php';
diff --git a/Hooks.php b/Hooks.php
index c2e76b1..a12c21a 100644
--- a/Hooks.php
+++ b/Hooks.php
@@ -27,10 +27,14 @@
                $baseSQLFile = "$dir/flow.sql";
                $updater->addExtensionTable( 'flow_revision', $baseSQLFile );
                $updater->addExtensionField( 'flow_revision', 
'rev_last_edit_id', "$dir/db_patches/patch-revision_last_editor.sql" );
-               if ( $updater->getDB()->getType() !== 'sqlite' ) {
+               if ( $updater->getDB()->getType() === 'sqlite' ) {
+                       $updater->modifyExtensionField( 
'flow_summary_revision', 'summary_workflow_id', 
"$dir/db_patches/patch-summary2header.sqlite.sql" );
+               } else {
                        // sqlite doesn't support alter table change, it also 
considers all types the same so
                        // this patch doesn't matter to it.
                        $updater->modifyExtensionField( 'flow_subscription', 
'subscription_user_id', "$dir/db_patches/patch-subscription_user_id.sql" );
+                       // renames columns, alternate patch is above for sqlite
+                       $updater->modifyExtensionField( 
'flow_summary_revision', 'summary_workflow_id', 
"$dir/db_patches/patch-summary2header.sql" );
                }
 
                $updater->addExtensionIndex( 'flow_workflow', 
'flow_workflow_lookup', "$dir/db_patches/patch-workflow_lookup_idx.sql" );
diff --git a/INITIAL_WORKFLOWS b/INITIAL_WORKFLOWS
index fda0ed1..3560135 100644
--- a/INITIAL_WORKFLOWS
+++ b/INITIAL_WORKFLOWS
@@ -2,7 +2,7 @@
 
 
 discussion:
-       summary - custom table
+       header - custom table
        topic list - custom table
 
 topic:
@@ -44,7 +44,7 @@
 slightly complicated by both the top level Discussion and the individual 
Topic's being "Flow Objects".
 To accomplish this we will define 3 types of blocks:
 
-       Summary
+       Header
        TopicList
        Topic
 
@@ -52,7 +52,7 @@
 The discussion workflow will be defined as:
 
        name: discussion
-       blocks: [ Summary, TopicList ]
+       blocks: [ Header, TopicList ]
        topic_workflow: discussion-topic
        singleton: true  // Only a single discussion may exist per wiki page
        closeable: false // Discussions are not closeable, they are forever
diff --git a/Resources.php b/Resources.php
index b204365..5bc8bbc 100644
--- a/Resources.php
+++ b/Resources.php
@@ -33,9 +33,9 @@
                'messages' => array(
                ),
        ),
-       'ext.flow.summary' => $flowResourceTemplate + array(
-               'styles' => 'summary/styles/base.less',
-               'scripts' => 'summary/summary.js',
+       'ext.flow.header' => $flowResourceTemplate + array(
+               'styles' => 'header/styles/base.less',
+               'scripts' => 'header/header.js',
                'dependencies' => array(
                        'ext.flow.editor',
                ),
@@ -50,7 +50,7 @@
                        'discussion/styles/components/container.less',
                        'discussion/styles/components/overlay.less',
                        'discussion/styles/components/post.less',
-                       'discussion/styles/components/summary.less',
+                       'discussion/styles/components/header.less',
                        'discussion/styles/components/timestamp.less',
                        'discussion/styles/components/topic.less',
 */
diff --git a/container.php b/container.php
index 796d6f7..6fe5b42 100644
--- a/container.php
+++ b/container.php
@@ -57,7 +57,7 @@
 use Flow\Data\BasicObjectMapper;
 use Flow\Data\BasicDbStorage;
 use Flow\Data\PostRevisionStorage;
-use Flow\Data\SummaryRevisionStorage;
+use Flow\Data\HeaderRevisionStorage;
 use Flow\Data\UniqueFeatureIndex;
 use Flow\Data\TopKIndex;
 use Flow\Data\TopicHistoryIndex;
@@ -113,16 +113,16 @@
        return new ObjectManager( $mapper, $storage, $indexes, $lifecycle );
 } );
 // Arbitrary bit of revisioned wiki-text attached to a workflow
-$c['storage.summary'] = $c->share( function( $c ) {
+$c['storage.header'] = $c->share( function( $c ) {
        global $wgFlowExternalStore, $wgContLang;
 
        $cache = $c['memcache.buffered'];
-       $mapper = BasicObjectMapper::model( 'Flow\\Model\\Summary' );
-       $storage = new SummaryRevisionStorage( $c['db.factory'], 
$wgFlowExternalStore );
+       $mapper = BasicObjectMapper::model( 'Flow\\Model\\Header' );
+       $storage = new HeaderRevisionStorage( $c['db.factory'], 
$wgFlowExternalStore );
 
        $pk = new UniqueFeatureIndex(
                $cache, $storage,
-               'flow_summary:pk', array( 'rev_id' )
+               'flow_header:pk', array( 'rev_id' )
        );
        $workflowIndexOptions = array(
                'sort' => 'rev_id',
@@ -136,18 +136,18 @@
                $pk,
                new TopKIndex(
                        $cache, $storage,
-                       'flow_summary:workflow', array( 'summary_workflow_id' ),
+                       'flow_header:workflow', array( 'header_workflow_id' ),
                        array( 'limit' => 100 ) + $workflowIndexOptions
                ),
                new TopKIndex(
                        $cache, $storage,
-                       'flow_summary:latest', array( 'summary_workflow_id' ),
+                       'flow_header:latest', array( 'header_workflow_id' ),
                        array( 'limit'  => 1 ) + $workflowIndexOptions
                ),
        );
 
        $handlers = array(
-               new Flow\Data\SummaryRecentChanges( $c['storage'], $wgContLang 
),
+               new Flow\Data\HeaderRecentChanges( $c['storage'], $wgContLang ),
        );
 
        return new ObjectManager( $mapper, $storage, $indexes, $handlers );
@@ -291,8 +291,8 @@
                        'Flow\\Model\\TopicListEntry' => 'storage.topic_list',
                        'TopicListEntry' => 'storage.topic_list',
 
-                       'Flow\\Model\\Summary' => 'storage.summary',
-                       'Summary' => 'storage.summary',
+                       'Flow\\Model\\Header' => 'storage.header',
+                       'Header' => 'storage.header',
                )
        );
 } );
diff --git a/db_patches/patch-summary2header.sql 
b/db_patches/patch-summary2header.sql
new file mode 100644
index 0000000..cff001d
--- /dev/null
+++ b/db_patches/patch-summary2header.sql
@@ -0,0 +1,9 @@
+-- Renames "summaries" to "headers"
+ALTER TABLE /*_*/flow_summary_revision
+       RENAME TO flow_header_revision,
+       DROP PRIMARY KEY,
+       CHANGE COLUMN summary_workflow_id header_workflow_id binary(16) not 
null,
+       CHANGE COLUMN summary_rev_id header_rev_id binary(16) not null,
+       ADD PRIMARY KEY ( header_workflow_id, header_rev_id );
+
+UPDATE /*_*/flow_revision SET rev_type='header' WHERE rev_type='summary';
\ No newline at end of file
diff --git a/flow.sql b/flow.sql
index 859af05..66ae34b 100644
--- a/flow.sql
+++ b/flow.sql
@@ -71,14 +71,14 @@
 CREATE UNIQUE INDEX /*i*/flow_tree_descendant_id_revisions
        ON /*_*/flow_tree_revision ( tree_rev_descendant_id, tree_rev_id );
 
--- Summary Content
--- Instead of summary, should this be more generic 'revisioned scratchpad'
--- or something?  Main limit in current setup can only associate one summary 
per
+-- Header Content
+-- Instead of header, should this be more generic 'revisioned scratchpad'
+-- or something?  Main limit in current setup can only associate one header per
 -- workflow
-CREATE TABLE /*_*/flow_summary_revision (
-       summary_workflow_id binary(16) not null,
-       summary_rev_id binary(16) not null,
-       PRIMARY KEY ( summary_workflow_id, summary_rev_id )
+CREATE TABLE /*_*/flow_header_revision (
+       header_workflow_id binary(16) not null,
+       header_rev_id binary(16) not null,
+       PRIMARY KEY ( header_workflow_id, header_rev_id )
 ) /*$wgDBTableOptions*/;
 
 -- Content
@@ -98,7 +98,7 @@
 CREATE TABLE /*_*/flow_revision (
        -- UID::newTimestampedUID128()
        rev_id binary(16) not null,
-       -- What kind of revision is this: tree/summary/etc.
+       -- What kind of revision is this: tree/header/etc.
        rev_type varchar(16) binary not null,
        -- user id creating the revision
        rev_user_id bigint unsigned not null,
diff --git a/includes/Block/Summary.php b/includes/Block/Header.php
similarity index 64%
rename from includes/Block/Summary.php
rename to includes/Block/Header.php
index c9beaab..1e37807 100644
--- a/includes/Block/Summary.php
+++ b/includes/Block/Header.php
@@ -5,16 +5,16 @@
 use Flow\DbFactory;
 use Flow\Data\ObjectManager;
 use Flow\Model\Workflow;
-use Flow\Model\Summary;
-use Flow\Repository\SummaryRepository;
+use Flow\Model\Header;
+use Flow\Repository\HeaderRepository;
 use Flow\Templating;
 use User;
 
-class SummaryBlock extends AbstractBlock {
+class HeaderBlock extends AbstractBlock {
 
-       protected $summary;
+       protected $header;
        protected $needCreate = false;
-       protected $supportedActions = array( 'edit-summary' );
+       protected $supportedActions = array( 'edit-header' );
 
        public function init( $action, $user ) {
                parent::init( $action, $user );
@@ -22,40 +22,40 @@
                        $this->needCreate = true;
                        return;
                }
-               // Get the latest summary attached to this workflow
+               // Get the latest revision attached to this workflow
                $found = $this->storage->find(
-                       'Summary',
-                       array( 'summary_workflow_id' => 
$this->workflow->getId() ),
+                       'Header',
+                       array( 'header_workflow_id' => $this->workflow->getId() 
),
                        array( 'sort' => 'rev_id', 'order' => 'DESC', 'limit' 
=> 1 )
                );
 
                if ( $found ) {
-                       $this->summary = reset( $found );
+                       $this->header = reset( $found );
                }
        }
 
        protected function validate() {
                if ( empty( $this->submitted['content'] ) ) {
-                       $this->errors['content'] = wfMessage( 
'flow-missing-summary-content' );
+                       $this->errors['content'] = wfMessage( 
'flow-missing-header-content' );
                }
 
-               if ( $this->summary ) {
+               if ( $this->header ) {
                        if ( empty( $this->submitted['prev_revision'] ) ) {
                                $this->errors['prev_revision'] = wfMessage( 
'flow-missing-prev-revision-identifier' );
-                       } elseif ( $this->summary->getRevisionId()->getHex() 
!== $this->submitted['prev_revision'] ) {
+                       } elseif ( $this->header->getRevisionId()->getHex() !== 
$this->submitted['prev_revision'] ) {
                                // This is a reasonably effective way to ensure 
prev revision matches, but for guarantees against race
                                // conditions there also exists a unique index 
on rev_prev_revision in mysql, meaning if someone else inserts against the
                                // parent we and the submitter think is the 
latest, our insert will fail.
                                // TODO: Catch whatever exception happens 
there, make sure the most recent revision is the one in the cache before
                                // handing user back to specific dialog 
indicating race condition
-                               $this->errors['prev_revision'] = wfMessage( 
'flow-prev-revision-mismatch' )->params( $this->submitted['prev_revision'], 
$this->summary->getRevisionId()->getHex() );
+                               $this->errors['prev_revision'] = wfMessage( 
'flow-prev-revision-mismatch' )->params( $this->submitted['prev_revision'], 
$this->header->getRevisionId()->getHex() );
                        }
-                       // this isnt really part of validate, but we want the 
error-rendering template to see the users edited summary
-                       $this->summary = $this->summary->newNextRevision( 
$this->user, $this->submitted['content'], 'flow-edit-summary' );
+                       // this isnt really part of validate, but we want the 
error-rendering template to see the users edited header
+                       $this->header = $this->header->newNextRevision( 
$this->user, $this->submitted['content'], 'flow-edit-header' );
                } else {
                        if ( empty( $this->submitted['prev_revision'] ) ) {
                                // this isnt really part of validate either, 
should validate be renamed or should this logic be redone?
-                               $this->summary = Summary::create( 
$this->workflow, $this->user, $this->submitted['content'] );
+                               $this->header = Header::create( 
$this->workflow, $this->user, $this->submitted['content'] );
                        } else {
                                // User submitted a previous revision, but we 
couldn't find one.  This is likely
                                // an internal error and not a user error, 
consider better handling
@@ -70,11 +70,11 @@
 
        public function commit() {
                switch( $this->action ) {
-               case 'edit-summary':
-                       $this->storage->put( $this->summary );
+               case 'edit-header':
+                       $this->storage->put( $this->header );
 
                        return array(
-                               'new-revision-id' => 
$this->summary->getRevisionId()
+                               'new-revision-id' => 
$this->header->getRevisionId()
                        );
                        break;
 
@@ -84,30 +84,29 @@
        }
 
        public function render( Templating $templating, array $options ) {
-               $templating->getOutput()->addModules( 'ext.flow.summary' );
-
-               $templateName = ( $this->action == 'edit-summary' ) ? 
'edit-summary' : 'summary';
+               $templating->getOutput()->addModules( 'ext.flow.header' );
+               $templateName = ( $this->action == 'edit-header' ) ? 
'edit-header' : 'header';
                $templating->render( "flow:$templateName.html.php", array(
                        'block' => $this,
                        'workflow' => $this->workflow,
-                       'summary' => $this->summary,
+                       'header' => $this->header,
                        'user' => $this->user,
                ) );
        }
 
        public function renderAPI( Templating $templating, array $options ) {
                $output = array();
-               $output['type'] = 'summary';
+               $output['type'] = 'header';
 
-               if ( $this->summary !== null ) {
-                       $output['*'] = $this->summary->getContent( null, 
'wikitext' );
-                       $output['summary-id'] = 
$this->summary->getRevisionId()->getHex();
+               if ( $this->header !== null ) {
+                       $output['*'] = $this->header->getContent( $this->user, 
'wikitext' );
+                       $output['header-id'] = 
$this->header->getRevisionId()->getHex();
                } else {
                        $output['missing'] = 'missing';
                }
 
                $output = array(
-                       '_element' => 'summary',
+                       '_element' => 'header',
                        0 => $output,
                );
 
@@ -115,7 +114,7 @@
        }
 
        public function getName() {
-               return 'summary';
+               return 'header';
        }
 
 }
diff --git a/includes/Data/RecentChanges.php b/includes/Data/RecentChanges.php
index 690d430..2e43b3c 100644
--- a/includes/Data/RecentChanges.php
+++ b/includes/Data/RecentChanges.php
@@ -70,7 +70,7 @@
        }
 }
 
-class SummaryRecentChanges extends RecentChanges {
+class HeaderRecentChanges extends RecentChanges {
        public function __construct( ManagerGroup $storage, Language $contLang 
) {
                $this->storage = $storage;
                $this->contLang = $contLang;
@@ -80,7 +80,7 @@
                $workflowId = $object->getWorkflowId();
                $workflow = $this->storage->get( 'Workflow', $workflowId );
                if ( !$workflow ) {
-                       wfDebugLog( __CLASS__, __FUNCTION__ . ": could not 
locate workflow for summary " . $object->getRevisionId()->getHex() );
+                       wfDebugLog( __CLASS__, __FUNCTION__ . ": could not 
locate workflow for header " . $object->getRevisionId()->getHex() );
                        return;
                }
 
diff --git a/includes/Data/RevisionStorage.php 
b/includes/Data/RevisionStorage.php
index f7a326a..f407290 100644
--- a/includes/Data/RevisionStorage.php
+++ b/includes/Data/RevisionStorage.php
@@ -403,24 +403,24 @@
        }
 }
 
-class SummaryRevisionStorage extends RevisionStorage {
+class HeaderRevisionStorage extends RevisionStorage {
 
        protected function joinTable() {
-               return 'flow_summary_revision';
+               return 'flow_header_revision';
        }
 
        protected function relatedPk() {
-               return 'summary_workflow_id';
+               return 'header_workflow_id';
        }
 
        protected function joinField() {
-               return 'summary_rev_id';
+               return 'header_rev_id';
        }
 
-       protected function insertRelated( array $row, array $summary ) {
+       protected function insertRelated( array $row, array $header ) {
                $res = $this->dbFactory->getDB( DB_MASTER )->insert(
                        $this->joinTable(),
-                       $summary,
+                       $header,
                        __METHOD__
                );
                if ( !$res ) {
@@ -429,9 +429,9 @@
                return $row;
        }
 
-       // There is changable data in the summary half, it just points to the 
correct workflow
-       protected function updateRelated( array $rev, array $summaryChanges ) {
-               if ( $summaryChanges ) {
+       // There is changable data in the header half, it just points to the 
correct workflow
+       protected function updateRelated( array $rev, array $headerChanges ) {
+               if ( $headerChanges ) {
                        throw new \MWException( 'No update allowed' );
                }
        }
diff --git a/includes/Model/Summary.php b/includes/Model/Header.php
similarity index 71%
rename from includes/Model/Summary.php
rename to includes/Model/Header.php
index 752eb9d..6990003 100644
--- a/includes/Model/Summary.php
+++ b/includes/Model/Header.php
@@ -4,10 +4,10 @@
 
 use User;
 
-class Summary extends AbstractRevision {
+class Header extends AbstractRevision {
        protected $workflowId;
 
-       static public function create( Workflow $workflow, User $user, 
$content, $comment = 'flow-create-summary' ) {
+       static public function create( Workflow $workflow, User $user, 
$content, $comment = 'flow-create-header' ) {
                $obj = new self;
                $obj->revId = UUID::create();
                $obj->workflowId = $workflow->getId();
@@ -21,20 +21,20 @@
 
        static public function fromStorageRow( array $row, $obj = null ) {
                $obj = parent::fromStorageRow( $row, $obj );
-               $obj->workflowId = UUID::create( $row['summary_workflow_id'] );
+               $obj->workflowId = UUID::create( $row['header_workflow_id'] );
                return $obj;
        }
 
        static public function toStorageRow( $obj ) {
                return parent::toStorageRow( $obj ) + array(
-                       'rev_type' => 'summary',
-                       'summary_rev_id' => $obj->revId->getBinary(),
-                       'summary_workflow_id' => $obj->workflowId->getBinary(),
+                       'rev_type' => 'header',
+                       'header_rev_id' => $obj->revId->getBinary(),
+                       'header_workflow_id' => $obj->workflowId->getBinary(),
                );
        }
 
        public function getRevisionType() {
-               return 'summary';
+               return 'header';
        }
 
        public function getWorkflowId() {
diff --git a/includes/RecentChanges/Formatter.php 
b/includes/RecentChanges/Formatter.php
index 768e3d7..6b2652d 100644
--- a/includes/RecentChanges/Formatter.php
+++ b/includes/RecentChanges/Formatter.php
@@ -80,8 +80,8 @@
                        $links[] = $this->postHistoryLink( $title, $changeData 
);
                        break;
 
-               case 'flow-rev-message-create-summary': // fall through
-               case 'flow-rev-message-edit-summary':
+               case 'flow-rev-message-create-header': // fall through
+               case 'flow-rev-message-edit-header':
                        //$links[] = $this->workflowLink( $title, $changeData );
                        break;
 
diff --git a/includes/WorkflowLoader.php b/includes/WorkflowLoader.php
index 0387146..73d444e 100644
--- a/includes/WorkflowLoader.php
+++ b/includes/WorkflowLoader.php
@@ -2,7 +2,7 @@
 
 namespace Flow;
 
-use Flow\Block\SummaryBlock;
+use Flow\Block\HeaderBlock;
 use Flow\Block\TopicBlock;
 use Flow\Block\TopicListBlock;
 use Flow\Model\Definition;
@@ -130,7 +130,7 @@
                switch( $this->definition->getType() ) {
                case 'discussion':
                        return array(
-                               'summary' => new SummaryBlock( $this->workflow, 
$this->storage, $this->notificationController ),
+                               'header' => new HeaderBlock( $this->workflow, 
$this->storage, $this->notificationController ),
                                'topics' => new TopicListBlock( 
$this->workflow, $this->storage, $this->notificationController, 
$this->rootPostLoader ),
                        );
 
diff --git a/modules/base/ext.flow.base.js b/modules/base/ext.flow.base.js
index 6c4eb35..c24b653 100644
--- a/modules/base/ext.flow.base.js
+++ b/modules/base/ext.flow.base.js
@@ -131,8 +131,8 @@
                        return mw.flow.api.readBlock( pageName, topicId, 
'topic', options );
                },
 
-               'readSummary' : function( pageName, workflowId, options ) {
-                       return mw.flow.api.readBlock( pageName, workflowId, 
'summary', options );
+               'readHeader' : function( pageName, workflowId, options ) {
+                       return mw.flow.api.readBlock( pageName, workflowId, 
'header', options );
                },
 
                /**
diff --git a/modules/summary/summary.js b/modules/header/header.js
similarity index 94%
rename from modules/summary/summary.js
rename to modules/header/header.js
index 13c08d1..d716975 100644
--- a/modules/summary/summary.js
+++ b/modules/header/header.js
@@ -2,7 +2,7 @@
        'use strict';
 
        $( function () {
-               var $form = $( '.flow-summary-form' );
+               var $form = $( '.flow-header-form' );
 
                // edit-form is showing
                if ( $form.length > 0 ) {
diff --git a/modules/summary/styles/base.less b/modules/header/styles/base.less
similarity index 79%
rename from modules/summary/styles/base.less
rename to modules/header/styles/base.less
index a3e8a38..8ed337c 100644
--- a/modules/summary/styles/base.less
+++ b/modules/header/styles/base.less
@@ -1,16 +1,16 @@
 @import 'settings/colors.less';
 @import 'mediawiki.mixins.less';
 
-#flow-summary {
+#flow-header {
        padding-bottom: 30px;
 
-       #flow-summary-content {
+       #flow-header-content {
                font-weight: bold;
                line-height: 25px;
-               color: @summary-content-color;
+               color: @header-content-color;
        }
 
-       .flow-summary-edit-link {
+       .flow-header-edit-link {
                background-position: center;
                background-size: 20px auto;
                background-repeat: no-repeat;
@@ -24,7 +24,7 @@
                }
        }
 
-       .flow-edit-summary-controls{
+       .flow-edit-header-controls{
                text-align: right;
        }
 }
diff --git a/modules/summary/styles/settings/colors.less 
b/modules/header/styles/settings/colors.less
similarity index 72%
rename from modules/summary/styles/settings/colors.less
rename to modules/header/styles/settings/colors.less
index f99acf7..d0936a9 100644
--- a/modules/summary/styles/settings/colors.less
+++ b/modules/header/styles/settings/colors.less
@@ -1,2 +1,2 @@
 // color-picked from Flow Prototype/Design/Iteration 5 
"Talkpage_Other_2Participants"
-@summary-content-color: #58595b;
+@header-content-color: #58595b;
diff --git a/special/SpecialFlow.php b/special/SpecialFlow.php
index 41aa6a2..6f0bf12 100644
--- a/special/SpecialFlow.php
+++ b/special/SpecialFlow.php
@@ -1,9 +1,5 @@
 <?php
 
-use Flow\Block\SummaryBlock;
-use Flow\Block\TopicBlock;
-use Flow\Block\TopicListBlock;
-use Flow\Model\Definition;
 use Flow\Model\UUID;
 use Flow\Model\Workflow;
 use Flow\WorkflowLoader;
diff --git a/templates/edit-summary.html.php b/templates/edit-header.html.php
similarity index 68%
rename from templates/edit-summary.html.php
rename to templates/edit-header.html.php
index 7e8204f..5f28e98 100644
--- a/templates/edit-summary.html.php
+++ b/templates/edit-header.html.php
@@ -2,22 +2,22 @@
 
 // owning workflow
 echo Html::openElement( 'div', array(
-       'id' => 'flow-summary'
+       'id' => 'flow-header'
 ) );
 echo Html::openElement( 'form', array(
        'method' => 'POST',
-       'action' => $this->generateUrl( $workflow, 'edit-summary' ),
-       'class' => 'flow-summary-form',
+       'action' => $this->generateUrl( $workflow, 'edit-header' ),
+       'class' => 'flow-header-form',
 ) );
 echo Html::element( 'input', array( 'type' => 'hidden', 'name' => 
'wpEditToken', 'value' => $editToken) );
 if ( $block->hasErrors( 'prev_revision' ) ) {
        echo '<p>' . $block->getError( 'prev_revision' )->escaped() . '</p>';
 }
-if ( $summary ) {
+if ( $header ) {
        echo Html::element( 'input', array(
                'type' => 'hidden',
                'name' => $block->getName()."[prev_revision]",
-               'value' => $summary->getRevisionId()->getHex(),
+               'value' => $header->getRevisionId()->getHex(),
        ) );
 }
 if ( $block->hasErrors( 'content' ) ) {
@@ -26,19 +26,19 @@
 
 echo Html::textarea(
        $block->getName() . '[content]',
-       $summary ? $summary->getContent( $user, 'wikitext' ) : '',
+       $header ? $header->getContent( $user, 'wikitext' ) : '',
        array(
                'class' => 'mw-ui-input',
-               'data-summary-id' => $summary ? 
$summary->getRevisionId()->getHex() : ''
+               'data-header-id' => $header ? 
$header->getRevisionId()->getHex() : ''
        )
 );
 echo Html::openElement( 'div', array(
-       'class' => 'flow-edit-summary-controls',
+       'class' => 'flow-edit-header-controls',
 ) );
 echo Html::element( 'input', array(
        'type' => 'submit',
        'class' => 'mw-ui-button mw-ui-constructive',
-       'value' => wfMessage( 'flow-summaryedit-submit' )->plain(),
+       'value' => wfMessage( 'flow-headeredit-submit' )->plain(),
 ) );
 echo Html::closeElement( 'div' );
 echo Html::closeElement( 'form' );
diff --git a/templates/header.html.php b/templates/header.html.php
new file mode 100644
index 0000000..a9f0f45
--- /dev/null
+++ b/templates/header.html.php
@@ -0,0 +1,33 @@
+<?php
+
+echo Html::openElement(
+       'div',
+       array( 'id' => 'flow-header' )
+);
+
+if ( $block->hasErrors( 'content' ) ) {
+       echo Html::element(
+               'p',
+               array( 'id' => 'flow-header-error' ),
+               $block->getError( 'content' )->text()
+       );
+}
+
+if ( $header ) {
+       echo Html::rawElement(
+               'div',
+               array( 'id' => 'flow-header-content' ),
+               $header->getContent( $user, 'html' ) // contains HTML5+RDFa 
content
+       );
+}
+
+echo Html::element(
+       'a',
+       array(
+               'href' => $this->generateUrl( $workflow, 'edit-header' ),
+               'class' => 'flow-header-edit-link flow-icon 
flow-icon-bottom-aligned',
+       ),
+       wfMessage( 'flow-edit-header-link' )->text()
+);
+
+echo Html::closeElement( 'div' );
diff --git a/templates/summary.html.php b/templates/summary.html.php
deleted file mode 100644
index babd042..0000000
--- a/templates/summary.html.php
+++ /dev/null
@@ -1,33 +0,0 @@
-<?php
-
-echo Html::openElement(
-       'div',
-       array( 'id' => 'flow-summary' )
-);
-
-if ( $block->hasErrors( 'content' ) ) {
-       echo Html::element(
-               'p',
-               array( 'id' => 'flow-summary-error' ),
-               $block->getError( 'content' )->text()
-       );
-}
-
-if ( $summary ) {
-       echo Html::rawElement(
-               'div',
-               array( 'id' => 'flow-summary-content' ),
-               $summary->getContent( $user, 'html' ) // contains HTML5+RDFa 
content
-       );
-}
-
-echo Html::element(
-       'a',
-       array(
-               'href' => $this->generateUrl( $workflow, 'edit-summary' ),
-               'class' => 'flow-summary-edit-link flow-icon 
flow-icon-bottom-aligned',
-       ),
-       wfMessage( 'flow-edit-summary-link' )->text()
-);
-
-echo Html::closeElement( 'div' );

-- 
To view, visit https://gerrit.wikimedia.org/r/88407
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I936cef6f58f4cd4472eb47d887639fc89adb4697
Gerrit-PatchSet: 7
Gerrit-Project: mediawiki/extensions/Flow
Gerrit-Branch: master
Gerrit-Owner: Werdna <[email protected]>
Gerrit-Reviewer: EBernhardson <[email protected]>
Gerrit-Reviewer: Matthias Mullie <[email protected]>
Gerrit-Reviewer: Siebrand <[email protected]>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to