Skip to content
Permalink
Browse files

EZP-23208: Improved the async. publishing queue UI

Added some style and made it display the time between two checks and the number
of attempts.
  • Loading branch information...
dpobel committed Jul 31, 2014
1 parent 54892d1 commit 097977ff8324fce5f3769aa8c956dd3527eb2760
@@ -582,3 +582,28 @@ font-size:0.9em;
{
position:absolute;
}

/* asynchronous publishing queued page */
.ezap-placeholder h1 {
margin-bottom: 0.8em;
}

#ezap-message-publishing {
border-color: #555;
}

#ezap-message-publishing h1:before {
content: "\021BB";
color: #555;
}

#ezap-message-finished h1:before, #ezap-message-deferred h1:before {
content: "\02713";
color: #3e8d29;
font-weight: bold;
}

#ezap-error {
font-size: 1.4em;
padding: 0.5em;
}
@@ -8,6 +8,7 @@ var eZAsynchronousPublishingApp = (function() {
wait_time: 1000,
redirect_uri: false,
},
checkedCount = 0,
failureCount = 0,
errorElement, publishingElement, finishedElement, deferredElement;

@@ -50,6 +51,10 @@ var eZAsynchronousPublishingApp = (function() {
);
});
} else {
if ( checkedCount ) {
displayStatus(publishingElement, lastCheckUpdate);
}
checkedCount++;
retryUpdateStatus();
}
}
@@ -92,6 +97,10 @@ var eZAsynchronousPublishingApp = (function() {
if ( failureCount > ret.cfg.max_allowed_failures ) {
displayStatus(errorElement, message);
} else {
if ( checkedCount ) {
displayStatus(publishingElement, lastCheckUpdate);
}
checkedCount++;
retryUpdateStatus();
}
}
@@ -106,6 +115,29 @@ var eZAsynchronousPublishingApp = (function() {
Y.later(ret.cfg.wait_time, null, updateStatus, null, false);
}

/**
* Updates (or creates) the last check message indicating to the user how
* many times the publishing state was checked. This method is supposed to
* be passed as a callback to the `displayStatus` method.
*
* @method lastCheckUpdate
* @private
* @param {Y.Node} element
*/
function lastCheckUpdate(element) {
var last = element.one('.last-check');

if ( !last ) {
element.append('<span class="last-check"></span>');
last = element.one('.last-check');
}
last.setContent(
ret.cfg.last_checked_message.replace(
'%times%', checkedCount
).replace('%ms%', ret.cfg.wait_time)
);
}

/**
* Initializes the component to regularly checks the version status
* This methods expects the component to be configured before this method is
@@ -37,6 +37,8 @@ eZAsynchronousPublishingApp.cfg = {ldelim}
version: {$version},
redirect_uri: {if is_set( $redirect_uri )}"{$redirect_uri|wash( 'javascript' )}"{else}false{/if},
failure_message: "{'A fatal error occured while checking the version status, you can try to refresh this page or contact your administrator.'|i18n( 'design/standard/location' )|wash( 'javascript' )}",
last_checked_message: "{'(Checking every %ms%ms and checked %times% times so far)'|i18n( 'design/standard/location' )|wash( 'javascript' )}",
{rdelim};
eZAsynchronousPublishingApp.init()
</script>
@@ -46,20 +48,20 @@ eZAsynchronousPublishingApp.init()
</div>

{* placeholder for text shown while the object is being published *}
<div class="ezap-placeholder" id="ezap-message-publishing">
<div class="ezap-placeholder message-confirmation" id="ezap-message-publishing">
<h1>{'Your content is being published'|i18n( 'design/standard/content' )}</h1>
{"Please wait while your content is being published"|i18n('design/standard/location')}
</div>

{* placeholder for text shown when the object has been published *}
<div class="ezap-placeholder" id="ezap-message-finished" style="display: none">
<div class="ezap-placeholder message-feedback" id="ezap-message-finished" style="display: none">
<h1>{'Publishing finished'|i18n( 'design/standard/content' )}</h1>
{"Your content has been published successfully"|i18n( 'design/standard/location' )}<br />
<a id="ezap-contentview-uri" href="#">{"View the published item"|i18n('design/standard/location')}</a>
</div>

{* placeholder for text shown when publishing has been deferred to cron (for instance by ezapprove) *}
<div class="ezap-placeholder" id="ezap-message-deferred" style="display: none">
<div class="ezap-placeholder message-feedback" id="ezap-message-deferred" style="display: none">
<h1>{'Your content is pending an external action'|i18n( 'design/standard/content' )}</h1>
{"Publishing has been deferred to crontab and will be published when the operation resumes. The object is also listed in your dashboard under pending items."|i18n( 'design/standard/location' )}
<a id="ezap-versionview-uri" href="#">{"View your pending content"|i18n( 'design/standard/location' )}</a>

0 comments on commit 097977f

Please sign in to comment.
You can’t perform that action at this time.