lib/gitdocs/views/settings.haml
- @title = 'Settings'
%script{ src: '/js/settings.js', type: 'text/javascript', charset: 'utf-8' }
%form#settings{ method: 'POST', action: url('/') }
%h2 Gitdocs
.field.config#config
%dl
%dt Web Frontend Host
%dd
%input{ type: 'input', name: 'config[web_frontend_host]', value: Gitdocs::Configuration.web_frontend_host }
%dt Web Frontend Port
%dd
%input{ type: 'input', name: 'config[web_frontend_port]', value: Gitdocs::Configuration.web_frontend_port }
%h2 Shares
- Gitdocs::Share.all.each_with_index do |share, idx|
.share{ id: "share-#{idx}", class: idx.even? ? 'even' : 'odd' }
%dl
%dt Path
%dd
%input.path{ name: "share[#{idx}][path]", value: share.path }
%dl
%dt Polling interval
%dd
%input{ name: "share[#{idx}][polling_interval]", value: share.polling_interval }
%dl
%dt Sync Type
%dd
%select{ name: "share[#{idx}][sync_type]" }
%option{ value: 'full', selected: (share.sync_type == 'full' ? 'selected' : nil) }
Full
%option{ value: 'fetch', selected: (share.sync_type == 'fetch' ? 'selected' : nil) }
Fetch only
- if Gitdocs::Repository.new(share).available_remotes
%dl
%dt Remote
%dd
%select{ name: "share[#{idx}][remote_branch]" }
- Gitdocs::Repository.new(share).available_remotes.each do |remote|
%option{ value: remote, selected: remote == "#{share.remote_name}/#{share.branch_name}" ? 'selected' : nil }
= remote
- else
%dl
%dt Remote
%dd
%input{ name: "share[#{idx}][remote_name]", value: share.remote_name }
%dl
%dt Branch
%dd
%input{ name: "share[#{idx}][branch_name]", value: share.branch_name }
.notify.field
%input{ type: 'hidden', value: '0', name: "share[#{idx}][notification]" }
%input{ type: 'checkbox', value: '1', name: "share[#{idx}][notification]", checked: share.notification ? 'checked' : nil }
%span Notifications?
.delete
%a.remote_share.btn.danger{ href: url("/#{share.id}"), 'data-method' => 'delete' }
Delete
%input.btn.primary{ value: 'Save', type: 'submit' }