Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit9fba4d2

Browse files
authored
Sponsorship benefits ux fixes (python#1687)
* Install jqueryui* Quickly displays elements titles* Update to all areas that states 'packages' to 'sponsor packages'* Highlight package only benefits
1 parent3abcbe8 commit9fba4d2

File tree

9 files changed

+47
-8
lines changed

9 files changed

+47
-8
lines changed

‎sponsors/forms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,13 +110,13 @@ def _clean_benefits(self, cleaned_data):
110110
ifnotpackage:
111111
raiseforms.ValidationError(
112112
_(
113-
"The application has 1 or more package only benefits and no package."
113+
"The application has 1 or more package only benefits and nosponsorpackage."
114114
)
115115
)
116116
elifnotbenefit.packages.filter(id=package.id).exists():
117117
raiseforms.ValidationError(
118118
_(
119-
"The application has 1 or more package only benefits but wrong package."
119+
"The application has 1 or more package only benefits but wrongsponsorpackage."
120120
)
121121
)
122122

‎sponsors/models.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class Meta(OrderedModel.Meta):
3232

3333
defhas_user_customization(self,benefits):
3434
"""
35-
Given a list of benefits this method checks if it exclusively matches the package benefits
35+
Given a list of benefits this method checks if it exclusively matches thesponsorpackage benefits
3636
"""
3737
pkg_benefits_with_conflicts=set(self.benefits.with_conflicts())
3838

@@ -113,7 +113,7 @@ class SponsorshipBenefit(OrderedModel):
113113
)
114114
package_only=models.BooleanField(
115115
default=False,
116-
verbose_name="Package Only Benefit",
116+
verbose_name="SponsorPackage Only Benefit",
117117
help_text="If a benefit is only available via a sponsorship package, select this option.",
118118
)
119119
new=models.BooleanField(
@@ -158,7 +158,7 @@ class SponsorshipBenefit(OrderedModel):
158158
)
159159

160160
NEW_MESSAGE="New benefit this year!"
161-
PACKAGE_ONLY_MESSAGE="This benefit isonly availablewith packages"
161+
PACKAGE_ONLY_MESSAGE="Benefitonly availableas part of a sponsor package"
162162
NO_CAPACITY_MESSAGE="This benefit is currently at capacity"
163163

164164
@property

‎sponsors/tests/test_forms.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ def test_package_only_benefit_without_package_should_not_validate(self):
101101
form=SponsorshiptBenefitsForm(data=data)
102102
self.assertFalse(form.is_valid())
103103
self.assertIn(
104-
"The application has 1 or more package only benefits and no package.",
104+
"The application has 1 or more package only benefits and nosponsorpackage.",
105105
form.errors["__all__"],
106106
)
107107

@@ -118,7 +118,7 @@ def test_package_only_benefit_with_wrong_package_should_not_validate(self):
118118
form=SponsorshiptBenefitsForm(data=data)
119119
self.assertFalse(form.is_valid())
120120
self.assertIn(
121-
"The application has 1 or more package only benefits but wrong package.",
121+
"The application has 1 or more package only benefits but wrongsponsorpackage.",
122122
form.errors["__all__"],
123123
)
124124

‎static/js/libs/jquery-ui-1.12.1.min.js

Lines changed: 13 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎static/js/sponsors/applicationForm.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,9 @@ $(document).ready(function(){
6565
}
6666
});
6767
});
68+
69+
$(document).tooltip({
70+
show:{effect:"blind",duration:0},
71+
hide:false
72+
});
6873
});

‎static/sass/style.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3618,13 +3618,18 @@ span.highlighted {
36183618
font-style: italic; }
36193619

36203620
/* ! ===== SPONSORSHIP APP ===== */
3621+
.ui-tooltip-content {
3622+
font-size:75%; }
3623+
36213624
#sponsorship_application_container {
36223625
display: block;
36233626
text-align: center;
36243627
display: block;
36253628
text-align: center; }
36263629
#sponsorship_application_containerform {
36273630
margin-bottom:0; }
3631+
#sponsorship_application_containerform .package_only_label {
3632+
color:#666666; }
36283633
#sponsorship_application_container#package_selection {
36293634
display: inline-block; }
36303635
#sponsorship_application_container#package_selectionli {

‎static/sass/style.scss

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2395,12 +2395,21 @@ span.highlighted {
23952395
@import"fonts";
23962396

23972397
/* ! ===== SPONSORSHIP APP =====*/
2398+
.ui-tooltip-content {
2399+
font-size:75%;
2400+
}
2401+
23982402
#sponsorship_application_container {
2403+
23992404
display:block;
24002405
text-align:center;
24012406

24022407
form {
24032408
margin-bottom:0;
2409+
2410+
.package_only_label {
2411+
color:$grey;
2412+
}
24042413
}
24052414

24062415
#package_selection {

‎templates/base.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<metahttp-equiv="X-UA-Compatible"content="IE=edge">
1010

1111
<linkrel="prefetch"href="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js">
12+
<linkrel="prefetch"href="//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js">
1213

1314
<metaname="application-name"content="{{ SITE_INFO.site_name }}">
1415
<metaname="msapplication-tooltip"content="{{ SITE_INFO.site_descript }}">
@@ -37,6 +38,7 @@
3738
{# equivalent to: #}
3839
{#<link rel="stylesheet" href="{{ STATIC_URL }}stylesheets/no-mq.css" media="screen">#}
3940
<![endif]-->
41+
<linkrel="stylesheet"href="//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css">
4042

4143
{# Place icon files in the root if possible (let browsers look for them where they expect them to be) #}
4244
<linkrel="icon"type="image/x-icon"href="{{ STATIC_URL }}favicon.ico">
@@ -327,6 +329,8 @@ <h1 class="site-headline">
327329
{% block javascript %}
328330
<scriptsrc="//ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js"></script>
329331
<script>window.jQuery||document.write('<script src="{{ STATIC_URL }}js/libs/jquery-1.8.2.min.js"><\/script>')</script>
332+
<scriptsrc="//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js"></script>
333+
<script>window.jQuery||document.write('<script src="{{ STATIC_URL }}js/libs/jquery-ui-1.12.1.min.js"><\/script>')</script>
330334

331335
<scriptsrc="{{ STATIC_URL }}js/libs/masonry.pkgd.min.js"></script>
332336
<scriptsrc="{{ STATIC_URL }}js/libs/html-includes.js"></script>

‎templates/sponsors/sponsorship_benefits_form.html

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@
4141
<div>
4242
<span><iclass="fa fa-cubes"></i> {{ benefit_model.PACKAGE_ONLY_MESSAGE }}</span>
4343
{% if capacities_met %}<span><iclass="fa fa-close"></i> {{ benefit_model.NO_CAPACITY_MESSAGE }}</span>{% endif %}
44+
<br/>
45+
<span><iclass="fa fa-info"></i> Hover over benefit for details</span>
4446
</div>
4547
</div>
4648

@@ -53,7 +55,8 @@ <h3 class="title">{{ field.label }}</h3>
5355
<liclass="{% cycle '' 'highlight' %}">
5456
<labelfor="id_{{field.name}}_{{ forloop.counter0 }}"benefit_id="{{ benefit.id }}">
5557
<inputid="id_{{field.name}}_{{ forloop.counter0 }}"name="{{ field.name }}"type="checkbox"value="{{ benefit.id }}"{%ifbenefit.unavailability_message%}disabled{%endif%}{%ifbenefit.idinfield.initial%}checked{%endif%}{%ifbenefit.package_only%}package_only='true'{%endif%}>
56-
<span{%ifbenefit.description%}title="{{ benefit.description }}"{%endif%}>{{ benefit.name }}</span>
58+
<span{%ifbenefit.package_only%}class='package_only_label'{%endif%}>{{ benefit.name }}</span>
59+
{% if benefit.description %}<iclass="fa fa-info"title="{{ benefit.description }}"></i>{% endif %}
5760
{% if benefit.package_only %}<iclass="fa fa-cubes"title="{{ benefit_model.PACKAGE_ONLY_MESSAGE }}"></i>{% endif %}
5861
{% if not benefit.has_capacity %}<iclass="fa fa-close"title="{{ benefit_model.NO_CAPACITY_MESSAGE }}"></i>{% endif %}
5962
</label>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp