Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/assets/images/check-mark-small.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion app/assets/images/chevron-left.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 7 additions & 2 deletions app/helpers/assets_helper.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
module AssetsHelper
def csp_nonce_attributes
nonce = respond_to?(:content_security_policy_nonce) ? content_security_policy_nonce : nil
nonce.present? ? {nonce: nonce} : {}
end

def inline_file(asset_name)
if (asset = Rails.application.assets&.find_asset(asset_name))
asset.source.html_safe
Expand All @@ -9,11 +14,11 @@ def inline_file(asset_name)
end

def inline_js(asset_name)
content_tag(:script, inline_file(asset_name), type: "text/javascript")
content_tag(:script, inline_file(asset_name), {type: "text/javascript"}.merge(csp_nonce_attributes))
end

def inline_stylesheet(asset_name)
content_tag(:style, inline_file(asset_name), type: "text/css")
content_tag(:style, inline_file(asset_name), {type: "text/css"}.merge(csp_nonce_attributes))
end

def inline_svg(asset_name, classname: "svg-container")
Expand Down
8 changes: 4 additions & 4 deletions app/views/webview/drug_stocks/index.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en" style="scroll-behavior: auto;">
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="HandheldFriendly" content="True">
Expand All @@ -13,8 +13,8 @@
<%= inline_stylesheet("user_analytics.css") %>
</head>
<body id="progress">
<div class="p-fixed b-0 l-0 zi-100 w-100 p-8px bgc-blue-light bs-border-box bs-fixed-card" style="padding-bottom: 12px;">
<a href="simple://progress-tab" class="d-block w-100 p-16px ta-center bgc-blue tt-uppercase ls-1_25px br-4px fs-16px b-none bs-primary-button bs-border-box" style="font-weight: 700; color: #ffffff;">
<div class="p-fixed b-0 l-0 zi-100 w-100 p-8px pb-12px bgc-blue-light bs-border-box bs-fixed-card">
<a href="simple://progress-tab" class="d-block w-100 p-16px ta-center fw-bold c-white bgc-blue tt-uppercase ls-1_25px br-4px fs-16px b-none bs-primary-button bs-border-box">
Done
</a>
</div>
Expand All @@ -31,7 +31,7 @@
See stock in estimated patient days below
</p>
</div>
<h3 class="m-0px p-0px pl-16px pb-12px ta-left fw-medium fs-18px c-grey" style="color: #82878F;">
<h3 class="m-0px p-0px pl-16px pb-12px ta-left fw-medium fs-18px c-grey">
Report for end of <%= @for_end_of_month.to_s(:mon_year) %>
</h3>
<% @drugs_by_category.each do |category, drugs| %>
Expand Down
6 changes: 3 additions & 3 deletions app/views/webview/drug_stocks/new.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -118,15 +118,15 @@
<% end %>
<% end %>
</div>
<div class="p-fixed b-0 l-0 zi-100 w-100 p-8px bgc-blue-light bs-border-box bs-fixed-card" style="padding-bottom: 12px;">
<%= form.button "SAVE", class: "d-block w-100 p-16px ta-center bgc-blue tt-uppercase ls-1_25px br-2px fs-16px b-none bs-primary-button bs-border-box", style: "font-weight: 700; color: #ffffff;" %>
<div class="p-fixed b-0 l-0 zi-100 w-100 p-8px pb-12px bgc-blue-light bs-border-box bs-fixed-card">
<%= form.button "SAVE", class: "d-block w-100 p-16px ta-center fw-bold c-white bgc-blue tt-uppercase ls-1_25px br-2px fs-16px b-none bs-primary-button bs-border-box" %>
</div>
<% end %>
</div>
</div>
</div>
</body>
<script type="text/javascript" charset="utf-8">
<script type="text/javascript" charset="utf-8" nonce="<%= content_security_policy_nonce %>">
window.addEventListener("load", function() {
let monthSelect = document.getElementById("for_end_of_month");
monthSelect.addEventListener("change", function(e) {
Expand Down