mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 14:56:13 -06:00
fixed category trans field
This commit is contained in:
parent
6f8612d63e
commit
9b3adea75f
@ -1,6 +1,8 @@
|
|||||||
{% extends "theme::layouts/default" %}
|
{% extends "theme::layouts/default" %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
{% include "theme::partials/messages" %}
|
{% include "theme::partials/messages" %}
|
||||||
|
{{ asset_add("scripts.js", "streams::js/form/form.js") }}
|
||||||
|
{{ asset_add("scripts.js", "streams::js/form/translations.js") }}
|
||||||
|
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
@ -19,7 +21,12 @@
|
|||||||
})|raw }}
|
})|raw }}
|
||||||
<fieldset>
|
<fieldset>
|
||||||
<div class="section">
|
<div class="section">
|
||||||
{{ nameField|raw }}
|
{% set fields = form.fields.base().pluck('field_name').all() %}
|
||||||
|
<div class="field-group name">
|
||||||
|
{% for field in form.fields.translations('name') %}
|
||||||
|
{{ field.render({'form': form})|raw }}
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
{{ form.fields.slug|raw }}
|
{{ form.fields.slug|raw }}
|
||||||
<input type="hidden" name="parent_category"
|
<input type="hidden" name="parent_category"
|
||||||
value="{% if form.fields.parent_category.value.id is defined %}{{ form.fields.parent_category.value.id }}{% elseif app.request.get('parent') is defined %}{{ app.request.get('parent') }}{% endif %}">
|
value="{% if form.fields.parent_category.value.id is defined %}{{ form.fields.parent_category.value.id }}{% elseif app.request.get('parent') is defined %}{{ app.request.get('parent') }}{% endif %}">
|
||||||
|
|||||||
@ -147,21 +147,10 @@ class CategoryController extends AdminController
|
|||||||
}
|
}
|
||||||
|
|
||||||
return $this->redirect->to('/admin/cats');
|
return $this->redirect->to('/admin/cats');
|
||||||
} else {
|
|
||||||
$form->setFields(['name']);
|
|
||||||
$form->setActions(['save']);
|
|
||||||
$formBuilder = $form;
|
|
||||||
$nameField = HTMLDomParser::str_get_html($form->render()->getContent());
|
|
||||||
$nameField = $nameField->find('.name', 0);
|
|
||||||
if ($nameField !== null) {
|
|
||||||
$nameField = $nameField->innertext();
|
|
||||||
} else {
|
|
||||||
$nameField = "";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return $this->view->make('visiosoft.module.cats::cats/admin-cat', compact('nameField', 'formBuilder'));
|
return $this->view->make('visiosoft.module.cats::cats/admin-cat', compact('formBuilder'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function endsWith($string, $test) {
|
public function endsWith($string, $test) {
|
||||||
@ -184,18 +173,9 @@ class CategoryController extends AdminController
|
|||||||
die;
|
die;
|
||||||
}
|
}
|
||||||
return $this->redirect->to('/admin/cats');
|
return $this->redirect->to('/admin/cats');
|
||||||
} else {
|
|
||||||
$form->setFields(['name']);
|
|
||||||
$nameField = HTMLDomParser::str_get_html($form->render($id)->getContent());
|
|
||||||
$nameField = $nameField->find('.name', 0);
|
|
||||||
if ($nameField !== null) {
|
|
||||||
$nameField = $nameField->innertext();
|
|
||||||
} else {
|
|
||||||
$nameField = "";
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->view->make('visiosoft.module.cats::cats/admin-cat', compact('nameField'))->with('id', $id);
|
return $this->view->make('visiosoft.module.cats::cats/admin-cat')->with('id', $id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function delete(CategoryRepositoryInterface $categoryRepository, Request $request, CategoryModel $categoryModel, $id)
|
public function delete(CategoryRepositoryInterface $categoryRepository, Request $request, CategoryModel $categoryModel, $id)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user