Skip to content

Commit 6de7355

Browse files
Gabe Alvarez-MillardGabe Alvarez-Millard
authored andcommitted
setting up preview panel in notifications
1 parent cebf311 commit 6de7355

File tree

21 files changed

+165
-197
lines changed

21 files changed

+165
-197
lines changed

Gruntfile.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ module.exports = function (grunt) {
99
require('time-grunt')(grunt);
1010

1111
//grunt.loadNpmTasks('grunt-remove');
12+
require('grunt-remove')(grunt);
1213

1314
// Define the configuration for all the tasks
1415
grunt.initConfig({
@@ -39,17 +40,17 @@ module.exports = function (grunt) {
3940
},
4041
dest: ''
4142
}
42-
}
43+
},
4344

4445
// Remove prod's css files to force recompilation
45-
/*
4646
remove: {
4747
default_options: {
4848
trace: true,
49-
fileList: ['<%= mautic.rootAssets %>/app.css', '<%= mautic.rootAssets %>/libraries.css']
49+
fileList: ['<%= mautic.rootAssets %>/app.css', '<%= mautic.rootAssets %>/libraries.css'],
50+
tasks: ['remove'],
51+
dest: ''
5052
}
5153
}
52-
*/
5354
});
5455

5556
grunt.registerTask('compile-less', [
Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
.fc-widget-header table th {padding: 8px 15px;}
1+
.fc-widget-header table th {
2+
padding: 8px 15px;
3+
}
24
div#calendar > .fc-toolbar {
3-
border-bottom: 1px solid #ebedf0;
4-
margin: -15px -15px 1em;
5-
padding: 10px 15px;
6-
}
5+
border-bottom: 1px solid #ebedf0;
6+
margin: -15px -15px 1em;
7+
padding: 10px 15px;
8+
}

app/bundles/CoreBundle/Assets/css/app.css

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4370,9 +4370,6 @@ lesshat-selector { -lh-property: 0 ;
43704370
border: 1px solid #eee;
43714371
height: auto;
43724372
}
4373-
#slot_codemode .CodeMirror {
4374-
height: 200px;
4375-
}
43764373
.CodeMirror-hints {
43774374
position: absolute;
43784375
z-index: 9999 !important;
@@ -4716,10 +4713,6 @@ table.table > tbody > tr > td.long-text {
47164713
vertical-align: top;
47174714
float: none;
47184715
}
4719-
#dynamic-content-container .addNewDynamicContentFilter{
4720-
display: inline-block !important;
4721-
}
4722-
47234716
div[data-filter-container] .in-group {
47244717
margin-left: 20px;
47254718
}

app/bundles/NotificationBundle/Entity/Notification.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,4 +675,14 @@ public function setMobileSettings(array $mobileSettings)
675675

676676
return $this;
677677
}
678+
679+
/**
680+
* @param string $notificationIcon
681+
*
682+
* @return $this
683+
*/
684+
public function getNotificationIcon()
685+
{
686+
return 'app/bundles/NotificationBundle/Assets/img/notification.svg';
687+
}
678688
}

app/bundles/NotificationBundle/Views/Notification/form.html.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@
3030
<div class="tab-content pa-md">
3131
<div class="tab-pane fade in active bdr-w-0" id="notification-container">
3232
<div class="row">
33-
<div class="col-md-6">
34-
<?php echo $view['form']->row($form['message']); ?>
35-
<?php include("preview.html.php"); ?>
36-
</div>
3733
<div class="col-md-6">
3834
<?php echo $view['form']->row($form['name']); ?>
3935
<?php echo $view['form']->row($form['heading']); ?>
36+
<?php echo $view['form']->row($form['message']); ?>
4037
<?php echo $view['form']->row($form['url']); ?>
4138
<?php echo $view['form']->row($form['button']); ?>
4239
</div>
40+
<div class="col-md-6">
41+
<?php include("preview.html.php"); ?>
42+
</div>
4343
</div>
4444
</div>
4545
</div>

app/bundles/NotificationBundle/Views/Notification/preview.html.php

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,24 +10,25 @@
1010
/* @var \Mautic\NotificationBundle\Entity\Notification $notification */
1111
$url = $notification->getUrl();
1212
$button = $notification->getButton();
13+
$icon = $notification->getNotificationIcon();
1314

1415
?>
15-
<div class="panel panel-default">
16-
<div class="panel-heading">
17-
<h3 class="panel-title">
18-
<?php echo $notification->getHeading()?>
19-
<?php if ($url) : ?>
20-
<span class="pull-right">
21-
<a href="<?php echo $url; ?>" target="_blank"><span class="fa fa-external-link"></span></a>
22-
</span>
23-
<?php endif; ?>
24-
</h3>
25-
</div>
16+
<label>Preview</label>
17+
<div id="notification-preview" class="panel panel-default">
2618
<div class="panel-body">
27-
<p><?php echo $notification->getMessage()?></p>
19+
<div class="row">
20+
<div class="icon height-auto text-center">
21+
<img src="../../../<?php echo $icon ?>" />
22+
</div>
23+
<div class="text height-auto bg-white">
24+
<h4><?php echo $notification->getHeading()?></h4>
25+
<p><?php echo $notification->getMessage()?></p>
26+
<span><?php echo $_SERVER['HTTP_HOST']; ?></span>
27+
</div>
28+
</div>
2829
<?php if ($url && $button) : ?>
29-
<br>
30-
<p><a href="<?php echo $url ?>" class="btn btn-primary"><?php echo $button ?></a></p>
30+
<hr>
31+
<a href="<?php echo $url ?>"><?php echo $button ?></a>
3132
<?php endif; ?>
3233
</div>
3334
</div>

app/config/config.php

100644100755
File mode changed.

app/config/config_dev.php

100644100755
File mode changed.

app/config/config_prod.php

100644100755
File mode changed.

app/config/config_test.php

100644100755
File mode changed.

0 commit comments

Comments
 (0)