text_marquee/app/views/admin/text_marquees/index.html.erb

63 lines
2.0 KiB
Plaintext

<div>
<%= render 'index' %>
</div>
<% if current_user.is_admin? or current_user.is_manager?(@module_app) %>
<div class="bottomnav clearfix" style="left: 81px;">
<div class="action pull-right">
<% if @categories.count == 0 %>
<a class="btn btn-primary" href="/admin/module_apps/<%= @module_app.id.to_s %>/categories"> <%= t(:categories) %></a>
<% else %>
<a data-title="<%= t("text_marquee.new") %>" data-id="new" data-fx="fade" class="btn btn-primary open-slide new-marquee" href="#">
<i class="icon-plus"></i> <%= t("text_marquee.new") %>
</a>
<% end %>
</div>
<div class="pagination pagination-centered"></div>
</div>
<div id="pageslide">
<div class="page-title clearfix">
<a class="pull-right" href="javascript:$.pageslide.close()">
<i class="icons-arrow-left-2"></i>
</a>
<span></span>
</div>
<div class="view-page">
<div class="nano">
<div class="content">
<%= form_for :marquee, url: nil, remote: true do |f| %>
<fieldset>
<%= render :partial => "form", :locals => { :f => f } %>
<div class="form-actions">
<a href="javascript:$.pageslide.close()" class="btn btn-small"><%= t(:cancel) %></a>
<%= f.submit t(:submit), class: 'btn btn-primary btn-small' %>
</div>
</fieldset>
<% end %>
</div>
</div>
</div>
</div>
<% end %>
<%= render 'layouts/delete_modal', delete_options: @delete_options %>
<script type="text/javascript">
$("a.edit-marquee").on("click",function(){
var form = $("#pageslide form"),
el = $(this);
setForm(el.data("form"));
form.attr("action",form.attr("action") + "/" + el.data("id"));
form.append("<input type='hidden' id='hidden_method_patch' name='_method' value='patch' />")
})
$("a.new-marquee").on("click",function(){
var form = $("#pageslide form"),
el = $(this);
resetForm();
form.attr("action","/en/admin/text_marquees");
form.find("#hidden_method_patch").remove();
})
</script>