Commit 15b06b01 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Bootstrap: Deploy keys, Hooks

parent 089dca4d
%div %div
= form_for [@project, @key], :url => project_deploy_keys_path do |f| = form_for [@project, @key], :url => project_deploy_keys_path do |f|
-if @key.errors.any? -if @key.errors.any?
%ul.errors_holder .alert-message.block-message.error
%ul
- @key.errors.full_messages.each do |msg| - @key.errors.full_messages.each do |msg|
%li= msg %li= msg
%table.no-borders .clearfix
%tr = f.label :title
%td= f.label :title .input= f.text_field :title
%td= f.text_field :title, :style => "width:300px" .clearfix
%tr = f.label :key
%td= f.label :key .input= f.text_area :key, :class => "xlarge"
%td= f.text_area :key, :style => "width:300px; height:130px" .actions
%br
.merge-tabs
= f.submit 'Save', :class => "primary btn" = f.submit 'Save', :class => "primary btn"
= link_to "Cancel", project_deploy_keys_path(@project), :class => "btn"
= render "repositories/head" = render "repositories/head"
- if can? current_user, :admin_project, @project
.alert-message.block-message.info
Deploy keys allow read-only access to repository.
= link_to new_project_deploy_key_path(@project), :class => "btn small", :title => "New Deploy Key" do
Add Deploy Key
%div#keys-table{ :class => "update-data ui-box ui-box-small ui-box-big" } %ul.unstyled
.data
- @keys.each do |key| - @keys.each do |key|
= render(:partial => 'show', :locals => {:key => key}) %li= render(:partial => 'show', :locals => {:key => key})
- if @keys.blank?
.notice_holder
%li Deploy Keys do not exist yet.
- if can? current_user, :admin_project, @project
%li You can add a new one by clicking on "Add New" button
:javascript
$('.delete-key').live('ajax:success', function() {
$(this).closest('.update-item').fadeOut(); });
.ui-box.width-100p = render "repositories/head"
%h3= @key.title %h3= @key.title
.data %hr
%pre= @key.key %pre= @key.key
.actions
= link_to 'Remove', project_deploy_key_path(@key.project, @key), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn delete-key"
.clear .clear
.buttons
= link_to 'Remove', project_deploy_key_path(@key.project, @key), :confirm => 'Are you sure?', :method => :delete, :class => "red-button delete-key right"
.clear
= render "repositories/head" = render "repositories/head"
- unless @hooks.empty?
%div.update-data.ui-box.ui-box-small - if can? current_user, :admin_project, @project
.data .alert-message.block-message.info
Post receive hooks for binding events when someone push to repository.
= link_to new_project_hook_path(@project), :class => "btn small", :title => "New Web Hook" do
Add Post Receive Hook
%ul.unstyled
- @hooks.each do |hook| - @hooks.each do |hook|
%li
%a.update-item{:href => project_hook_path(@project, hook)} %a.update-item{:href => project_hook_path(@project, hook)}
%span.update-title{:style => "margin-bottom:0px;"}
= hook.url = hook.url
%span.update-author.right
Added
= time_ago_in_words(hook.created_at)
ago
- else
%h3 No hooks
.clear .alert-message.block-message.info
%hr We send some data with POST request when someone makes git push
%p
Post receive hooks. For now only POST request allowed. We send some data with request. Example below
.view_file .well= render "data_ex"
.view_file_header
%strong POST data passed
.data.no-padding
= render "data_ex"
= render "repositories/head" = render "repositories/head"
%h3 %pre= @hook.url
%span.commit.tag POST
= @hook.url
- if can? current_user, :admin_project, @project - if can? current_user, :admin_project, @project
.merge-tabs .actions
= link_to 'Test Hook', test_project_hook_path(@project, @hook), :class => "grey-button" = link_to 'Test Hook', test_project_hook_path(@project, @hook), :class => "btn"
.right = link_to 'Remove', project_hook_path(@project, @hook), :confirm => 'Are you sure?', :method => :delete, :class => "danger btn"
= link_to 'Remove', project_hook_path(@project, @hook), :confirm => 'Are you sure?', :method => :delete, :class => "red-button"
.top-tabs.repository %ul.tabs
= link_to project_repository_path(@project), :class => "activities-tab tab #{'active' if current_page?(project_repository_path(@project)) }" do %li{:class => "#{'active' if current_page?(project_repository_path(@project)) }"}
= link_to project_repository_path(@project) do
%span %span
Activities Activities
= link_to branches_project_repository_path(@project), :class => "tab #{'active' if current_page?(branches_project_repository_path(@project)) }" do %li{:class => "#{'active' if current_page?(branches_project_repository_path(@project)) }"}
= link_to branches_project_repository_path(@project) do
%span %span
Branches Branches
= link_to tags_project_repository_path(@project), :class => "tab #{'active' if current_page?(tags_project_repository_path(@project)) }" do %li{:class => "#{'active' if current_page?(tags_project_repository_path(@project)) }"}
= link_to tags_project_repository_path(@project) do
%span %span
Tags Tags
= link_to project_hooks_path, :class => "tab #{'active' if controller.controller_name == "hooks" }" do %li{:class => "#{'active' if controller.controller_name == "hooks" }"}
= link_to project_hooks_path do
%span %span
Hooks Hooks
%li{:class => "#{'active' if controller.controller_name == "deploy_keys"}"}
- if can? current_user, :admin_project, @project - if can? current_user, :admin_project, @project
= link_to project_deploy_keys_path(@project), :class => "tab #{'active' if controller.controller_name == "deploy_keys"}" do = link_to project_deploy_keys_path(@project) do
%span %span
Deploy Keys Deploy Keys
- if current_page?(project_hooks_path(@project))
- if can? current_user, :admin_project, @project
= link_to new_project_hook_path(@project), :class => "add_new", :title => "New Web Hook" do
Add new
- if current_page?(project_deploy_keys_path(@project))
- if can? current_user, :admin_project, @project
= link_to new_project_deploy_key_path(@project), :class => "add_new", :title => "New Deploy Key" do
Add new
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment