blob: 0bd4a70fa007255055ee56076c4fedad2a1411fb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
<?xml version="1.0" encoding="utf-8"?>
<templates id="template" xml:space="preserve">
<t t-extend="wysiwyg.widgets.file">
<t t-jquery=".o_we_load_more" t-operation="after">
<div class="unsplash_error"></div>
</t>
</t>
<t t-extend="wysiwyg.widgets.image">
<t t-jquery="option[value='media-library']" t-operation="after">
<option value="unsplash">Photos (via Unsplash)</option>
</t>
</t>
<t t-extend="wysiwyg.widgets.image.existing.attachments">
<t t-jquery="t[t-foreach='libraryMedia']" t-operation="after">
<t t-if="['all', 'unsplash'].includes(widget.searchService)" t-foreach="widget.unsplashRecords" t-as="record">
<t t-call="web_unsplash.dialog.image.content"/>
</t>
</t>
</t>
<t t-name="web_unsplash.dialog.image.content">
<div class="o_existing_attachment_cell o_unsplash_attachment_cell position-relative align-items-center justify-content-center bg-light" t-att-data-imgid="record.id" t-att-data-id="record.id" t-att-data-url="record.urls.regular" t-att-data-download-url="record.links.download_location" t-att-data-description="record.alt_description">
<img class="img img-fluid o_we_attachment_highlight" t-att-src="record.url" t-att-alt="record.alt_description" style="max-height: 100%;"/>
<a class="o_we_media_author" t-att-href="record.user.links.html" target="_blank" t-esc="record.user.name" t-att-title="record.user.name"/>
</div>
</t>
<t t-name="web_unsplash.dialog.error.credentials">
<h4><t t-esc="title"/></h4>
<div class="details">
<t t-esc="subtitle"/>
<div class="form-group mt-4 access_key_box">
<input type="text" class="form-control w-100" id="accessKeyInput" placeholder="Paste your access key here"/>
</div>
<a href="https://www.odoo.com/documentation/14.0/applications/general/unsplash/unsplash_access_key.html" target="_blank"><i class="fa fa-arrow-right"/> Generate an access key</a>
<div class="form-group mt-4 access_key_box">
<input type="text" class="form-control w-100" id="appIdInput" placeholder="Paste your application ID here"/>
</div>
<a href="https://www.odoo.com/documentation/14.0/applications/general/unsplash/unsplash_application_id.html" target="_blank">
<i class="fa fa-arrow-right"/> How to find my Unsplash Application ID?</a>
<button type="button" class="btn btn-primary btn-block mt-4 save_unsplash">Apply</button>
</div>
</t>
<t t-name="web_unsplash.dialog.error.content">
<div class="d-flex mt-2 unsplash_error">
<div class="mx-auto text-center">
<t t-if="status == 'key_not_found'">
<t t-call="web_unsplash.dialog.error.credentials">
<t t-set="title">
Unsplash requires an access key and an application ID
</t>
</t>
</t>
<t t-elif="status == 403">
<h4 class="text-muted">
Search is temporarily unavailable
</h4>
<div class="details">
The max number of searches is exceeded. Please retry in an hour or extend to a better account.
</div>
</t>
<t t-elif="status == 401">
<t t-call="web_unsplash.dialog.error.credentials">
<t t-set="title">
Unauthorized Key
</t>
<t t-set="subtitle">
Please check your Unsplash access key and application ID.
</t>
</t>
</t>
<t t-else="">
<h4 class="text-muted">
Something went wrong
</h4>
<div class="details">
Please check your internet connection or contact administrator.
</div>
</t>
</div>
</div>
</t>
</templates>
|