Skip to content

Commit

Permalink
Merge pull request #808 from Studio-Yandex-Practicum/feature/customiz…
Browse files Browse the repository at this point in the history
…able-link-button-text

Feature/customizable link button text
  • Loading branch information
AntonZelinsky authored Oct 30, 2024
2 parents edef3d1 + 5492ee0 commit 1e88011
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 7 deletions.
18 changes: 18 additions & 0 deletions apps/content_pages/migrations/0010_link_action_text.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.25 on 2024-10-30 13:15

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('content_pages', '0009_embedcode'),
]

operations = [
migrations.AddField(
model_name='link',
name='action_text',
field=models.CharField(default='Перейти', max_length=50, verbose_name='Текст на кнопке'),
),
]
5 changes: 5 additions & 0 deletions apps/content_pages/models/content_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ class Link(AbstractItemWithTitle):
verbose_name="Описание ссылки",
)
url = models.URLField()
action_text = models.CharField(
max_length=50,
default="Перейти",
verbose_name="Текст на кнопке",
)

class Meta:
verbose_name = "Ссылка с описанием"
Expand Down
1 change: 1 addition & 0 deletions apps/content_pages/serializers/content_items.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ class Meta:
"title",
"description",
"url",
"action_text",
)


Expand Down
8 changes: 4 additions & 4 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ yadisk = "^1.2.15"
django-filer = "^3.1.0"
certifi = "^2024.8.30"
pip = "^24.0"
werkzeug = "^3.0.4"
werkzeug = "3.0.6"
urllib3 = "^2.2.2"
requests = "^2.32.3"
cryptography = "^43.0.1"
Expand Down
2 changes: 1 addition & 1 deletion requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,6 @@ urllib3==2.2.2 ; python_version >= "3.9" and python_version < "4.0"
virtualenv==20.25.0 ; python_version >= "3.9" and python_version < "4.0"
wcwidth==0.2.12 ; python_version >= "3.9" and python_version < "4.0"
webencodings==0.5.1 ; python_version >= "3.9" and python_version < "4.0"
werkzeug==3.0.4 ; python_version >= "3.9" and python_version < "4.0"
werkzeug==3.0.6 ; python_version >= "3.9" and python_version < "4.0"
xhtml2pdf==0.2.11 ; python_version >= "3.9" and python_version < "4.0"
yadisk==1.3.4 ; python_version >= "3.9" and python_version < "4.0"
2 changes: 1 addition & 1 deletion requirements/prod.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,6 @@ uritemplate==4.1.1 ; python_version >= "3.9" and python_version < "4.0"
uritools==4.0.2 ; python_version >= "3.9" and python_version < "4.0"
urllib3==2.2.2 ; python_version >= "3.9" and python_version < "4.0"
webencodings==0.5.1 ; python_version >= "3.9" and python_version < "4.0"
werkzeug==3.0.4 ; python_version >= "3.9" and python_version < "4.0"
werkzeug==3.0.6 ; python_version >= "3.9" and python_version < "4.0"
xhtml2pdf==0.2.11 ; python_version >= "3.9" and python_version < "4.0"
yadisk==1.3.4 ; python_version >= "3.9" and python_version < "4.0"

0 comments on commit 1e88011

Please sign in to comment.