Skip to content
Permalink
Browse files

Merge pull request Novactive#18 from Novactive/fix-tabs-front-end-menu

Fix tabs front end menu
  • Loading branch information...
Plopix committed Feb 20, 2019
2 parents 47b3e1d + 38e5da2 commit 9eda47659c19caa39a460a0225d4620481834d9d
@@ -83,13 +83,17 @@ public function onTabGroupPreRender(TabGroupEvent $event): void
if ($campaigns) {
$this->campaignsTab->setCampaigns($campaigns);
$this->tabRegistry->addTab($this->campaignsTab, 'location-view');
$tabGroup->addTab($this->campaignsTab);
}
$mailingRepo = $this->entityManager->getRepository('NovaeZMailingBundle:Mailing');
$mailings = $mailingRepo->findBy(['locationId' => $location->id]);
if ($mailings) {
$this->mailingsTab->setMailings($mailings);
$this->tabRegistry->addTab($this->mailingsTab, 'location-view');
$tabGroup->addTab($this->mailingsTab);
}
$event->setData($tabGroup);
}
}
@@ -191,3 +191,7 @@ $eZLightBackground: #F5F5F5;
margin: 20px 10px 10px 10px;
}
}

.campaigns > ul > li > label:hover {
font-weight: bold;
}
@@ -10,4 +10,9 @@ jQuery(function () {
eZMailingSubItemsModule.init(jQuery, $app);
eZMailingEditFormModule.init(jQuery, $app);
eZMailingContentSelectionModule.init(jQuery, $app);

$('.campaigns > ul > li > label').click(function () {
window.location = $(this).parent().find('ul > li.subscriptions > a').attr('href');
return false;
});
});
@@ -21,6 +21,36 @@ var eZMailingContentSelectionModule = function () {
}
}), udwContainer);
});

$("button.js-novaezmailing-create-content", $app).click(function () {
var token = document.querySelector('meta[name="CSRF-Token"]').content;
var siteaccess = document.querySelector('meta[name="SiteAccess"]').content;
var udwContainer = $("#react-udw").get(0);
var parentLocationId = $(this).data('parent-location-id');
var title = $(this).find('span').html();
ReactDOM.render(React.createElement(eZ.modules.UniversalDiscovery, {
onCancel: function () {
ReactDOM.unmountComponentAtNode(udwContainer)
},
title: title,
multiple: false,
startingLocationId: 1,
canSelectContent: function (data) {
var contentDisabled = true;
if (data.item.pathString.split('/').includes(parentLocationId.toString()) && $('.c-choose-content-type__list .is-selected').length > 0) {
contentDisabled = false;
}
$('button.m-ud__action--create-content').prop("disabled", contentDisabled);
},
restInfo: {token: token, siteaccess: siteaccess},
visibleTabs: ['create'],
activeTab: 'create',
onConfirm: function (response) {
ReactDOM.unmountComponentAtNode(udwContainer);
location.reload();
}
}), udwContainer);
});
}

return {init: _init};
@@ -31,9 +31,7 @@ var eZMailingSubItemsModule = function () {
totalCount: subitemsList.ChildrenCount,
handleEditItem: function (content) {
var contentId = content._id;
var versionNumber = content.CurrentVersion.Version.VersionInfo.versionNo;
var langCode = content.mainLanguageCode;
alert("/admin/content/edit/draft/" + contentId + "/" + versionNumber + "/" + langCode);
},
generateLink: function (locationId) {
return window.Routing.generate('_ezpublishLocation', {locationId: locationId});
@@ -67,7 +67,7 @@ campaign.details.name: Name
campaign.details.sender: Sender
campaign.details.report_email: Report Email
campaign.details.siteaccess_limit: Siteaccess limit
campaign.details.mailing_lists: Mailing Lists
campaign.details.mailing_lists: Mailing List|Mailing Lists
campaign.details.associated_content: Associated content
campaign.edit.name: Name
campaign.edit.location: Location
@@ -135,6 +135,7 @@ mailing.mailing_tabs.confirm_sending: Confirm the sending
mailing.mailing_tabs.mailing_lists_count1: Campaign defines
mailing.mailing_tabs.mailing_lists_count2: Mailing Lists
mailing.mailing_tabs.mailing_list_reach: The reach of this Mailing is
mailing.mailing_tabs.create_content: Create Content
mailing.edit.mailing: Mailing
mailing_list.edit.name: Name
mailing_list.edit.title: Edit
@@ -50,7 +50,7 @@ dashboard.see_mailing_lists: Voir les listes de diffusion
dashboard.see_users: Voir les utilisateurs
dashboard.last_user_updated: Dernier utilisateur mis à jour
dashboard.last_broadcast: Dernières diffusions
campaign.tabs.campaign: Campagne|Campagnes
campaign.tabs.campaign: Campagne
campaign.tabs.associated_content: Contenu eZ associé
campaign.tabs.mailings: Envoi
campaign.tabs.create: Créer
@@ -135,6 +135,7 @@ mailing.mailing_tabs.confirm_sending: Confirmer l'envoi
mailing.mailing_tabs.mailing_lists_count1: La campagne définit
mailing.mailing_tabs.mailing_lists_count2: listes de diffusion
mailing.mailing_tabs.mailing_list_reach: La portée de cet envoi est de
mailing.mailing_tabs.create_content: Créer du contenu
mailing.edit.mailing: Envoi
mailing_list.edit.name: Nom
mailing_list.edit.title: Modifier
@@ -27,7 +27,7 @@
</tr>
{% endif %}
<tr>
<th>{{"campaign.details.mailing_lists"|trans}}</th>
<th>{{"campaign.details.mailing_lists"|transchoice(item.mailingLists|length, {})}}</th>
<td>
<div class="list-group">
{% for mailingList in item.mailingLists %}
@@ -78,6 +78,12 @@
</svg>
<span>{{"mailing.mailing_tabs.confirm"|trans}}</span>
</button>
<button type="button" class="btn btn-sm btn-primary js-novaezmailing-create-content" data-parent-location-id="{{ item.location.id }}">
<svg class="ez-icon">
<use xlink:href="/bundles/ezplatformadminui/img/ez-icons.svg#create"></use>
</svg>
<span>{{"mailing.mailing_tabs.create_content"|trans}}</span>
</button>
</div>
<div class="modal fade" tabindex="-1" role="dialog" id="novaezmailingmailingtestmodal">
<div class="modal-dialog" role="document">

0 comments on commit 9eda476

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.