From 096ac337e1ccef8b2659699885a60b9c71d7fbd7 Mon Sep 17 00:00:00 2001
From: Ee Durbin
Date: Fri, 9 Feb 2024 08:42:26 -0500
Subject: [PATCH] LinkedIn stuff (#2367)
* Adds linkedin to socialize
* Adds linkedin to sponsor profile
Closes #2365
---
sponsors/forms.py | 6 ++++++
.../0101_sponsor_linked_in_page_url.py | 18 ++++++++++++++++++
sponsors/models/sponsors.py | 6 ++++++
static/sass/style.css | 17 +++++++++++++++++
static/sass/style.scss | 18 ++++++++++++++++++
templates/base.html | 7 ++++---
.../new_sponsorship_application_form.html | 11 +++++++++++
templates/users/sponsor_info_update.html | 12 ++++++++++++
8 files changed, 92 insertions(+), 3 deletions(-)
create mode 100644 sponsors/migrations/0101_sponsor_linked_in_page_url.py
diff --git a/sponsors/forms.py b/sponsors/forms.py
index 21258f3b2..4ced017c9 100644
--- a/sponsors/forms.py
+++ b/sponsors/forms.py
@@ -221,6 +221,11 @@ class SponsorshipApplicationForm(forms.Form):
help_text="For promotion of your sponsorship on social media.",
required=False,
)
+ linked_in_page_url = forms.URLField(
+ label="LinkedIn page URL",
+ help_text="URL for your LinkedIn page.",
+ required=False,
+ )
web_logo = forms.ImageField(
label="Sponsor web logo",
help_text="For display on our sponsor webpage. High resolution PNG or JPG, smallest dimension no less than 256px",
@@ -379,6 +384,7 @@ def save(self):
description=self.cleaned_data.get("description", ""),
landing_page_url=self.cleaned_data.get("landing_page_url", ""),
twitter_handle=self.cleaned_data["twitter_handle"],
+ linked_in_page_url=self.cleaned_data["linked_in_page_url"],
print_logo=self.cleaned_data.get("print_logo"),
country_of_incorporation=self.cleaned_data.get("country_of_incorporation", ""),
state_of_incorporation=self.cleaned_data.get("state_of_incorporation", ""),
diff --git a/sponsors/migrations/0101_sponsor_linked_in_page_url.py b/sponsors/migrations/0101_sponsor_linked_in_page_url.py
new file mode 100644
index 000000000..61041a08e
--- /dev/null
+++ b/sponsors/migrations/0101_sponsor_linked_in_page_url.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.2.24 on 2024-02-09 13:30
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('sponsors', '0100_auto_20240107_1054'),
+ ]
+
+ operations = [
+ migrations.AddField(
+ model_name='sponsor',
+ name='linked_in_page_url',
+ field=models.URLField(blank=True, help_text='URL for your LinkedIn page.', null=True, verbose_name='LinkedIn page URL'),
+ ),
+ ]
diff --git a/sponsors/models/sponsors.py b/sponsors/models/sponsors.py
index ba0cff83d..78d5d6e32 100644
--- a/sponsors/models/sponsors.py
+++ b/sponsors/models/sponsors.py
@@ -44,6 +44,12 @@ class Sponsor(ContentManageable):
null=True,
verbose_name="Twitter handle",
)
+ linked_in_page_url = models.URLField(
+ blank=True,
+ null=True,
+ verbose_name="LinkedIn page URL",
+ help_text="URL for your LinkedIn page."
+ )
web_logo = models.ImageField(
upload_to="sponsor_web_logos",
verbose_name="Web logo",
diff --git a/static/sass/style.css b/static/sass/style.css
index c3d2bb5f9..a58863817 100644
--- a/static/sass/style.css
+++ b/static/sass/style.css
@@ -3405,6 +3405,23 @@ span.highlighted {
.icon-megaphone span, .icon-python-alt span, .icon-pypi span, .icon-news span, .icon-moderate span, .icon-mercurial span, .icon-jobs span, .icon-help span, .icon-download span, .icon-documentation span, .icon-community span, .icon-code span, .icon-close span, .icon-calendar span, .icon-beginner span, .icon-advanced span, .icon-sitemap span, .icon-search span, .icon-search-alt span, .icon-python span, .icon-github span, .icon-get-started span, .icon-feed span, .icon-facebook span, .icon-email span, .icon-arrow-up span, .icon-arrow-right span, .icon-arrow-left span, .icon-arrow-down span, .errorlist:before span, .icon-freenode span, .icon-alert span, .icon-versions span, .icon-twitter span, .icon-thumbs-up span, .icon-thumbs-down span, .icon-text-resize span, .icon-success-stories span, .icon-statistics span, .icon-stack-overflow span, .icon-mastodon span {
display: none; }
+.fa {
+ speak: none;
+ font-style: normal;
+ font-weight: normal;
+ font-variant: normal;
+ text-transform: none;
+ line-height: 1;
+ margin-right: .5em;
+ /* Better Font Rendering =========== */
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+ /* Hide a unicode fallback character when we supply it by default.
+ * In fonts.scss, we hide the icon and show the fallback when other conditions are not met
+ */ }
+ .fa {
+ display: none; }
+
/* Keep this at the bottom since it will create a huge set of data */
/*
* Would have liked to use Compass' built-in font-face mixin with the inline-font-files() helper, but it seems to be BROKEN in older versions!
diff --git a/static/sass/style.scss b/static/sass/style.scss
index 2e0ea8981..4fd9a3efd 100644
--- a/static/sass/style.scss
+++ b/static/sass/style.scss
@@ -2426,6 +2426,24 @@ span.highlighted {
*/
span { display: none; }
}
+.fa {
+ speak: none;
+ font-style: normal;
+ font-weight: normal;
+ font-variant: normal;
+ text-transform: none;
+ line-height: 1;
+ margin-right: .5em;
+
+ /* Better Font Rendering =========== */
+ -webkit-font-smoothing: antialiased;
+ -moz-osx-font-smoothing: grayscale;
+
+ /* Hide a unicode fallback character when we supply it by default.
+ * In fonts.scss, we hide the icon and show the fallback when other conditions are not met
+ */
+ span { display: none; }
+}
/* Keep this at the bottom since it will create a huge set of data */
@import "fonts";
diff --git a/templates/base.html b/templates/base.html
index 27daceb50..cfa0f34ce 100644
--- a/templates/base.html
+++ b/templates/base.html
@@ -41,6 +41,7 @@
{% stylesheet 'style' %}
{% stylesheet 'mq' %}
+ {% stylesheet 'font-awesome' %}
{% comment %}
{# equivalent to: #}
@@ -235,10 +236,10 @@
Socialize
diff --git a/templates/sponsors/new_sponsorship_application_form.html b/templates/sponsors/new_sponsorship_application_form.html
index 1610807e8..c95bdf4ea 100644
--- a/templates/sponsors/new_sponsorship_application_form.html
+++ b/templates/sponsors/new_sponsorship_application_form.html
@@ -130,6 +130,17 @@ Basics
{% endif %}
+
+
+
+
+ {% render_field form.linked_in_page_url%}
+ {% if form.linked_in_page_url.help_text %}
+
+ {{ form.linked_in_page_url.help_text }}
+ {% endif %}
+
+
diff --git a/templates/users/sponsor_info_update.html b/templates/users/sponsor_info_update.html
index e1984a28c..1312fb782 100644
--- a/templates/users/sponsor_info_update.html
+++ b/templates/users/sponsor_info_update.html
@@ -93,6 +93,18 @@
Sponsor Information
{% endif %}
+
+
+
+
+ {% render_field form.linked_in_page_url%}
+ {% if form.linked_in_page_url.help_text %}
+
+ {{ form.linked_in_page_url.help_text }}
+ {% endif %}
+
+