diff --git a/enferno/admin/templates/admin/activity.html b/enferno/admin/templates/admin/activity.html index 3d67de988..c10e4f983 100644 --- a/enferno/admin/templates/admin/activity.html +++ b/enferno/admin/templates/admin/activity.html @@ -263,7 +263,7 @@ { title: "{{_('User')}}", value: "user_id", width:50, sortable: false }, { title: "{{_('Action')}}", value: "action", width:50, sortable: false }, { title: "{{_('Status')}}", value: "status", width:50, sortable: false }, - { title: "{{_('Subject')}}", value: "subject", width:50, sortable: false }, + { title: "{{_('Affected Item')}}", value: "subject", width:50, sortable: false }, { title: "{{_('Class')}}", value: "model", width:100, sortable: false }, { title: "{{_('Details')}}", value: "details", width:200, sortable: false }, ], diff --git a/enferno/admin/templates/admin/actors.html b/enferno/admin/templates/admin/actors.html index 79e2c88d3..368d80484 100644 --- a/enferno/admin/templates/admin/actors.html +++ b/enferno/admin/templates/admin/actors.html @@ -369,6 +369,7 @@ + @@ -1698,6 +1699,7 @@ app.component('EventsSection', EventsSection); app.component('ReadMore', ReadMore); app.component('FieldRenderer', FieldRenderer); + app.component('Asterisk', Asterisk); app.component('RelatedBulletinsCard', RelatedBulletinsCard); app.component('RelatedActorsCard', RelatedActorsCard); diff --git a/enferno/admin/templates/admin/bulletins.html b/enferno/admin/templates/admin/bulletins.html index ce7d7446b..ca50708a8 100644 --- a/enferno/admin/templates/admin/bulletins.html +++ b/enferno/admin/templates/admin/bulletins.html @@ -433,6 +433,7 @@ + @@ -1758,6 +1759,7 @@ app.component('IdNumberDynamicField', IdNumberDynamicField); app.component('EventsSection', EventsSection); app.component('FieldRenderer', FieldRenderer); + app.component('Asterisk', Asterisk); app.use(router).use(vuetify); router.isReady().then(() => { diff --git a/enferno/admin/templates/admin/component-data.html b/enferno/admin/templates/admin/component-data.html index c98dacd45..42b3a64ed 100644 --- a/enferno/admin/templates/admin/component-data.html +++ b/enferno/admin/templates/admin/component-data.html @@ -29,7 +29,7 @@

{{ _('Component Data Management') }}

{{ _('Full Location text format') }} + load-endpoint="/admin/api/location-types/?per_page=1000" + :required-fields="['title']" + >
@@ -110,7 +112,7 @@

{{ _('Full Location text format') }} + load-endpoint="/admin/api/countries/?per_page=1000" :required-fields="['title']"> @@ -118,7 +120,7 @@

{{ _('Full Location text format') }} + load-endpoint="/admin/api/ethnographies/?per_page=1000" :required-fields="['title']"> @@ -126,7 +128,7 @@

{{ _('Full Location text format') }} + load-endpoint="/admin/api/dialects/?per_page=1000" :required-fields="['title']"> @@ -146,6 +148,7 @@

{{ _('Full Location text format') }} @@ -154,6 +157,7 @@

{{ _('Full Location text format') }}
@@ -162,6 +166,7 @@

{{ _('Full Location text format') }}
@@ -170,6 +175,7 @@

{{ _('Full Location text format') }}
@@ -178,6 +184,7 @@

{{ _('Full Location text format') }}
@@ -186,6 +193,7 @@

{{ _('Full Location text format') }}
@@ -196,6 +204,7 @@

{{ _('Full Location text format') }}
@@ -205,6 +214,7 @@

{{ _('Full Location text format') }}
@@ -222,6 +232,7 @@

{{ _('Full Location text format') }}
@@ -242,6 +253,7 @@

{{ _('Full Location text format') }}
@@ -250,6 +262,7 @@

{{ _('Full Location text format') }}
@@ -275,6 +288,7 @@

{{ _('Full Location text format') }} {% endif %} + @@ -290,17 +304,12 @@

{{ _('Full Location text format') }} delimiters: delimiters, mixins: [globalMixin], mounted() { - this.setInitialTabStateKey() + // Initialize tabs from URL on first load + this.syncTabsFromHash(); - this.$router.afterEach((to) => { - const [main, child] = to.hash.slice(1).split('/'); - - const mainKey = main && main in this.tabsMap ? main : Object.keys(this.tabsMap)[0]; - const nested = this.tabsMap[mainKey]?.nestedTabsMap || {}; - const childKey = child && child in nested ? child : Object.keys(nested)[0] || null; - - this.tabState.main = mainKey; - this.tabState.child = Object.keys(nested).length ? childKey : null; + // Update tabs when user navigates (back/forward buttons) + this.$router.afterEach(() => { + this.syncTabsFromHash(); }); }, data() { @@ -385,21 +394,16 @@

{{ _('Full Location text format') }} }, deep: true }, - 'tabState.main'(mainKey) { - const nested = this.tabsMap?.[mainKey]?.nestedTabsMap; - - this.tabState.main = mainKey; - this.tabState.child = nested - ? nested[this.tabState.child] - ? this.tabState.child - : Object.keys(nested)[0] - : null; - - this.updateHash(); + 'tabState.main'(newVal, oldVal) { + // Only update hash if change came from user interaction (not from syncTabsFromHash) + if (oldVal !== null) { + this.updateHashFromTabs(); + } }, - - 'tabState.child'() { - this.updateHash(); + 'tabState.child'(newVal, oldVal) { + if (oldVal !== null) { + this.updateHashFromTabs(); + } } }, @@ -422,23 +426,6 @@

{{ _('Full Location text format') }} return [...base, ...(fieldMaps[type] || customFields), { title: "{{ _('Actions') }}", value: 'actions', align: 'end' }]; }, - updateHash() { - const { main, child } = this.tabState; - const hash = [main, child].filter(Boolean).join('/'); - this.$router.push({ name: 'component-data', hash: `#${hash}` }); - }, - setInitialTabStateKey() { - const main = this.tabState.main || Object.keys(this.tabsMap)[0]; - const nested = this.tabsMap[main]?.nestedTabsMap || {}; - const child = this.tabState.child || Object.keys(nested)[0] || null; - - const hash = [main, child].filter(Boolean).join('/'); - - this.$router.replace({ - name: 'component-data', - hash: `#${hash}` - }); - }, onDragEnd() { if (this.isOrderChanged) { this.showLalWarning = true; @@ -475,11 +462,38 @@

{{ _('Full Location text format') }} this.$root.showSnack(response.data); this.showLalWarning = false; }); - } + }, + updateHashFromTabs() { + const { main, child } = this.tabState; + const hash = [main, child].filter(Boolean).join('/'); + + // Only push if hash actually changed + if (this.$route.hash !== `#${hash}`) { + this.$router.push({ + name: 'component-data', + hash: `#${hash}` + }); + } + }, + syncTabsFromHash() { + const hash = this.$route.hash.slice(1); // Remove '#' + const [main, child] = hash ? hash.split('/') : []; + + // Validate and set main tab + const mainKey = main && main in this.tabsMap ? main : Object.keys(this.tabsMap)[0]; + + // Validate and set child tab + const nested = this.tabsMap[mainKey]?.nestedTabsMap || {}; + const childKey = child && child in nested ? child : Object.keys(nested)[0] || null; + + this.tabState.main = mainKey; + this.tabState.child = childKey; + }, } }); app.component('EditableTable', EditableTable); app.component('Draggable', draggable); + app.component('Asterisk', Asterisk); app.use(router).use(vuetify).mount('#app'); {% endblock %} \ No newline at end of file diff --git a/enferno/admin/templates/admin/eventtypes.html b/enferno/admin/templates/admin/eventtypes.html index e98aabb79..3c60fdb2c 100644 --- a/enferno/admin/templates/admin/eventtypes.html +++ b/enferno/admin/templates/admin/eventtypes.html @@ -38,73 +38,72 @@ - ${ formTitle } - - - - - - - - - - - - - - - - - - - - - - - + + + - - - - + + + + + + + - - - + + + + - - - {{ _('Cancel') }} - {{ _('Save') }} - + + + + + + + + + + + + + + + + + + + + {{ _('Cancel') }} + {{ _('Save') }} + + @@ -186,6 +185,7 @@ {% endblock %} {% block js %} + -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/enferno/admin/templates/admin/incidents.html b/enferno/admin/templates/admin/incidents.html index 27d7d4af6..e196e2f64 100644 --- a/enferno/admin/templates/admin/incidents.html +++ b/enferno/admin/templates/admin/incidents.html @@ -354,6 +354,7 @@ + @@ -1556,6 +1557,7 @@ app.component('RelationEditorCard', RelationEditorCard); app.component('EventsSection', EventsSection); app.component('FieldRenderer', FieldRenderer); + app.component('Asterisk', Asterisk); app.use(router).use(vuetify); router.isReady().then(() => { diff --git a/enferno/admin/templates/admin/jsapi.jinja2 b/enferno/admin/templates/admin/jsapi.jinja2 index 348f0aa90..3d26e2624 100644 --- a/enferno/admin/templates/admin/jsapi.jinja2 +++ b/enferno/admin/templates/admin/jsapi.jinja2 @@ -40,6 +40,7 @@ markFieldAsRequired_: "{{ _('Make the field required') }}", markFieldAsSearchable_: "{{ _('Make the field searchable') }}", showField_: "{{ _('Show Field') }}", hideField_: "{{ _('Hide Field') }}", +requiredFields_: "{{ _('Required fields') }}", showOption_: "{{ _('Show Option') }}", hideOption_: "{{ _('Hide Option') }}", deleteField_: "{{ _('Delete Field') }}", @@ -118,9 +119,10 @@ to_: "{{ _('To') }}", comments_: "{{ _('Comments') }}", commentsAr_: "{{ _('Comments (Ar)') }}", status_: "{{ _('Status') }}", -restrictToAccessGroups_: "{{ _('Restrict Actor to Access Group(s)') }}", +restrictActorToAccessGroups_: "{{ _('Restrict Actor to Access Group(s)') }}", noAccessAccessGroups_: "{{ _('No Access Access Groups') }}", profile_: "{{ _('Profile') }}", +location_: "{{ _('Location') }}", showMore_: "{{ _('Show more') }}", showLess_: "{{ _('Show less') }}", diff --git a/enferno/admin/templates/admin/labels.html b/enferno/admin/templates/admin/labels.html index a8e57061f..63ed63a51 100644 --- a/enferno/admin/templates/admin/labels.html +++ b/enferno/admin/templates/admin/labels.html @@ -49,122 +49,119 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ _('Cancel') }} - {{ _('Save') }} - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ _('Cancel') }} + {{ _('Save') }} + + @@ -252,6 +249,7 @@ {% endblock %} {% block js %} + -{% endblock %} +{% endblock %} \ No newline at end of file diff --git a/enferno/admin/templates/admin/locations.html b/enferno/admin/templates/admin/locations.html index e6d6029fb..598f60718 100644 --- a/enferno/admin/templates/admin/locations.html +++ b/enferno/admin/templates/admin/locations.html @@ -159,6 +159,7 @@ + {% if config.GOOGLE_MAPS_API_KEY %} {{ ''|safe }} @@ -544,6 +545,7 @@ app.component('GeoMap', GeoMap); app.component('GlobalMap', GlobalMap); app.component('ReadMore', ReadMore); + app.component('Asterisk', Asterisk); app.use(router).use(vuetify).mount('#app'); {% endblock %} diff --git a/enferno/admin/templates/admin/partials/actor_dialog.html b/enferno/admin/templates/admin/partials/actor_dialog.html index 6d524b4f8..0c4958898 100644 --- a/enferno/admin/templates/admin/partials/actor_dialog.html +++ b/enferno/admin/templates/admin/partials/actor_dialog.html @@ -54,29 +54,31 @@ + > + + +

+ > + + +
+ > + + +
+ > + +
+ > + +