File tree Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Expand file tree Collapse file tree 3 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,11 @@ class SettingsModel extends Model
32
32
*/
33
33
public int $ maxTokens = 256 ;
34
34
35
+ /**
36
+ * @var bool
37
+ */
38
+ public bool $ showTranslationPrompts = true ;
39
+
35
40
/**
36
41
* @return string
37
42
*/
Original file line number Diff line number Diff line change 20
20
21
21
{% set currentLang = " " %}
22
22
23
+ {% set displayTranslationPrompts = craft .app .getPlugins .getPlugin (' chatgpt-integration' ).settings.showTranslationPrompts %}
24
+
23
25
{% if craft .app .getPlugins .getPlugin (' chatgpt-integration' ).settings.usePageLang %}
24
26
{% for site in craft .app .sites .getAllSites () %}
25
27
{% if site .handle == craft .app .request .getQueryParam (' site' ) %}
40
42
<ul class =" padded" >
41
43
{% for item in prompts %}
42
44
<li ><a href =" javascript:void(0)" class =" doAi" type =" button" role =" button" data-hash =" {{ hash }}" data-prompt =" {{ currentLang }} {{ item .promptTemplate }}: " aria-label =" {{ item .label }}" >{{ item .label }}</a ></li >
45
+ {% else %}
46
+ {% if displayTranslationPrompts == false %}
47
+ <li style =" padding: 1em 0" ><p >{{ ' No prompts found' | t(' chatgpt-integration' ) }}</p ></li >
48
+ {% endif %}
43
49
{% endfor %}
44
50
</ul >
45
- <hr >
51
+ {% if displayTranslationPrompts %}
52
+ {% if prompts | length %}
53
+ <hr >
54
+ {% endif %}
46
55
<ul class =" padded" >
47
56
{% if craft .app .sites .getAllSites ()| length > 1 %}
48
57
{% for site in craft .app .sites .getAllSites () %}
60
69
<a href="#" class="open-modal">{{ 'Senden'|t('chatgpt-integration') }}</a>
61
70
</li>
62
71
</ul>#}
72
+ {% endif %}
63
73
</div >
64
74
</div >
65
75
{% endif %}
Original file line number Diff line number Diff line change 28
28
instructions : ' Always use current page language for query results.' |t(' chatgpt-integration' ),
29
29
}) }}
30
30
31
+ {{ forms.lightSwitchField ({
32
+ label : ' Display default translation prompts.' |t(' chatgpt-integration' ),
33
+ name : ' showTranslationPrompts' ,
34
+ value : settings .showTranslationPrompts ,
35
+ on : settings .showTranslationPrompts ,
36
+ instructions : ' Provide default translation prompts based on the configured languages of your setup.'
37
+ }) }}
38
+
31
39
{{ forms.autosuggestField ({
32
40
label : ' API: Access Token' |t(' chatgpt-integration' ),
33
41
name : ' accessToken' ,
You can’t perform that action at this time.
0 commit comments