From 778cb4d61b41a228c2f1e66310a0dd73893b3963 Mon Sep 17 00:00:00 2001 From: Chris Arridge Date: Mon, 12 Aug 2024 13:24:44 +0100 Subject: [PATCH 1/8] feat: Updated branding text strings and urls in Python code Modified text strings and urls in Python code to change from codeforIATI to IATI branding. --- make_html.py | 9 +++++---- text.py | 4 +++- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/make_html.py b/make_html.py index 075fe3b0e..1afb25916 100644 --- a/make_html.py +++ b/make_html.py @@ -82,11 +82,11 @@ def xpath_to_url(path): # remove conditions path = re.sub(r'\[[^]]+\]', '', path) if path.startswith('iati-activity'): - url = 'https://reference.codeforiati.org/activity-standard/iati-activities/' + path.split('@')[0] + url = 'http://iatistandard.org/activity-standard/iati-activities/' + path.split('@')[0] elif path.startswith('iati-organisation'): - url = 'https://reference.codeforiati.org/organisation-standard/iati-organisations/' + path.split('@')[0] + url = 'http://iatistandard.org/organisation-standard/iati-organisations/' + path.split('@')[0] else: - url = 'https://reference.codeforiati.org/activity-standard/iati-activities/iati-activity/' + path.split('@')[0] + url = 'http://iatistandard.org/activity-standard/iati-activities/iati-activity/' + path.split('@')[0] if '@' in path: url += '#attributes' return url @@ -117,7 +117,8 @@ def get_codelist_values(codelist_values_for_element): app.jinja_env.filters['has_future_transactions'] = timeliness.has_future_transactions app.jinja_env.filters['round_nicely'] = round_nicely -# Custom Jinja globals +# Custom Jinja globals - NOTE: codeforIATI stats URLs have not been +# changed. app.jinja_env.globals['dataset_to_publisher'] = dataset_to_publisher app.jinja_env.globals['url'] = lambda x: '/' if x == 'index.html' else x app.jinja_env.globals['datetime_generated'] = lambda: datetime.now(UTC).strftime('%-d %B %Y (at %H:%M %Z)') diff --git a/text.py b/text.py index 56081bcd7..6955838bd 100644 --- a/text.py +++ b/text.py @@ -1,3 +1,5 @@ +"""Text fragments for page titles, navigation and page leaders/sub-leaders +""" import copy top_titles = { @@ -10,7 +12,7 @@ } page_titles = { - 'index': 'Code for IATI Analytics', + 'index': 'Dashboard Home', 'headlines': 'Headlines', 'data_quality': 'Data Quality', 'exploring_data': 'Exploring Data', From f949e7ea564e4aaa47517f3c638df62a2c91f068 Mon Sep 17 00:00:00 2001 From: Chris Arridge Date: Mon, 12 Aug 2024 15:08:39 +0100 Subject: [PATCH 2/8] fix: Fixed template that was using the wrong variable The validation page template was using the wrong variable name to form the link to the validator. --- templates/validation.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/validation.html b/templates/validation.html index 412812c33..7a91ff096 100644 --- a/templates/validation.html +++ b/templates/validation.html @@ -45,7 +45,7 @@

List of files that fail validation, grouped by publisher

{% if publisher in ckan and dataset_name in ckan[publisher] %} - validator + validator {% endif %}
From 9bd86a27a9eed90c85a91135b719192cc33daa1e Mon Sep 17 00:00:00 2001 From: Chris Arridge Date: Mon, 12 Aug 2024 15:11:55 +0100 Subject: [PATCH 3/8] redundant: Deleted CNAME file from static --- static/CNAME | 1 - 1 file changed, 1 deletion(-) delete mode 100644 static/CNAME diff --git a/static/CNAME b/static/CNAME deleted file mode 100644 index f5afd29b7..000000000 --- a/static/CNAME +++ /dev/null @@ -1 +0,0 @@ -analytics.codeforiati.org From c4bc379c00021b0be802c3792f55e3b77dbd090c Mon Sep 17 00:00:00 2001 From: Chris Arridge Date: Mon, 12 Aug 2024 15:40:10 +0100 Subject: [PATCH 4/8] feat: Replace favicon Replaced favicon with those from the IATI design system. They are all placed in img/ and appropriate routes added to make_html.py so that /favicon.ico is still accessible. The base template is modified to use the PNG favicon. --- make_html.py | 20 ++++++++++++++++---- static/favicon.ico | Bin 4286 -> 0 bytes static/img/favicon-16x16.png | Bin 0 -> 479 bytes static/img/favicon-32x32.png | Bin 0 -> 1170 bytes static/img/favicon.ico | Bin 0 -> 4286 bytes templates/base.html | 2 +- 6 files changed, 17 insertions(+), 5 deletions(-) delete mode 100644 static/favicon.ico create mode 100644 static/img/favicon-16x16.png create mode 100644 static/img/favicon-32x32.png create mode 100644 static/img/favicon.ico diff --git a/make_html.py b/make_html.py index 1afb25916..04546b9a6 100644 --- a/make_html.py +++ b/make_html.py @@ -328,10 +328,22 @@ def registration_agencies(): nonmatching=nonmatching) -# Serve static files through the development server (--live) -@app.route('/') -def favicon_development(filename): - return send_from_directory('static', filename) +@app.route('/') +def serve_images_development(filename): + """Serve static images through the development server (--live)""" + return send_from_directory('static/', filename) + + +@app.route('/') +def serve_css_development(filename): + """Serve static css through the development server (--live)""" + return send_from_directory('static/', filename) + + +@app.route('/favicon.ico') +def favicon_root(): + """Serve favicon from img folder when requested from root""" + return send_from_directory('static/img', 'favicon.ico') @app.route('/.csv') diff --git a/static/favicon.ico b/static/favicon.ico deleted file mode 100644 index bfc433773399f6c5d50ad02f0d961f0bd5851172..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4286 zcmeHLTZkJ~7#{IOeNi72A4J+dSQP}R#Rp|UWN`&iq_xn8RuJ1-t>UE*Drgb6EftZn z^`Sl}wFawg7hTmd#qt=GJWPlbK28emQ4mGD&u_yV>J^CJimhg2GySNRpEi zzH|Bh|NFoBAHpyrou1tmp=A|>CfAI_<*nECt4~y z1AEM1->TN2>xI9~D5yL2o;)||h{=;bL3|hF+_+9_^G{;%>WDb5mG&30WtyEnXxkQP zwvg&I5bM?`hehbx`~oJ6#3qgT4n}bddzS$7-6(do8IEFN;)Eb)&v}6srdbEfvycs+ zj)rs(9SB*@mPa$(S|;Y*!$jpJf?EwAx8B=UOaazh$HW%5J(11Un+Vq+&VjY*_`S@m zu<^EJK5|i!=pC0Qm0urZ;@<7dADOqevU3>2y-tG^hF^@sbBYVYn@&SK332v#i5=ZB z3swo%>DhfdO42L+IlWD=mr3Y~<05AyR8=3pGigF>vcG_h&5z7kNA__hXhF7Y$VlPy zvJjb2QV%ilrtMf-G@?#HtT94d()6!sZm7J&O?)I(W`;CV`+ z?g;cUXX|4b>+C5h$Rp4LVjtYYN{8MpBj67-`ua1$+TNEe96O@$)p+{mZ(p#I<$dCzlsyZ^o`?#_W+lzJjMtxRpWCE*=@X`I8BMOibVASW3d+FPuO78L{ zrAqan_f&a9`sT1u3Vl&2&P*usU-_@+TIu(SXRdl+rE@*}n%8<-^t9-C;NN**rT+zP G6#ge{A%s={ diff --git a/static/img/favicon-16x16.png b/static/img/favicon-16x16.png new file mode 100644 index 0000000000000000000000000000000000000000..dab68d1b0f2ee5eb05ba1b71a176cf7f71c7e63c GIT binary patch literal 479 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbMfjR2nzS0F7Cks}e3AsLpj?A3em zkPPwA4437`TH0tq@dO^}Yr z($B4vkI7R_DzPkYpK$r6ZB4gt?<}B#z6;ka%GxX|+AYf4qGl~~YV41hyCQDhs+MEt z5*DrjDyTbf5=dsR*{+&gA|I2lmQtF%W?Rm>9i`h2RPH_!IB{Okr1_=W54g8Y@$8)D z-#-T^5mUb+`W76@vB#_-@bkK@zbYo-+%rJ1mC~^{Q2`Y z4E*iAHDe0Uz(P+K#}J9j$q5WhYJ#q^x~y_+786XiZ{Jd2AlmjZa?9H}YjfA;`0QB7 z)RX1smGr1Bt*`-iKDtAWr>8u ukDmfePIX2nqe literal 0 HcmV?d00001 diff --git a/static/img/favicon-32x32.png b/static/img/favicon-32x32.png new file mode 100644 index 0000000000000000000000000000000000000000..605e8f2e880364fd30031dc7fcd546764b53b825 GIT binary patch literal 1170 zcmV;D1a13?P)bsWdvpXZ)?IFKL5@xudz5D9632&v_4)oSMY zK?>uNO8>ykK^xg>%gsOhqphtqYp%4sE3-9QH10}GhEmF)L?SJ>5o<;Cxoc|#rwbS_Wr)#uYEt??L)W?nJwj!U=%U1mI#>uA^`*dTmtwf203KA z_44gx(yWS$%MA>?VF(R*b>%~OhMe3iAt^Z#21AIXsy9^Gt%$Dfi)d+fYKk&k1*RRc z!|J{(01J!D5{byZ`jJ(c1%*$C1+E9gcIP>*zwZjh#>O>Cl7xgLGjf(aAf%)w3oT7f z^}BCtlt5r&quXvhea8SPo3<^plx+ARXL(la(L=}7=F_cWa&nTIzI2ITG)Ag{>jCk~ z6zy`$@7yS3$x04f#FJ3gOp`@Ro9(?EocFBid_5HI}J z(;xI)^J<3B5HU6FK8QM-oj=#DZ~vu3*HG6;Uhjy%u=qJ$Xjmxh zUmw=3d33cF9c_&Gwd-QUcvsu8IRSjL>)nxy*Y)D~nD4QQ*SG3U9IscakJN@t27`Wp z_JjBUgId8z8M-Q)JI;1Z6ql?g&mSH*TidllOM$+nsV!Tdmi@_im(zc%4q+yM*pdoC zk%vp4dgcjjaBxUF`F(@Lj7v<&0r4IH8ZkG=#F=uJ+`ssOBL5zC*ir3&cEdWMueV=P zWF?rtGS>j$`RO`l1kh`$px5hnSIDP0X;P3Zf{Rt z=HS4Px@>utP=E52xO4m4y8*11-AZ|GUbeuD)H%HX05I{es;X;!KEDdUOAHZAu{Zn1 zM#h8(SLJ;P<|hH12jHI!s)A0Z69|yz4DeE%X?$~H{0V06Wgs1Z#Kgy^dJKjTZE<=k z7A;CR%&c4u&LcsS1SG zUW|(l{$<4q5TvHY)|~`CNVevjR@Gypn?DL-7^5U-P$)B-#r__Y&8!s4=@if4=@if*IlrW kf!e(^b07*qoM6N<$f(Jz>X#fBK literal 0 HcmV?d00001 diff --git a/static/img/favicon.ico b/static/img/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..40b5194de1cf9a4a6418d672a2dfc6404e619fc8 GIT binary patch literal 4286 zcmeHJeMnSU6o0i65m6B`^ZLMs2$YQ?ifS`Ui6|(Fq8W3@pbu-N)wNB*OfxG2#9#mW~aPB#k6VApn-72tcfVPam^E8wx~!hP<#h>jSUVY>;^u)cN^) zPXWLF{`1#m_QV|e=dbt1Px8-S&+~^fsWa=f0slo?zD9reSWJ33=l|jdcR$pB%Vf|- zeCr%c23fOlO>l_yVC2l~)EN`N5!9Un^#>w{DJH$P3ccvt{khtE#0rQpYC7V$U3N{I z%jR^q+Id^6jksMlE3StsF;TbpebNdHLatYViOMryEo#U>JiA#h2d;}8HZ*7RjAt8G zjHVfhlj*&xOxotM-#`xiM11%{d%3A-?;?x6a9I`f+3YK?vJWw9QCBTKYFc0T|9B+7zSPkdJuqqHgxB||92KG%a3AW z9o!-ZOMcFL@}$Nh>c6POQ)A7M!vf-rBcq%zkC1&CvnhBvatMQsL>^ShVP|q^t*iMc z+hqQc{k(KIef7NHRBG(Fx(e$m`q$+&2LB>8yozsJRA67^?l@cV3#tAy;}f4=TaW(h z5Hkc=3vK75tQ$LESIYESkxyanLU+T{d=_gQ$sgVOjg%iUqJDXm5>u^39b1xOf@yO@ zF~eCVpY)Z*IXnPw2-C7B}AGd|6Bib}yjWsbS=e)5@{e1O7m@yuu%I9rU)P z+>@0&jqXmHNm`mp8MN>wVD1#{g~i!q2eaq3BS&)Tn2D}mK8n@XSm^2FW{TYQ`@*g4 z!THN-bR1^eHcX=16DHA`>TD`{ee3!*?}d}Udaj*MCeWJ*AIv+6j~*qS5opiiqk|gI zzs~oP5>t&ujPaLFC$_XSmavljOGvD71j|hNi5xGAre{vXc`M6eXkO-A8ow+E>r=_& zfA-MF_j75|nqW72Ger&8mwb``aA - + {% block title %}{{ page_titles[page] }} – Code for IATI Analytics{% endblock %} From 77ac303d532368df9251ca307bca31511080aa71 Mon Sep 17 00:00:00 2001 From: Chris Arridge Date: Mon, 12 Aug 2024 17:31:48 +0100 Subject: [PATCH 5/8] feat: Updated base template Updated base template to change page title, remove codeforIATI navigation, and change URLs to FAQ and GitHub repo/issue pages. --- templates/base.html | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/templates/base.html b/templates/base.html index 980e77a81..3bf3405dd 100644 --- a/templates/base.html +++ b/templates/base.html @@ -7,7 +7,7 @@ - {% block title %}{{ page_titles[page] }} – Code for IATI Analytics{% endblock %} + IATI Dashboard – {% block title %}{{ page_titles[page] }}{% endblock %} @@ -28,15 +28,6 @@
-

The below figures are calculated based on the data contained within the <budget> element for each reported activity. Original and revised elements are based on the value declared in the budget/@type attribute. Where budgets fall across two calendar years, the month of the <period-end> date is used to determine annual groupings, with budgets for periods ending January-June added to the previous calendar year.

+

The below figures are calculated based on the data contained within the <budget> element for each reported activity. Original and revised elements are based on the value declared in the budget/@type attribute. Where budgets fall across two calendar years, the month of the <period-end> date is used to determine annual groupings, with budgets for periods ending January-June added to the previous calendar year.

@@ -379,7 +379,7 @@

Codelist Values (version {{ major_version }}.xx)

{% with element_i=element_list.index(element) %} - + {% with codes=sorted(codelist_sets[major_version].get(codelist_mapping[major_version].get(element)).intersection(values.keys())) %}
{{ element }}{{ codelist_mapping[major_version].get(element) }}{{ codelist_mapping[major_version].get(element) }}{% if codes|count %} {{ codes|count }} diff --git a/templates/validation.html b/templates/validation.html index 7a91ff096..c01936cc3 100644 --- a/templates/validation.html +++ b/templates/validation.html @@ -45,7 +45,7 @@

List of files that fail validation, grouped by publisher

{% if publisher in ckan and dataset_name in ckan[publisher] %} - validator + validator {% endif %}
From f0bf0ed76527681eff6298f7b74063dfd2b0455e Mon Sep 17 00:00:00 2001 From: Chris Arridge Date: Tue, 13 Aug 2024 11:32:06 +0100 Subject: [PATCH 8/8] feat: Minor text updates Minor updates to template text. --- templates/data_quality.html | 4 ++-- templates/exploring_data.html | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/data_quality.html b/templates/data_quality.html index 81be6c67a..6250d02f0 100644 --- a/templates/data_quality.html +++ b/templates/data_quality.html @@ -1,6 +1,6 @@ {% extends 'section_index.html' %} {% block about %} -

This section tracks published IATI data around a series of quality measures.

-

These are specifically technical measures - schema validation, download issues, XML formatting, etc - that can be easily rectified by publishers. No attempt is made to evaluate the actual content of the data - it should be used for sense checking and technical fixes.

+

This section of the IATI Dashboard tracks published IATI data around a series of quality measures.

+

These are specifically technical measures - schema validation, download issues, XML formatting, etc - that can be easily rectified by publishers. No attempt is made to evaluate the actual content of the data - the dashboard should be used for sense checking and technical fixes.

{% endblock about %} {% block publisher_page_hash %}#h_dataquality{% endblock %} diff --git a/templates/exploring_data.html b/templates/exploring_data.html index 7cd53a2a1..5d4a99465 100644 --- a/templates/exploring_data.html +++ b/templates/exploring_data.html @@ -1,6 +1,6 @@ {% extends 'section_index.html' %} {% block about %} -This section tracks the various elements, attributes and codelists within published IATI data. -For every instance of these properties, a report is made available. +

This section tracks the various elements, attributes and codelists within published IATI data.

+

For every instance of these properties, a report is made available.

{% endblock about %} {% block publisher_page_hash %}#h_exploringdata{% endblock %}