diff --git a/hypha/locale/django.pot b/hypha/locale/django.pot index ed410d3f93..e08120d692 100644 --- a/hypha/locale/django.pot +++ b/hypha/locale/django.pot @@ -6627,22 +6627,6 @@ msgid "" "is not defined." msgstr "" -#: hypha/public/utils/models.py:268 -msgid "Your Twitter username without the @, e.g. katyperry" -msgstr "" - -#: hypha/public/utils/models.py:273 -msgid "Your Facebook app ID." -msgstr "" - -#: hypha/public/utils/models.py:279 -msgid "Default sharing text to use if social text has not been set on a page." -msgstr "" - -#: hypha/public/utils/models.py:286 -msgid "Site name, used by Open Graph." -msgstr "" - #: hypha/public/utils/models.py:303 msgid "Default site logo" msgstr "" @@ -6695,22 +6679,6 @@ msgstr "" msgid "You might also likeā€¦" msgstr "" -#: hypha/templates/includes/share.html:4 -msgid "Share" -msgstr "" - -#: hypha/templates/includes/share.html:8 -msgid "Share on Twitter" -msgstr "" - -#: hypha/templates/includes/share.html:14 -msgid "Share on LinkedIn" -msgstr "" - -#: hypha/templates/includes/share.html:21 -msgid "Share on Facebook" -msgstr "" - #: hypha/templates/password_required.html:4 #: hypha/templates/password_required.html:9 msgid "Password required" diff --git a/hypha/public/forms/migrations/0005_remove_formpage_social_image_and_more.py b/hypha/public/forms/migrations/0005_remove_formpage_social_image_and_more.py new file mode 100644 index 0000000000..da06fd5fd7 --- /dev/null +++ b/hypha/public/forms/migrations/0005_remove_formpage_social_image_and_more.py @@ -0,0 +1,20 @@ +# Generated by Django 4.2.9 on 2024-01-07 18:52 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("public_forms", "0004_auto_20220722_0844"), + ] + + operations = [ + migrations.RemoveField( + model_name="formpage", + name="social_image", + ), + migrations.RemoveField( + model_name="formpage", + name="social_text", + ), + ] diff --git a/hypha/public/funds/migrations/0015_remove_baseapplicationpage_social_image_and_more.py b/hypha/public/funds/migrations/0015_remove_baseapplicationpage_social_image_and_more.py new file mode 100644 index 0000000000..4888ad5080 --- /dev/null +++ b/hypha/public/funds/migrations/0015_remove_baseapplicationpage_social_image_and_more.py @@ -0,0 +1,52 @@ +# Generated by Django 4.2.9 on 2024-01-07 18:52 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("public_funds", "0014_auto_20220722_0844"), + ] + + operations = [ + migrations.RemoveField( + model_name="baseapplicationpage", + name="social_image", + ), + migrations.RemoveField( + model_name="baseapplicationpage", + name="social_text", + ), + migrations.RemoveField( + model_name="fundindex", + name="social_image", + ), + migrations.RemoveField( + model_name="fundindex", + name="social_text", + ), + migrations.RemoveField( + model_name="labindex", + name="social_image", + ), + migrations.RemoveField( + model_name="labindex", + name="social_text", + ), + migrations.RemoveField( + model_name="labpage", + name="social_image", + ), + migrations.RemoveField( + model_name="labpage", + name="social_text", + ), + migrations.RemoveField( + model_name="opencallindexpage", + name="social_image", + ), + migrations.RemoveField( + model_name="opencallindexpage", + name="social_text", + ), + ] diff --git a/hypha/public/home/migrations/0014_remove_homepage_social_image_and_more.py b/hypha/public/home/migrations/0014_remove_homepage_social_image_and_more.py new file mode 100644 index 0000000000..d931488efa --- /dev/null +++ b/hypha/public/home/migrations/0014_remove_homepage_social_image_and_more.py @@ -0,0 +1,20 @@ +# Generated by Django 4.2.9 on 2024-01-07 18:52 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("home", "0013_alter_homepage_our_work"), + ] + + operations = [ + migrations.RemoveField( + model_name="homepage", + name="social_image", + ), + migrations.RemoveField( + model_name="homepage", + name="social_text", + ), + ] diff --git a/hypha/public/news/migrations/0015_remove_newsindex_social_image_and_more.py b/hypha/public/news/migrations/0015_remove_newsindex_social_image_and_more.py new file mode 100644 index 0000000000..f1d1687d0b --- /dev/null +++ b/hypha/public/news/migrations/0015_remove_newsindex_social_image_and_more.py @@ -0,0 +1,28 @@ +# Generated by Django 4.2.9 on 2024-01-07 18:52 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("news", "0014_alter_newspagenewstype_news_type"), + ] + + operations = [ + migrations.RemoveField( + model_name="newsindex", + name="social_image", + ), + migrations.RemoveField( + model_name="newsindex", + name="social_text", + ), + migrations.RemoveField( + model_name="newspage", + name="social_image", + ), + migrations.RemoveField( + model_name="newspage", + name="social_text", + ), + ] diff --git a/hypha/public/news/templates/news/news_page.html b/hypha/public/news/templates/news/news_page.html index 9d40bb989b..2164a308ef 100644 --- a/hypha/public/news/templates/news/news_page.html +++ b/hypha/public/news/templates/news/news_page.html @@ -39,7 +39,6 @@

Projects Mentioned

{% endif %} - {% include "includes/share.html" %} {% include "includes/relatedcontent.html" with related_documents=page.related_documents.all related_pages=page.related_pages.all %} diff --git a/hypha/public/partner/migrations/0003_remove_partnerindexpage_social_image_and_more.py b/hypha/public/partner/migrations/0003_remove_partnerindexpage_social_image_and_more.py new file mode 100644 index 0000000000..a61ebbc866 --- /dev/null +++ b/hypha/public/partner/migrations/0003_remove_partnerindexpage_social_image_and_more.py @@ -0,0 +1,28 @@ +# Generated by Django 4.2.9 on 2024-01-07 18:52 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("partner", "0002_currency_symbol_setting"), + ] + + operations = [ + migrations.RemoveField( + model_name="partnerindexpage", + name="social_image", + ), + migrations.RemoveField( + model_name="partnerindexpage", + name="social_text", + ), + migrations.RemoveField( + model_name="partnerpage", + name="social_image", + ), + migrations.RemoveField( + model_name="partnerpage", + name="social_text", + ), + ] diff --git a/hypha/public/people/migrations/0016_remove_personindexpage_social_image_and_more.py b/hypha/public/people/migrations/0016_remove_personindexpage_social_image_and_more.py new file mode 100644 index 0000000000..f2729adb6b --- /dev/null +++ b/hypha/public/people/migrations/0016_remove_personindexpage_social_image_and_more.py @@ -0,0 +1,28 @@ +# Generated by Django 4.2.9 on 2024-01-07 18:52 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("people", "0015_alter_personpage_biography"), + ] + + operations = [ + migrations.RemoveField( + model_name="personindexpage", + name="social_image", + ), + migrations.RemoveField( + model_name="personindexpage", + name="social_text", + ), + migrations.RemoveField( + model_name="personpage", + name="social_image", + ), + migrations.RemoveField( + model_name="personpage", + name="social_text", + ), + ] diff --git a/hypha/public/projects/migrations/0011_remove_projectindexpage_social_image_and_more.py b/hypha/public/projects/migrations/0011_remove_projectindexpage_social_image_and_more.py new file mode 100644 index 0000000000..ee51e67837 --- /dev/null +++ b/hypha/public/projects/migrations/0011_remove_projectindexpage_social_image_and_more.py @@ -0,0 +1,28 @@ +# Generated by Django 4.2.9 on 2024-01-07 18:52 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("projects", "0010_alter_projectpage_body"), + ] + + operations = [ + migrations.RemoveField( + model_name="projectindexpage", + name="social_image", + ), + migrations.RemoveField( + model_name="projectindexpage", + name="social_text", + ), + migrations.RemoveField( + model_name="projectpage", + name="social_image", + ), + migrations.RemoveField( + model_name="projectpage", + name="social_text", + ), + ] diff --git a/hypha/public/standardpages/migrations/0007_remove_indexpage_social_image_and_more.py b/hypha/public/standardpages/migrations/0007_remove_indexpage_social_image_and_more.py new file mode 100644 index 0000000000..a7dfe858d4 --- /dev/null +++ b/hypha/public/standardpages/migrations/0007_remove_indexpage_social_image_and_more.py @@ -0,0 +1,28 @@ +# Generated by Django 4.2.9 on 2024-01-07 18:52 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("standardpages", "0006_alter_informationpage_body"), + ] + + operations = [ + migrations.RemoveField( + model_name="indexpage", + name="social_image", + ), + migrations.RemoveField( + model_name="indexpage", + name="social_text", + ), + migrations.RemoveField( + model_name="informationpage", + name="social_image", + ), + migrations.RemoveField( + model_name="informationpage", + name="social_text", + ), + ] diff --git a/hypha/public/standardpages/templates/standardpages/information_page.html b/hypha/public/standardpages/templates/standardpages/information_page.html index e676eafdac..53f0ceda8a 100644 --- a/hypha/public/standardpages/templates/standardpages/information_page.html +++ b/hypha/public/standardpages/templates/standardpages/information_page.html @@ -10,7 +10,6 @@

{{ page.introduction }}

{% endif %} {% include_block page.body %} - {% include "includes/share.html" %} diff --git a/hypha/public/utils/migrations/0010_delete_socialmediasettings.py b/hypha/public/utils/migrations/0010_delete_socialmediasettings.py new file mode 100644 index 0000000000..bf29e28006 --- /dev/null +++ b/hypha/public/utils/migrations/0010_delete_socialmediasettings.py @@ -0,0 +1,15 @@ +# Generated by Django 4.2.9 on 2024-01-07 18:52 + +from django.db import migrations + + +class Migration(migrations.Migration): + dependencies = [ + ("utils", "0009_systemmessagessettings_body_403_and_more"), + ] + + operations = [ + migrations.DeleteModel( + name="SocialMediaSettings", + ), + ] diff --git a/hypha/public/utils/models.py b/hypha/public/utils/models.py index b715c1375b..64c96eec04 100644 --- a/hypha/public/utils/models.py +++ b/hypha/public/utils/models.py @@ -13,7 +13,6 @@ ) from wagtail.contrib.settings.models import ( BaseGenericSetting, - BaseSiteSetting, register_setting, ) from wagtail.fields import RichTextField, StreamField @@ -21,8 +20,6 @@ from wagtail.snippets.models import register_snippet from wagtailcache.cache import WagtailCacheMixin, cache_page -from hypha.core.wagtail.admin import register_public_site_setting - class LinkFields(models.Model): """ @@ -118,31 +115,6 @@ class Meta: ] -# Generic social fields abstract class to add social image/text to any new content type easily. -class SocialFields(models.Model): - social_image = models.ForeignKey( - "images.CustomImage", - null=True, - blank=True, - on_delete=models.SET_NULL, - related_name="+", - ) - social_text = models.CharField(max_length=255, blank=True) - - class Meta: - abstract = True - - promote_panels = [ - MultiFieldPanel( - [ - FieldPanel("social_image"), - FieldPanel("social_text"), - ], - "Social networks", - ), - ] - - # Generic listing fields abstract class to add listing image/text to any new content type easily. class ListingFields(models.Model): listing_image = models.ForeignKey( @@ -260,33 +232,6 @@ def __str__(self): return self.title -@register_public_site_setting -class SocialMediaSettings(BaseSiteSetting): - twitter_handle = models.CharField( - max_length=255, - blank=True, - help_text=_("Your Twitter username without the @, e.g. katyperry"), - ) - facebook_app_id = models.CharField( - max_length=255, - blank=True, - help_text=_("Your Facebook app ID."), - ) - default_sharing_text = models.CharField( - max_length=255, - blank=True, - help_text=_( - "Default sharing text to use if social text has not been set on a page." - ), - ) - site_name = models.CharField( - max_length=255, - blank=True, - default="hypha", - help_text=_("Site name, used by Open Graph."), - ) - - @register_setting class SystemMessagesSettings(BaseGenericSetting): wagtail_reference_index_ignore = True @@ -383,7 +328,7 @@ class Meta: @method_decorator(cache_page, name="serve") -class BasePage(WagtailCacheMixin, SocialFields, ListingFields, Page): +class BasePage(WagtailCacheMixin, ListingFields, Page): wagtail_reference_index_ignore = True show_in_menus_default = True @@ -400,9 +345,7 @@ class Meta: content_panels = Page.content_panels + [FieldPanel("header_image")] - promote_panels = ( - Page.promote_panels + SocialFields.promote_panels + ListingFields.promote_panels - ) + promote_panels = Page.promote_panels + ListingFields.promote_panels def cache_control(self): return f"public, s-maxage={settings.CACHE_CONTROL_S_MAXAGE}" diff --git a/hypha/public/utils/templatetags/util_tags.py b/hypha/public/utils/templatetags/util_tags.py index 5e43c9b19a..63e01d8cac 100644 --- a/hypha/public/utils/templatetags/util_tags.py +++ b/hypha/public/utils/templatetags/util_tags.py @@ -1,20 +1,9 @@ from django import template from wagtail.coreutils import camelcase_to_underscore -from hypha.public.utils.models import SocialMediaSettings - register = template.Library() -# Social text -@register.filter(name="social_text") -def social_text(page, site): - try: - return page.social_text - except AttributeError: - return SocialMediaSettings.for_site(site).default_sharing_text - - # Get widget type of a field @register.filter(name="widget_type") def widget_type(bound_field): diff --git a/hypha/static_src/src/images/social.jpg b/hypha/static_src/src/images/social.jpg deleted file mode 100644 index aa604168e9..0000000000 Binary files a/hypha/static_src/src/images/social.jpg and /dev/null differ diff --git a/hypha/static_src/src/sass/public/components/_icon.scss b/hypha/static_src/src/sass/public/components/_icon.scss index 14a5617209..ebe6417090 100644 --- a/hypha/static_src/src/sass/public/components/_icon.scss +++ b/hypha/static_src/src/sass/public/components/_icon.scss @@ -13,12 +13,6 @@ fill: $color--white; } - &--footer-social { - @include media-query(tablet-portrait) { - margin-right: 10px; - } - } - &--mobile-menu { width: 32px; height: 28px; diff --git a/hypha/templates/base.html b/hypha/templates/base.html index 5ef0342162..a4dff98fe0 100644 --- a/hypha/templates/base.html +++ b/hypha/templates/base.html @@ -28,28 +28,12 @@ - - - {% if page.social_image %} - {% image page.social_image width-320 as social_img %} - - {% else %} - - {% endif %} - - {% if page.social_image %} - - {% else %} - - {% endif %} - - @@ -201,18 +185,9 @@

{% block page_title %}{{ page.title }}{% endblock %}
- {% cookie_banner %} diff --git a/hypha/templates/includes/share.html b/hypha/templates/includes/share.html deleted file mode 100644 index fa189d7f2f..0000000000 --- a/hypha/templates/includes/share.html +++ /dev/null @@ -1,26 +0,0 @@ -{% load i18n util_tags wagtailcore_tags wagtailimages_tags %} -{% wagtail_site as current_site %} -
-
{% trans "Share" %}
- {% image page.social_image fill-150x150 as social_img %} - {% with settings.utils.SocialMediaSettings as social_media_settings %} - - - - - - - - - - - - - {% if social_media_settings.facebook_app_id %} - - - - {% endif %} - {% endwith %} -
diff --git a/hypha/templates/includes/sprites.html b/hypha/templates/includes/sprites.html index c0bdc488ea..07d4aab9aa 100644 --- a/hypha/templates/includes/sprites.html +++ b/hypha/templates/includes/sprites.html @@ -4,14 +4,6 @@ - - - - - - - - @@ -146,10 +138,6 @@ - - - -