extends vibelog.admin.layout

block vibelog.title
	- title = "Edit configuration '"~info.config.name~"'";

block vibelog-localnav
	ul.admin-local-nav
		li
			a(href="../") Back to config list

block vibelog-content
	form(action="./", method="POST")
		- import std.array;
		- if( info.config.name == "global" )
			p
				label(for="categories") Categories
				br
				textarea(name="categories", rows="10", cols="40")= join(info.config.categories, "\n")
		- else
			p Categories
			p
				- foreach( grp; info.globalConfig.categories )
					- if( info.config.hasCategory(grp) )
						input(type="checkbox", name="category_#{grp}", value="1", checked)
					- else
						input(type="checkbox", name="category_#{grp}", value="1")
					label(for="category_#{grp}")= grp
					br

		p
			label(for="language") Language
			input(type="text", name="language", value="#{info.config.language}")

		p
			label(for="copyrightString") Copyright String
			input(type="text", name="copyrightString", value="#{info.config.copyrightString}")

		p
			label(for="feedTitle") Feed title
			input(type="text", name="feedTitle", value="#{info.config.feedTitle}")

		p
			label(for="feedLink") Feed link
			input(type="url", name="feedLink", value="#{info.config.feedLink}")

		p
			label(for="feedDescription") Feed description
			input(type="text", name="feedDescription", value="#{info.config.feedDescription}")

		p
			label(for="feedImageTitle") Feed image title
			input(type="text", name="feedImageTitle", value="#{info.config.feedImageTitle}")

		p
			label(for="feedImageUrl") Feed image URL
			input(type="url", name="feedImageUrl", value="#{info.config.feedImageUrl}")

		input(type="submit", value="Apply changes")
