Skip to content

Commit

Permalink
[TradingView] add Generate Email CTA
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeDSM committed Oct 7, 2024
1 parent 3635734 commit 72b8563
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,14 @@ <h4>
<i class="fa fa-copy mr-1"></i>
{{ read_only_info.value }}
</span>
{% elif read_only_info.type.value == "cta" %}
<a
type="button" class="btn btn-sm btn-primary"
href="{{url_for(read_only_info.path) if read_only_info.path else read_only_info.value}}"
>
<i class="fa fa-plus mr-1"></i>
{{ read_only_info.value }}
</a>
{% else %}
{{ read_only_info.value }}
{% endif %}
Expand Down
5 changes: 3 additions & 2 deletions Services/Services_bases/trading_view_service/trading_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,15 @@ def is_improved_by_extensions(self) -> bool:

def get_read_only_info(self) -> list[services.ReadOnlyInfo]:
read_only_info = []
if email_address := authentication.Authenticator.instance().get_saved_tradingview_email():
auth = authentication.Authenticator.instance()
if auth.is_tradingview_email_confirmed() and (email_address := auth.get_saved_tradingview_email()):
read_only_info.append(services.ReadOnlyInfo(
'Email address:', email_address, services_enums.ReadOnlyInfoType.COPYABLE,
configuration_title="Configure on TradingView", configuration_path="tradingview_email_config"
))
else:
read_only_info.append(services.ReadOnlyInfo(
'Email address:', "Click to configure", services_enums.ReadOnlyInfoType.CLICKABLE,
'Email address:', "Generate email", services_enums.ReadOnlyInfoType.CTA,
path="tradingview_email_config"
))
if self._webhook_url:
Expand Down

0 comments on commit 72b8563

Please sign in to comment.