diff options
Diffstat (limited to 'app/views/ci/projects')
-rw-r--r-- | app/views/ci/projects/_form.html.haml | 101 | ||||
-rw-r--r-- | app/views/ci/projects/_gl_projects.html.haml | 15 | ||||
-rw-r--r-- | app/views/ci/projects/_info.html.haml | 2 | ||||
-rw-r--r-- | app/views/ci/projects/_no_runners.html.haml | 8 | ||||
-rw-r--r-- | app/views/ci/projects/_project.html.haml | 22 | ||||
-rw-r--r-- | app/views/ci/projects/_public.html.haml | 21 | ||||
-rw-r--r-- | app/views/ci/projects/_search.html.haml | 17 | ||||
-rw-r--r-- | app/views/ci/projects/edit.html.haml | 21 | ||||
-rw-r--r-- | app/views/ci/projects/gitlab.html.haml | 27 | ||||
-rw-r--r-- | app/views/ci/projects/index.html.haml | 13 | ||||
-rw-r--r-- | app/views/ci/projects/show.html.haml | 60 |
11 files changed, 307 insertions, 0 deletions
diff --git a/app/views/ci/projects/_form.html.haml b/app/views/ci/projects/_form.html.haml new file mode 100644 index 00000000000..d50e1a83b06 --- /dev/null +++ b/app/views/ci/projects/_form.html.haml @@ -0,0 +1,101 @@ +.bs-callout.help-callout + %p + If you want to test your .gitlab-ci.yml, you can use special tool - #{link_to "Lint", ci_lint_path} + %p + Edit your + #{link_to ".gitlab-ci.yml using web-editor", yaml_web_editor_link(@project)} + += nested_form_for [:ci, @project], html: { class: 'form-horizontal' } do |f| + - if @project.errors.any? + #error_explanation + %p.lead= "#{pluralize(@project.errors.count, "error")} prohibited this project from being saved:" + .alert.alert-error + %ul + - @project.errors.full_messages.each do |msg| + %li= msg + + %fieldset + %legend Build settings + .form-group + = label_tag nil, class: 'control-label' do + Get code + .col-sm-10 + %p Get recent application code using the following command: + .radio + = label_tag do + = f.radio_button :allow_git_fetch, 'false' + %strong git clone + .light Slower but makes sure you have a clean dir before every build + .radio + = label_tag do + = f.radio_button :allow_git_fetch, 'true' + %strong git fetch + .light Faster + .form-group + = f.label :timeout_in_minutes, 'Timeout', class: 'control-label' + .col-sm-10 + = f.number_field :timeout_in_minutes, class: 'form-control', min: '0' + .light per build in minutes + + + %fieldset + %legend Build Schedule + .form-group + = f.label :always_build, 'Schedule build', class: 'control-label' + .col-sm-10 + .checkbox + = f.label :always_build do + = f.check_box :always_build + %span.light Repeat last build after X hours if no builds + .form-group + = f.label :polling_interval, "Build interval", class: 'control-label' + .col-sm-10 + = f.number_field :polling_interval, placeholder: '5', min: '0', class: 'form-control' + .light In hours + + %fieldset + %legend Project settings + .form-group + = f.label :default_ref, "Make tabs for the following branches", class: 'control-label' + .col-sm-10 + = f.text_field :default_ref, class: 'form-control', placeholder: 'master, stable' + .light You will be able to filter builds by the following branches + .form-group + = f.label :public, 'Public mode', class: 'control-label' + .col-sm-10 + .checkbox + = f.label :public do + = f.check_box :public + %span.light Anyone can see project and builds + .form-group + = f.label :coverage_regex, "Test coverage parsing", class: 'control-label' + .col-sm-10 + .input-group + %span.input-group-addon / + = f.text_field :coverage_regex, class: 'form-control', placeholder: '\(\d+.\d+\%\) covered' + %span.input-group-addon / + .light We will use this regular expression to find test coverage output in build trace. Leave blank if you want to disable this feature + .bs-callout.bs-callout-info + %p Below are examples of regex for existing tools: + %ul + %li + Simplecov (Ruby) - + %code \(\d+.\d+\%\) covered + %li + pytest-cov (Python) - + %code \d+\%$ + + + + %fieldset + %legend Advanced settings + .form-group + = f.label :token, "CI token", class: 'control-label' + .col-sm-10 + = f.text_field :token, class: 'form-control', placeholder: 'xEeFCaDAB89' + + .form-actions + = f.submit 'Save changes', class: 'btn btn-save' + = link_to 'Cancel', projects_path, class: 'btn' + - unless @project.new_record? + = link_to 'Remove Project', ci_project_path(@project), method: :delete, data: { confirm: 'Project will be removed. Are you sure?' }, class: 'btn btn-danger pull-right' diff --git a/app/views/ci/projects/_gl_projects.html.haml b/app/views/ci/projects/_gl_projects.html.haml new file mode 100644 index 00000000000..7bd30b37caf --- /dev/null +++ b/app/views/ci/projects/_gl_projects.html.haml @@ -0,0 +1,15 @@ +- @gl_projects.sort_by(&:name_with_namespace).each do |project| + %tr.light + %td + = project.name_with_namespace + %td + %small Not added to CI + %td + %td + - if Ci::Project.already_added?(project) + %strong.cgreen + Added + - else + = form_tag ci_projects_path do + = hidden_field_tag :project, project.to_json(methods: [:name_with_namespace, :path_with_namespace, :ssh_url_to_repo]) + = submit_tag 'Add project to CI', class: 'btn btn-default btn-sm' diff --git a/app/views/ci/projects/_info.html.haml b/app/views/ci/projects/_info.html.haml new file mode 100644 index 00000000000..1888e1bde93 --- /dev/null +++ b/app/views/ci/projects/_info.html.haml @@ -0,0 +1,2 @@ +- if no_runners_for_project?(@project) + = render 'no_runners' diff --git a/app/views/ci/projects/_no_runners.html.haml b/app/views/ci/projects/_no_runners.html.haml new file mode 100644 index 00000000000..c0a296fb17d --- /dev/null +++ b/app/views/ci/projects/_no_runners.html.haml @@ -0,0 +1,8 @@ +.alert.alert-danger + %p + There are NO runners to build this project. + %br + You can add Specific runner for this project on Runners page + + - if current_user.is_admin + or add Shared runner for whole application in admin are. diff --git a/app/views/ci/projects/_project.html.haml b/app/views/ci/projects/_project.html.haml new file mode 100644 index 00000000000..b3ad47ce432 --- /dev/null +++ b/app/views/ci/projects/_project.html.haml @@ -0,0 +1,22 @@ +- last_commit = project.last_commit +%tr.alert{class: commit_status_alert_class(last_commit) } + %td + = link_to [:ci, project] do + %strong= project.name + %td + - if last_commit + #{last_commit.status} (#{commit_link(last_commit)}) + - if project.last_commit_date + = time_ago_in_words project.last_commit_date + ago + - else + No builds yet + %td + - if project.public + %i.fa.fa-globe + Public + - else + %i.fa.fa-lock + Private + %td + = project.commits.count diff --git a/app/views/ci/projects/_public.html.haml b/app/views/ci/projects/_public.html.haml new file mode 100644 index 00000000000..c2157ab741a --- /dev/null +++ b/app/views/ci/projects/_public.html.haml @@ -0,0 +1,21 @@ += content_for :title do + %h3.project-title + Public projects + +.bs-callout + = link_to new_ci_user_sessions_path(state: generate_oauth_state(request.fullpath)) do + %strong Login with GitLab + to see your private projects + +- if @projects.present? + .projects + %table.table + %tr + %th Name + %th Last commit + %th Access + %th Commits + = render @projects + = paginate @projects +- else + %h4 No public projects yet diff --git a/app/views/ci/projects/_search.html.haml b/app/views/ci/projects/_search.html.haml new file mode 100644 index 00000000000..6d84b25a6af --- /dev/null +++ b/app/views/ci/projects/_search.html.haml @@ -0,0 +1,17 @@ +.search + = form_tag "#", method: :get, class: 'ci-search-form' do |f| + .input-group + = search_field_tag "search", params[:search], placeholder: "Search", class: "search-input form-control" + .input-group-addon + %i.fa.fa-search + + +:coffeescript + $('.ci-search-form').submit -> + NProgress.start() + query = $('.ci-search-form .search-input').val() + $.get '#{gitlab_ci_projects_path}', { search: query }, (data) -> + $(".projects").html data.html + NProgress.done() + CiPager.init "#{gitlab_ci_projects_path}" + "?search=" + query, #{Ci::ProjectsController::PROJECTS_BATCH}, false + false diff --git a/app/views/ci/projects/edit.html.haml b/app/views/ci/projects/edit.html.haml new file mode 100644 index 00000000000..298007a6565 --- /dev/null +++ b/app/views/ci/projects/edit.html.haml @@ -0,0 +1,21 @@ +- if @project.generated_yaml_config + %p.alert.alert-danger + CI Jobs are deprecated now, you can #{link_to "download", dumped_yaml_project_path(@project)} + or + %a.preview-yml{:href => "#yaml-content", "data-toggle" => "modal"} preview + yaml file which is based on your old jobs. + Put this file to the root of your project and name it .gitlab-ci.yml + += render 'form' + +- if @project.generated_yaml_config + #yaml-content.modal.fade{"aria-hidden" => "true", "aria-labelledby" => ".gitlab-ci.yml", :role => "dialog", :tabindex => "-1"} + .modal-dialog + .modal-content + .modal-header + %button.close{"aria-hidden" => "true", "data-dismiss" => "modal", :type => "button"} × + %h4.modal-title Content of .gitlab-ci.yml + .modal-body + = text_area_tag :yaml, @project.generated_yaml_config, size: "70x25", class: "form-control" + .modal-footer + %button.btn.btn-default{"data-dismiss" => "modal", :type => "button"} Close diff --git a/app/views/ci/projects/gitlab.html.haml b/app/views/ci/projects/gitlab.html.haml new file mode 100644 index 00000000000..f57dfcb0790 --- /dev/null +++ b/app/views/ci/projects/gitlab.html.haml @@ -0,0 +1,27 @@ +- if @offset == 0 + .clearfix.light + .pull-left.fetch-status + - if params[:search].present? + by keyword: "#{params[:search]}", + #{@total_count} projects, #{@projects.size} of them added to CI + %br + + %table.table.projects-table.content-list + %thead + %tr + %th Project Name + %th Last commit + %th Access + %th Commits + + = render @projects + + = render "gl_projects" + + %p.text-center.hide.loading + %i.fa.fa-refresh.fa-spin + +- else + = render @projects + + = render "gl_projects" diff --git a/app/views/ci/projects/index.html.haml b/app/views/ci/projects/index.html.haml new file mode 100644 index 00000000000..085a70811ae --- /dev/null +++ b/app/views/ci/projects/index.html.haml @@ -0,0 +1,13 @@ +- if current_user + .gray-content-block.top-block + = render "search" + .projects.prepend-top-default + %p.fetch-status.light + %i.fa.fa-refresh.fa-spin + :coffeescript + $.get '#{gitlab_ci_projects_path}', (data) -> + $(".projects").html data.html + CiPager.init "#{gitlab_ci_projects_path}", #{Ci::ProjectsController::PROJECTS_BATCH}, false + +- else + = render 'public' diff --git a/app/views/ci/projects/show.html.haml b/app/views/ci/projects/show.html.haml new file mode 100644 index 00000000000..6443378af99 --- /dev/null +++ b/app/views/ci/projects/show.html.haml @@ -0,0 +1,60 @@ += render 'ci/shared/guide' unless @project.setup_finished? + +- if current_user && can?(current_user, :manage_project, gl_project) && !@project.any_runners? + .alert.alert-danger + Builds for this project wont be served unless you configure runners on + = link_to "Runners page", ci_project_runners_path(@project) + +%ul.nav.nav-tabs.append-bottom-20 + %li{class: ref_tab_class} + = link_to 'All commits', ci_project_path(@project) + - @project.tracked_refs.each do |ref| + %li{class: ref_tab_class(ref)} + = link_to ref, ci_project_path(@project, ref: ref) + + - if @ref && !@project.tracked_refs.include?(@ref) + %li{class: 'active'} + = link_to @ref, ci_project_path(@project, ref: @ref) + + %li.pull-right + = link_to 'View on GitLab', @project.gitlab_url, no_turbolink.merge( class: 'btn btn-sm' ) + +- if @ref + %p + Paste build status image for #{@ref} with next link + = link_to '#', class: 'badge-codes-toggle btn btn-default btn-xs' do + Status Badge + .badge-codes-block.bs-callout.bs-callout-info.hide + %p + Status badge for + %span.label.label-info #{@ref} + branch + %div + %label Markdown: + = text_field_tag 'badge_md', markdown_badge_code(@project, @ref), readonly: true, class: 'form-control' + %label Html: + = text_field_tag 'badge_html', html_badge_code(@project, @ref), readonly: true, class: 'form-control' + + + + +%table.table.builds + %thead + %tr + %th Status + %th Commit + %th Message + %th Branch + %th Total duration + %th Finished at + - if @project.coverage_enabled? + %th Coverage + + = render @commits + += paginate @commits + +- if @commits.empty? + .bs-callout + %h4 No commits yet + |