<commit_before>extends ../layout/base

include ../mixins/columns

block css
	link(rel="stylesheet", href="/keystone/js/lib/fancybox/jquery.fancybox.css")
	if list.fieldTypes.markdown
		link(rel="stylesheet", href="/keystone/js/lib/bootstrap-markdown/css/bootstrap-markdown.css")
	if list.fieldTypes.code
		link(rel="stylesheet", href="/keystone/js/lib/codemirror/codemirror.css")

block js
	script(src="/keystone/js/common/ui-fixed-toolbar.js")
	script(src="/keystone/js/lib/joseph-myers/md5.js")
	script(src="/keystone/js/lib/fancybox/jquery.fancybox.pack.js")
	script(src="/keystone/js/lib/html5sortable/jquery.sortable.js")
	if list.fieldTypes.location
		script(src="/keystone/js/common/ui-location.js")
	if list.fieldTypes.cloudinaryimage
		script(src="/keystone/js/common/ui-cloudinaryimage.js")
	if list.fieldTypes.cloudinaryimages
		script(src="/keystone/js/common/ui-cloudinaryimages.js")
	if list.fieldTypes.s3file
		script(src="/keystone/js/common/ui-s3file.js")
	if list.fieldTypes.azurefile
		script(src="/keystone/js/common/ui-azurefile.js")
	if list.fieldTypes.localfile
		script(src="/keystone/js/common/ui-localfile.js")
	if list.fieldTypes.localfiles
		script(src="/keystone/js/common/ui-localfiles.js")
	if list.fieldTypes.markdown
		script(src='/keystone/js/lib/marked/marked.js')
		script(src='/keystone/js/lib/bootstrap-markdown/js/bootstrap-markdown.js')
		script(src="/keystone/js/common/ui-markdown.js")
	if list.fieldTypes.code
		script(src="/keystone/js/common/ui-code.js")
		script(src='/keystone/js/lib/codemirror/codemirror-compressed.js')
	if list.fieldTypes.wysiwyg
		script(src='/keystone/js/lib/tinymce/tinymce.min.js')
		script(src='/keystone/js/lib/tinymce/jquery.tinymce.min.js')
		script(src="/keystone/js/common/ui-wysiwyg.js")
	
	script(src='/keystone/js/views/item.js')
	script.
		Keystone.list = { path: "#{list.path}" };
		Keystone.item = { id: "#{item.id}" };
		Keystone.wysiwyg = { options: !{JSON.stringify(wysiwygOptions)} };

block intro
	.item-toolbar.item-toolbar--header
		ul.item-breadcrumbs
			li: a(href=js, title='Search #{list.plural}').js-itemsearch-open: span.ion-search
			if drilldown && drilldown.items.length
				each d in drilldown.items
					if d.items
						li
							each di, i in d.items
								a(href=di.href, title=d.list.singular)= di.label
								if i < d.items.length - 1
									span , 
						if d.more
							li: span  ... 
					else
						li: a(href=d.href, title=d.list.singular) #{d.label}
				li
					a(href='/keystone/' + list.path, title='Back to ' + list.plural) #{list.label}
			else
				li: a(href='/keystone/' + list.path, title='Back to ' + list.plural)
					span.mr-5.ion-arrow-left-c
					= list.plural
		.searchbox
			form(method='get', action='/keystone/' + list.path).form-inline.searchbox-form
				.searchbox-field: input(type='search', name='search', placeholder='Search #{list.plural}').form-control.searchbox-input
				.searchbox-button: button(type='submit').btn.btn-default.searchbox-submit Search
				button(type='button').btn.btn-link.btn-cancel.js-itemsearch-close Cancel
		ul.item-toolbar-info
			if list.autokey && item.get(list.autokey.path)
				li(data-alt-text='id: ' + item.id) #{list.autokey.path}: #{item.get(list.autokey.path)}
			else
				li id: #{item.id}
			if !list.options.nocreate
				li: a(href='/keystone/#{list.path}?new' + csrf_query)
					span.mr-5.ion-plus
					| New #{list.singular}
			
block content
	form(method='post', enctype='multipart/form-data').item-details
		
		input(type='hidden', name='action', value='updateItem')
		input(type='hidden', name=csrf_token_key, value=csrf_token_value)
		
		- var nameField = list.nameField, nameIsEditable = list.nameIsEditable;
		
		.field.item-name: .col-sm-12
			if nameIsEditable
				input(type='text', name=list.nameField.path, value=item.get(list.nameField.path)).form-control.input-lg
				if list.nameField.note
					.field-note !{list.nameField.note}
			else if nameField
				h2.form-heading.name-value= list.nameField.format(item) || '(no name)'
			else
				h2.form-heading.name-value= item.get(list.namePath) || '(no name)'
		
		if list.tracking
			- var meta_createdAt, meta_createdBy, meta_updatedAt, meta_updatedBy
			.item-details-meta
				if list.tracking.createdAt
					- meta_createdAt = item.get(list.tracking.createdAt)
					if (meta_createdAt)
						.item-details-meta-item
							span.item-details-meta-label Created
							span.item-details-meta-info= moment(meta_createdAt).format('Do MMM YY h:MM:SSa')
				if list.tracking.createdBy
					- meta_createdBy = item.get(list.tracking.createdBy)
					if meta_createdBy
						.item-details-meta-item
							span.item-details-meta-label= meta_createdAt ? 'by' : 'Created by'
							span.item-details-meta-info: a(href='/keystone/' + User.path + '/' + meta_createdBy.id)= User.getDocumentName(meta_createdBy)
				if list.tracking.updatedAt
					- meta_updatedAt = item.get(list.tracking.updatedAt)
					if meta_updatedAt && (!meta_createdAt || meta_createdAt.getTime() !== meta_updatedAt.getTime())
						.item-details-meta-item
							span.item-details-meta-label Updated
							span.item-details-meta-info= moment(meta_updatedAt).format('Do MMM YY h:MM:SSa')
					else
						- meta_updatedAt = false
				if list.tracking.updatedBy
					- meta_updatedBy = item.get(list.tracking.updatedBy)
					if meta_updatedBy && (!meta_createdBy || meta_createdBy.id !== meta_updatedBy.id || meta_updatedAt)
						.item-details-meta-item
							span.item-details-meta-label= meta_updatedAt ? 'by' : 'Updated by'
							span.item-details-meta-info: a(href='/keystone/' + User.path + '/' + meta_updatedBy.id)= User.getDocumentName(meta_updatedBy)
		<commit_msg>bugfix for issue #702<commit_after>extends ../layout/base

include ../mixins/columns

block css
	link(rel="stylesheet", href="/keystone/js/lib/fancybox/jquery.fancybox.css")
	if list.fieldTypes.markdown
		link(rel="stylesheet", href="/keystone/js/lib/bootstrap-markdown/css/bootstrap-markdown.css")
	if list.fieldTypes.code
		link(rel="stylesheet", href="/keystone/js/lib/codemirror/codemirror.css")

block js
	script(src="/keystone/js/common/ui-fixed-toolbar.js")
	script(src="/keystone/js/lib/joseph-myers/md5.js")
	script(src="/keystone/js/lib/fancybox/jquery.fancybox.pack.js")
	script(src="/keystone/js/lib/html5sortable/jquery.sortable.js")
	if list.fieldTypes.location
		script(src="/keystone/js/common/ui-location.js")
	if list.fieldTypes.cloudinaryimage
		script(src="/keystone/js/common/ui-cloudinaryimage.js")
	if list.fieldTypes.cloudinaryimages
		script(src="/keystone/js/common/ui-cloudinaryimages.js")
	if list.fieldTypes.s3file
		script(src="/keystone/js/common/ui-s3file.js")
	if list.fieldTypes.azurefile
		script(src="/keystone/js/common/ui-azurefile.js")
	if list.fieldTypes.localfile
		script(src="/keystone/js/common/ui-localfile.js")
	if list.fieldTypes.localfiles
		script(src="/keystone/js/common/ui-localfiles.js")
	if list.fieldTypes.markdown
		script(src='/keystone/js/lib/marked/marked.js')
		script(src='/keystone/js/lib/bootstrap-markdown/js/bootstrap-markdown.js')
		script(src="/keystone/js/common/ui-markdown.js")
	if list.fieldTypes.code
		script(src="/keystone/js/common/ui-code.js")
		script(src='/keystone/js/lib/codemirror/codemirror-compressed.js')
	if list.fieldTypes.wysiwyg
		script(src='/keystone/js/lib/tinymce/tinymce.min.js')
		script(src='/keystone/js/lib/tinymce/jquery.tinymce.min.js')
		script(src="/keystone/js/common/ui-wysiwyg.js")
	
	script(src='/keystone/js/views/item.js')
	script.
		Keystone.list = { path: "#{list.path}" };
		Keystone.item = { id: "#{item.id}" };
		Keystone.wysiwyg = { options: !{JSON.stringify(wysiwygOptions)} };

block intro
	.item-toolbar.item-toolbar--header
		ul.item-breadcrumbs
			li: a(href=js, title='Search #{list.plural}').js-itemsearch-open: span.ion-search
			if drilldown && drilldown.items.length
				each d in drilldown.items
					if d.items
						li
							each di, i in d.items
								a(href=di.href, title=d.list.singular)= di.label
								if i < d.items.length - 1
									span , 
						if d.more
							li: span  ... 
					else
						li: a(href=d.href, title=d.list.singular) #{d.label}
				li
					a(href='/keystone/' + list.path, title='Back to ' + list.plural) #{list.label}
			else
				li: a(href='/keystone/' + list.path, title='Back to ' + list.plural)
					span.mr-5.ion-arrow-left-c
					= list.plural
		.searchbox
			form(method='get', action='/keystone/' + list.path).form-inline.searchbox-form
				.searchbox-field: input(type='search', name='search', placeholder='Search #{list.plural}').form-control.searchbox-input
				.searchbox-button: button(type='submit').btn.btn-default.searchbox-submit Search
				button(type='button').btn.btn-link.btn-cancel.js-itemsearch-close Cancel
		ul.item-toolbar-info
			if list.autokey && item.get(list.autokey.path)
				li(data-alt-text='id: ' + item.id) #{list.autokey.path}: #{item.get(list.autokey.path)}
			else
				li id: #{item.id}
			if !list.options.nocreate
				li: a(href='/keystone/#{list.path}?new' + csrf_query)
					span.mr-5.ion-plus
					| New #{list.singular}
			
block content
	form(method='post', enctype='multipart/form-data').item-details
		
		input(type='hidden', name='action', value='updateItem')
		input(type='hidden', name=csrf_token_key, value=csrf_token_value)
		
		- var nameField = list.nameField, nameIsEditable = list.nameIsEditable;
		
		.field.item-name: .col-sm-12
			if nameIsEditable
				input(type='text', name=list.nameField.path, value=item.get(list.nameField.path)).form-control.input-lg
				if list.nameField.note
					.field-note !{list.nameField.note}
			else if nameField
				h2.form-heading.name-value= list.nameField.format(item) || '(no name)'
			else
				h2.form-heading.name-value= item.get(list.namePath) || '(no name)'
		
		if list.tracking
			- var meta_createdAt, meta_createdBy, meta_updatedAt, meta_updatedBy
			.item-details-meta
				if list.tracking.createdAt
					- meta_createdAt = item.get(list.tracking.createdAt)
					if (meta_createdAt)
						.item-details-meta-item
							span.item-details-meta-label Created
							span.item-details-meta-info= moment(meta_createdAt).format('Do MMM YY h:mm:ssa')
				if list.tracking.createdBy
					- meta_createdBy = item.get(list.tracking.createdBy)
					if meta_createdBy
						.item-details-meta-item
							span.item-details-meta-label= meta_createdAt ? 'by' : 'Created by'
							span.item-details-meta-info: a(href='/keystone/' + User.path + '/' + meta_createdBy.id)= User.getDocumentName(meta_createdBy)
				if list.tracking.updatedAt
					- meta_updatedAt = item.get(list.tracking.updatedAt)
					if meta_updatedAt && (!meta_createdAt || meta_createdAt.getTime() !== meta_updatedAt.getTime())
						.item-details-meta-item
							span.item-details-meta-label Updated
							span.item-details-meta-info= moment(meta_updatedAt).format('Do MMM YY h:mm:ssa')
					else
						- meta_updatedAt = false
				if list.tracking.updatedBy
					- meta_updatedBy = item.get(list.tracking.updatedBy)
					if meta_updatedBy && (!meta_createdBy || meta_createdBy.id !== meta_updatedBy.id || meta_updatedAt)
						.item-details-meta-item
							span.item-details-meta-label= meta_updatedAt ? 'by' : 'Updated by'
							span.item-details-meta-info: a(href='/keystone/' + User.path + '/' + meta_updatedBy.id)= User.getDocumentName(meta_updatedBy)
		
{'fraction_non_alphanumeric': 0.15913089373680506, 'fraction_numerical': 0.002199155524278677, 'mean_word_length': 3.6940545004128817, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5293191', 'n_tokens_mistral': 4808, 'n_tokens_neox': 4070, 'n_words': 557}