Copy item names to clipboard

This commit is contained in:
Jan Kvetina 2022-03-04 22:17:23 +01:00
parent c8962a8cb4
commit 7b2e67655a
2 changed files with 21 additions and 12 deletions

View File

@ -12,14 +12,15 @@ SELECT
--
REGEXP_SUBSTR(REGEXP_REPLACE(t.item_name, '^T[_]'), '^([^_]+)', 1, 1, NULL, 1) AS item_type,
--
CASE WHEN i.item_name IS NOT NULL THEN 'Y' END AS is_page_item,
CASE WHEN a.item_name IS NOT NULL THEN 'Y' END AS is_app_item,
--
t.value_en,
t.value_cz,
t.value_sk,
t.value_pl,
t.value_hu
t.value_hu,
--
'<a href="#" onclick="copy_to_clipboard(''&' || t.item_name ||
CASE WHEN t.item_name LIKE 'HELP\_%' ESCAPE '\' THEN '!RAW' END ||
'.''); return false;">' || app.get_icon('fa-copy') || '</a>' AS action_copy
FROM translated_items t
JOIN x
ON x.app_id = t.app_id

View File

@ -6,7 +6,8 @@ WITH x AS (
FROM DUAL
),
t AS (
SELECT
SELECT
x.app_id,
t.item_type,
t.item_name,
t.page_id,
@ -32,7 +33,11 @@ SELECT
t.item_type,
t.item_name,
t.page_id,
t.value_en
t.value_en,
--
'<a href="#" onclick="copy_to_clipboard(''&' || t.item_name ||
CASE WHEN t.item_name LIKE 'HELP\_%' ESCAPE '\' THEN '!RAW' END ||
'.''); return false;">' || app.get_icon('fa-copy') || '</a>' AS action_copy
FROM t
UNION ALL
--
@ -41,12 +46,15 @@ SELECT
--
i.item_name,
i.page_id,
i.value_en
i.value_en,
--
'<a href="#" onclick="copy_to_clipboard(''&' || t.item_name ||
CASE WHEN t.item_name LIKE 'HELP\_%' ESCAPE '\' THEN '!RAW' END ||
'.''); return false;">' || app.get_icon('fa-copy') || '</a>' AS action_copy
FROM translated_items i
JOIN x
ON x.app_id = i.app_id
AND x.page_id != i.page_id
JOIN t
ON t.item_name = i.item_name
WHERE i.item_name NOT IN ('PAGE_NAME');
ON t.app_id = i.app_id
AND t.item_name = i.item_name
WHERE i.page_id != t.page_id --= 0
AND i.item_name NOT IN ('PAGE_NAME');