зеркало из https://github.com/nextcloud/cookbook.git
Interface overhaul
This commit is contained in:
Родитель
2593347eeb
Коммит
d1b12c6ccf
|
@ -10,6 +10,7 @@
|
|||
return [
|
||||
'routes' => [
|
||||
['name' => 'page#index', 'url' => '/', 'verb' => 'GET'],
|
||||
['name' => 'page#home', 'url' => '/home', 'verb' => 'GET'],
|
||||
['name' => 'page#recipe', 'url' => '/recipe', 'verb' => 'GET'],
|
||||
['name' => 'page#edit', 'url' => '/edit', 'verb' => 'GET'],
|
||||
['name' => 'recipe#index', 'url' => '/recipes', 'verb' => 'GET'],
|
||||
|
|
108
css/style.css
108
css/style.css
|
@ -12,26 +12,15 @@
|
|||
#app-navigation .app-navigation-create {
|
||||
padding: 10px;
|
||||
}
|
||||
#app-navigation #clear-recipe-search {
|
||||
border-top: 1px solid var(--color-border-dark);
|
||||
border-bottom: 1px solid var(--color-border-dark);
|
||||
padding: 0 15px;
|
||||
}
|
||||
|
||||
#app-navigation input:hover ~ #clear-recipe-search,
|
||||
#app-navigation input:focus ~ #clear-recipe-search {
|
||||
border-color: var(--color-primary-element);
|
||||
}
|
||||
|
||||
#app-navigation .app-navigation-create .button {
|
||||
display: inline-block;
|
||||
width: 100%;
|
||||
padding: 6px 12px;
|
||||
padding-left: 12px;
|
||||
padding: 10px;
|
||||
padding-left: 34px;
|
||||
background-position: 10px center;
|
||||
text-align: left;
|
||||
margin: 0;
|
||||
border-radius: var(--border-radius);
|
||||
background-position: left 9px center;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
#app-navigation select {
|
||||
|
@ -47,7 +36,7 @@
|
|||
#app-navigation .app-navigation-new:not(:first-child) {
|
||||
padding-top: 0;
|
||||
}
|
||||
|
||||
|
||||
#app-navigation #create-recipe > button {
|
||||
height: 40px !important;
|
||||
}
|
||||
|
@ -61,7 +50,7 @@
|
|||
border-right-width: 0;
|
||||
flex-basis: 0;
|
||||
}
|
||||
|
||||
|
||||
#app-navigation .app-navigation-new button {
|
||||
border-radius: 0 var(--border-radius) var(--border-radius) 0;
|
||||
padding: 0 !important;
|
||||
|
@ -90,7 +79,7 @@
|
|||
background-position: left 9px center;
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
|
||||
#app-settings input[type="text"],
|
||||
#app-settings input[type="number"],
|
||||
#app-settings .button {
|
||||
|
@ -107,25 +96,36 @@
|
|||
|
||||
#app-content-wrapper {
|
||||
flex-wrap: wrap;
|
||||
padding: 2em;
|
||||
}
|
||||
.home {
|
||||
padding: 1rem;
|
||||
}
|
||||
|
||||
.home .feature {
|
||||
background-position: left top;
|
||||
min-height: 32px;
|
||||
padding-left: 32px;
|
||||
margin-top: 1em;
|
||||
}
|
||||
|
||||
.loader {
|
||||
text-align: center;
|
||||
flex-basis: 100%;
|
||||
padding-top: 50px;
|
||||
}
|
||||
|
||||
#controls {
|
||||
flex-basis: 100%;
|
||||
}
|
||||
#controls .pull-right {
|
||||
display: inline-flex;
|
||||
flex-grow: 100;
|
||||
flex-direction: row-reverse;
|
||||
}
|
||||
|
||||
#app-content-wrapper header {
|
||||
flex-basis: 100%;
|
||||
margin-bottom: 1rem;
|
||||
line-height: 1.5;
|
||||
}
|
||||
#app-content-wrapper header .recipe-toolbar {
|
||||
display: flex;
|
||||
justify-content: flex-end;
|
||||
}
|
||||
|
||||
#app-content-wrapper header .recipe-toolbar .button {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
#app-content-wrapper header img {
|
||||
max-width: 100%;
|
||||
max-height: 40vh;
|
||||
|
@ -154,6 +154,11 @@
|
|||
vertical-align: middle;
|
||||
}
|
||||
|
||||
#app-content-wrapper .recipe-content {
|
||||
padding: 1rem;
|
||||
flex-basis: 100%;
|
||||
}
|
||||
|
||||
#app-content-wrapper main {
|
||||
flex-basis: calc(100% - 22rem);
|
||||
}
|
||||
|
@ -169,11 +174,14 @@
|
|||
#app-content-wrapper form {
|
||||
width: 100%;
|
||||
}
|
||||
#app-content-wrapper form .recipe-edit {
|
||||
padding: 1rem;
|
||||
}
|
||||
#app-content-wrapper form fieldset {
|
||||
margin-bottom: 1em;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
|
||||
#app-content-wrapper form fieldset > input {
|
||||
width: calc(100% - 11em);
|
||||
margin: 0;
|
||||
|
@ -185,7 +193,7 @@
|
|||
border-bottom-right-radius: 0;
|
||||
border-right: 0;
|
||||
}
|
||||
|
||||
|
||||
#app-content-wrapper form fieldset > input[name="image"] + button {
|
||||
border-top-right-radius: var(--border-radius);
|
||||
border-bottom-right-radius: var(--border-radius);
|
||||
|
@ -194,7 +202,7 @@
|
|||
width: 3em;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
|
||||
#app-content-wrapper form fieldset > input[name="image"] + button > * {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
@ -205,7 +213,7 @@
|
|||
line-height: 18px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
#app-content-wrapper form fieldset ul label input[type="checkbox"] {
|
||||
margin-left: 1em;
|
||||
vertical-align: middle;
|
||||
|
@ -216,26 +224,36 @@
|
|||
margin-top: 1em;
|
||||
padding-left: 1em;
|
||||
}
|
||||
|
||||
|
||||
#app-content-wrapper form fieldset > ul > li > input {
|
||||
width: calc(100% - 3em);
|
||||
width: 100%;
|
||||
margin: 0 0 1em 0;
|
||||
}
|
||||
|
||||
|
||||
#app-content-wrapper form fieldset > ul > li > button {
|
||||
position: absolute;
|
||||
right: 10px;
|
||||
margin-top: 8px;
|
||||
margin-right: 9px;
|
||||
z-index: 10;
|
||||
}
|
||||
|
||||
#app-content-wrapper form fieldset > ul > li > textarea {
|
||||
width: calc(100% - 3em);
|
||||
margin: 0;
|
||||
height: 10em;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
#app-content-wrapper form fieldset > ul button {
|
||||
|
||||
#app-content-wrapper form fieldset button {
|
||||
border: 0;
|
||||
background-color: transparent;
|
||||
position: relative;
|
||||
top: -2px;
|
||||
}
|
||||
|
||||
#app-content-wrapper form fieldset button.right {
|
||||
float: right;
|
||||
}
|
||||
|
||||
#app-content-wrapper form button[type="submit"] {
|
||||
margin-left: auto;
|
||||
display: block;
|
||||
|
@ -261,7 +279,7 @@
|
|||
#app-content {
|
||||
margin-left: 0 !important;
|
||||
}
|
||||
|
||||
|
||||
#app-content header img {
|
||||
display: none !important;
|
||||
}
|
||||
|
|
Двоичный файл не отображается.
После Ширина: | Высота: | Размер: 775 B |
|
@ -0,0 +1,66 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<svg
|
||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
||||
xmlns:cc="http://creativecommons.org/ns#"
|
||||
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||
xmlns:svg="http://www.w3.org/2000/svg"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||
width="1792"
|
||||
height="1792"
|
||||
viewBox="0 0 1792 1792"
|
||||
version="1.1"
|
||||
id="svg4"
|
||||
sodipodi:docname="favicon.svg"
|
||||
inkscape:version="0.92.4 (5da689c313, 2019-01-14)">
|
||||
<metadata
|
||||
id="metadata10">
|
||||
<rdf:RDF>
|
||||
<cc:Work
|
||||
rdf:about="">
|
||||
<dc:format>image/svg+xml</dc:format>
|
||||
<dc:type
|
||||
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||
</cc:Work>
|
||||
</rdf:RDF>
|
||||
</metadata>
|
||||
<defs
|
||||
id="defs8" />
|
||||
<sodipodi:namedview
|
||||
pagecolor="#ffffff"
|
||||
bordercolor="#666666"
|
||||
borderopacity="1"
|
||||
objecttolerance="10"
|
||||
gridtolerance="10"
|
||||
guidetolerance="10"
|
||||
inkscape:pageopacity="0"
|
||||
inkscape:pageshadow="2"
|
||||
inkscape:window-width="1868"
|
||||
inkscape:window-height="1051"
|
||||
id="namedview6"
|
||||
showgrid="false"
|
||||
inkscape:snap-smooth-nodes="false"
|
||||
inkscape:object-nodes="false"
|
||||
inkscape:zoom="0.37249375"
|
||||
inkscape:cx="1148.918"
|
||||
inkscape:cy="894.66024"
|
||||
inkscape:window-x="52"
|
||||
inkscape:window-y="0"
|
||||
inkscape:window-maximized="1"
|
||||
inkscape:current-layer="svg4" />
|
||||
<rect
|
||||
style="fill:#0082c9;stroke-width:13.99482822"
|
||||
rx="279.90094"
|
||||
ry="279.89218"
|
||||
height="1791.3102"
|
||||
width="1791.3658"
|
||||
y="0.45423824"
|
||||
x="0.43064034"
|
||||
id="rect2" />
|
||||
<path
|
||||
d="m 849.81604,171.87247 v 569.22395 q 0,54.25415 -31.57414,98.72477 -31.57414,44.47063 -82.27065,62.25887 v 692.85224 q 0,46.2495 -33.79767,80.0471 -33.79767,33.7977 -80.04712,33.7977 H 508.28167 q -46.24945,0 -80.04712,-33.7977 -33.79767,-33.7976 -33.79767,-80.0471 V 902.08006 Q 343.74037,884.29182 312.16623,839.82119 280.59209,795.35057 280.59209,741.09642 V 171.87247 q 0,-23.12473 16.89884,-40.02356 16.89883,-16.89884 40.02356,-16.89884 23.12472,0 40.02355,16.89884 16.89884,16.89883 16.89884,40.02356 v 369.99556 q 0,23.12473 16.89884,40.02356 16.89883,16.89884 40.02356,16.89884 23.12472,0 40.02355,-16.89884 16.89884,-16.89883 16.89884,-40.02356 V 171.87247 q 0,-23.12473 16.89884,-40.02356 16.89883,-16.89884 40.02356,-16.89884 23.12472,0 40.02355,16.89884 16.89884,16.89883 16.89884,40.02356 v 369.99556 q 0,23.12473 16.89884,40.02356 16.89883,16.89884 40.02356,16.89884 23.12472,0 40.02355,-16.89884 16.89884,-16.89883 16.89884,-40.02356 V 171.87247 q 0,-23.12473 16.89884,-40.02356 16.89883,-16.89884 40.02356,-16.89884 23.12472,0 40.02355,16.89884 16.89884,16.89883 16.89884,40.02356 z m 683.06876,0 V 1594.9323 q 0,46.2495 -33.7977,80.0471 -33.7976,33.7977 -80.0471,33.7977 h -113.8448 q -46.2494,0 -80.0471,-33.7977 -33.7977,-33.7976 -33.7977,-80.0471 V 1139.5532 H 992.12198 q -11.5623,0 -20.0117,-8.4495 -8.4494,-8.4494 -8.4494,-20.0117 V 399.56205 q 0,-117.40244 83.60472,-201.00721 83.6048,-83.60477 201.0072,-83.60477 h 227.6896 q 23.1247,0 40.0236,16.89884 16.8988,16.89883 16.8988,40.02356 z"
|
||||
id="path2"
|
||||
inkscape:connector-curvature="0"
|
||||
style="fill:#ffffff;stroke-width:0.8894124" />
|
||||
</svg>
|
После Ширина: | Высота: | Размер: 3.3 KiB |
29
js/script.js
29
js/script.js
|
@ -152,8 +152,7 @@ var Content = function (cookbook) {
|
|||
var isEditor = location.hash.indexOf('|edit') > -1 || location.hash === '#new';
|
||||
|
||||
if(!recipeId && !isEditor) {
|
||||
$('#app-content-wrapper').html(t(appName, 'Please pick a recipe'));
|
||||
|
||||
$('#app-content-wrapper').load(cookbook._baseUrl + '/home');
|
||||
} else {
|
||||
$.ajax({
|
||||
url: cookbook._baseUrl + '/' + (isEditor ? 'edit' : 'recipe') + (isEditor && !recipeId ? '?new' : '?id=' + recipeId),
|
||||
|
@ -289,11 +288,11 @@ var Content = function (cookbook) {
|
|||
self.onAddListItem = function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
var $ul = $(e.currentTarget).parents('ul');
|
||||
var $add = $ul.find('.icon-add');
|
||||
var $ul = $(e.currentTarget).closest('fieldset').children('ul');
|
||||
var template = $ul.find('template').html();
|
||||
var $item = $(template);
|
||||
|
||||
var $item = $(template).insertBefore($add);
|
||||
$ul.append($item);
|
||||
|
||||
$item.find('input').focus();
|
||||
|
||||
|
@ -330,6 +329,8 @@ var Content = function (cookbook) {
|
|||
var Nav = function (cookbook) {
|
||||
var self = this;
|
||||
|
||||
self.query = null;
|
||||
|
||||
/**
|
||||
* Event: Change recipe folder
|
||||
*/
|
||||
|
@ -382,16 +383,14 @@ var Nav = function (cookbook) {
|
|||
self.onCategorizeRecipes = function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#find-recipes input').val('');
|
||||
|
||||
self.render();
|
||||
};
|
||||
|
||||
/**
|
||||
* Event: Submit new search query
|
||||
*/
|
||||
self.onFindRecipes = function(e) {
|
||||
e.preventDefault();
|
||||
self.onFindRecipes = function(query) {
|
||||
self.query = query;
|
||||
|
||||
$('#categorize-recipes select').val(null);
|
||||
|
||||
|
@ -416,12 +415,10 @@ var Nav = function (cookbook) {
|
|||
/**
|
||||
* Event: Clear recipe search
|
||||
*/
|
||||
self.onClearRecipeSearch = function(e) {
|
||||
e.preventDefault();
|
||||
self.onClearRecipeSearch = function() {
|
||||
self.query = null;
|
||||
|
||||
$('#find-recipes input').val('');
|
||||
|
||||
self.onFindRecipes(e);
|
||||
self.render();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -430,7 +427,7 @@ var Nav = function (cookbook) {
|
|||
* @return {String} Keywords
|
||||
*/
|
||||
self.getKeywords = function() {
|
||||
return [$('#categorize-recipes select').val(), $('#find-recipes input').val()].join(',');
|
||||
return [$('#categorize-recipes select').val(), self.query].join(',');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -504,6 +501,8 @@ var Nav = function (cookbook) {
|
|||
$('#reindex-recipes').click(self.onReindexRecipes);
|
||||
|
||||
};
|
||||
|
||||
this.search = new OCA.Search(self.onFindRecipes, self.onClearRecipeSearch);
|
||||
}
|
||||
|
||||
var cookbook = new Cookbook(OC.generateUrl('/apps/cookbook'));
|
||||
|
|
|
@ -45,6 +45,18 @@ class PageController extends Controller
|
|||
return new TemplateResponse($this->appName, 'index', $view_data); // templates/index.php
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
*/
|
||||
public function home()
|
||||
{
|
||||
$response = new TemplateResponse($this->appName, 'navigation/home');
|
||||
$response->renderAs('blank');
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
/**
|
||||
* @NoAdminRequired
|
||||
* @NoCSRFRequired
|
||||
|
@ -83,11 +95,11 @@ class PageController extends Controller
|
|||
|
||||
if (isset($_GET['id'])) {
|
||||
$recipe = $this->service->getRecipeById($_GET['id']);
|
||||
|
||||
|
||||
if(!$recipe) { throw new \Exception('Recipe ' . $_GET['id'] . ' not found'); }
|
||||
|
||||
$recipe['id'] = $_GET['id'];
|
||||
|
||||
|
||||
}
|
||||
|
||||
$response = new TemplateResponse($this->appName, 'content/edit', $recipe);
|
||||
|
|
|
@ -1,121 +1,156 @@
|
|||
<header>
|
||||
<div class="recipe-toolbar">
|
||||
<a href="#<?php echo $_['id']; ?>" class="svg action icon-close"></a>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<form id="editRecipeForm" action="#" method="POST">
|
||||
<fieldset>
|
||||
<label><?php /* TRANSLATORS The name of the recipe */
|
||||
echo p($l->t('Name')); ?></label>
|
||||
<input required type="text" name="name" value="<?php if(isset($_['name'])) { echo $_['name']; } ?>"></h2>
|
||||
</fieldset>
|
||||
<div id="controls">
|
||||
<div class="breadcrumb">
|
||||
<div class="crumb svg crumbmenu hidden">
|
||||
<a class="icon-more menutoggle" aria-expanded="false"></a>
|
||||
<div class="popovermenu menu-center menu">
|
||||
<ul>
|
||||
<li class="crumblist ui-droppable in-breadcrumb">
|
||||
<a href="#">
|
||||
<span class="icon-folder"></span>
|
||||
<span><?php p($l->t('Home')); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="crumblist in-breadcrumb">
|
||||
<a href="#<?php echo $_['id']; ?>">
|
||||
<span class="icon-folder"></span>
|
||||
<span><?php echo $_['id'] ? $_['name'] : p($l->t('New recipe')); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="crumb svg crumbhome ui-droppable">
|
||||
<a href="#" class="icon-home"><?php p($l->t('Home')); ?></a>
|
||||
</div>
|
||||
<div class="crumb svg">
|
||||
<a href="#<?php echo $_['id']; ?>"><?php echo $_['id'] ? $_['name'] : p($l->t('New recipe')); ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button type="submit">
|
||||
<span class="icon icon-checkmark"></span>
|
||||
<span class="hidden-visually"><?php p($l->t('Save changes')); ?></span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<fieldset>
|
||||
<label><?php /* TRANSLATORS The description of the recipe */
|
||||
echo p($l->t('Description')); ?></label>
|
||||
<input type="text" name="description" value="<?php if(isset($_['description'])) { echo $_['description']; } ?>">
|
||||
</fieldset>
|
||||
<div class="actions pull-right">
|
||||
<a id="edit-recipe" href="#<?php echo $_['id']; ?>" class="button svg action" title="<?php p($l->t('Cancel')); ?>">
|
||||
<span class="icon icon-close"></span>
|
||||
<span class="hidden-visually"><?php p($l->t('Cancel')); ?></span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<fieldset>
|
||||
<label><?php p($l->t('URL')); ?></label>
|
||||
<input type="url" name="url" value="<?php if(isset($_['url'])) { echo $_['url']; } ?>">
|
||||
</fieldset>
|
||||
<div class="recipe-edit">
|
||||
<fieldset>
|
||||
<label><?php /* TRANSLATORS The name of the recipe */
|
||||
echo p($l->t('Name')); ?></label>
|
||||
<input required type="text" name="name" value="<?php if(isset($_['name'])) { echo $_['name']; } ?>"></h2>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<label><?php p($l->t('Image')); ?></label>
|
||||
<input type="text" name="image" value="<?php if(isset($_['image'])) { echo $_['image']; } ?>"><button type="button" id="pick-image" title="<?php p($l->t('Pick a local image')) ?>"><span class="icon-category-multimedia"></span></button>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label><?php /* TRANSLATORS The description of the recipe */
|
||||
echo p($l->t('Description')); ?></label>
|
||||
<input type="text" name="description" value="<?php if(isset($_['description'])) { echo $_['description']; } ?>">
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<label><?php p($l->t('Preparation time')); ?></label>
|
||||
<input type="text" name="prepTime" value="<?php if(isset($_['prepTime'])) {echo $_['prepTime']; } ?>" placeholder="PT0H15M">
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label><?php p($l->t('URL')); ?></label>
|
||||
<input type="url" name="url" value="<?php if(isset($_['url'])) { echo $_['url']; } ?>">
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<label><?php p($l->t('Cooking time')); ?></label>
|
||||
<input type="text" name="cookTime" value="<?php if(isset($_['cookTime'])) { echo $_['cookTime']; } ?>" placeholder="PT1H30M">
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label><?php p($l->t('Image')); ?></label>
|
||||
<input type="text" name="image" value="<?php if(isset($_['image'])) { echo $_['image']; } ?>"><button type="button" id="pick-image" title="<?php p($l->t('Pick a local image')) ?>"><span class="icon-category-multimedia"></span></button>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<label><?php p($l->t('Total time')); ?></label>
|
||||
<input type="text" name="totalTime" value="<?php if(isset($_['totalTime'])) { echo $_['totalTime']; } ?>" placeholder="PT1H30M">
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label><?php p($l->t('Preparation time')); ?></label>
|
||||
<input type="text" name="prepTime" value="<?php if(isset($_['prepTime'])) {echo $_['prepTime']; } ?>" placeholder="PT0H15M">
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<label><?php p($l->t('Keywords (comma-separated)')); ?></label>
|
||||
<input type="text" name="keywords" value="<?php if(isset($_['keywords'])) { echo $_['keywords']; } ?>">
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label><?php p($l->t('Cooking time')); ?></label>
|
||||
<input type="text" name="cookTime" value="<?php if(isset($_['cookTime'])) { echo $_['cookTime']; } ?>" placeholder="PT1H30M">
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<label><?php p($l->t('Servings')); ?></label>
|
||||
<input type="number" name="recipeYield" value="<?php if(isset($_['recipeYield'])) { echo $_['recipeYield']; } ?>">
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<label><?php p($l->t('Total time')); ?></label>
|
||||
<input type="text" name="totalTime" value="<?php if(isset($_['totalTime'])) { echo $_['totalTime']; } ?>" placeholder="PT1H30M">
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<label><?php p($l->t('Tools')); ?></label>
|
||||
<ul>
|
||||
<template>
|
||||
<li>
|
||||
<input type="text" name="tool[]" value="">
|
||||
<button class="icon-delete"></button>
|
||||
</li>
|
||||
</template>
|
||||
<?php if(isset($_['tool']) && is_array($_['tool'])) { ?>
|
||||
<?php foreach ($_['tool'] as $i => $tool) { ?>
|
||||
<fieldset>
|
||||
<label><?php p($l->t('Keywords (comma-separated)')); ?></label>
|
||||
<input type="text" name="keywords" value="<?php if(isset($_['keywords'])) { echo $_['keywords']; } ?>">
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<label><?php p($l->t('Servings')); ?></label>
|
||||
<input type="number" name="recipeYield" value="<?php if(isset($_['recipeYield'])) { echo $_['recipeYield']; } ?>">
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<button class="icon-add right"></button>
|
||||
<label><?php p($l->t('Tools')); ?></label>
|
||||
<ul>
|
||||
<template>
|
||||
<li>
|
||||
<input type="text" name="tool[]" value="<?php echo $tool; ?>">
|
||||
<input type="text" name="tool[]" value="">
|
||||
<button class="icon-delete"></button>
|
||||
</li>
|
||||
</template>
|
||||
<?php if(isset($_['tool']) && is_array($_['tool'])) { ?>
|
||||
<?php foreach ($_['tool'] as $i => $tool) { ?>
|
||||
<li>
|
||||
<input type="text" name="tool[]" value="<?php echo $tool; ?>">
|
||||
<button class="icon-delete"></button>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<button class="icon-add"></button>
|
||||
</ul>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<label><?php p($l->t('Ingredients')); ?></label>
|
||||
</ul>
|
||||
</fieldset>
|
||||
|
||||
<ul>
|
||||
<template>
|
||||
<li>
|
||||
<input type="text" name="recipeIngredient[]" value="">
|
||||
<button class="icon-delete"></button>
|
||||
</li>
|
||||
</template>
|
||||
<?php if(isset($_['recipeIngredient']) && is_array($_['recipeIngredient'])) { ?>
|
||||
<?php foreach ($_['recipeIngredient'] as $i => $ingredient) { ?>
|
||||
<fieldset>
|
||||
<button class="icon-add right"></button>
|
||||
<label><?php p($l->t('Ingredients')); ?></label>
|
||||
<ul>
|
||||
<template>
|
||||
<li>
|
||||
<input type="text" name="recipeIngredient[]" value="<?php echo $ingredient; ?>">
|
||||
<input type="text" name="recipeIngredient[]" value="">
|
||||
<button class="icon-delete"></button>
|
||||
</li>
|
||||
</template>
|
||||
<?php if(isset($_['recipeIngredient']) && is_array($_['recipeIngredient'])) { ?>
|
||||
<?php foreach ($_['recipeIngredient'] as $i => $ingredient) { ?>
|
||||
<li>
|
||||
<input type="text" name="recipeIngredient[]" value="<?php echo $ingredient; ?>">
|
||||
<button class="icon-delete"></button>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<button class="icon-add"></button>
|
||||
</ul>
|
||||
</fieldset>
|
||||
</ul>
|
||||
</fieldset>
|
||||
|
||||
<fieldset>
|
||||
<label><?php p($l->t('Instructions')); ?></label>
|
||||
|
||||
<ul>
|
||||
<template>
|
||||
<li>
|
||||
<textarea name="recipeInstructions[]"></textarea>
|
||||
<button class="icon-delete"></button>
|
||||
</li>
|
||||
</template>
|
||||
<?php if(isset($_['recipeInstructions']) && is_array($_['recipeInstructions'])) { ?>
|
||||
<?php foreach ($_['recipeInstructions'] as $i => $step) { ?>
|
||||
<fieldset>
|
||||
<button class="icon-add right"></button>
|
||||
<label><?php p($l->t('Instructions')); ?></label>
|
||||
<ul>
|
||||
<template>
|
||||
<li>
|
||||
<textarea name="recipeInstructions[]"><?php echo $step; ?></textarea>
|
||||
<textarea name="recipeInstructions[]"></textarea>
|
||||
<button class="icon-delete"></button>
|
||||
</li>
|
||||
</template>
|
||||
<?php if(isset($_['recipeInstructions']) && is_array($_['recipeInstructions'])) { ?>
|
||||
<?php foreach ($_['recipeInstructions'] as $i => $step) { ?>
|
||||
<li>
|
||||
<textarea name="recipeInstructions[]"><?php echo $step; ?></textarea>
|
||||
<button class="icon-delete"></button>
|
||||
</li>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<button class="icon-add"></button>
|
||||
</ul>
|
||||
</fieldset>
|
||||
|
||||
<button type="submit"><?php p($l->t('Save')); ?></button>
|
||||
</ul>
|
||||
</fieldset>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
@ -1,16 +1,58 @@
|
|||
<header>
|
||||
<?php if(isset($_['image']) && $_['image']) { ?>
|
||||
<img src="<?php echo $_['imageURL']; ?>&t=<?php echo time(); ?>">
|
||||
<?php } ?>
|
||||
|
||||
<div class="recipe-toolbar">
|
||||
<a id="edit-recipe" href="#<?php echo $_['id']; ?>|edit" class="button svg action icon-rename" title="<?php p($l->t('Edit recipe')); ?>"></a>
|
||||
<button id="print-recipe" class="button svg action icon-category-office" title="<?php p($l->t('Print recipe')); ?>"></button>
|
||||
<button id="delete-recipe" class="button svg action icon-delete" data-id="<?php echo $_['id']; ?>" title="<?php p($l->t('Delete recipe')); ?>"></button>
|
||||
<div id="controls">
|
||||
<div class="breadcrumb">
|
||||
<div class="crumb svg crumbmenu hidden">
|
||||
<a class="icon-more menutoggle" aria-expanded="false"></a>
|
||||
<div class="popovermenu menu-center menu">
|
||||
<ul>
|
||||
<li class="crumblist ui-droppable in-breadcrumb">
|
||||
<a href="#">
|
||||
<span class="icon-folder"></span>
|
||||
<span><?php p($l->t('Home')); ?></span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="crumblist in-breadcrumb">
|
||||
<a href="#<?php echo $_['id']; ?>">
|
||||
<span class="icon-folder"></span>
|
||||
<span><?php echo $_['name']; ?></span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="crumb svg crumbhome ui-droppable">
|
||||
<a href="#" class="icon-home"><?php p($l->t('Home')); ?></a>
|
||||
</div>
|
||||
<div class="crumb svg">
|
||||
<a href="#<?php echo $_['id']; ?>"><?php echo $_['name']; ?></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<a id="edit-recipe" href="#<?php echo $_['id']; ?>|edit" class="button svg action" title="<?php p($l->t('Edit recipe')); ?>">
|
||||
<span class="icon icon-rename"></span>
|
||||
<span class="hidden-visually"><?php p($l->t('Edit recipe')); ?></span>
|
||||
</a>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button id="print-recipe" class="button svg action" title="<?php p($l->t('Print recipe')); ?>">
|
||||
<span class="icon icon-category-office"></span>
|
||||
<span class="hidden-visually"><?php p($l->t('Print recipe')); ?></span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="actions">
|
||||
<button id="delete-recipe" class="button svg action" data-id="<?php echo $_['id']; ?>" title="<?php p($l->t('Delete recipe')); ?>">
|
||||
<span class="icon icon-delete"></span>
|
||||
<span class="hidden-visually"><?php p($l->t('Delete recipe')); ?></span>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2><?php echo $_['name']; ?></h2>
|
||||
|
||||
<?php if(isset($_['image']) && $_['image']) { ?>
|
||||
<header>
|
||||
<img src="<?php echo $_['imageURL']; ?>&t=<?php echo time(); ?>">
|
||||
</header>
|
||||
<?php } ?>
|
||||
|
||||
<div class="recipe-content">
|
||||
<div class="recipe-details">
|
||||
<?php if(isset($_['url']) && $_['url']) { ?>
|
||||
<p><strong><?php p($l->t('Source')); ?>: </strong><a target="_blank" href="<?php echo $_['url']; ?>"><?php echo $_['url']; ?></a></p>
|
||||
|
@ -47,29 +89,35 @@
|
|||
</header>
|
||||
|
||||
<aside>
|
||||
<ul>
|
||||
<h3><?php p($l->t('Tools')); ?></h3>
|
||||
<?php if(!empty($_['tools'])) { ?>
|
||||
<ul>
|
||||
<h3><?php p($l->t('Tools')); ?></h3>
|
||||
|
||||
<?php foreach($_['tool'] as $tools) { ?>
|
||||
<li><?php echo $tools; ?></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<?php foreach($_['tool'] as $tools) { ?>
|
||||
<li><?php echo $tools; ?></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
<?php } ?>
|
||||
<?php if(!empty($_['recipeIngredient'])) { ?>
|
||||
<ul>
|
||||
<h3><?php p($l->t('Ingredients')); ?></h3>
|
||||
|
||||
<?php foreach($_['recipeIngredient'] as $ingredient) { ?>
|
||||
<li><?php echo $ingredient; ?></li>
|
||||
<li><?php echo $ingredient; ?></li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</ul>
|
||||
<?php } ?>
|
||||
</aside>
|
||||
|
||||
<main>
|
||||
<ol>
|
||||
<h3><?php p($l->t('Instructions')); ?></h3>
|
||||
<?php if(!empty($_['recipeInstructions'])) { ?>
|
||||
<main>
|
||||
<ol>
|
||||
<h3><?php p($l->t('Instructions')); ?></h3>
|
||||
|
||||
<?php foreach($_['recipeInstructions'] as $step) { ?>
|
||||
<li><?php echo nl2br($step); ?></li>
|
||||
<?php } ?>
|
||||
</ol>
|
||||
</main>
|
||||
<?php foreach($_['recipeInstructions'] as $step) { ?>
|
||||
<li><?php echo nl2br($step); ?></li>
|
||||
<?php } ?>
|
||||
</ol>
|
||||
</main>
|
||||
<?php } ?>
|
||||
|
||||
|
|
|
@ -4,14 +4,17 @@ style('cookbook', 'style');
|
|||
?>
|
||||
|
||||
<div id="app">
|
||||
<div id="app-navigation">
|
||||
<div id="app-navigation">
|
||||
<?php print_unescaped($this->inc('navigation/index')); ?>
|
||||
<?php print_unescaped($this->inc('settings/index')); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="app-content">
|
||||
<div id="app-content">
|
||||
<div id="app-content-wrapper">
|
||||
</div>
|
||||
</div>
|
||||
<div class="loader">
|
||||
<span class="icon-loading"></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -0,0 +1,12 @@
|
|||
<div class="home">
|
||||
<h2><?php p($l->t('Cookbook')); ?></h2>
|
||||
<div class="feature icon-add">
|
||||
<?php p($l->t('Create a new recipe by clicking on "Create recipe" in the app navigation.')); ?>
|
||||
</div>
|
||||
<div class="feature icon-files-dark">
|
||||
<?php p($l->t('Organize your recipes with tags.')); ?>
|
||||
</div>
|
||||
<div class="feature icon-search">
|
||||
<?php p($l->t('Search your favorite recipe with the global search.')); ?>
|
||||
</div>
|
||||
</div>
|
|
@ -10,19 +10,6 @@
|
|||
</button>
|
||||
</form>
|
||||
|
||||
<form id="find-recipes" class="app-navigation-new">
|
||||
<input list="list-keywords" name="keywords" placeholder="<?php p($l->t('Search')); ?>" multiple>
|
||||
<datalist id="list-keywords">
|
||||
<?php foreach($_['all_keywords'] as $keyword) { ?>
|
||||
<?php if(!isset($keyword['name']) || empty($keyword['name'])) { continue; } ?>
|
||||
|
||||
<option value="<?php echo $keyword['name']; ?>">
|
||||
<?php } ?>
|
||||
</datalist>
|
||||
<a id="clear-recipe-search" class="icon-close"></a>
|
||||
<button class="icon-category-search" type="submit"></button>
|
||||
</form>
|
||||
|
||||
<form id="categorize-recipes" class="app-navigation-new">
|
||||
<select name="keywords">
|
||||
<option selected value=""><?php p($l->t('All')); ?></option>
|
||||
|
|
Загрузка…
Ссылка в новой задаче