Skip to content

Commit

Permalink
feat: improve spacing and file handling of multisite
Browse files Browse the repository at this point in the history
  • Loading branch information
arcs- committed Aug 7, 2024
1 parent 10ebf04 commit c194b62
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
6 changes: 6 additions & 0 deletions resources/dist/css/cp.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
.novu-float-right {
float: right !important
}
.novu-m-\[0_-2px_-2px_0\] {
margin: 0 -2px -2px 0 !important
}
.novu-mb-6 {
margin-bottom: 1.5rem !important
}
Expand Down Expand Up @@ -63,6 +66,9 @@
.novu-pr-0 {
padding-right: 0px !important
}
.novu-pr-\[2px\] {
padding-right: 2px !important
}
.novu-transition-all {
transition-property: all !important;
transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1) !important;
Expand Down
9 changes: 4 additions & 5 deletions resources/dist/js/cp.js
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,7 @@ var render = function render() {
}), _vm._v(" "), _vm.altCount ? _c("button", {
staticClass: "btn !novu-px-3 novu-w-[2.5rem]",
attrs: {
type: "button",
tabindex: "-1"
type: "button"
},
on: {
click: _vm.expanded
Expand All @@ -304,12 +303,12 @@ var render = function render() {
name: "translate"
}
})], 1) : _vm._e()], 1), _vm._v(" "), _vm.details ? _c("div", {
staticClass: "novu-transition-all novu-overflow-hidden",
staticClass: "novu-transition-all novu-overflow-hidden novu-m-[0_-2px_-2px_0]",
style: {
height: _vm.grow ? _vm.altCount * 38 + 8 + 2 + "px" : 0
height: _vm.grow ? _vm.altCount * (38 + 8) + 2 + "px" : 0
}
}, [_c("div", {
staticClass: "pt-2 flex gap-2 flex-col"
staticClass: "pt-2 flex gap-2 flex-col novu-pr-[2px]"
}, _vm._l(_vm.alternatives, function (alt) {
return _c("div", {
key: alt.handle,
Expand Down
11 changes: 5 additions & 6 deletions resources/js/components/Entry.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,17 @@
<!-- main input -->
<div class="flex gap-2">
<TrackedInput :name="formName" :value="value" :placeholder="value" />
<button v-if="altCount" class="btn !novu-px-3 novu-w-[2.5rem]" type="button" tabindex="-1"
@click="expanded">
<button v-if="altCount" class="btn !novu-px-3 novu-w-[2.5rem]" type="button" @click="expanded">
<svg-icon name="translate"></svg-icon>
</button>
</div>

<!-- alternatives -->
<div v-if="details" class="novu-transition-all novu-overflow-hidden" :style="{
height: grow ? altCount * 38 + 8 + 2 + 'px' : 0
<div v-if="details" class="novu-transition-all novu-overflow-hidden novu-m-[0_-2px_-2px_0]" :style="{
height: grow ? altCount * (38 + 8) + 2 + 'px' : 0
}">
<div class="pt-2 flex gap-2 flex-col ">
<div v-for="alt of alternatives" :key="alt.handle" class="flex gap-4 novu-items-center">
<div class="pt-2 flex gap-2 flex-col novu-pr-[2px]">
<div v-for=" alt of alternatives" :key="alt.handle" class="flex gap-4 novu-items-center">
<div class="field-inner truncate novu-w-[8rem]">
<label class="publish-field-label"
:for="`${formName.replace(`translations[${site}]`, `translations[${alt.handle}]`)}`">
Expand Down
2 changes: 2 additions & 0 deletions src/Http/Controllers/PublicController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public function serve()
$site = \Request::segment(3);
$filePath = base_path("content/localize/{$site}.json");

// ToDo: compress json file

return response()->file($filePath);
}
}
1 change: 1 addition & 0 deletions src/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ public function bootAddon()

$this->loadTranslationsFrom(__DIR__.'/../resources/lang', 'localize');

$this->ensureFiles();
$this->bootAddonPermissions();
$this->registerRoutes();
$this->bootAddonNav();
Expand Down

0 comments on commit c194b62

Please sign in to comment.