Replace angular tooltips in Primary Details tab

This commit is contained in:
binarygit
2022-08-31 10:25:55 +05:45
parent 8861b6d077
commit 02e3184945
3 changed files with 8 additions and 16 deletions

View File

@@ -3,8 +3,7 @@
.row
.three.columns.alpha
= label_tag :permalink, t('.permalink')
%div{'ofn-with-tip' => t('.permalink_tip', link: main_app.root_url)}
%a= t('admin.whats_this')
= render partial: 'admin/shared/tooltip', locals: {tooltip_text: t('.permalink_tip', link: main_app.root_url)}
.eight.columns
= text_field_tag "enterprise[permalink]", @enterprise.permalink, data: { action: "input->permalink#validate", "permalink-target": "permalinkField" }
.two.columns.omega
@@ -21,15 +20,13 @@
.row
.three.columns.alpha
%label= t('.link_to_front')
%div{'ofn-with-tip' => t('.link_to_front_tip')}
%a= t('admin.whats_this')
= render partial: 'admin/shared/tooltip', locals: {tooltip_text: t('.link_to_front_tip')}
.eight.columns.omega
- front_shop_path = "#{main_app.root_url}#{@enterprise.permalink}/shop"
= link_to front_shop_path, front_shop_path , target: "_blank"
.row
.three.columns.alpha
= label_tag :id, t('.ofn_uid')
%div{'ofn-with-tip' => t('.ofn_uid_tip')}
%a= t('admin.whats_this')
= render partial: 'admin/shared/tooltip', locals: {tooltip_text: t('.ofn_uid_tip')}
.six.columns
= @enterprise.id

View File

@@ -8,15 +8,13 @@
.row
.three.columns.alpha
= f.label :group_ids, t('.groups')
%div{'ofn-with-tip' => t('.groups_tip')}
%a= t('admin.whats_this')
= render partial: 'admin/shared/tooltip', locals: {tooltip_text: t('.groups_tip')}
.eight.columns.omega
= f.collection_select :group_ids, @groups, :id, :name, {}, data: { controller: "tom-select", "tom-select-options-value": { plugins: ['remove_button'], maxItems: nil } }, class: "full-width", multiple: true, placeholder: t('.groups_placeholder')
.row
.three.columns.alpha
%label= t('.primary_producer')
%div{'ofn-with-tip' => t('.primary_producer_tip')}
%a= t('admin.whats_this')
= render partial: 'admin/shared/tooltip', locals: {tooltip_text: t('.primary_producer_tip')}
.five.columns.omega
= f.check_box :is_primary_producer, data: { action: "change->primary-details#primaryProducerChanged" }
= f.label :is_primary_producer, t('.producer')
@@ -24,8 +22,7 @@
.row
.three.columns.alpha
= f.label :sells, t('.sells')
%div{'ofn-with-tip' => t('.sells_tip')}
%a= t('admin.whats_this')
= render partial: 'admin/shared/tooltip', locals: {tooltip_text: t('.sells_tip')}
.two.columns
= f.radio_button :sells, "none", 'ng-model' => 'Enterprise.sells', data: {action: "change->primary-details#enterpriseSellsChanged"}
= f.label :sells, t('.none'), value: "none"
@@ -38,8 +35,7 @@
.row
.three.columns.alpha
%label= t('.visible_in_search')
%div{'ofn-with-tip' => t('.visible_in_search_tip')}
%a= t('admin.whats_this')
= render partial: 'admin/shared/tooltip', locals: {tooltip_text: t('.visible_in_search_tip')}
.two.columns
= f.radio_button :visible, "public", 'ng-model' => 'Enterprise.visible'
= f.label :visible, t('.visible'), value: 'public'

View File

@@ -2,6 +2,5 @@
%a{"data-tooltip-target": "element", "data-action": "mouseenter->tooltip#showTooltip mouseleave->tooltip#hideTooltip"}= t('admin.whats_this')
.tooltip-container
.tooltip{"data-tooltip-target": "tooltip"}
= tooltip_text
= sanitize tooltip_text
.arrow{"data-tooltip-target": "arrow"}