Skip to content

Commit

Permalink
Fixing depenency on Change having an Admin with the edit modal
Browse files Browse the repository at this point in the history
  • Loading branch information
weotch committed Dec 6, 2017
1 parent bdff6cc commit 8cffa39
Show file tree
Hide file tree
Showing 10 changed files with 64 additions and 52 deletions.
6 changes: 5 additions & 1 deletion assets/js/modules/changes-modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ define(function (require) {
</div>\
<div class="modal-footer">\
<%=action%> ' + __('changes.on') + ' <%=date%> ' + __('changes.by') + ' \
<a href="<%=admin_edit%>"><%=admin%></a>\
<% if (admin_edit) { %>\
<a href="<%= admin_edit %>"><%= admin %></a>\
<% } else { %>\
<%= admin %>\
<% } %>\
</div>\
</div>\
</div>\
Expand Down
6 changes: 3 additions & 3 deletions classes/Controllers/Changes.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,12 +89,12 @@ public function getPermissionOptions()
public function edit($id)
{
$change = Change::findOrFail($id);

$admin = $change->admin;
return Response::json([
'action' => __("decoy::changes.actions.$change->action"),
'title' => $change->title,
'admin' => $change->admin->getAdminTitleHtmlAttribute(),
'admin_edit' => $change->admin->getAdminEditAttribute(),
'admin' => $admin ? $admin->getAdminTitleHtmlAttribute() : 'someone',
'admin_edit' => $admin ? $admin->getAdminEditAttribute() : null,
'date' => $change->getHumanDateAttribute(),
'attributes' => $change->attributesForModal(),
]);
Expand Down
2 changes: 1 addition & 1 deletion dist/index.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! 📝 Bukwild 💾 11.15.17 👍 */
/*! 📝 Bukwild 💾 12.6.17 👍 */
@import url(//fonts.googleapis.com/css?family=Cabin:400,700|Roboto+Slab:100,300,400);@charset "UTF-8";
/**
* Bootstrap variables
Expand Down
44 changes: 24 additions & 20 deletions dist/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! 📝 Bukwild 💾 11.15.17 👍 */
/*! 📝 Bukwild 💾 12.6.17 👍 */
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
Expand Down Expand Up @@ -56826,28 +56826,32 @@ return /******/ (function(modules) { // webpackBootstrap

// Dependencies
var $ = __webpack_require__(2),
__ = __webpack_require__(15),
__ = __webpack_require__(15),
_ = __webpack_require__(5),
bootstrap = __webpack_require__(10),
tpl = _.template('\
<div class="modal fade changes-modal">\
<div class="modal-dialog">\
<div class="modal-content">\
<div class="modal-header">\
<button type="button" class="close" data-dismiss="modal" \
aria-label="' + __('changes.close') + '"><span aria-hidden="true">&times;</span></button>\
<h4 class="modal-title">' + __('changes.changes_to') + ' "<%=title%>"</h4>\
</div>\
<div class="modal-body">\
<%=body%>\
</div>\
<div class="modal-footer">\
<%=action%> ' + __('changes.on') + ' <%=date%> ' + __('changes.by') + ' \
<a href="<%=admin_edit%>"><%=admin%></a>\
</div>\
</div>\
</div>\
</div>');
<div class="modal fade changes-modal">\
<div class="modal-dialog">\
<div class="modal-content">\
<div class="modal-header">\
<button type="button" class="close" data-dismiss="modal" \
aria-label="' + __('changes.close') + '"><span aria-hidden="true">&times;</span></button>\
<h4 class="modal-title">' + __('changes.changes_to') + ' "<%=title%>"</h4>\
</div>\
<div class="modal-body">\
<%=body%>\
</div>\
<div class="modal-footer">\
<%=action%> ' + __('changes.on') + ' <%=date%> ' + __('changes.by') + ' \
<% if (admin_edit) { %>\
<a href="<%= admin_edit %>"><%= admin %></a>\
<% } else { %>\
<%= admin %>\
<% } %>\
</div>\
</div>\
</div>\
</div>');

/**
* Request the attribtues from the server
Expand Down
2 changes: 1 addition & 1 deletion dist/index.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/index.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion example/public/assets/decoy/index.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! 📝 Bukwild 💾 11.15.17 👍 */
/*! 📝 Bukwild 💾 12.6.17 👍 */
@import url(//fonts.googleapis.com/css?family=Cabin:400,700|Roboto+Slab:100,300,400);@charset "UTF-8";
/**
* Bootstrap variables
Expand Down
44 changes: 24 additions & 20 deletions example/public/assets/decoy/index.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! 📝 Bukwild 💾 11.15.17 👍 */
/*! 📝 Bukwild 💾 12.6.17 👍 */
(function webpackUniversalModuleDefinition(root, factory) {
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
Expand Down Expand Up @@ -56826,28 +56826,32 @@ return /******/ (function(modules) { // webpackBootstrap

// Dependencies
var $ = __webpack_require__(2),
__ = __webpack_require__(15),
__ = __webpack_require__(15),
_ = __webpack_require__(5),
bootstrap = __webpack_require__(10),
tpl = _.template('\
<div class="modal fade changes-modal">\
<div class="modal-dialog">\
<div class="modal-content">\
<div class="modal-header">\
<button type="button" class="close" data-dismiss="modal" \
aria-label="' + __('changes.close') + '"><span aria-hidden="true">&times;</span></button>\
<h4 class="modal-title">' + __('changes.changes_to') + ' "<%=title%>"</h4>\
</div>\
<div class="modal-body">\
<%=body%>\
</div>\
<div class="modal-footer">\
<%=action%> ' + __('changes.on') + ' <%=date%> ' + __('changes.by') + ' \
<a href="<%=admin_edit%>"><%=admin%></a>\
</div>\
</div>\
</div>\
</div>');
<div class="modal fade changes-modal">\
<div class="modal-dialog">\
<div class="modal-content">\
<div class="modal-header">\
<button type="button" class="close" data-dismiss="modal" \
aria-label="' + __('changes.close') + '"><span aria-hidden="true">&times;</span></button>\
<h4 class="modal-title">' + __('changes.changes_to') + ' "<%=title%>"</h4>\
</div>\
<div class="modal-body">\
<%=body%>\
</div>\
<div class="modal-footer">\
<%=action%> ' + __('changes.on') + ' <%=date%> ' + __('changes.by') + ' \
<% if (admin_edit) { %>\
<a href="<%= admin_edit %>"><%= admin %></a>\
<% } else { %>\
<%= admin %>\
<% } %>\
</div>\
</div>\
</div>\
</div>');

/**
* Request the attribtues from the server
Expand Down
2 changes: 1 addition & 1 deletion example/public/assets/decoy/index.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions example/public/assets/decoy/index.min.js

Large diffs are not rendered by default.

0 comments on commit 8cffa39

Please sign in to comment.