Skip to content

Commit

Permalink
Merge branch 'release/4.1.29'
Browse files Browse the repository at this point in the history
* release/4.1.29:
  updated the changelog
  added multilingual support to the default template
  Apply fixes from StyleCI (#465)
  adds support for localized validation messages
  adds support for chinese simplified
  Apply fixes from StyleCI (#464)
  wip
  wip
  added a global locale
  wip
  global search and replace of trans() helper to __()
  wip
  wip
  wip
  wip
  wip
  wip
  work
  wip
  • Loading branch information
austintoddj committed Apr 26, 2019
2 parents 222dd45 + c77ad0a commit 9b3af37
Show file tree
Hide file tree
Showing 87 changed files with 1,698 additions and 282 deletions.
5 changes: 5 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Release Notes

## [v4.1.29](https://github.com/cnvs/canvas/compare/v4.1.28...v4.1.29)

### Added
- Added multilingual support for French, Portuguese and Chinese (Simplified) ([#447](https://github.com/cnvs/canvas/issues/447), [f622b1e](https://github.com/cnvs/canvas/commit/f622b1e4864ecd1a526c79a467dda7b1aa1485ad))

## [v4.1.28](https://github.com/cnvs/canvas/compare/v4.1.27...v4.1.28)

### Changed
Expand Down
2 changes: 1 addition & 1 deletion public/js/app.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/app.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"/js/app.js": "/js/app.js?id=58f7249482e1fba84837",
"/js/app.js": "/js/app.js?id=e7d01bf545b09bb6ea7f",
"/css/app.css": "/css/app.css?id=f67fa09e4165d6153c77",
"/css/app-dark.css": "/css/app-dark.css?id=96b402438f4da22bea87",
"/js/app.js.map": "/js/app.js.map?id=e768b1c9e916df5939dc",
"/js/app.js.map": "/js/app.js.map?id=77dfa9301d3e746dc180",
"/favicon.ico": "/favicon.ico?id=dbb0c05daa3432643753"
}
2 changes: 2 additions & 0 deletions resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const files = require.context('./', true, /\.vue$/i);

files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default));

Vue.prototype.trans = string => _.get(window.i18n, string);

new Vue({
el: '#app',
});
7 changes: 5 additions & 2 deletions resources/js/bootstrap.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,13 @@ window._ = require('lodash');

try {
window.Popper = require('popper.js').default;

window.$ = window.jQuery = require('jquery');

window.autosize = window.autosize ? window.autosize : require('autosize');

window.trans = (string) => _.get(window.i18n, string);

/**
* Current workaround for using the Autosize library which will only resize
* elements when clicked, not on the initial page load.
Expand All @@ -37,7 +41,6 @@ try {
});

require('bootstrap');
require('@fortawesome/fontawesome-free');
} catch (e) {
}

Expand All @@ -63,4 +66,4 @@ if (token) {
window.axios.defaults.headers.common['X-CSRF-TOKEN'] = token.content;
} else {
console.error('CSRF token not found: https://laravel.com/docs/csrf#csrf-x-csrf-token');
}
}
8 changes: 5 additions & 3 deletions resources/js/components/Editor.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
data() {
return {
editor: null,
editorBody: this.value
editorBody: this.value,
placeholder: i18n.posts.forms.editor.body,
link: i18n.posts.forms.editor.link,
}
},
Expand Down Expand Up @@ -64,7 +66,7 @@
},
theme: 'bubble',
scrollingContainer: 'html, body',
placeholder: "Tell your story..."
placeholder: this.placeholder
});
/**
Expand All @@ -74,7 +76,7 @@
*/
let tooltip = quill.theme.tooltip;
let input = tooltip.root.querySelector("input[data-link]");
input.dataset.link = 'Paste or type a link...';
input.dataset.link = this.link;
return quill;
},
Expand Down
31 changes: 22 additions & 9 deletions resources/js/components/ImagePicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,18 @@
unsplashPage: 1,
searchingUnsplash: true,
unsplashImages: [],
greeting: i18n.posts.forms.editor.images.picker.greeting,
action: i18n.posts.forms.editor.images.picker.action,
item: i18n.posts.forms.editor.images.picker.item,
operator: i18n.posts.forms.editor.images.picker.operator,
source: i18n.posts.forms.editor.images.picker.unsplash,
key: i18n.posts.forms.editor.images.picker.key,
placeholder: i18n.posts.forms.editor.images.picker.placeholder,
empty: i18n.posts.forms.editor.images.picker.search.empty,
next: i18n.buttons.general.next,
cancel: i18n.buttons.general.cancel,
captionBy: i18n.posts.forms.editor.images.picker.caption.by,
captionOn: i18n.posts.forms.editor.images.picker.caption.on,
}
},
Expand All @@ -31,7 +43,7 @@
// Get images from Unsplash
getImagesFromUnsplash(page = 1) {
if (!this.unsplash) {
return this.alertError('Please configure your Unsplash API Key.');
return this.alertError(this.key);
}
this.unsplashPage = page;
this.searchingUnsplash = true;
Expand Down Expand Up @@ -72,7 +84,7 @@
this.$emit('changed', {
url: this.selectedUnsplashImage.urls.regular,
caption: 'Photo by <a href="' + this.selectedUnsplashImage.user.links.html + '" target="_blank">' + this.selectedUnsplashImage.user.name + '</a> on <a href="https://unsplash.com" target="_blank">Unsplash</a>',
caption: this.captionBy + ' <a href="' + this.selectedUnsplashImage.user.links.html + '" target="_blank">' + this.selectedUnsplashImage.user.name + '</a> ' + this.captionOn + ' <a href="https://unsplash.com" target="_blank">Unsplash</a>',
});
this.closeUnsplashModal();
Expand Down Expand Up @@ -122,13 +134,14 @@
accept="image/*"
v-on:change="uploadSelectedImage">
<div class="mb-0">
Please <label :for="'imageUpload'+_uid" class="text-primary" style="cursor:pointer;">upload</label> an image
<span v-if="this.unsplash">or</span>
{{ this.greeting }} <label :for="'imageUpload'+_uid" class="text-primary" style="cursor:pointer;">{{
this.action }}</label> {{ this.item }}
<span v-if="this.unsplash">{{ this.operator }}</span>
<a v-if="this.unsplash"
href="#"
@click.prevent="openUnsplashModal"
class="text-primary">
search Unsplash
{{ this.source }}
</a>
</div>

Expand All @@ -139,7 +152,7 @@
v-if="this.unsplash"
v-model="unsplashSearchTerm"
ref="unsplashSearch"
placeholder="Search free high-resolution photos">
:placeholder="this.placeholder">

<div v-if="!searchingUnsplash && unsplashImages.length">
<div class="card-columns">
Expand All @@ -157,20 +170,20 @@
type="button"
@click="closeUnsplashModal"
v-on:submit.prevent="onSubmit">
Cancel
{{ this.cancel }}
</button>
<button class="btn btn-sm btn-outline-primary"
type="button"
@click="getImagesFromUnsplash(unsplashPage + 1)"
v-if="unsplashImages.length == 12"
v-on:submit.prevent="onSubmit">
Next page
{{ this.next }}
</button>
</div>
</div>

<div v-if="!searchingUnsplash && !unsplashImages.length">
<h4 class="text-center py-4">We couldn't find any matches.</h4>
<h4 class="text-center py-4">{{ this.empty }}</h4>
</div>
</div>
</div>
Expand Down
9 changes: 5 additions & 4 deletions resources/js/components/LineChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
points: [{
values: Object.values(this.views)
}],
title: i18n.stats.cards.views.title,
tooltip: i18n.stats.chart.view,
labels: Object.keys(this.views)
}
},
Expand All @@ -36,7 +37,7 @@
<vue-frappe
id="stats"
:labels="this.labels"
title="Views (Last 30 days)"
:title="this.title"
type="line"
:axisOptions="{
xIsSeries: true,
Expand All @@ -50,8 +51,8 @@
:dataSets="this.points"
:tooltipOptions="{
formatTooltipX: d => moment(d, 'YYYY-MM-DD').format('dddd, MMMM Do'),
formatTooltipY: d => d + pluralize('view', d),
formatTooltipY: d => d + pluralize(this.tooltip, d),
}">
</vue-frappe>
</div>
</template>
</template>
8 changes: 5 additions & 3 deletions resources/js/components/TagSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@
return {
value: this.tagged ? this.tagged : [],
options: allTags
options: allTags,
tag: i18n.tags.forms.tag,
select: i18n.tags.forms.select,
}
},
Expand Down Expand Up @@ -54,8 +56,8 @@
<div>
<multiselect
v-model="value"
placeholder="Select some tags..."
tag-placeholder="Add a new tag"
:placeholder="this.select"
:tag-placeholder="this.tag"
label="name"
track-by="slug"
:options="options"
Expand Down
8 changes: 5 additions & 3 deletions resources/js/components/TopicSelect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@
return {
value: this.assigned ? this.assigned : [],
options: allTopics
options: allTopics,
topic: i18n.topics.forms.tag,
select: i18n.topics.forms.select,
}
},
Expand Down Expand Up @@ -64,8 +66,8 @@
<div>
<multiselect
v-model="value"
placeholder="Select a topic..."
tag-placeholder="Add this as new topic"
:placeholder="this.select"
:tag-placeholder="this.topic"
label="name"
track-by="slug"
:options="options"
Expand Down
10 changes: 6 additions & 4 deletions resources/js/components/editorComponents/HTMLEmbedder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
data() {
return {
content: '',
modalShown: false,
done: i18n.buttons.general.done,
label: i18n.posts.forms.editor.html.label,
placeholder: i18n.posts.forms.editor.html.placeholder,
}
},
Expand Down Expand Up @@ -38,16 +40,16 @@
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<p class="font-weight-bold lead">Embed HTML</p>
<p class="font-weight-bold lead">{{ this.label }}</p>
<div class="form-group row">
<div class="col-lg-12 mx-0 px-0">
<textarea ref="content" cols="30" rows="10" class="form-control border-0"
placeholder="Paste your HTML here" style="resize: none" v-model="content"></textarea>
:placeholder="this.placeholder" style="resize: none" v-model="content"></textarea>
</div>
</div>
</div>
<div class="modal-footer">
<button class="btn btn-link text-muted" data-dismiss="modal" @click="addHTML">Done</button>
<button class="btn btn-link text-muted" data-dismiss="modal" @click="addHTML">{{ this.done }}</button>
</div>
</div>
</div>
Expand Down
15 changes: 10 additions & 5 deletions resources/js/components/editorComponents/ImageUploader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@
imageUrl: null,
layout: 'default',
caption: '',
label: i18n.posts.forms.editor.images.picker.uploader.label,
placeholder: i18n.posts.forms.editor.images.picker.uploader.caption.placeholder,
default: i18n.posts.forms.editor.images.picker.uploader.layout.default,
wide: i18n.posts.forms.editor.images.picker.uploader.layout.wide,
done: i18n.buttons.general.done,
}
},
Expand Down Expand Up @@ -73,21 +78,21 @@
<div class="modal-dialog" id="unsplash-modal" role="document">
<div class="modal-content">
<div class="modal-body">
<p class="font-weight-bold lead">Add image</p>
<p class="font-weight-bold lead">{{ this.label }}</p>
<div class="form-group row">
<div class="col-lg-12">
<div v-if="imageUrl" id="current-image">
<img :src="imageUrl" class="w-100">

<div class="input-group py-2">
<input type="text" class="form-control border-0 px-0" v-model="caption"
placeholder="Type caption for image (optional)" ref="caption">
:placeholder="this.placeholder" ref="caption">
</div>

<div class="input-group py-2">
<select class="custom-select border-0 px-0" v-model="layout">
<option value="default">Default layout</option>
<option value="wide">Wide image</option>
<option value="default">{{ this.default }}</option>
<option value="wide">{{ this.wide }}</option>
</select>
</div>
</div>
Expand All @@ -101,7 +106,7 @@
</div>
</div>
<div class="modal-footer">
<button class="btn btn-link text-muted" data-dismiss="modal" @click="applyImage">Done</button>
<button class="btn btn-link text-muted" data-dismiss="modal" @click="applyImage">{{ this.done }}</button>
</div>
</div>
</div>
Expand Down
34 changes: 34 additions & 0 deletions resources/lang/cn/blog.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

return [

'title' => '博客',
'buttons' => [
'learn' => '学到更多',
'next' => '阅读下一篇',
'enjoy' => '你可能会喜欢',
'edit' => '编辑帖子',
'stats' => '查看统计信息',
],
'empty' => [
'description' => '没有找到帖子,从头开始',
'action' => '添加新帖子',
],
'nav' => [
'user' => [
'posts' => '帖子',
'tags' => '标签',
'topics' => '话题',
'stats' => '统计',
'login' => '登入',
'logout' => '登出',
],
],
'posts' => [
'label' => '最近的帖子',
],
'tags' => [
'label' => '标签',
],

];
33 changes: 33 additions & 0 deletions resources/lang/cn/buttons.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
<?php

return [

'general' => [
'cancel' => '取消',
'delete' => '刪除',
'done' => '完成',
'load' => '顯示更多',
'save' => '保存',
'next' => '下一頁',
],
'posts' => [
'create' => '最新帖子',
'edit' => '編輯帖子',
'update' => '更新帖子',
'save' => '保存並發布',
'schedule' => '發佈時間表',
],
'stats' => [
'index' => '查看所有統計數據',
'show' => '細節',
],
'tags' => [
'create' => '新標籤',
'update' => '保存更改',
],
'topics' => [
'create' => '新話題',
'update' => '保存更改',
],

];
Loading

0 comments on commit 9b3af37

Please sign in to comment.