fluentd-ui/app/views/shared/vue/_treeview.html.erb
Kenji Okimoto 009c3527bb Use bootstrap4 class instead of font-awesome class
Signed-off-by: Kenji Okimoto <okimoto@clear-code.com>
2018-05-21 15:03:23 +09:00

34 lines
1.1 KiB
Plaintext

<% add_javascript_pack_tag("treeview") %>
<% name ||= "" %>
<% action ||= "" %>
<% submit_button ||= "" %>
<%= form_tag(action, method: :post) do %>
<div id="treeview">
<div class="card">
<pre class="card-body pb-0">{{ path }}</pre>
</div>
<input type="hidden" name="<%= name %>" v-model="path" />
<div class="dirs">
<span v-for="(dir, index) in currentDirs">
<span v-if="index > 0">
<%= icon('fa-caret-right') %>
</span>
<span v-on:click="selectPath(dir)" class="dir">{{ basename(dir) }}</span>
</span>
</div>
<div class="tree">
<span v-on:click="selectPath(value.path)" class="vue-path" v-bind:class="{ selected: isSelected(value.path) }" v-for="value in paths">
<span v-if="value.is_dir"><%= icon("fa-folder") %></span>
<span v-if="!value.is_dir"><%= icon("fa-file-o") %></span>
{{ basename(value.path) }}
<br />
</span>
</div>
<pre v-if="preview" class="preview">{{ preview }}</pre>
<p>
<%= submit_tag submit_button, class: "btn btn-lg btn-primary float-right", "v-bind:disabled" => "selectedIsDir" %>
</p>
</div>
<% end %>