mirror of
https://github.com/fluent/fluentd-ui.git
synced 2025-08-14 18:27:06 +02:00
Convert to Haml
But we cannot use b-collapse and v-b-toggle here. Because `v-b-toggle="id"` does not reactive. Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
This commit is contained in:
parent
b715a0288e
commit
7feeeeb17a
@ -1,25 +0,0 @@
|
||||
<%- add_javascript_pack_tag('codemirror') %>
|
||||
|
||||
<script type="text/x-template" id="vue-setting-section">
|
||||
|
||||
<div class="card card-primary mb-3">
|
||||
<div class="card-header" data-toggle="collapse" v-bind:href="'#'+id" v-bind:title="content">
|
||||
<i class="fa fa-caret-down"></i>
|
||||
{{ type }}
|
||||
<span v-if="!_.isEmpty(arg) && (name == 'match' || name == 'filter')">({{ arg }})</span>
|
||||
</div>
|
||||
<div class="card-body collapse" v-bind:id="id">
|
||||
<pre v-if="mode != 'edit'">{{ content }}</pre>
|
||||
<p v-if="mode == 'edit'">
|
||||
<textarea v-config-editor class="form-control" v-model.lazy="content" v-bind:disabled="processing"></textarea>
|
||||
</p>
|
||||
<p class="float-right">
|
||||
<button v-if="mode != 'edit'" class="btn btn-secondary" v-on:click="onEdit"><%= t('terms.edit') %></button>
|
||||
<button v-if="mode != 'edit'" class="btn btn-danger" v-on:click="onDelete"><%= t('terms.destroy') %></button>
|
||||
<button v-if="mode == 'edit'" class="btn btn-secondary" v-on:click="onCancel"><%= t('terms.cancel') %></button>
|
||||
<button v-if="mode == 'edit'" class="btn btn-primary" v-on:click="onSubmit"><%= t('terms.save') %></button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</script>
|
20
app/views/shared/vue/_setting.html.haml
Normal file
20
app/views/shared/vue/_setting.html.haml
Normal file
@ -0,0 +1,20 @@
|
||||
- add_javascript_pack_tag('codemirror')
|
||||
|
||||
%script{"type" => "text/x-template", "id" => "vue-setting-section"}
|
||||
%b-card.mb-3(no-body){"variant" => "primary"}
|
||||
%template{"slot" => "header"}
|
||||
%div{"data-toggle" => "collapse", "v-bind:href" => "`#${id}`", "v-bind:title" => "content"}
|
||||
= icon("fa-caret-down")
|
||||
{{ type }}
|
||||
%span{"v-if" => '!_.isEmpty(arg) && (name == "match" || name == "filter")'}
|
||||
({{ arg }})
|
||||
%b-card-body.collapse{"v-bind:id" => "id"}
|
||||
%pre{"v-if" => 'mode !== "edit"'}
|
||||
{{ content }}
|
||||
%p{"v-if" => 'mode === "edit"'}
|
||||
%textarea.form-control(v-config-editor){"v-model.lazy" => "content", "v-bind:disabled" => "processing"}
|
||||
%p.float-right
|
||||
%b-button{"v-if" => 'mode !== "edit"', "variant" => "secondary", "v-on:click" => "onEdit"}=t("terms.edit")
|
||||
%b-button{"v-if" => 'mode !== "edit"', "variant" => "danger", "v-on:click" => "onDelete"}=t("terms.destroy")
|
||||
%b-button{"v-if" => 'mode === "edit"', "variant" => "secondary", "v-on:click" => "onCancel"}=t("terms.cancel")
|
||||
%b-button{"v-if" => 'mode === "edit"', "variant" => "primary", "v-on:click" => "onSubmit"}=t("terms.save")
|
Loading…
Reference in New Issue
Block a user