Skip to content

Commit

Permalink
Allow admin to edit post from public view
Browse files Browse the repository at this point in the history
  • Loading branch information
kutaloweb committed Feb 12, 2019
1 parent b6736e9 commit a170e0a
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Binary file modified public/images/custom-select.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/mix-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
"/css/colors/red.css": "/css/colors/red.css",
"/css/colors/red-dark.css": "/css/colors/red-dark.css",
"/js/plugin.js": "/js/plugin.js"
}
}
10 changes: 10 additions & 0 deletions resources/assets/js/views/post/View.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
</span>
<h1 class="card-title post-title">{{ post.title }}</h1>
<div class="card-text" v-html="post.body"></div>
<div class="card-text" v-if="hasRole('admin')">
<router-link :to="`/post/${post.slug}/edit`"
class="btn btn-info btn-sm"
v-tooltip="trans('post.edit_published')">
<i class="fas fa-edit"></i>
</router-link>
</div>
</div>
<div class="col-md-3" v-if="post.body">
<div class="text-muted card-caps mb-1">{{ trans('general.share') }}</div>
Expand Down Expand Up @@ -109,6 +116,9 @@
helper.showSpinner();
this.$store.dispatch('setSearchCategory', categoryId);
this.$router.push('/search');
},
hasRole(role) {
return helper.hasRole(role);
}
}
}
Expand Down

0 comments on commit a170e0a

Please sign in to comment.