2020-04-17 01:13:18 +08:00
|
|
|
<div class="dropdown my-module-protocol-status">
|
|
|
|
<% if @protocol.linked? %>
|
|
|
|
<span class="status-label linked">
|
2022-07-11 17:29:05 +08:00
|
|
|
[<%= t("my_modules.protocols.protocol_status_bar.linked") %>]
|
2020-04-17 01:13:18 +08:00
|
|
|
</span>
|
|
|
|
<% else %>
|
|
|
|
<span class="status-label">
|
|
|
|
[<%= t("my_modules.protocols.protocol_status_bar.unlinked") %>]
|
|
|
|
</span>
|
|
|
|
<% end %>
|
2020-05-02 02:45:09 +08:00
|
|
|
<a href="#" id="my-module-protocol-info-button" class="status-info
|
2023-03-07 20:03:01 +08:00
|
|
|
<%= 'parent-newer' if @protocol.parent_newer? %>
|
2020-05-02 02:45:09 +08:00
|
|
|
<%= 'protocol-newer' if @protocol.newer_than_parent? %>
|
|
|
|
" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
2023-06-15 21:12:51 +08:00
|
|
|
<i class="sn-icon sn-icon-info"></i>
|
2020-04-17 01:13:18 +08:00
|
|
|
</a>
|
|
|
|
<div class="dropdown-menu status-info-dropdown" aria-labelledby="my-module-protocol-info-button">
|
2023-03-07 12:48:20 +08:00
|
|
|
<div class="dropdown-content">
|
|
|
|
<div class="dropdown-header">
|
|
|
|
<h2 class="protocol-name">
|
2023-06-08 16:54:01 +08:00
|
|
|
<%= @protocol.name_with_label %>
|
2023-03-07 12:48:20 +08:00
|
|
|
</h2>
|
|
|
|
<% if @protocol.linked? %>
|
|
|
|
<div class="protocol-header-info">
|
2023-03-09 23:29:40 +08:00
|
|
|
<span><%= t('my_modules.protocols.protocol_status_bar.protocol_id_label') %> <%= @protocol.original_code %></span>
|
2023-03-07 12:48:20 +08:00
|
|
|
<span><%= t('my_modules.protocols.protocol_status_bar.protocol_version_label') %> <%= @protocol.parent&.version_number %></span>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
2020-04-17 01:13:18 +08:00
|
|
|
</div>
|
2023-03-07 12:48:20 +08:00
|
|
|
<div class="dropdown-body">
|
|
|
|
<% if @protocol.unlinked? %>
|
|
|
|
<div class="info-line">
|
|
|
|
<div class="description"><%= t("my_modules.protocols.protocol_status_bar.protocol_created") %></div>
|
|
|
|
<div class="value"><%= I18n.l(@protocol.created_at, format: :full) %></div>
|
2023-02-21 20:44:26 +08:00
|
|
|
</div>
|
2020-04-17 01:13:18 +08:00
|
|
|
<% end %>
|
2023-03-07 12:48:20 +08:00
|
|
|
<div class="info-line">
|
|
|
|
<div class="description"><%= t("my_modules.protocols.protocol_status_bar.protocol_updated") %></div>
|
|
|
|
<div class="value"><%= I18n.l(@protocol.updated_at, format: :full) %></div>
|
|
|
|
</div>
|
|
|
|
<% if @protocol.linked?%>
|
|
|
|
<div class="info-line">
|
|
|
|
<div class="description"><%= t("my_modules.protocols.protocol_status_bar.protocol_loaded") %></div>
|
|
|
|
<div class="value"><%= @protocol.linked_at ? I18n.l(@protocol.linked_at, format: :full) : '' %></div>
|
|
|
|
</div>
|
|
|
|
<div class="info-line">
|
|
|
|
<div class="description"><%= t("my_modules.protocols.protocol_status_bar.protocol_published") %></div>
|
|
|
|
<div class="value"><%= I18n.l(@protocol&.parent&.published_on, format: :full) %></div>
|
2023-02-21 20:44:26 +08:00
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
2023-03-07 12:48:20 +08:00
|
|
|
<div class="dropdown-footer">
|
|
|
|
<% if @protocol.linked? %>
|
2023-03-09 23:29:40 +08:00
|
|
|
<% if @protocol.parent_newer? %>
|
2023-03-07 12:48:20 +08:00
|
|
|
<div class="notification-line new-parent-version">
|
2023-06-15 21:12:51 +08:00
|
|
|
<i class="sn-icon sn-icon-info"></i>
|
2023-03-07 12:48:20 +08:00
|
|
|
<div class="description"><%= t("my_modules.protocols.protocol_status_bar.messages.template_updated_html") %></div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<% if @protocol.newer_than_parent? %>
|
|
|
|
<div class="notification-line new-protocol-version">
|
2023-06-15 21:12:51 +08:00
|
|
|
<i class="sn-icon sn-icon-info"></i>
|
2023-03-07 12:48:20 +08:00
|
|
|
<div class="description"><%= t("my_modules.protocols.protocol_status_bar.messages.protocol_updated") %></div>
|
|
|
|
</div>
|
|
|
|
<% end %>
|
|
|
|
<% end %>
|
|
|
|
</div>
|
|
|
|
</div>
|
2020-04-17 01:13:18 +08:00
|
|
|
</div>
|
2016-07-21 19:11:15 +08:00
|
|
|
</div>
|
2016-08-12 22:31:40 +08:00
|
|
|
<%= javascript_include_tag("my_modules/protocols/protocol_status_bar") %>
|