Skip to content

Commit

Permalink
feat: Improved dynamic link ui for tiptap editor (#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
fsbraun authored Dec 22, 2024
1 parent e9d3b48 commit 5281364
Show file tree
Hide file tree
Showing 52 changed files with 3,588 additions and 5,621 deletions.
42 changes: 29 additions & 13 deletions djangocms_text/editors.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,17 @@ def default(self, obj):
"Link": {
"title": _("Link"),
"form": [
# {
# "type": "link",
# "url": '#',
# "label": '<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" '
# 'class="bi bi-box-arrow-up-left" viewBox="0 0 16 16">'
# '<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 '
# '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 '
# '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" '
# '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 '
# '1.707V5.5a.5.5 0 0 1-1 0z"/></svg>',
# },
{
"name": "href_select",
"type": "hidden",
Expand All @@ -162,19 +173,24 @@ def default(self, obj):
"class": "js-linkfield",
"required": False,
},
# {"type": 'hr'},
# {
# "name": 'target',
# "label": 'Target',
# "type": 'select',
# "options": [
# {"value": '', "label": '-----'},
# {"value": '_blank', "label": 'New window'},
# {"value": '_self', "label": 'Same window'},
# {"value": '_parent', "label": 'Parent window'},
# ],
# "required": False
# }
{
"type": "section",
"label": _("Link options"),
"content": [
{
"name": "target",
"label": _("Target"),
"type": "select",
"options": [
{"value": "", "label": "-----"},
{"value": "_blank", "label": _("New window")},
{"value": "_self", "label": _("Same window")},
{"value": "_parent", "label": _("Parent window")},
],
"required": False,
}
],
},
],
"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'
+ ' <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'
Expand Down
114 changes: 67 additions & 47 deletions djangocms_text/locale/ar/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-10-27 21:26+0100\n"
"POT-Creation-Date: 2024-12-22 01:08+0100\n"
"PO-Revision-Date: 2019-01-23 16:28+0000\n"
"Last-Translator: Angelo Dini <[email protected]>, 2019\n"
"Language-Team: Arabic (https://www.transifex.com/divio/teams/58664/ar/)\n"
Expand All @@ -30,187 +30,207 @@ msgstr ""
msgid "Unable to process your request. Invalid token."
msgstr ""

#: cms_toolbars.py:58
#: cms_toolbars.py:60
msgid "Toggle inline editing mode for text plugins"
msgstr ""

#: editors.py:31
#: editors.py:32
msgid "Undo"
msgstr ""

#: editors.py:35
#: editors.py:36
msgid "Redo"
msgstr ""

#: editors.py:39
#: editors.py:40
msgid "Bold"
msgstr ""

#: editors.py:45
#: editors.py:46
msgid "Italic"
msgstr ""

#: editors.py:51
#: editors.py:52
msgid "Underline"
msgstr ""

#: editors.py:57
#: editors.py:58
msgid "Strike"
msgstr ""

#: editors.py:61
#: editors.py:62
msgid "Subscript"
msgstr ""

#: editors.py:67
#: editors.py:68
msgid "Superscript"
msgstr ""

#: editors.py:73
#: editors.py:74
msgid "Remove formatting"
msgstr ""

#: editors.py:86
#: editors.py:87
msgid "Align left"
msgstr ""

#: editors.py:92
#: editors.py:93
msgid "Align center"
msgstr ""

#: editors.py:98
#: editors.py:99
msgid "Align right"
msgstr ""

#: editors.py:104
#: editors.py:105
msgid "Justify"
msgstr ""

#: editors.py:110
#: editors.py:111
msgid "Horizontal rule"
msgstr ""

#: editors.py:116
#: editors.py:117
msgid "Numbered list"
msgstr ""

#: editors.py:123
#: editors.py:124
msgid "Bullet list"
msgstr ""

#: editors.py:129
#: editors.py:130
msgid "Outdent"
msgstr ""

#: editors.py:136
#: editors.py:137
msgid "Indent"
msgstr ""

#: editors.py:143
#: editors.py:144
msgid "Blockquote"
msgstr ""

#: editors.py:149
#: editors.py:150
msgid "Link"
msgstr ""

#: editors.py:158
#: editors.py:170
msgid "Type URL or search for a destination"
msgstr ""

#: editors.py:159
#: editors.py:171
msgid "URL or search"
msgstr ""

#: editors.py:184
#: editors.py:178
msgid "Link options"
msgstr ""

#: editors.py:182
msgid "Target"
msgstr ""

#: editors.py:186
msgid "New window"
msgstr ""

#: editors.py:187
msgid "Same window"
msgstr ""

#: editors.py:188
msgid "Parent window"
msgstr ""

#: editors.py:201
msgid "Unlink"
msgstr ""

#: editors.py:192
#: editors.py:209
msgid "Table"
msgstr ""

#: editors.py:196
#: editors.py:213
msgid "Code"
msgstr ""

#: editors.py:202
#: editors.py:219
msgid "Small"
msgstr ""

#: editors.py:205
#: editors.py:222
msgid "Keyboard input"
msgstr ""

#: editors.py:211
#: editors.py:228
msgid "Code block"
msgstr ""

#: editors.py:218
#: editors.py:235
msgid "Heading 1"
msgstr ""

#: editors.py:224
#: editors.py:241
msgid "Heading 2"
msgstr ""

#: editors.py:230
#: editors.py:247
msgid "Heading 3"
msgstr ""

#: editors.py:236
#: editors.py:253
msgid "Heading 4"
msgstr ""

#: editors.py:242
#: editors.py:259
msgid "Heading 5"
msgstr ""

#: editors.py:248
#: editors.py:265
msgid "Heading 6"
msgstr ""

#: editors.py:254
#: editors.py:271
msgid "Paragraph"
msgstr ""

#: editors.py:260
#: editors.py:277
msgid "Anchor"
msgstr ""

#: editors.py:263
#: editors.py:280
msgid "Block format"
msgstr ""

#: editors.py:267
#: editors.py:284
msgid "Styles"
msgstr ""

#: editors.py:271
#: editors.py:288
msgid "Font"
msgstr ""

#: editors.py:274
#: editors.py:291
msgid "Font size"
msgstr ""

#: editors.py:277 editors.py:278 widgets.py:183 widgets.py:186
#: editors.py:294 editors.py:295 widgets.py:240 widgets.py:243
msgid "CMS Plugins"
msgstr ""

#: editors.py:279 widgets.py:185
#: editors.py:296 widgets.py:242
msgid "Edit CMS Plugin"
msgstr ""

#: editors.py:280 widgets.py:184
#: editors.py:297 widgets.py:241
msgid "Add CMS Plugin"
msgstr ""

#: models.py:51
#: models.py:50
msgid "body"
msgstr "المحتوى"

#: models.py:52
#: models.py:51
msgid "json"
msgstr ""

Expand Down
Loading

0 comments on commit 5281364

Please sign in to comment.