Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update wet theme #1012

Merged
merged 43 commits into from
Dec 12, 2019
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
489c11e
initial code
HoussamBedja Aug 22, 2019
be9ead3
migrating all content from theme_gc_intranet plugin
HoussamBedja Aug 26, 2019
cfa1000
adding all helper function from wet-boew extention
HoussamBedja Aug 28, 2019
36ddb13
adding all wet-boew/GCweb plugin templates to ckanext-canada/public
HoussamBedja Aug 28, 2019
5d93205
moved all helper fonctions from wet-boew to ckan helpers.py
HoussamBedja Sep 3, 2019
2d1ca0c
added the rest of wet-boew/plugin.py into ckanext, including all imports
HoussamBedja Sep 3, 2019
0eb6834
Adding all wet-boew/templates/wet-boew content to ckanext-canada/temp…
HoussamBedja Sep 4, 2019
2d7edc0
cleaning up template merge errors
HoussamBedja Sep 5, 2019
d0d8ca3
link the right wet-theme files to templates
HoussamBedja Sep 24, 2019
6bf016b
fixed template merging bugs
HoussamBedja Sep 27, 2019
3323f57
fix tempate merging bugs
HoussamBedja Oct 4, 2019
71eaab9
merging updates from master to the branch
HoussamBedja Oct 7, 2019
9dfebb7
updating the header and menu wet theme
HoussamBedja Oct 9, 2019
4580125
merging wet-boew bilangual-strings to ckanext-canada
HoussamBedja Oct 9, 2019
7f8b98f
cleaning up empty lines
HoussamBedja Oct 9, 2019
bef67b3
Merge branch 'add-wet-theme' into update-wet-theme
HoussamBedja Oct 9, 2019
1ec2267
updating wet theme footer
HoussamBedja Oct 11, 2019
8d52635
fixing breadcrumb on mobile view
HoussamBedja Oct 11, 2019
ddda4dc
fixing datatable width in dataset page
HoussamBedja Oct 11, 2019
b231374
changing registry WET theme to GCWeb
HoussamBedja Oct 17, 2019
0074244
Merge branch 'master' into update-wet-theme
HoussamBedja Oct 17, 2019
21bb47f
Removing wet-boew theme plugins from registry & portal site instructions
HoussamBedja Oct 18, 2019
df922a9
update jquery.min.js from 2.1.4 to 2.2.4
HoussamBedja Oct 22, 2019
8cb8bd8
adding additional french translations to dictionary
HoussamBedja Oct 22, 2019
a8986a1
Update README File - instructions to add WET files
HoussamBedja Oct 23, 2019
f750347
Update README file - change GCWeb version example
HoussamBedja Oct 23, 2019
4afdb20
deleteing old unused code coming from ckanext-wet-boew extension
HoussamBedja Oct 24, 2019
eeb3735
Merge branch 'update-wet-theme' of https://github.com/open-data/ckane…
HoussamBedja Oct 24, 2019
4220454
make dataset map zoomed in on page load
HoussamBedja Oct 30, 2019
01709c5
moving geomapzoom.js file under 'static' directory
HoussamBedja Oct 30, 2019
98be46f
moving geomapzoom.js file under 'static/js/' directory
HoussamBedja Oct 30, 2019
6d6aabf
removing canada.ca search
HoussamBedja Dec 2, 2019
8af7e10
changing registry site menu to horizontal menu
HoussamBedja Dec 3, 2019
8d8077b
aligning menu dropdown items to the left
HoussamBedja Dec 4, 2019
c119d2b
adding new line at end of code
HoussamBedja Dec 4, 2019
5c28862
Adding custom css to horizontal menu
HoussamBedja Dec 5, 2019
38a0c4d
realigning menu dropdown items to the left
HoussamBedja Dec 5, 2019
2ec2515
Merge branch 'master' into update-wet-theme
HoussamBedja Dec 12, 2019
7a030c3
Merge branch 'master' into update-wet-theme
HoussamBedja Dec 12, 2019
6865905
fixing typo
HoussamBedja Dec 12, 2019
c11b0ec
merging wet_boew.po and canada.po
HoussamBedja Dec 12, 2019
c56e2cf
remove wet_theme() helper function
HoussamBedja Dec 12, 2019
c0a1633
re-adding experiment type to registry menu
HoussamBedja Dec 12, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions ckanext/canada/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import datetime
import unicodedata
import ckan as ckan
import jinja2

import ckanapi

Expand Down Expand Up @@ -459,3 +460,20 @@ def _add_extra_longitude_points(gjson):
return {u'coordinates': [out], u'type': u'Polygon'}


def recombinant_description_to_markup(text):
wardi marked this conversation as resolved.
Show resolved Hide resolved
"""
Return text as HTML escaped strings joined with '<br/>, links enabled'
"""
# very lax, this is trusted text defined in a schema not user-provided
url_pattern = r'(https?:[^)\s"]{20,})'
markup = []
for i, part in enumerate(re.split(url_pattern, h.recombinant_language_text(text))):
if i % 2:
markup.append(jinja2.Markup('<a href="{0}">{1}</a>'.format(part, jinja2.escape(part))))
else:
markup.extend(jinja2.Markup('<br/>'.join(
jinja2.escape(t) for t in part.split('\n')
)))
# extra dict because language text expected and language text helper
# will cause plain markup to be escaped
return {'en': jinja2.Markup(''.join(markup))}
4 changes: 2 additions & 2 deletions ckanext/canada/i18n/fr/LC_MESSAGES/canada.po
Original file line number Diff line number Diff line change
Expand Up @@ -1875,8 +1875,8 @@ msgstr "Demande d'un compte"
msgid "Request an Account"
msgstr "Demande d'un compte"

msgid "We encountered an error and are unable to serve your request. Please try again in short time or contact <a href=\"mailto:open-ouvert@tbs-sct.gc.ca\">open-ouvert@tbs-sct.gc.ca</a> if you need immediate assistance or if this issue persists."
msgstr "Nous rencontrons une erreur et nous ne pouvons pas répondre à votre demande. Veuillez réessayer plus tard ou communiquer avec <a href=\"mailto:open-ouvert@tbs-sct.gc.ca\">open-ouvert@tbs-sct.gc.ca</a> si votre demande est urgente ou si ce problème persiste."
msgid "We encountered an error and are unable to serve your request. Please try again in short time or contact <a href=\"mailto:open-ouvert@tbs-sct.gc.ca\">open-ouvert@tbs-sct.gc.ca</a> if you need immediate assistance or if this issue persists. Note that your login expires after 1 hour of inactivity."
msgstr "Nous rencontrons une erreur et nous ne pouvons pas répondre à votre demande. Veuillez réessayer plus tard ou communiquer avec <a href=\"mailto:open-ouvert@tbs-sct.gc.ca\">open-ouvert@tbs-sct.gc.ca</a> si votre demande est urgente ou si ce problème persiste. Veuillez noter que votre connexion expire après une heure d'inactivité."

msgid "We encountered an error"
msgstr "Nous rencontrons une erreur"
Expand Down
8 changes: 6 additions & 2 deletions ckanext/canada/plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,8 @@ def get_helpers(self):
'date_format',
'parse_release_date_facet',
'is_ready_to_publish',
'get_datapreview_recombinant'
'get_datapreview_recombinant',
'recombinant_description_to_markup',
])
helperfunctions['wet_theme'] = self.wet_theme
return helperfunctions
Expand Down Expand Up @@ -352,7 +353,10 @@ def get_helpers(self):
'url_for_wet_theme',
'url_for_wet',
'wet_jquery_offline',
'get_map_type'
'get_map_type',
'adobe_analytics_login_required',
'adobe_analytics_lang',
'adobe_analytics_js'
])
helperfunctions['wet_theme'] = self.wet_theme
return helperfunctions
Expand Down
13 changes: 13 additions & 0 deletions ckanext/canada/public/css/canada1.css
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,21 @@ details.alert-error {
#wb-sm li.dropdown-item a {
color: #284162;
text-align: left;
text-decoration: none;
}

#wb-sm .menu li.dropdown-item a:hover {
color: white;
}

#wb-sm .menu>li {
padding:0;
}
#wb-sm .menu>li>a {
display: block;
padding: 1em;
text-align: center;
text-decoration: none;
}


9 changes: 3 additions & 6 deletions ckanext/canada/templates/internal/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
{% block sitesearch %}{% endblock %}

{% block sitemenu %}
<nav role="navigation" id="wb-sm" class="wb-menu visible-md visible-lg" typeof="SiteNavigationElement">
<nav role="navigation" id="wb-sm" class="visible-md visible-lg" typeof="SiteNavigationElement">
<div class="container navbar">
<h2>Topics menu</h2>
<div class="row">
Expand Down Expand Up @@ -56,6 +56,7 @@ <h2>Topics menu</h2>
</ul>
</div>
</div>
</div>
</nav>
{% endblock %}

Expand Down Expand Up @@ -85,8 +86,4 @@ <h2>{{ _('You are here:') }}</h2>
</div>
</div>
{%- endif -%}
{% endblock %}




{% endblock %}
4 changes: 3 additions & 1 deletion ckanext/canada/templates/internal/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,6 @@
</div>
</main>
</div></div>
{% endblock content %}
{% endblock content %}

{%- block adobe_analytics_footer -%}{%- endblock -%}
5 changes: 4 additions & 1 deletion ckanext/canada/templates/public/page.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,7 @@ <h1 property="name" id="wb-cont">
{% block scripts %}
{% snippet 'snippets/wet-boew/footerresources.html' %}
<script type="text/javascript" src="{{ h.url_for_static('/static/js/googleanalytics_event_tracking.js') }}" ></script>
{% endblock %}
{% block adobe_analytics_footer %}
<script type="text/javascript">_satellite.pageBottom();</script>
{%- endblock -%}
{% endblock %}