mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
fixed category trans field
This commit is contained in:
parent
6f8612d63e
commit
9b3adea75f
@ -1,13 +1,15 @@
|
||||
{% extends "theme::layouts/default" %}
|
||||
{% block content %}
|
||||
{% 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="card">
|
||||
<div class="card-block">
|
||||
|
||||
{% set actions = ['save'] %}
|
||||
|
||||
|
||||
{% if id is not null %}
|
||||
{% set actions = ['update'] %}
|
||||
{% endif %}
|
||||
@ -19,7 +21,12 @@
|
||||
})|raw }}
|
||||
<fieldset>
|
||||
<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 }}
|
||||
<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 %}">
|
||||
|
||||
@ -147,21 +147,10 @@ class CategoryController extends AdminController
|
||||
}
|
||||
|
||||
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) {
|
||||
@ -184,18 +173,9 @@ class CategoryController extends AdminController
|
||||
die;
|
||||
}
|
||||
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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user