Minor - Format code

pull/3272/head
Julio Montoya 5 years ago
parent 5561086e94
commit 2d6c6bd0db
  1. 8
      assets/vue/App.vue
  2. 34
      assets/vue/views/documents/List.vue
  3. 6
      assets/vue/views/documents/Show.vue
  4. 1
      src/CoreBundle/Entity/Listener/CourseListener.php
  5. 3
      src/CoreBundle/Entity/ResourceLink.php
  6. 2
      src/CoreBundle/Entity/User.php
  7. 9
      src/CoreBundle/Repository/UserRepository.php

@ -120,14 +120,11 @@
</v-btn>
</v-app-bar>
<v-content>
<Breadcrumb layout-class="pl-3 py-3" />
<router-view></router-view>
</v-content>
<v-footer color="indigo" app>
<span class="white--text">&copy; 2019</span>
</v-footer>
@ -148,6 +145,11 @@
data: () => ({
drawer: null
}),
computed: {
isAuthenticated() {
return this.$store.getters['security/isAuthenticated']
},
},
beforeMount() {
}
}

@ -16,7 +16,6 @@
/>
</DataFilter>
<br />
<v-data-table
v-model="selected"
:headers="headers"
@ -31,8 +30,28 @@
show-select
@update:options="onUpdateOptions"
>
<template slot="item.resourceNode" slot-scope="{ item }">
{{ item['@id'] }}
<template slot="item.resourceNode.title" slot-scope="{ item }">
<div v-if="item['resourceNode']['resourceFile']">
<!-- <a @click="showHandler(item)" >-->
<!-- {{ item['contentUrl'] }}-->
<!-- </a>-->
<a data-fancybox="gallery" :href=" item['contentUrl'] " >
{{ item['resourceNode']['title'] }}
</a>
</div>
<div v-else>
<a @click="handleClick(item)">
{{ item['resourceNode']['title'] }}
</a>
</div>
</template>
<!-- <template slot="item.resourceNode" slot-scope="{ item }">-->
<!-- {{ item['@id'] }}-->
<!-- </template>-->
<template slot="item.resourceNode.updatedAt" slot-scope="{ item }">
{{ item.resourceNode.updatedAt | moment("from", "now") }}
</template>
<ActionCell
@ -72,12 +91,9 @@ export default {
return {
headers: [
{text: 'Title', value: 'resourceNode.title', sortable: true},
{text: 'Last modified', value: 'resourceNode.updatedAt', sortable: true},
{
text: 'Actions',
value: 'action',
sortable: false
}
{text: 'Modified', value: 'resourceNode.updatedAt', sortable: true},
{text: 'Size', value: 'resourceNode.resourceFile.size', sortable: true},
{text: 'Actions', value: 'action', sortable: false}
],
selected: []
};

@ -25,7 +25,7 @@
<tr>
<td><strong>{{ $t('title') }}</strong></td>
<td>
{{ item['title'] }}
{{ item['title'] }}
</td>
<td><strong>{{ $t('comment') }}</strong></td>
@ -42,12 +42,12 @@
</td>
<td></td>
</tr>
<tr>
<td><strong>{{ $t('file') }}</strong></td>
<td>
<div v-if="item['resourceNode']['resourceFile']">
<img v-bind:src=" item['resourceNode']['resourceFile']['file'] " />
<!-- <img v-bind:src=" item['resourceNode']['resourceFile']['file'] " />-->
<img v-bind:src=" item['contentUrl'] " />
</div>
<div v-else>
-

@ -69,7 +69,6 @@ class CourseListener
{
/** @var AccessUrlRelCourse $urlRelCourse */
if ($course) {
/*$urlRelCourse = $course->getUrls()->first();
$url = $urlRelCourse->getUrl();*/
//$url = $course->getCurrentUrl();

@ -33,15 +33,12 @@ class ResourceLink
protected $id;
/**
*
*
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\ResourceNode", inversedBy="resourceLinks")
* @ORM\JoinColumn(name="resource_node_id", referencedColumnName="id", onDelete="SET NULL")
*/
protected $resourceNode;
/**
*
* @ORM\ManyToOne(targetEntity="Chamilo\CoreBundle\Entity\Course", inversedBy="resourceLinks")
* @ORM\JoinColumn(name="c_id", referencedColumnName="id", nullable=true)
*/

@ -21,7 +21,7 @@ use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Validator\Mapping\ClassMetadata;
//
/**
* @ApiResource(
* attributes={"security"="is_granted('ROLE_ADMIN')"},

@ -71,8 +71,8 @@ class UserRepository extends ResourceRepository implements UserLoaderInterface,
*/
protected $encoder;
public function setEncoder(UserPasswordEncoderInterface $encoder){
public function setEncoder(UserPasswordEncoderInterface $encoder)
{
$this->encoder = $encoder;
}
@ -94,11 +94,10 @@ class UserRepository extends ResourceRepository implements UserLoaderInterface,
public function canonicalize($string)
{
$encoding = mb_detect_encoding($string);
$result = $encoding
return $encoding
? mb_convert_case($string, MB_CASE_LOWER, $encoding)
: mb_convert_case($string, MB_CASE_LOWER);
return $result;
}
public function updateCanonicalFields(UserInterface $user)

Loading…
Cancel
Save