Skip to content

Commit

Permalink
(bug) unable to show machine/training picture
Browse files Browse the repository at this point in the history
  • Loading branch information
gnepud committed Apr 11, 2024
1 parent a16e5e5 commit 2820af8
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

- improvement: hide gender in member create/edit form if not required
- Fix a bug: unable to update member's profile
- Fix a bug: unable to show machine/training picture
- updates translations

## v6.3.19 2024 Avril 9
Expand Down
8 changes: 8 additions & 0 deletions app/frontend/src/javascript/filters/filters.js
Original file line number Diff line number Diff line change
Expand Up @@ -367,3 +367,11 @@ Application.Filters.filter('currency', [function ($locale) {
: new Intl.NumberFormat(Fablab.intl_locale, { style: 'currency', currency: Fablab.intl_currency }).format(amount);
};
}]);

Application.Filters.filter('encodeURI', [function () {
return function (str) {
return encodeURIComponent(str).replace(/[!'()*]/g, function (c) {
return '%' + c.charCodeAt(0).toString(16);
});
};
}]);
2 changes: 1 addition & 1 deletion app/frontend/templates/home/projects.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<h4 class="text-sm m-t-sm" translate>{{ 'app.public.home.latest_documented_projects' }}</h4>

<uib-carousel interval="5000" disable-animation="true" active="activeSlide">
<uib-slide class="h480 cover r" ng-repeat="p in lastProjects track by $index" index="$index" style="background-image:url('{{p.project_image}}');">
<uib-slide class="h480 cover r" ng-repeat="p in lastProjects track by $index" index="$index" style="background-image:url('{{p.project_image | encodeURI}}');">
<div class="carousel-caption">
<h1 class="title"><a ui-sref="app.public.projects_show({id:p.slug})">{{p.name}}</a></h1>
</div>
Expand Down
2 changes: 1 addition & 1 deletion app/frontend/templates/projects/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ <h3 translate>{{ 'app.public.projects_list.filter' }}</h3>
<div class="projects-list">
<span ng-show="projects && (projects.length == 0)"> {{ 'app.public.projects_list.project_search_result_is_empty' | translate }} </span>
<div class="project-card" ng-repeat="project in projects" ng-click="showProject(project)">
<div class="project-image" style="background-image: url({{project.project_image}});">
<div class="project-image" style="background-image: url('{{project.project_image | encodeURI}}');">
<img src="data:image/png;base64," data-src="holder.js/100%x100%/text:&#xf03e;/font:'Font Awesome 5 Free'/icon" bs-holder ng-if="!project.project_image">
</div>

Expand Down
2 changes: 1 addition & 1 deletion app/frontend/templates/spaces/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ <h1 translate>{{ 'app.public.spaces_list.the_spaces' }}</h1>
<div class="panel-heading picture" ng-if="!space.space_image_attributes" ng-click="showSpace(space)">
<img src="data:image/png;base64," data-src="holder.js/100%x100%/text:&#xf03e;/font:'Font Awesome 5 Free'/icon" bs-holder class="img-responsive">
</div>
<div class="panel-heading picture" style="background-image:url('{{space.space_image_attributes.attachment_url}}')" ng-if="space.space_image_attributes" ng-click="showSpace(space)">
<div class="panel-heading picture" style="background-image:url('{{space.space_image_attributes.attachment_url | encodeURI}}')" ng-if="space.space_image_attributes" ng-click="showSpace(space)">
</div>
<div class="panel-body">
<h1 class="text-center m-b">{{space.name}}</h1>
Expand Down
2 changes: 1 addition & 1 deletion app/frontend/templates/trainings/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ <h1 translate>{{ 'app.public.trainings_list.the_trainings' }}</h1>
<div class="panel-heading picture" ng-if="!training.training_image_attributes" ng-click="showTraining(training)">
<img src="data:image/png;base64," data-src="holder.js/100%x100%/text:&#xf03e;/font:'Font Awesome 5 Free'/icon" bs-holder class="img-responsive">
</div>
<div class="panel-heading picture" style="background-image:url('{{training.training_image_attributes.attachment_url}}')" ng-if="training.training_image_attributes" ng-click="showTraining(training)">
<div class="panel-heading picture" style="background-image:url('{{training.training_image_attributes.attachment_url | encodeURI}}')" ng-if="training.training_image_attributes" ng-click="showTraining(training)">
</div>
<div class="panel-body">
<h1 class="m-b text-center">{{training.name}}</h1>
Expand Down

0 comments on commit 2820af8

Please sign in to comment.