Skip to content

Commit

Permalink
Merge pull request #499 from vrk-kpa/LIKA-627_upgrade_bootstrap
Browse files Browse the repository at this point in the history
LIKA-627: Upgrade bootstrap
  • Loading branch information
Zharktas authored Jan 28, 2025
2 parents 0e1aa6d + e772e42 commit 5c258f2
Show file tree
Hide file tree
Showing 64 changed files with 873 additions and 811 deletions.
19 changes: 10 additions & 9 deletions ansible/roles/ckan/files/patches/remove_free_fontawesome.patch
Original file line number Diff line number Diff line change
@@ -1,24 +1,25 @@
diff --git a/ckan/public-bs3/base/vendor/webassets.yml b/ckan/public-bs3/base/vendor/webassets.yml
index 40e09173a..393ae2cf5 100644
--- a/ckan/public-bs3/base/vendor/webassets.yml
+++ b/ckan/public-bs3/base/vendor/webassets.yml
@@ -4,11 +4,6 @@ select2-css:
diff --git a/ckan/public/base/vendor/webassets.yml b/ckan/public/base/vendor/webassets.yml
index 2ff63043c..3d226878c 100644
--- a/ckan/public/base/vendor/webassets.yml
+++ b/ckan/public/base/vendor/webassets.yml
@@ -4,12 +4,6 @@ select2-css:
contents:
- select2/select2.css

-fontawesome:
- output: vendor/%(version)s_fontawesome.css
- filters: cssrewrite
- contents:
- - fontawesome-free/css/all.css

-
jquery:
filters: rjsmin
@@ -39,7 +34,6 @@ bootstrap:
output: vendor/%(version)s_jquery.js
@@ -41,7 +35,6 @@ bootstrap:
output: vendor/%(version)s_bootstrap.js
extra:
preload:
- - vendor/fontawesome
- vendor/jquery
contents:
- bootstrap/javascripts/bootstrap.js
- bootstrap/js/bootstrap.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions ansible/roles/ckan/templates/ckan.ini.j2
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ ckan.feeds.date =
ckan.feeds.author_name =
ckan.feeds.author_link =

ckan.base_public_folder = public-bs3
ckan.base_templates_folder = templates-bs3
#ckan.base_public_folder = public-bs3
#ckan.base_templates_folder = templates-bs3

ckan.hide_activity_from_users = non-existing

Expand Down
1 change: 1 addition & 0 deletions ansible/roles/ckan/vars/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ ckan_patches:
- { file: "fix_updating_resource_filesize" } # https://github.com/ckan/ckan/pull/7103
- { file: "fix_resource_delete_auth" } # https://github.com/ckan/ckan/pull/7132
- { file: "fix_missing_robotstxt"} # https://github.com/ckan/ckan/pull/8536
- { file: "replace_btn-default_with_btn-secondary"} # https://github.com/ckan/ckan/pull/8611

files_created_by_patches:
- { file: "/usr/lib/ckan/default/src/ckan/ckan/templates-bs3/home/robots.txt" }
Expand Down
4 changes: 2 additions & 2 deletions ckanext/ckanext-apicatalog/buildsass.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sass scss/main.scss --source-map=ckanext/apicatalog/public/base/main.css.map --source-map-url=/base/main.css.map --source-map-less-inline > ckanext/apicatalog/fanstatic/apicatalog/main.css
sass scss/openapi_view.scss --source-map=ckanext/apicatalog/public/base/openapi_view.css.map --source-map-url=/base/openapi_view.css.map --source-map-less-inline > ckanext/apicatalog/fanstatic/openapi_view.css
sass scss/main.scss --source-map --embed-source-map ckanext/apicatalog/fanstatic/apicatalog/main.css
sass scss/openapi_view.scss --source-map --embed-source-map ckanext/apicatalog/fanstatic/openapi_view.css
echo $(date): Compiled sass
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ this.ckan.module('modal-dialog', function (jQuery) {
'<div class="modal-body"></div>',
'<div class="modal-footer">',
'<button class="btn btn-primary"></button>',
'<button class="btn btn-default btn-cancel"></button>',
'<button class="btn btn-secondary btn-cancel"></button>',
'</div>',
'</div>',
'</div>',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ckan.module("mutexfield", function($) {
const handleMutex = (newValue) => {
children.each((i, child) => {
let mutexValue = $(child).attr('data-mutex-value');
$(child).toggleClass('hidden', newValue != mutexValue);
$(child).attr('hidden', newValue != mutexValue);
});
};
handleMutex(mutexElement.val());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<div id="cookie_consent" data-module="cookie_consent"></div>

{% block header_language %}
<header class="language-navbar hidden-xs">
<header class="language-navbar d-none d-sm-block">
<div class="container">

<div class="left">
Expand All @@ -29,19 +29,19 @@

{% block header_account %}
<div class="navbar-wrapper">
<nav class="navbar navbar-default main-navbar" data-spy="affix" data-offset-top="80">
<nav class="navbar navbar-expand-lg navbar-light main-navbar" data-spy="affix" data-offset-top="80">
{% block header_debug %}
{% if g.debug and not g.debug_supress_header %}
<div class="debug">Controller : {{ c.controller }}<br>Action : {{ c.action }}</div>
{% endif %}
{% endblock %}
<div class="container">
<div class="logo-row">
<div class="navbar-logo-text visible-xs">
<div class="navbar-logo-text d-block d-sm-none">
<a href="{{ h.url_for('home.index') }}"><img class="lika-logo" src="/base/images/lika-logo.svg" alt="{{ _('API Catalog') }}"></a>
</div>

<button type="button" class="navbar-toggle collapsed placeright" data-toggle="collapse" data-target=".navbar-collapse">
<button type="button" class="navbar-toggler collapsed placeright" data-bs-toggle="collapse" data-bs-target=".navbar-collapse">
<span class="sr-only navbar-hamburger">Toggle navigation</span>
<span class="icon-bar navbar-hamburger"></span>
<span class="icon-bar navbar-hamburger"></span>
Expand Down Expand Up @@ -70,7 +70,7 @@
<li {% if page_name == page.name %}class="active"{% endif %}>{{ h.literal('<a href="/%s/%s/%s">%s</a>' % (lang, type_, page.name, page_title)) }}</li>
{% endfor %}
{% if submenu_content | length > 2 %}
<li class="dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#">{{ _('More options') }}<span class="caret"></span></a>
<li class="btn btn-primary dropdown"><a class="dropdown-toggle" data-toggle="dropdown" href="#">{{ _('More options') }}</a>
<ul class="dropdown-menu">
{% for page in submenu_content[2:] %}
{% set type_ = 'blog' if page['page_type'] == 'blog' else 'pages' %}
Expand All @@ -82,11 +82,11 @@
{% endif %}

{% if c.userobj %}
{% snippet 'home/snippets/apicatalog_profile_items.html', class="visible-xs" %}
{% snippet 'home/snippets/apicatalog_profile_items.html', class="d-block d-sm-none" %}
{% else %}
<li class="visible-xs">{% link_for _('Log in'), controller='user', action='login', icon='signin' %}</li>
<li class="d-block d-sm-none">{% link_for _('Log in'), controller='user', action='login', icon='signin' %}</li>
{% if h.check_access('user_create') %}
<li class="visible-xs">{% link_for _('Register'), controller='user', action='register', class_='sub' %}</li>
<li class="d-block d-sm-none">{% link_for _('Register'), controller='user', action='register', class_='sub' %}</li>
{% endif %}
{% endif %}
{% endblock %}
Expand Down
22 changes: 12 additions & 10 deletions ckanext/ckanext-apicatalog/ckanext/apicatalog/templates/footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@
<footer>
<div class="footer-top clearfix">
<div class="container">
<div class="col-xs-12 col-sm-4 col-lg-3">
<img class="lika-logo" src="/base/images/lika-logo.svg" alt="{{ _('API Catalog') }}">
<p class="footer-description">{{_('The service is being developed by the Digital and Population Data Services Agency.')}}</p>
</div>
<div class="footer-top-links col-xs-12 col-sm-8 col-lg-9">
<ul class="nav navbar footer-nav">
{{ h.build_nav_main() }}
<li><a href="{{'https://palveluhallinta.suomi.fi/%s/sivut/palveluvayla/palvelukuvaus/tietosuoja' % lang_code}}" target="_blank">{{_('Privacy statement')}}&nbsp;<i class="fal fa-external-link"></i></a></li>
<li><a href="https://laatutyokalut.suomi.fi/p/jTVC" target="_blank">{{_('Give feedback')}}&nbsp;<i class="fal fa-external-link"></i></a></li>
</ul>
<div class="row">
<div class="col-xs-12 col-sm-4 col-lg-3">
<img class="lika-logo" src="/base/images/lika-logo.svg" alt="{{ _('API Catalog') }}">
<p class="footer-description">{{_('The service is being developed by the Digital and Population Data Services Agency.')}}</p>
</div>
<div class="footer-top-links col-xs-12 col-sm-8 col-lg-9">
<ul class="nav navbar footer-nav">
{{ h.build_nav_main() }}
<li><a href="{{'https://palveluhallinta.suomi.fi/%s/sivut/palveluvayla/palvelukuvaus/tietosuoja' % lang_code}}" target="_blank">{{_('Privacy statement')}}&nbsp;<i class="fal fa-external-link"></i></a></li>
<li><a href="https://laatutyokalut.suomi.fi/p/jTVC" target="_blank">{{_('Give feedback')}}&nbsp;<i class="fal fa-external-link"></i></a></li>
</ul>
</div>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@

<div class="hero">
<section aria-label="{{ _('hero') }}" class="hero-background-container {% if h.is_test_environment() %}test-environment{% endif %}">
<div class="container">
{% block slogan %} {% snippet 'home/snippets/apicatalog_slogan.html' %} {% endblock %}
<div id="hero-stats" class="col-sm-8 col-sm-offset-2">

<div id="hero-stats" class="col-sm-8 offset-sm-2">
{% set statistics = h.get_statistics() %}
<div class="row align-items-start">
<div class="col-sm-4">
<a href="{{ h.url_for('dataset.search') }}" aria-label="{{ _('Show all datasets') }}">
<div class="count">{{statistics.package_count}}</div>
Expand All @@ -25,9 +25,9 @@
</a>
</div>
</div>
</div>
</div>
</section>
</div>

<section id="main_content" role="main">
{% block service_alerts %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
{% set current_lang = request.environ.CKAN_LANG %}
{% set lang_code = 'en' if current_lang == 'en_GB' else current_lang %}
<div class="btn-group language-changer">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<button type="button" class="btn btn-secondary dropdown-toggle" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
{{ lang_code|upper }} <i class="fa fa-chevron-down"></i>
</button>
<ul class="dropdown-menu">
{% for lang, locale in [('fi', 'fi'), ('sv', 'sv'), ('en', 'en_GB')] %}
<li {% if current_lang == locale %} class="active" {% endif %}><a href="{% url_for h.unquote_url(current_url), locale=locale %}">{{ lang|upper }}</a></li>
<li {% if current_lang == locale %} class="active" {% endif %}><a class="dropdown-item" href="{% url_for h.unquote_url(current_url), locale=locale %}">{{ lang|upper }}</a></li>
{% endfor %}
</ul>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
{% set new_activities = h.new_activities() %}
<div class="dropdown" id="profile">

<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<a href="#" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<span class="username">{{ c.userobj.name }}</span>
<span class="caret"></span>
</a>

<ul id="no-collapse" class="dropdown-menu dropdown-menu-right">
{% snippet 'home/snippets/apicatalog_profile_items.html' %}
{% snippet 'home/snippets/apicatalog_profile_items.html', class="dropdown-item" %}
</ul> <!-- /.dropdown-menu -->
</div> <!-- /.dropdown -->
{% else %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div class="row hidden-xs hidden-sm">
<div class="col-md-10 col-md-offset-1">
<div class="col-md-10 offset-md-1">
<h1 class="top-caption">
{{ h.get_slogan() }}
</h1>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,10 @@ <h1 class="hide-heading">{{ _('Edit datasets') }}</h1>
<form method="POST" data-module="basic-form">
{{ h.csrf_input() }}
<div class="bulk_process-actions">
<button name="bulk_action.public" value="public" class="btn btn-default" type="submit">
<button name="bulk_action.public" value="public" class="btn btn-secondary" type="submit">
{{ _('Make public') }}
</button>
<button name="bulk_action.private" value="private" class="btn btn-default" type="submit">
<button name="bulk_action.private" value="private" class="btn btn-secondary" type="submit">
{{ _('Make private') }}
</button>
<button name="bulk_action.delete" value="delete" class="btn btn-delete" type="submit">
Expand Down Expand Up @@ -64,12 +64,12 @@ <h1 class="hide-heading">{{ _('Edit datasets') }}</h1>
</a>
{{ h.link_to(h.truncate(title, truncate_title), h.url_for(package.type ~ '.read', id=package.name)) }}
{% if package.get('state', '').startswith('draft') %}
<span class="label label-info">{{ _('Draft') }}</span>
<span class="badge bg-info">{{ _('Draft') }}</span>
{% elif package.get('state', '').startswith('deleted') %}
<span class="label label-danger">{{ _('Deleted') }}</span>
<span class="badge bg-danger">{{ _('Deleted') }}</span>
{% endif %}
{% if package.private %}
<span class="label label-danger">{{ _('Private') }}</span>
<span class="badge bg-danger">{{ _('Private') }}</span>
{% endif %}
{% if notes %}
<p>{{ notes|urlize }}</p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ <h1>{{ h.get_translated(c.group_dict, 'title') }}</h1>

{% block content_action %}
{% if organization and h.check_access('organization_show', {'id': organization.id}) %}
<a href="{{ h.url_for('organization.read', id=organization.id) }}" class="btn btn-default dataset-edit-cancel">
<a href="{{ h.url_for('organization.read', id=organization.id) }}" class="btn btn-secondary dataset-edit-cancel">
<i class="far fa-long-arrow-left"></i>
{{ _('Cancel editing') }}
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h3 class="page-heading">{{ members_count }}</h3>
{% if h.check_access('organization_member_create', {'id': c.group_dict.id }) and h.check_access('organization_member_delete', {'id': c.group_dict.id }) %}
<div class="btn-group pull-right">
{% set user_edit_url = h.url_for('organization.member_new', group_type=c.group_dict.type, id=c.group_dict.id, is_organization=True, user=username) %}
<a class="btn btn-default btn-sm" href="{{ user_edit_url }}"
<a class="btn btn-secondary btn-sm" href="{{ user_edit_url }}"
data-module="modal-dialog"
data-module-content-id="edit-members-dialog"
data-module-title="{{ _('Edit member role') }}"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

{% block content_action %}
{% if h.check_access('organization_update', {'id': group_dict.id}) %}
{% link_for _('Edit'), named_route=group_type+'.edit', id=group_dict.name, class_='btn btn-default', icon='far fa-edit' %}
{% link_for _('Edit'), named_route=group_type+'.edit', id=group_dict.name, class_='btn btn-secondary', icon='far fa-edit' %}
{% endif %}
{% endblock %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ <h1>{% block page_title %}{{ _('Edit subsystem') }}{% endblock %}</h1>

{% endblock %}
{% block content_action %}
<a href="{{ h.url_for('dataset.read', id=pkg.name) }}" class="btn btn-default dataset-edit-cancel">
<a href="{{ h.url_for('dataset.read', id=pkg.name) }}" class="btn btn-secondary dataset-edit-cancel">
<i class="far fa-long-arrow-left"></i>
{{ _('Cancel editing') }}
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

{% block content_action %}
{% if h.check_access('package_update', {'id':pkg.id }) %}
{% link_for _('Edit'), named_route=pkg.type ~ '.edit', id=pkg.name, class_='btn btn-default', icon='far fa-edit' %}
{% link_for _('Edit'), named_route=pkg.type ~ '.edit', id=pkg.name, class_='btn btn-secondary', icon='far fa-edit' %}
{% endif %}
{% endblock %}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
<div class="col-xs-12 prelude">
<div class="pull-right page-actions">
{% block content_action %}
{% link_for _('Cancel edit'), named_route=pkg.type ~ '.resources', id=pkg.name, class_='btn btn-default', icon='arrow-left' %}
{% link_for _('Cancel edit'), named_route=pkg.type ~ '.resources', id=pkg.name, class_='btn btn-secondary', icon='arrow-left' %}
{% endblock %}
{% if self.page_primary_action() | trim %}
<div class="page_primary_action">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{% ckan_extends %}

{% block content_action %}
{% link_for _('Cancel editing'), named_route=pkg.type ~ '.read', id=pkg.name, class_='btn btn-default', icon='arrow-left' %}
{% link_for _('Cancel editing'), named_route=pkg.type ~ '.read', id=pkg.name, class_='btn btn-secondary', icon='arrow-left' %}
{% if res %}
{% link_for _('View resource'), named_route=pkg.type ~ '_resource.read', id=pkg.name, resource_id=res.id, class_='btn btn-default', icon='eye' %}
{% link_for _('View resource'), named_route=pkg.type ~ '_resource.read', id=pkg.name, resource_id=res.id, class_='btn btn-secondary', icon='eye' %}
{% endif %}
{% endblock %}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{% endblock %}

{% block page_primary_action %}
<a href="{{ h.url_for(pkg.type ~ '.read', id=pkg.name) }}" class="btn btn-default dataset-edit-cancel">
<a href="{{ h.url_for(pkg.type ~ '.read', id=pkg.name) }}" class="btn btn-secondary dataset-edit-cancel">
<i class="far fa-long-arrow-left"></i>
{{ _('Cancel editing') }}
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<li class="resource-item" data-id="{{ res.id }}">
<div class="container-fluid">
<div class="row">
<div class="col-xs-9">
<div class="col-9">
<a href="{{ url }}" title="{{ res.name or res.description }}">
<div class="container-fluid">
{% block resource_item_title %}
Expand All @@ -24,12 +24,12 @@
{{ description }}
</p>
{% endif %}
{% if res.valid_content == 'no' %}<span class="label label-danger">{{ _("Invalid content") }}</span>{% endif %}
{% if res.valid_content == 'no' %}<span class="badge bg-danger">{{ _("Invalid content") }}</span>{% endif %}
{% endblock %}
</div>
</a>
</div>
<div class="col-xs-3 hidden-xs">
<div class="col-3 d-none d-sm-block">
<div class="container-fluid resource-download">
{% block resource_item_explore %}
{% if not url_is_edit %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
<h2 class="visual-h3 flex">{{ title }}</h2>
{% if h.check_access('resource_create', {'package_id': pkg['id']}) and resource_type == "attachment" %}
<div class="flex-right">
{% link_for _('Add new resource'), named_route=pkg.type ~ '_resource.new', id=pkg.name, class_='btn btn-default' %}
{% link_for _('Add new resource'), named_route=pkg.type ~ '_resource.new', id=pkg.name, class_='btn btn-secondary' %}
</div>
{% endif %}
{% if h.check_access('package_update', {'id': pkg['id']}) and resource_type == "service" %}
Expand Down
Loading

0 comments on commit 5c258f2

Please sign in to comment.