Skip to content

Commit 5281364

Browse files
authored
feat: Improved dynamic link ui for tiptap editor (#41)
1 parent e9d3b48 commit 5281364

File tree

52 files changed

+3588
-5621
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3588
-5621
lines changed

djangocms_text/editors.py

+29-13
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,17 @@ def default(self, obj):
149149
"Link": {
150150
"title": _("Link"),
151151
"form": [
152+
# {
153+
# "type": "link",
154+
# "url": '#',
155+
# "label": '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" '
156+
# 'class="bi bi-box-arrow-up-left" viewBox="0 0 16 16">'
157+
# '<path fill-rule="evenodd" d="M7.364 3.5a.5.5 0 0 1 .5-.5H14.5A1.5 1.5 0 0 1 16 4.5v10a1.5 '
158+
# '1.5 0 0 1-1.5 1.5h-10A1.5 1.5 0 0 1 3 14.5V7.864a.5.5 0 1 1 1 0V14.5a.5.5 0 0 0 .5.5h10a.5.5 '
159+
# '0 0 0 .5-.5v-10a.5.5 0 0 0-.5-.5H7.864a.5.5 0 0 1-.5-.5"/><path fill-rule="evenodd" '
160+
# 'd="M0 .5A.5.5 0 0 1 .5 0h5a.5.5 0 0 1 0 1H1.707l8.147 8.146a.5.5 0 0 1-.708.708L1 '
161+
# '1.707V5.5a.5.5 0 0 1-1 0z"/></svg>',
162+
# },
152163
{
153164
"name": "href_select",
154165
"type": "hidden",
@@ -162,19 +173,24 @@ def default(self, obj):
162173
"class": "js-linkfield",
163174
"required": False,
164175
},
165-
# {"type": 'hr'},
166-
# {
167-
# "name": 'target',
168-
# "label": 'Target',
169-
# "type": 'select',
170-
# "options": [
171-
# {"value": '', "label": '-----'},
172-
# {"value": '_blank', "label": 'New window'},
173-
# {"value": '_self', "label": 'Same window'},
174-
# {"value": '_parent', "label": 'Parent window'},
175-
# ],
176-
# "required": False
177-
# }
176+
{
177+
"type": "section",
178+
"label": _("Link options"),
179+
"content": [
180+
{
181+
"name": "target",
182+
"label": _("Target"),
183+
"type": "select",
184+
"options": [
185+
{"value": "", "label": "-----"},
186+
{"value": "_blank", "label": _("New window")},
187+
{"value": "_self", "label": _("Same window")},
188+
{"value": "_parent", "label": _("Parent window")},
189+
],
190+
"required": False,
191+
}
192+
],
193+
},
178194
],
179195
"icon": '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-link-45deg" viewBox="0 0 16 16">\n'
180196
+ ' <path d="M4.715 6.542 3.343 7.914a3 3 0 1 0 4.243 4.243l1.828-1.829A3 3 0 0 0 8.586 5.5L8 6.086a1 1 0 0 0-.154.199 2 2 0 0 1 .861 3.337L6.88 11.45a2 2 0 1 1-2.83-2.83l.793-.792a4 4 0 0 1-.128-1.287z"/>\n'

djangocms_text/locale/ar/LC_MESSAGES/django.po

+67-47
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ msgid ""
1111
msgstr ""
1212
"Project-Id-Version: PACKAGE VERSION\n"
1313
"Report-Msgid-Bugs-To: \n"
14-
"POT-Creation-Date: 2024-10-27 21:26+0100\n"
14+
"POT-Creation-Date: 2024-12-22 01:08+0100\n"
1515
"PO-Revision-Date: 2019-01-23 16:28+0000\n"
1616
"Last-Translator: Angelo Dini <angelo.dini@divio.ch>, 2019\n"
1717
"Language-Team: Arabic (https://www.transifex.com/divio/teams/58664/ar/)\n"
@@ -30,187 +30,207 @@ msgstr ""
3030
msgid "Unable to process your request. Invalid token."
3131
msgstr ""
3232

33-
#: cms_toolbars.py:58
33+
#: cms_toolbars.py:60
3434
msgid "Toggle inline editing mode for text plugins"
3535
msgstr ""
3636

37-
#: editors.py:31
37+
#: editors.py:32
3838
msgid "Undo"
3939
msgstr ""
4040

41-
#: editors.py:35
41+
#: editors.py:36
4242
msgid "Redo"
4343
msgstr ""
4444

45-
#: editors.py:39
45+
#: editors.py:40
4646
msgid "Bold"
4747
msgstr ""
4848

49-
#: editors.py:45
49+
#: editors.py:46
5050
msgid "Italic"
5151
msgstr ""
5252

53-
#: editors.py:51
53+
#: editors.py:52
5454
msgid "Underline"
5555
msgstr ""
5656

57-
#: editors.py:57
57+
#: editors.py:58
5858
msgid "Strike"
5959
msgstr ""
6060

61-
#: editors.py:61
61+
#: editors.py:62
6262
msgid "Subscript"
6363
msgstr ""
6464

65-
#: editors.py:67
65+
#: editors.py:68
6666
msgid "Superscript"
6767
msgstr ""
6868

69-
#: editors.py:73
69+
#: editors.py:74
7070
msgid "Remove formatting"
7171
msgstr ""
7272

73-
#: editors.py:86
73+
#: editors.py:87
7474
msgid "Align left"
7575
msgstr ""
7676

77-
#: editors.py:92
77+
#: editors.py:93
7878
msgid "Align center"
7979
msgstr ""
8080

81-
#: editors.py:98
81+
#: editors.py:99
8282
msgid "Align right"
8383
msgstr ""
8484

85-
#: editors.py:104
85+
#: editors.py:105
8686
msgid "Justify"
8787
msgstr ""
8888

89-
#: editors.py:110
89+
#: editors.py:111
9090
msgid "Horizontal rule"
9191
msgstr ""
9292

93-
#: editors.py:116
93+
#: editors.py:117
9494
msgid "Numbered list"
9595
msgstr ""
9696

97-
#: editors.py:123
97+
#: editors.py:124
9898
msgid "Bullet list"
9999
msgstr ""
100100

101-
#: editors.py:129
101+
#: editors.py:130
102102
msgid "Outdent"
103103
msgstr ""
104104

105-
#: editors.py:136
105+
#: editors.py:137
106106
msgid "Indent"
107107
msgstr ""
108108

109-
#: editors.py:143
109+
#: editors.py:144
110110
msgid "Blockquote"
111111
msgstr ""
112112

113-
#: editors.py:149
113+
#: editors.py:150
114114
msgid "Link"
115115
msgstr ""
116116

117-
#: editors.py:158
117+
#: editors.py:170
118118
msgid "Type URL or search for a destination"
119119
msgstr ""
120120

121-
#: editors.py:159
121+
#: editors.py:171
122122
msgid "URL or search"
123123
msgstr ""
124124

125-
#: editors.py:184
125+
#: editors.py:178
126+
msgid "Link options"
127+
msgstr ""
128+
129+
#: editors.py:182
130+
msgid "Target"
131+
msgstr ""
132+
133+
#: editors.py:186
134+
msgid "New window"
135+
msgstr ""
136+
137+
#: editors.py:187
138+
msgid "Same window"
139+
msgstr ""
140+
141+
#: editors.py:188
142+
msgid "Parent window"
143+
msgstr ""
144+
145+
#: editors.py:201
126146
msgid "Unlink"
127147
msgstr ""
128148

129-
#: editors.py:192
149+
#: editors.py:209
130150
msgid "Table"
131151
msgstr ""
132152

133-
#: editors.py:196
153+
#: editors.py:213
134154
msgid "Code"
135155
msgstr ""
136156

137-
#: editors.py:202
157+
#: editors.py:219
138158
msgid "Small"
139159
msgstr ""
140160

141-
#: editors.py:205
161+
#: editors.py:222
142162
msgid "Keyboard input"
143163
msgstr ""
144164

145-
#: editors.py:211
165+
#: editors.py:228
146166
msgid "Code block"
147167
msgstr ""
148168

149-
#: editors.py:218
169+
#: editors.py:235
150170
msgid "Heading 1"
151171
msgstr ""
152172

153-
#: editors.py:224
173+
#: editors.py:241
154174
msgid "Heading 2"
155175
msgstr ""
156176

157-
#: editors.py:230
177+
#: editors.py:247
158178
msgid "Heading 3"
159179
msgstr ""
160180

161-
#: editors.py:236
181+
#: editors.py:253
162182
msgid "Heading 4"
163183
msgstr ""
164184

165-
#: editors.py:242
185+
#: editors.py:259
166186
msgid "Heading 5"
167187
msgstr ""
168188

169-
#: editors.py:248
189+
#: editors.py:265
170190
msgid "Heading 6"
171191
msgstr ""
172192

173-
#: editors.py:254
193+
#: editors.py:271
174194
msgid "Paragraph"
175195
msgstr ""
176196

177-
#: editors.py:260
197+
#: editors.py:277
178198
msgid "Anchor"
179199
msgstr ""
180200

181-
#: editors.py:263
201+
#: editors.py:280
182202
msgid "Block format"
183203
msgstr ""
184204

185-
#: editors.py:267
205+
#: editors.py:284
186206
msgid "Styles"
187207
msgstr ""
188208

189-
#: editors.py:271
209+
#: editors.py:288
190210
msgid "Font"
191211
msgstr ""
192212

193-
#: editors.py:274
213+
#: editors.py:291
194214
msgid "Font size"
195215
msgstr ""
196216

197-
#: editors.py:277 editors.py:278 widgets.py:183 widgets.py:186
217+
#: editors.py:294 editors.py:295 widgets.py:240 widgets.py:243
198218
msgid "CMS Plugins"
199219
msgstr ""
200220

201-
#: editors.py:279 widgets.py:185
221+
#: editors.py:296 widgets.py:242
202222
msgid "Edit CMS Plugin"
203223
msgstr ""
204224

205-
#: editors.py:280 widgets.py:184
225+
#: editors.py:297 widgets.py:241
206226
msgid "Add CMS Plugin"
207227
msgstr ""
208228

209-
#: models.py:51
229+
#: models.py:50
210230
msgid "body"
211231
msgstr "المحتوى"
212232

213-
#: models.py:52
233+
#: models.py:51
214234
msgid "json"
215235
msgstr ""
216236

0 commit comments

Comments
 (0)