Skip to content

Commit

Permalink
version 0.9.2
Browse files Browse the repository at this point in the history
  • Loading branch information
engram-design committed Jul 8, 2016
1 parent 9bbac18 commit 73a2c32
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 75 deletions.
8 changes: 8 additions & 0 deletions changelog.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
3 changes: 2 additions & 1 deletion workflow/WorkflowPlugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function getName()

public function getVersion()
{
return '0.9.1';
return '0.9.2';
}

public function getSchemaVersion()
Expand Down Expand Up @@ -60,6 +60,7 @@ public function getSettingsUrl()
public function registerCpRoutes()
{
return array(
'workflow/drafts' => array('action' => 'workflow/drafts'),
'workflow/settings' => array('action' => 'workflow/settings'),
);
}
Expand Down
11 changes: 11 additions & 0 deletions workflow/controllers/WorkflowController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -19,6 +29,7 @@ public function actionSettings()
));
}


//
// Front-End
//
Expand Down
1 change: 1 addition & 0 deletions workflow/templates/_layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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') },
} %}

Expand Down
44 changes: 44 additions & 0 deletions workflow/templates/drafts.html
Original file line number Diff line number Diff line change
@@ -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 %}
<table id="entries" class="data fullwidth collapsible">
<thead>
<tr>
<th scope="col">{{ 'Entry' | t }}</th>
<th scope="col">{{ 'Date Created' | t }}</th>
<th scope="col">{{ 'Date Updated' | t }}</th>
<td class="thin"></td>
</tr>
</thead>
<tbody>
{% for entry in entries %}
<tr data-id="{{ entry.id }}">
<th scope="row" data-title="{{ 'Name' | t }}">
<a href="{{ entry.cpEditUrl }}">{{ entry.title }}</a>
</th>

<td data-title="{{ 'Date created' | t }}">
{{ entry.dateCreated | date('Y-m-d H:i:s') }}
</td>

<td data-title="{{ 'Date updated' | t }}">
{{ entry.dateUpdated | date('Y-m-d H:i:s') }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>{{ "No draft entries." | t }}</p>
{% endif %}

{% endblock %}
74 changes: 0 additions & 74 deletions workflow/templates/index.html
Original file line number Diff line number Diff line change
@@ -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 %}
<table id="submissions" class="data fullwidth collapsible">
<thead>
<tr>
<th scope="col">{{ 'Entry' | t }}</th>
<th scope="col">{{ 'Editor' | t }}</th>
<th scope="col">{{ 'Date Submitted' | t }}</th>
<th scope="col">{{ 'Publisher' | t }}</th>
<th scope="col">{{ 'Date Approved' | t }}</th>
<td class="thin"></td>
</tr>
</thead>
<tbody>
{% for submission in submissions %}
<tr data-id="{{ submission.id }}">
<th scope="row" data-title="{{ 'Name' | t }}">
{% if submission.approved %}
<span class="status green"></span>
{% else %}
<span class="status"></span>
{% endif %}

<a href="{{ submission.element.cpEditUrl }}">{{ submission.element.title }}</a>
</th>

<td data-title="{{ 'Editor' | t }}">
<a href="{{ submission.editor.cpEditUrl }}">{{ submission.editor }}</a>
</td>

<td data-title="{{ 'Date submitted' | t }}">
{{ submission.dateCreated | date('Y-m-d H:i:s') }}
</td>

<td data-title="{{ 'Publisher' | t }}">
{% if submission.publisher %}
<a href="{{ submission.publisher.cpEditUrl }}">{{ submission.publisher }}</a>
{% endif %}
</td>

<td data-title="{{ 'Date approved' | t }}">
{{ submission.dateApproved | date('Y-m-d H:i:s') }}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<p>{{ "No entries in the queue to approve." | t }}</p>
{% endif %}

{% endblock %}

{% set js %}
new Craft.AdminTable({
tableSelector: '#submissions',
noObjectsSelector: '#nosubmissions',
});
{% endset %}
{% includeJs js %}#}




{% set parentLayout = '_layouts/elementindex' %}
{% extends "workflow/_layouts" %}

Expand Down

0 comments on commit 73a2c32

Please sign in to comment.