Skip to content
This repository has been archived by the owner on Dec 7, 2020. It is now read-only.

Commit

Permalink
Merge pull request #12 from nfls/dev
Browse files Browse the repository at this point in the history
20180311-8
  • Loading branch information
hqy2000 authored Mar 11, 2018
2 parents d42a4eb + d292a85 commit 55bb1fe
Show file tree
Hide file tree
Showing 12 changed files with 27 additions and 33 deletions.
3 changes: 1 addition & 2 deletions config/packages/sentry.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,4 @@ sentry:
- 'Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException'
- 'Symfony\Component\Debug\Exception\FatalErrorException'
- 'RuntimeException'
- 'Symfony\Component\Console\Exception\RuntimeException'
-
- 'Symfony\Component\Console\Exception\RuntimeException'
3 changes: 1 addition & 2 deletions config/packages/translation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,4 @@ framework:
translator:
paths:
- '%kernel.project_dir%/web/translation/backend'
fallbacks:
- 'zh'
fallbacks: ['zh']
7 changes: 1 addition & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@
"babel-preset-stage-2": "^6.22.0",
"chalk": "^2.0.1",
"copy-webpack-plugin": "^4.0.1",
"css-loader": "^0.28.0",
"eslint": "^4.15.0",
"eslint-config-standard": "^10.2.1",
"eslint-friendly-formatter": "^3.0.0",
Expand All @@ -85,7 +84,6 @@
"node-notifier": "^5.1.2",
"node-sass": "^4.7.2",
"optimize-css-assets-webpack-plugin": "^3.2.0",
"ora": "^1.2.0",
"portfinder": "^1.0.13",
"postcss-import": "^11.0.0",
"postcss-loader": "^2.0.8",
Expand All @@ -94,17 +92,14 @@
"sass-loader": "^6.0.6",
"semver": "^5.3.0",
"shelljs": "^0.7.6",
"style-loader": "^0.19.1",
"uglifyjs-webpack-plugin": "^1.1.1",
"url-loader": "^0.5.8",
"vue-lazyload": "^1.2.1",
"vue-loader": "^13.3.0",
"vue-style-loader": "^3.0.1",
"vue-template-compiler": "^2.5.2",
"webpack": "^3.6.0",
"webpack-bundle-analyzer": "^2.9.0",
"webpack-dev-server": "^2.9.1",
"webpack-merge": "^4.1.0"
"webpack-dev-server": "^2.9.1"
},
"engines": {
"node": ">= 6.0.0",
Expand Down
8 changes: 0 additions & 8 deletions src/Controller/Basic/AboutController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,4 @@ public function version()
return $this->response()->response($gitHashLong);
}

/**
* @Route("/about/trans")
*/
public function trans(TranslatorInterface $translator) {
//$a = ;
return $this->response()->response($translator->trans("nihao"));

}
}
4 changes: 2 additions & 2 deletions src/Listener/LocaleListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ class LocaleListener {
public function onKernelRequest(GetResponseEvent $event)
{
$request = $event->getRequest();
if($request->cookies->get("locale") === "zh")
if($request->cookies->get("lang") === "zh")
$request->setLocale("zh");
else if ($request->cookies->get("locale") === "en")
else if ($request->cookies->get("lang") === "en")
$request->setLocale("en");
else if(strpos($request->headers->get("Accept-Language"),"zh") === false)
$request->setLocale("en");
Expand Down
2 changes: 1 addition & 1 deletion src/Security/OAuthAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function checkCredentials($credentials, UserInterface $user)

public function onAuthenticationFailure(Request $request, AuthenticationException $exception)
{
return new JsonResponse(array("code" => 400, "message" => "Incorrect Information"), 400);
return new JsonResponse(array("code" => 400, "message" => $exception->getMessage()), 400);
}

public function onAuthenticationSuccess(Request $request, TokenInterface $token, $providerKey)
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/alumni/auth.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
var len = (String(base || 10).length - String(this).length)+1;
return len > 0? new Array(len).join(chr || '0')+this : this;
};
var d = new Date,
var d = new Date(val),
dformat = [d.getFullYear(),
(d.getMonth()+1).padLeft(),
d.getDate().padLeft()].join('/') +' ' +
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/media/comment.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
var len = (String(base || 10).length - String(this).length)+1;
return len > 0? new Array(len).join(chr || '0')+this : this;
};
var d = new Date,
var d = new Date(val),
dformat = [d.getFullYear(),
(d.getMonth()+1).padLeft(),
d.getDate().padLeft()].join('/') +' ' +
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/media/gallery.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
var len = (String(base || 10).length - String(this).length)+1;
return len > 0? new Array(len).join(chr || '0')+this : this;
};
var d = new Date,
var d = new Date(val),
dformat = [d.getFullYear(),
(d.getMonth()+1).padLeft(),
d.getDate().padLeft()].join('/') +' ' +
Expand Down
2 changes: 1 addition & 1 deletion templates/admin/media/photo.php.twig
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
var len = (String(base || 10).length - String(this).length)+1;
return len > 0? new Array(len).join(chr || '0')+this : this;
};
var d = new Date,
var d = new Date(val),
dformat = [d.getFullYear(),
(d.getMonth()+1).padLeft(),
d.getDate().padLeft()].join('/') +' ' +
Expand Down
2 changes: 1 addition & 1 deletion web/components/Components/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@
}, created: function () {
document.getElementById('recaptcha').style.visibility = 'hidden';
}, mounted: function () {
this.username = this.$t('username')
this.username = this.$t('not-login')
this.reload()
this.initReCaptcha()
this.loadWebP()
Expand Down
23 changes: 16 additions & 7 deletions web/components/School/Blackboard.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<i18n src="../../translation/frontend/School.json"></i18n>
<template>
<div class="class" v-infinite-scroll="loadMore" :infinite-scroll-disabled="empty || loading">
<div class="class" v-infinite-scroll="loadMore" :infinite-scroll-disabled="empty || loading" :infinite-scroll-immediate-check="false">
<div class="info" v-if="!empty">
<md-card>
<md-card-content style="align:left;">
Expand Down Expand Up @@ -578,6 +578,8 @@
})
},
loadMore() {
if(!this.currentClass)
return
this.loading = true
this.page++
this.axios.get("/school/blackboard/detail", {
Expand All @@ -587,12 +589,19 @@
}
}).then((response) => {
this.loading = false
var self = this
var info = response.data["data"].map(function (val) {
val.preview = self.$moment(val.time).toDate() > new Date()
return val
})
this.classInfo.notices = this.classInfo.notices.concat(info)
if(response.data["data"] === 200)
{
this.$emit("showMsg",this.$t("new-succeeded"))
var self = this
var info = response.map(function (val) {
val.preview = self.$moment(val.time).toDate() > new Date()
return val
})
this.classInfo.notices = this.classInfo.notices.concat(info)
}else{
this.$emit("showMsg",response.data["data"])
}
this.getCsrf()
}).catch((error) => {
this.loading = false
Expand Down

0 comments on commit 55bb1fe

Please sign in to comment.