Sha256: e20f91a0381bc5287cf339e8265394b30551e0f7aa28414221e45b5bc0b70741

Contents?: true

Size: 2 KB

Versions: 1

Compression:

Stored size: 2 KB

Contents

- @title = "Settings"
%script{ :src => "/js/settings.js", :type => "text/javascript", :charset => "utf-8" }

%form#settings{:method => 'POST', :action => '/settings'}
  %h2 Gitdocs
  #config.field.config
    %dl
      %dt Web Frontend Port
      %dd
        %input{:type =>'input', :name=>"config[web_frontend_port]", :value => conf.global.web_frontend_port }
  %h2 Shares
  - conf.shares.each_with_index do |share, idx|
    %div{:id => "share-#{idx}", :class => "share #{idx % 2 == 0 ? 'even' : 'odd'}"}
      %dl
        %dt Path
        %dd
          %input{:name=>"share[#{idx}][path]", :value => share.path, :class => "path" }
      %dl
        %dt Polling interval
        %dd
          %input{:name=>"share[#{idx}][polling_interval]", :value => share.polling_interval}

      - 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{ :href => "/shares/#{share.id}", :class => "btn remove_share danger", :"data-method" => "delete"}
          Delete

  %input{:value => 'Save', :type => 'submit', :class => "btn primary" }
  %a{ :class => "btn secondary new-share", :href => "/shares", :"data-method" => "post" } Add Share

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gitdocs-0.5.0.pre6 lib/gitdocs/views/settings.haml