Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require(["app", "underscore", "handlebars", "core/UIManager", "helpers/file", "helpers/status", "helpers/string", "core/t", "moment"], function(e, t, n, i, o, r, a, s, l) {
- function c() {
- return e.PATH
- }
- function u(e, t, o) {
- // Set extra z var
- var r, a, z;
- z = '';
- if (e.structure && (r = e.structure.get(t)), r && (r.isOneToMany() || r.isManyToMany())) {
- // Get item value from all items and build a string
- for (ia = 0; ia < e.attributes[t].models.length; ia++) {
- if (e.attributes[t].models[ia].attributes.data.attributes.system_title !== undefined) {
- z += e.attributes[t].models[ia].attributes.data.attributes.system_title;
- }
- if (e.attributes[t].models.length !== ia+1 && z.length > 0){
- z += ', ';
- }
- }
- var l = e.get(t).length,
- c = "item",
- u = "multiple";
- "directus_files" === r.getRelatedTableName() && (c = "file"), 1 === l && (u = "single"),
- a = s("relational_count_x_" + c + "_" + u, {
- count: l
- }
- )
- // If the string contains something, replace the item count with it
- if(z !== 'undefined' && z.length > 0){
- a = z
- }
- } else e.isNested && (e = e.get("data")), a = i.getList(e, t) || '<span class="no-value">--</span>';
- return new n.SafeString(a)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement