mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-06 23:15:34 +08:00
Dropdown menu works, need to add backend code for the second button
This commit is contained in:
parent
0f4dadefa9
commit
9b640c5df8
1 changed files with 23 additions and 29 deletions
|
@ -50,14 +50,29 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="import-export-protocols" class="btn-group" role="group">
|
<div id="import-export-protocols" class="btn-group" role="group">
|
||||||
<a class="btn btn-default btn-open-file" <%= can_import_protocols(@current_team) ? 'data-action="import"' : 'disabled="disabled"' %>>
|
<a class="btn btn-default btn-open-file" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" href="#"><span class="glyphicon glyphicon-import"></span><span class="hidden-xs"> <%= "Import protocol" %></span></a>
|
||||||
<span class="glyphicon glyphicon-import"></span>
|
|
||||||
<span class="hidden-xs"> <%= t("protocols.index.import") %></span>
|
<ul class="dropdown-menu">
|
||||||
<input type="file" value="" accept=".eln" data-role="import-file-input"
|
<li>
|
||||||
data-team-id="<%= @current_team.id %>"
|
|
||||||
data-type="<%= @type %>" data-import-url="<%= import_protocols_path %>"
|
<a class="btn btn-default-link btn-open-file" <%= can_import_protocols(@current_team) ? 'data-action="import"' : 'disabled="disabled"' %>>
|
||||||
<%= 'disabled="disabled"' unless can_import_protocols(@current_team) %>>
|
<span class="glyphicon glyphicon-file"></span>
|
||||||
</a>
|
<span class="hidden-xs"> <%= t("protocols.index.import_alt") %></span>
|
||||||
|
<input type="file" value="" accept=".eln" data-role="import-file-input"
|
||||||
|
data-team-id="<%= @current_team.id %>"
|
||||||
|
data-type="<%= @type %>" data-import-url="<%= import_protocols_path %>"
|
||||||
|
<%= 'disabled="disabled"' unless can_import_protocols(@current_team) %>>
|
||||||
|
</a>
|
||||||
|
|
||||||
|
</li>
|
||||||
|
|
||||||
|
<li>
|
||||||
|
<%= link_to import_protocols_path(@protocol, format: :json), remote: true, data: { action: "import"} do %>
|
||||||
|
<span class="glyphicon glyphicon-file"></span> <%= "from protocols.io file(.json)" %></a>
|
||||||
|
<% end %>
|
||||||
|
</li>
|
||||||
|
|
||||||
|
</ul>
|
||||||
<a class="btn btn-default" data-action="export" data-export-url="<%= export_protocols_path() %>">
|
<a class="btn btn-default" data-action="export" data-export-url="<%= export_protocols_path() %>">
|
||||||
<span class="glyphicon glyphicon-export"></span>
|
<span class="glyphicon glyphicon-export"></span>
|
||||||
<span class="hidden-xs"> <%= t("protocols.index.export") %></span>
|
<span class="hidden-xs"> <%= t("protocols.index.export") %></span>
|
||||||
|
@ -65,28 +80,7 @@
|
||||||
<!-- </div> -->
|
<!-- </div> -->
|
||||||
|
|
||||||
<!--<div class="btn-group"> -->
|
<!--<div class="btn-group"> -->
|
||||||
<a class="btn btn-default btn-open-file" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" href="#"><span class="glyphicon glyphicon-import"></span><span class="hidden-xs"> <%= "Import protocol" %></span></a>
|
|
||||||
<ul class="dropdown-menu">
|
|
||||||
<li>
|
|
||||||
|
|
||||||
<a class="btn btn-default-link btn-open-file" <%= can_import_protocols(@current_team) ? 'data-action="import"' : 'disabled="disabled"' %>>
|
|
||||||
<span class="glyphicon glyphicon-file"></span>
|
|
||||||
<span class="hidden-xs"> <%= t("protocols.index.import_alt") %></span>
|
|
||||||
<input type="file" value="" accept=".eln" data-role="import-file-input"
|
|
||||||
data-team-id="<%= @current_team.id %>"
|
|
||||||
data-type="<%= @type %>" data-import-url="<%= import_protocols_path %>"
|
|
||||||
<%= 'disabled="disabled"' unless can_import_protocols(@current_team) %>>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
</li>
|
|
||||||
|
|
||||||
<li>
|
|
||||||
<%= link_to import_protocols_path(@protocol, format: :json), remote: true, data: { action: "import"} do %>
|
|
||||||
<span class="glyphicon glyphicon-file"></span> <%= "from protocols.io file(.json)" %></a>
|
|
||||||
<% end %>
|
|
||||||
</li>
|
|
||||||
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="btn-group" role="group">
|
<div class="btn-group" role="group">
|
||||||
|
|
Loading…
Reference in a new issue