Skip to content

Commit 096ac33

Browse files
authored
LinkedIn stuff (#2367)
* Adds linkedin to socialize * Adds linkedin to sponsor profile Closes #2365
1 parent cde08ed commit 096ac33

File tree

8 files changed

+92
-3
lines changed

8 files changed

+92
-3
lines changed

sponsors/forms.py

+6
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,11 @@ class SponsorshipApplicationForm(forms.Form):
221221
help_text="For promotion of your sponsorship on social media.",
222222
required=False,
223223
)
224+
linked_in_page_url = forms.URLField(
225+
label="LinkedIn page URL",
226+
help_text="URL for your LinkedIn page.",
227+
required=False,
228+
)
224229
web_logo = forms.ImageField(
225230
label="Sponsor web logo",
226231
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):
379384
description=self.cleaned_data.get("description", ""),
380385
landing_page_url=self.cleaned_data.get("landing_page_url", ""),
381386
twitter_handle=self.cleaned_data["twitter_handle"],
387+
linked_in_page_url=self.cleaned_data["linked_in_page_url"],
382388
print_logo=self.cleaned_data.get("print_logo"),
383389
country_of_incorporation=self.cleaned_data.get("country_of_incorporation", ""),
384390
state_of_incorporation=self.cleaned_data.get("state_of_incorporation", ""),
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Generated by Django 2.2.24 on 2024-02-09 13:30
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('sponsors', '0100_auto_20240107_1054'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='sponsor',
15+
name='linked_in_page_url',
16+
field=models.URLField(blank=True, help_text='URL for your LinkedIn page.', null=True, verbose_name='LinkedIn page URL'),
17+
),
18+
]

sponsors/models/sponsors.py

+6
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,12 @@ class Sponsor(ContentManageable):
4444
null=True,
4545
verbose_name="Twitter handle",
4646
)
47+
linked_in_page_url = models.URLField(
48+
blank=True,
49+
null=True,
50+
verbose_name="LinkedIn page URL",
51+
help_text="URL for your LinkedIn page."
52+
)
4753
web_logo = models.ImageField(
4854
upload_to="sponsor_web_logos",
4955
verbose_name="Web logo",

static/sass/style.css

+17
Original file line numberDiff line numberDiff line change
@@ -3405,6 +3405,23 @@ span.highlighted {
34053405
.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 {
34063406
display: none; }
34073407

3408+
.fa {
3409+
speak: none;
3410+
font-style: normal;
3411+
font-weight: normal;
3412+
font-variant: normal;
3413+
text-transform: none;
3414+
line-height: 1;
3415+
margin-right: .5em;
3416+
/* Better Font Rendering =========== */
3417+
-webkit-font-smoothing: antialiased;
3418+
-moz-osx-font-smoothing: grayscale;
3419+
/* Hide a unicode fallback character when we supply it by default.
3420+
* In fonts.scss, we hide the icon and show the fallback when other conditions are not met
3421+
*/ }
3422+
.fa {
3423+
display: none; }
3424+
34083425
/* Keep this at the bottom since it will create a huge set of data */
34093426
/*
34103427
* 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!

static/sass/style.scss

+18
Original file line numberDiff line numberDiff line change
@@ -2426,6 +2426,24 @@ span.highlighted {
24262426
*/
24272427
span { display: none; }
24282428
}
2429+
.fa {
2430+
speak: none;
2431+
font-style: normal;
2432+
font-weight: normal;
2433+
font-variant: normal;
2434+
text-transform: none;
2435+
line-height: 1;
2436+
margin-right: .5em;
2437+
2438+
/* Better Font Rendering =========== */
2439+
-webkit-font-smoothing: antialiased;
2440+
-moz-osx-font-smoothing: grayscale;
2441+
2442+
/* Hide a unicode fallback character when we supply it by default.
2443+
* In fonts.scss, we hide the icon and show the fallback when other conditions are not met
2444+
*/
2445+
span { display: none; }
2446+
}
24292447

24302448
/* Keep this at the bottom since it will create a huge set of data */
24312449
@import "fonts";

templates/base.html

+4-3
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@
4141

4242
{% stylesheet 'style' %}
4343
{% stylesheet 'mq' %}
44+
{% stylesheet 'font-awesome' %}
4445
{% comment %}
4546
{# equivalent to: #}
4647
<link rel="stylesheet" href="{{ STATIC_URL }}stylesheets/style.css" title="default">
@@ -235,10 +236,10 @@ <h1 class="site-headline">
235236
<li class="tier-1 last" aria-haspopup="true">
236237
<a href="#" class="action-trigger">Socialize</a>
237238
<ul class="subnav menu">
238-
<li class="tier-2 element-1" role="treeitem"><a href="https://www.facebook.com/pythonlang?fref=ts"><span aria-hidden="true" class="icon-facebook"></span>Facebook</a></li>
239+
<li class="tier-2 element-1" role="treeitem"><a href="https://www.linkedin.com/company/python-software-foundation/"><i aria-hidden="true" class="fa fa-linkedin-square"></i></span>LinkedIn</a></li>
239240
<li class="tier-2 element-2" role="treeitem"><a href="https://fosstodon.org/@ThePSF"><span aria-hidden="true" class="icon-mastodon"></span>Mastodon</a></li>
240-
<li class="tier-2 element-3" role="treeitem"><a href="https://twitter.com/ThePSF"><span aria-hidden="true" class="icon-twitter"></span>Twitter</a></li>
241-
<li class="tier-2 element-4" role="treeitem"><a href="/community/irc/"><span aria-hidden="true" class="icon-freenode"></span>Chat on IRC</a></li>
241+
<li class="tier-2 element-3" role="treeitem"><a href="/community/irc/"><span aria-hidden="true" class="icon-freenode"></span>Chat on IRC</a></li>
242+
<li class="tier-2 element-4" role="treeitem"><a href="https://twitter.com/ThePSF"><span aria-hidden="true" class="icon-twitter"></span>Twitter</a></li>
242243
</ul>
243244
</li>
244245
</ul>

templates/sponsors/new_sponsorship_application_form.html

+11
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,17 @@ <h2>Basics</h2>
130130
{% endif %}
131131
</p>
132132
</div>
133+
134+
<div>
135+
<p class="form_field">
136+
<label>{{ form.linked_in_page_url.label }} <span class="error-message">{% if form.linked_in_page_url.errors %}{{ form.linked_in_page_url.errors.as_text }}</span>{% endif %}</label>
137+
{% render_field form.linked_in_page_url%}
138+
{% if form.linked_in_page_url.help_text %}
139+
<br/>
140+
<span class="helptext">{{ form.linked_in_page_url.help_text }}</span>
141+
{% endif %}
142+
</p>
143+
</div>
133144
</div>
134145

135146
<div class="inline_fields">

templates/users/sponsor_info_update.html

+12
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,18 @@ <h2>Sponsor Information</h2>
9393
{% endif %}
9494
</p>
9595
</div>
96+
97+
<div>
98+
<p class="form_field">
99+
<label>{{ form.linked_in_page_url.label }} <span class="error-message">{% if form.linked_in_page_url.errors %}
100+
{{ form.linked_in_page_url.errors.as_text }}</span>{% endif %}</label>
101+
{% render_field form.linked_in_page_url%}
102+
{% if form.linked_in_page_url.help_text %}
103+
<br/>
104+
<span class="helptext">{{ form.linked_in_page_url.help_text }}</span>
105+
{% endif %}
106+
</p>
107+
</div>
96108
</div>
97109
<div class="inline_fields">
98110
<div>

0 commit comments

Comments
 (0)