Skip to content

Commit

Permalink
Port console templates to Twig
Browse files Browse the repository at this point in the history
Signed-off-by: Maurício Meneghini Fauth <mauriciofauth@gmail.com>
  • Loading branch information
MauricioFauth committed Jun 5, 2017
1 parent cd9948a commit 275baf6
Show file tree
Hide file tree
Showing 5 changed files with 222 additions and 263 deletions.
10 changes: 5 additions & 5 deletions libraries/Console.php
Expand Up @@ -96,7 +96,7 @@ public static function getBookmarkContent()
return Template::get('console/bookmark_content')
->render(
array(
'welcomeMessage' => $welcomeMessage,
'welcome_message' => $welcomeMessage,
'bookmarks' => $bookmarks,
)
);
Expand Down Expand Up @@ -132,10 +132,10 @@ public function getDisplay()
return Template::get('console/display')
->render(
array(
'cfgBookmark' => $cfgBookmark,
'image' => $image,
'_sql_history' => $_sql_history,
'bookmarkContent' => $bookmarkContent,
'cfg_bookmark' => $cfgBookmark,
'image' => $image,
'sql_history' => $_sql_history,
'bookmark_content' => $bookmarkContent,
)
);
}
Expand Down
31 changes: 0 additions & 31 deletions templates/console/bookmark_content.phtml

This file was deleted.

25 changes: 25 additions & 0 deletions templates/console/bookmark_content.twig
@@ -0,0 +1,25 @@
<div class="message welcome">
<span>{{ welcome_message }}</span>
</div>
{% for bookmark in bookmarks %}
<div class="message collapsed bookmark" bookmarkid="{{ bookmark.getId() }}"
targetdb="{{ bookmark.getDatabase() }}">
{% include 'console/query_action.twig' with {
'parent_div_classes': 'action_content',
'content_array': [
['action collapse', 'Collapse'|trans],
['action expand', 'Expand'|trans],
['action requery', 'Requery'|trans],
['action edit_bookmark', 'Edit'|trans],
['action delete_bookmark', 'Delete'|trans],
{0: 'text targetdb', 1: 'Database'|trans, 'extraSpan': bookmark.getDatabase()}
]
} only %}
<span class="bookmark_label{{ bookmark.getUser() is empty ? ' shared' }}">
{{ bookmark.getLabel() }}
</span>
<span class="query">
{{ bookmark.getQuery() }}
</span>
</div>
{% endfor %}
227 changes: 0 additions & 227 deletions templates/console/display.phtml

This file was deleted.

0 comments on commit 275baf6

Please sign in to comment.