Skip to content

Commit 694ee63

Browse files
committed
BIT-3709 green and first text
1 parent 7dfc67f commit 694ee63

File tree

4 files changed

+39
-50
lines changed

4 files changed

+39
-50
lines changed

app/helpers/application_helper.rb

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,28 @@ def current_ad(tag, ad_type = :ad)
3737
ad ? ad[ad_type] : nil
3838
end
3939

40-
def tab_ad(ad_tag = 'tab', html_class = 'nav-item nav-item-ad')
41-
if ad = current_ad(ad_tag, :ad)
42-
tag.li(class: html_class) do
43-
link_to ad[:url], class: "nav-link nav-link-ad", style: (ad[:bgcolor] ? "background-color: #{ad[:bgcolor]}" : ''), target: :blank do
44-
"#{ad[:text]} <sup class='fas fa-ad text-second'></sup>".html_safe
40+
def tab_ads html_class = 'nav-item nav-item-ad'
41+
if ads = current_ad(:tab, :ads)
42+
ads.collect {|ad|
43+
tag.li(class: html_class) do
44+
link_to ad[:url], class: "nav-link nav-link-ad", style: (ad[:bgcolor] ? "background-color: #{ad[:bgcolor]}" : ''), target: :blank do
45+
"#{ad[:text]} <sup class='fas fa-ad text-second'></sup>".html_safe
46+
end
4547
end
46-
end
48+
}.join("\n").html_safe
4749
end
4850
end
49-
50-
def tab_ad1(ad_tag = 'tab0', html_class = 'nav-item nav-item-ad')
51-
if ad1 = current_ad(ad_tag, :ad1)
51+
52+
def tab_ad html_class = 'nav-item nav-item-ad'
53+
if ad = current_ad(:tab, :ad)
5254
tag.li(class: html_class) do
53-
link_to ad1[:url], class: "nav-link nav-link-ad", style: (ad1[:bgcolor] ? "background-color: #{ad1[:bgcolor]}" : ''), target: :blank do
54-
"#{ad1[:text]} <sup class='fas fa-ad text-second'></sup>".html_safe
55+
link_to ad[:url], class: "nav-link nav-link-ad", style: (ad[:bgcolor] ? "background-color: #{ad[:bgcolor]}" : ''), target: :blank do
56+
"#{ad[:text]} <sup class='fas fa-ad text-second'></sup>".html_safe
5557
end
5658
end
5759
end
5860
end
59-
61+
6062
def tab_link(name, action, new_tabs = [], html_class = 'nav-item', data = { changeurl: true })
6163
tag.li(class: html_class) do
6264
tab_a(name, action, new_tabs, 'nav-link', data)

app/views/shared/ads/_tab.html.erb

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
<%= tab_ad 'tab0' %>
2-
<%= tab_ad %>
3-
<%= tab_ad1 'tab1' %>
4-
<%= tab_ad1 %>
1+
<%= tab_ads %>

config/initializers/ads.rb

Lines changed: 19 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,28 @@
11
ADS={
2-
tab0: {
3-
ad: {
4-
text: 'Free DEX Swaps',
5-
url: 'https://jn3rg.app.link/Bitquery_1inch',
6-
bgcolor: '#0570f2'
7-
},
8-
ad1: {
9-
text: 'Verse DEX',
10-
url: 'https://verse.bitcoin.com/?utm_source=bitquery&utm_medium=web&utm_campaign=bitquery_explorer',
11-
bgcolor: '#0085FF'
12-
}
13-
14-
},
152
tab: {
16-
# ad: {
17-
# text: 'Buy this ad',
18-
# url: 'https://bitquery.io/forms/ads'
19-
# },
20-
# ad: {
21-
# text: 'Swap Crypto',
22-
# url: 'https://simpleswap.io/crypto/?ref=e11e6b4d3b3d',
23-
# bgcolor: '#9acd32'
24-
# },
3+
ads: [
4+
{
5+
text: 'Get Tax Report',
6+
url: 'https://koinly.io/offer-bitquery/?utm_source=bitquery&utm_medium=cpm&utm_campaign=direct_buy&utm_term=apr_23',
7+
bgcolor: 'green'
8+
},
9+
{
10+
text: 'Free DEX Swaps',
11+
url: 'https://jn3rg.app.link/Bitquery_1inch',
12+
bgcolor: '#0570f2'
13+
},
14+
{
15+
text: 'Verse DEX',
16+
url: 'https://verse.bitcoin.com/?utm_source=bitquery&utm_medium=web&utm_campaign=bitquery_explorer',
17+
bgcolor: '#0085FF'
18+
}
19+
],
2520
# platform: {
2621
# smart_contract: {
27-
# ad: {
22+
# ads: [{
2823
# text: '13',
2924
# url: '21'
30-
# }
25+
# }]
3126
# }
3227
# }
3328
},

yarn.lock

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -4067,11 +4067,6 @@ graphql-ws@5.0.0:
40674067
resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-5.0.0.tgz#30f55a649f8dc825c51b6f7cfc05e513688c4f8d"
40684068
integrity sha512-SSSn5xQB5bDtmIwn2Rkw9WakrNbkDvPP5B7J5pKhFoDfQkF5xs9BaqelsGljoRs4rrdmWq9xw/QVtEXmjImZQA==
40694069

4070-
graphql-ws@5.0.0:
4071-
version "5.0.0"
4072-
resolved "https://registry.yarnpkg.com/graphql-ws/-/graphql-ws-5.0.0.tgz#30f55a649f8dc825c51b6f7cfc05e513688c4f8d"
4073-
integrity sha512-SSSn5xQB5bDtmIwn2Rkw9WakrNbkDvPP5B7J5pKhFoDfQkF5xs9BaqelsGljoRs4rrdmWq9xw/QVtEXmjImZQA==
4074-
40754070
hammerjs@^2.0.8:
40764071
version "2.0.8"
40774072
resolved "https://registry.yarnpkg.com/hammerjs/-/hammerjs-2.0.8.tgz#04ef77862cff2bb79d30f7692095930222bf60f1"
@@ -8810,16 +8805,16 @@ yaeti@^0.0.6:
88108805
resolved "https://registry.yarnpkg.com/yaeti/-/yaeti-0.0.6.tgz#f26f484d72684cf42bedfb76970aa1608fbf9577"
88118806
integrity sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==
88128807

8813-
yallist@*, yallist@^4.0.0:
8814-
version "4.0.0"
8815-
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
8816-
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==
8817-
88188808
yallist@^3.0.2:
88198809
version "3.1.1"
88208810
resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd"
88218811
integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==
88228812

8813+
yallist@^4.0.0:
8814+
version "4.0.0"
8815+
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
8816+
integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==
8817+
88238818
yaml@^1.7.2:
88248819
version "1.10.2"
88258820
resolved "https://registry.yarnpkg.com/yaml/-/yaml-1.10.2.tgz#2301c5ffbf12b467de8da2333a459e29e7920e4b"

0 commit comments

Comments
 (0)