Skip to content

Commit

Permalink
Expose both image/and thumbnail in references too (fix #824)
Browse files Browse the repository at this point in the history
  • Loading branch information
noirbizarre committed Apr 23, 2017
1 parent 5dd14bb commit 4a005ea
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 7 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
[#877](https://github.com/opendatateam/udata/pull/877)
- Fix new issue submission
[#874](https://github.com/opendatateam/udata/issues/874)
- Display full images/logo/avatars URL in references too
[#824](https://github.com/opendatateam/udata/issues/824)

## 1.0.8 (2017-04-14)

Expand Down
4 changes: 2 additions & 2 deletions js/components/dataset/card.vue
Original file line number Diff line number Diff line change
Expand Up @@ -103,10 +103,10 @@ export default {
},
computed: {
logo() {
if (!this.dataset || !this.dataset.organization || !this.dataset.organization.logo) {
if (!this.dataset || !this.dataset.organization || !this.dataset.organization.logo_thumbnail) {
return placeholders.organization;
}
return this.dataset.organization.logo;
return this.dataset.organization.logo_thumbnail;
},
certified() {
return `${config.theme_static}img/certified-stamp.png`;
Expand Down
2 changes: 1 addition & 1 deletion js/components/sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ export default {
return this.$root.me.organizations.map(function(org) {
return {
label: org.acronym || org.name,
image: org.logo,
image: org.logo_thumbnail,
route: '/organization/' + org.id + '/',
children: [{
label: Vue._('Dataset'),
Expand Down
5 changes: 4 additions & 1 deletion udata/core/organization/api_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@
'page': fields.UrlFor(
'organizations.show', lambda o: {'org': o},
description='The organization web page URL', readonly=True),
'logo': fields.ImageField(size=BIGGEST_LOGO_SIZE,
'logo': fields.ImageField(original=True,
description='The organization logo URL'),
'logo_thumbnail': fields.ImageField(attribute='logo', size=BIGGEST_LOGO_SIZE,
description='The organization logo thumbnail URL. This is the square '
'({0}x{0}) and cropped version.'.format(BIGGEST_LOGO_SIZE)),
})


Expand Down
6 changes: 4 additions & 2 deletions udata/core/reuse/api_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,10 @@

reuse_ref_fields = api.inherit('ReuseReference', base_reference, {
'title': fields.String(description='The reuse title', readonly=True),
'image': fields.ImageField(size=BIGGEST_IMAGE_SIZE,
description='The reuse thumbnail'),
'image': fields.ImageField(description='The reuse thumbnail thumbnail (cropped) URL'),
'image_thumbnail': fields.ImageField(attribute='image', size=BIGGEST_IMAGE_SIZE,
description='The reuse thumbnail thumbnail URL. This is the square '
'({0}x{0}) and cropped version.'.format(BIGGEST_IMAGE_SIZE)),
'uri': fields.UrlFor(
'api.reuse', lambda o: {'reuse': o},
description='The reuse API URI', readonly=True),
Expand Down
5 changes: 4 additions & 1 deletion udata/core/user/api_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,11 @@
'uri': fields.UrlFor(
'api.user', lambda o: {'user': o},
description='The user API URI', required=True),
'avatar': fields.ImageField(size=BIGGEST_AVATAR_SIZE,
'avatar': fields.ImageField(original=True,
description='The user avatar URL'),
'avatar_thumbnail': fields.ImageField(attribute='avatar', size=BIGGEST_AVATAR_SIZE,
description='The user avatar thumbnail URL. This is the square '
'({0}x{0}) and cropped version.'.format(BIGGEST_AVATAR_SIZE)),
})


Expand Down

0 comments on commit 4a005ea

Please sign in to comment.