diff --git a/changelog.json b/changelog.json index 422ee0f..d9de12f 100644 --- a/changelog.json +++ b/changelog.json @@ -1,4 +1,12 @@ [ + { + "version": "0.9.2", + "downloadUrl": "https://github.com/engram-design/Comments/archive/0.9.2.zip", + "date": "2016-07-08T23:00:00+10:00", + "notes": [ + "[Added] Added Draft overview screen - shows all available drafts site-wide." + ] + }, { "version": "0.9.1", "downloadUrl": "https://github.com/engram-design/Comments/archive/0.9.1.zip", diff --git a/workflow/WorkflowPlugin.php b/workflow/WorkflowPlugin.php index 36e0dd5..8d03089 100644 --- a/workflow/WorkflowPlugin.php +++ b/workflow/WorkflowPlugin.php @@ -14,7 +14,7 @@ public function getName() public function getVersion() { - return '0.9.1'; + return '0.9.2'; } public function getSchemaVersion() @@ -60,6 +60,7 @@ public function getSettingsUrl() public function registerCpRoutes() { return array( + 'workflow/drafts' => array('action' => 'workflow/drafts'), 'workflow/settings' => array('action' => 'workflow/settings'), ); } diff --git a/workflow/controllers/WorkflowController.php b/workflow/controllers/WorkflowController.php index be824b2..0dfa077 100644 --- a/workflow/controllers/WorkflowController.php +++ b/workflow/controllers/WorkflowController.php @@ -10,6 +10,16 @@ class WorkflowController extends BaseController // Control Panel // + public function actionDrafts() + { + $records = EntryDraftRecord::model()->findAll(); + $drafts = EntryDraftModel::populateModels($records); + + $this->renderTemplate('workflow/drafts', array( + 'entries' => $drafts, + )); + } + public function actionSettings() { $settings = craft()->workflow->getSettings(); @@ -19,6 +29,7 @@ public function actionSettings() )); } + // // Front-End // diff --git a/workflow/templates/_layouts/index.html b/workflow/templates/_layouts/index.html index 0816b1a..811420d 100644 --- a/workflow/templates/_layouts/index.html +++ b/workflow/templates/_layouts/index.html @@ -6,6 +6,7 @@ {% set tabs = { workflow: { label: "Overview" | t, url: url('workflow') }, + drafts: { label: "Drafts" | t, url: url('workflow/drafts') }, settings: { label: "Settings" | t, url: url('workflow/settings') }, } %} diff --git a/workflow/templates/drafts.html b/workflow/templates/drafts.html new file mode 100644 index 0000000..12b7d23 --- /dev/null +++ b/workflow/templates/drafts.html @@ -0,0 +1,44 @@ +{% extends "workflow/_layouts" %} + +{% set crumbs = [ + { label: "Workflow" | t, url: url('workflow') }, + { label: "Drafts" | t, url: url('workflow/drafts') }, +] %} + +{% set selectedTab = 'drafts' %} + +{% block blockContent %} + +{% if entries | length %} + + + + + + + + + + + {% for entry in entries %} + + + + + + + + {% endfor %} + +
{{ 'Entry' | t }}{{ 'Date Created' | t }}{{ 'Date Updated' | t }}
+ {{ entry.title }} + + {{ entry.dateCreated | date('Y-m-d H:i:s') }} + + {{ entry.dateUpdated | date('Y-m-d H:i:s') }} +
+{% else %} +

{{ "No draft entries." | t }}

+{% endif %} + +{% endblock %} \ No newline at end of file diff --git a/workflow/templates/index.html b/workflow/templates/index.html index f3ea97e..52d00a6 100644 --- a/workflow/templates/index.html +++ b/workflow/templates/index.html @@ -1,77 +1,3 @@ -{#{% extends "workflow/_layouts" %} - -{% set crumbs = [ - { label: "Workflow" | t, url: url('workflow') }, - { label: "Overview" | t, url: url('workflow') }, -] %} - -{% set selectedTab = 'workflow' %} - -{% block blockContent %} - -{% if submissions | length %} - - - - - - - - - - - - - {% for submission in submissions %} - - - - - - - - - - - - {% endfor %} - -
{{ 'Entry' | t }}{{ 'Editor' | t }}{{ 'Date Submitted' | t }}{{ 'Publisher' | t }}{{ 'Date Approved' | t }}
- {% if submission.approved %} - - {% else %} - - {% endif %} - - {{ submission.element.title }} - - {{ submission.editor }} - - {{ submission.dateCreated | date('Y-m-d H:i:s') }} - - {% if submission.publisher %} - {{ submission.publisher }} - {% endif %} - - {{ submission.dateApproved | date('Y-m-d H:i:s') }} -
-{% else %} -

{{ "No entries in the queue to approve." | t }}

-{% endif %} - -{% endblock %} - -{% set js %} - new Craft.AdminTable({ - tableSelector: '#submissions', - noObjectsSelector: '#nosubmissions', - }); -{% endset %} -{% includeJs js %}#} - - - - {% set parentLayout = '_layouts/elementindex' %} {% extends "workflow/_layouts" %}