From 344cc19480d735059c4bc1632664d603b5088bbf Mon Sep 17 00:00:00 2001 From: Alexander Machehin Date: Thu, 23 Oct 2014 18:49:57 +0600 Subject: [PATCH] [#369] update new build list page; work in progress --- app/assets/javascripts/new_application.js | 6 +- .../build_lists/_include_repos.html.haml | 2 +- .../projects/build_lists/_new_form.html.haml | 16 ++--- app/views/projects/git/base/_fork.html.haml | 2 +- app/views/shared/_autocomplete_form.html.haml | 60 +++---------------- .../_extra_repositories.en.html.haml | 20 ++++--- .../_extra_repositories.ru.html.haml | 20 ++++--- 7 files changed, 43 insertions(+), 83 deletions(-) diff --git a/app/assets/javascripts/new_application.js b/app/assets/javascripts/new_application.js index 5554abbec..b1cf6c68c 100644 --- a/app/assets/javascripts/new_application.js +++ b/app/assets/javascripts/new_application.js @@ -3,12 +3,10 @@ //= require jquery-ui //= require js-routes -//= require autocomplete-rails -//= require extra/autocomplete-form +// require autocomplete-rails +// require extra/autocomplete-form //= require bootstrap-sprockets -// Loads all Bootstrap javascripts -//= require bootstrap //= require angular //= require angular-sanitize diff --git a/app/views/projects/build_lists/_include_repos.html.haml b/app/views/projects/build_lists/_include_repos.html.haml index 091e2ec38..143d6d7d7 100644 --- a/app/views/projects/build_lists/_include_repos.html.haml +++ b/app/views/projects/build_lists/_include_repos.html.haml @@ -1,6 +1,6 @@ .col-md-5.col-md-offset-2 %h4= t 'activerecord.attributes.build_list.build_for_platform' - .offset20{ 'ng-repeat' => 'platform in newBuildCtrl.platforms', + .boffset20{ 'ng-repeat' => 'platform in newBuildCtrl.platforms', 'ng-hide' => 'newBuildCtrl.hidePlatform(platform)' } %div %h5 {{ platform.name }} diff --git a/app/views/projects/build_lists/_new_form.html.haml b/app/views/projects/build_lists/_new_form.html.haml index cdb019a13..7c5470f1d 100644 --- a/app/views/projects/build_lists/_new_form.html.haml +++ b/app/views/projects/build_lists/_new_form.html.haml @@ -3,26 +3,26 @@ = render 'include_repos' .col-md-5 - %h4.boffset20= t 'activerecord.attributes.build_list.save_to_repository' - %select.form-control{ 'ng-model' => 'newBuildCtrl.save_to_repository', + %h4= t 'activerecord.attributes.build_list.save_to_repository' + %select.form-control.boffset20{ 'ng-model' => 'newBuildCtrl.save_to_repository', 'ng-options' => 'save_in_repo.name for save_in_repo in newBuildCtrl.save_to_repositories', 'ng-change' => 'newBuildCtrl.selectSaveToRepository()' } - %h4.boffset20= t 'activerecord.attributes.build_list.project_version' - %select.form-control{ 'ng-model' => 'newBuildCtrl.project_version', + %h4= t 'activerecord.attributes.build_list.project_version' + %select.form-control.boffset20{ 'ng-model' => 'newBuildCtrl.project_version', 'ng-options' => 'version.name group by version.kind for version in newBuildCtrl.project_versions' } - %h3= t 'activerecord.attributes.build_list.arch' - .checkbox{ 'ng-repeat' => 'arch in newBuildCtrl.arches' } + %h4= t 'activerecord.attributes.build_list.arch' + .checkbox.boffset20{ 'ng-repeat' => 'arch in newBuildCtrl.arches' } %label %input{ type: 'checkbox', 'ng-model' => 'arch.checked', name: 'arches[]' } {{ arch.name }} - %h3= t 'activerecord.attributes.build_list.update_type' + %h4= t 'activerecord.attributes.build_list.update_type' - selected = params[:build_list].try(:[], :update_type) ? {selected: params[:build_list][:update_type]} : {} - = f.select :update_type, BuildList::UPDATE_TYPES, selected, class: 'form-control' + = f.select :update_type, BuildList::UPDATE_TYPES, selected, class: 'form-control boffset20' = render 'shared/autocomplete_form', field: :extra_repositories, diff --git a/app/views/projects/git/base/_fork.html.haml b/app/views/projects/git/base/_fork.html.haml index 32f1c1396..4f533a0f1 100644 --- a/app/views/projects/git/base/_fork.html.haml +++ b/app/views/projects/git/base/_fork.html.haml @@ -9,7 +9,7 @@ .pull-right#fork-and-edit.roffset5 = link_to t('layout.projects.fork_and_edit'), '#', class: 'btn btn-primary', 'data-toggle' => 'modal', 'data-target' => '#forkModal' - #forkModal.modal.fade{ tabindex: '-1', role: 'dialog', 'aria-labelledby' => 'myModalLabel', 'aria-hidden' => 'true' } + #forkModal.modal.fade{ tabindex: '-1', role: 'dialog', 'aria-labelledby' => 'forkModalLabel', 'aria-hidden' => 'true' } .modal-dialog .modal-content .modal-header diff --git a/app/views/shared/_autocomplete_form.html.haml b/app/views/shared/_autocomplete_form.html.haml index a9d3351ba..3a691f691 100644 --- a/app/views/shared/_autocomplete_form.html.haml +++ b/app/views/shared/_autocomplete_form.html.haml @@ -9,55 +9,13 @@ - default_values ||= [] - subject_class = subject.class.name.underscore -.modal.fade{ id: "#{field}_dialog", tabindex: '-1', role: 'dialog', 'aria-labelledby' => "myModalLabel", - 'aria-hidden' => 'true'} - .modal-dialog - .modal-content - .modal-header - %button.close{ type: 'button', 'data-dismiss' => 'modal', 'aria-hidden' => 'true' } × - %h4.modal-title= t "activerecord.attributes.build_list.#{field}" - .modal-body= render "shared/autocomplete_docs/#{field}" - .modal-footer - %button.btn.btn-default{ type: 'button', 'data-dismiss' => 'modal' }= t 'close' - -.autocomplete-form{subject_class: subject_class, field: field, path: autocomplete_path, class: field} - %h3 - = t "activerecord.attributes.build_list.#{field}" - %i.fa.fa-question-circle{ 'data-toggle' => 'modal', 'data-target' => "##{field}_dialog" } - %input.form-control{ type: 'text', 'ng-model' => "async_#{field}_selected", placeholder: placeholder, - 'typeahead' => "extra for extra in get_#{field}($viewValue)", 'typeahead-loading' => "loading_#{field}", - 'typeahead-on-select' => "select_#{field}($item, $model, $label)" } - %i.glyphicon.glyphicon-refresh{ 'ng-show' => "loading_#{field}" } - - .row - = hidden_field_tag field, nil, id: "#{field}_field" - = hidden_field_tag field, nil, id: "#{field}_field_path" - = hidden_field_tag field, nil, id: "#{field}_field_label" - .col-xs-6 - .form-group - = autocomplete_field_tag field, nil, - "#{autocomplete_path}?#{{platform_id: subject.save_to_platform.try(:id)}.to_param}", - placeholder: placeholder, class: 'autocomplete form-control', - update_elements: { id: "##{field}_field", path: "##{field}_field_path", label: "##{field}_field_label" } - .col-xs-2= submit_tag t('layout.add'), class: 'btn btn-default add' - - %table.table.table-bordered - %tbody - - field_name = "#{subject_class}[#{field}][]" - - field_class.where(id: params[:build_list].try(:[], field) ).each do |extra| - %tr - %td - - if extra.is_a?(BuildList) - = link_to "#{extra.id} (#{extra.project.name} - #{extra.arch.name})", extra - - else - = link_to "#{extra.platform.name}/#{extra.name}", [extra.platform, extra] - .actions.pull-right - = hidden_field_tag field_name, extra.id - %span.fa.fa-times.fa-lg.delete.text-danger - .default-values - - field_class.where(id: default_values).each do |extra| - .hidden{ label: "#{extra.platform.name}/#{extra.name}", - path: url_for([extra.platform, extra]), - name: field_name, value: extra.id } - +%h4 + = t "activerecord.attributes.build_list.#{field}" + -#%a{ href: '#', tabindex: 0, class: 'btn btn-lg btn-danger bs-docs-popover boffset20', 'data-toggle' => 'popover', + 'data-trigger' => 'focus', title: t("activerecord.attributes.build_list.#{field}"), + html: 'true', 'data-content' => "And here's some amazing content. It's very engaging. Right?" } + %i.fa.fa-question-circle + %button.btn.btn-default{ popover: render("shared/autocomplete_docs/#{field}"), + 'popover-title' => t("activerecord.attributes.build_list.#{field}") } + %i.fa.fa-question-circle \ No newline at end of file diff --git a/app/views/shared/autocomplete_docs/_extra_repositories.en.html.haml b/app/views/shared/autocomplete_docs/_extra_repositories.en.html.haml index d11733dfa..3c78ddaa6 100644 --- a/app/views/shared/autocomplete_docs/_extra_repositories.en.html.haml +++ b/app/views/shared/autocomplete_docs/_extra_repositories.en.html.haml @@ -1,14 +1,16 @@ -:markdown - - __Ability to attach at assembly repositories of platforms as additional sources of packages.__ -
+%p + %strong Ability to attach at assembly repositories of platforms as additional sources of packages. + %br +%p Requirements for attaching repositories: + %ul + %li attaching repositories from other platform available only for build list into the personal platform. - - attaching repositories from other platform available only for build list into the personal platform. - +%p How to attach a repository: + %ul + %li write the name of platform, choose repository from the list for attaching and click to "Add" button. - - write the name of platform, choose repository from the list for attaching and click to "Add" button. - - _Example: correct input "uxteam_personal", wrong - "uxteam_personal/main"._ \ No newline at end of file +%p + %em Example: correct input "uxteam_personal", wrong - "uxteam_personal/main". diff --git a/app/views/shared/autocomplete_docs/_extra_repositories.ru.html.haml b/app/views/shared/autocomplete_docs/_extra_repositories.ru.html.haml index c26de1d1e..93e1b5790 100644 --- a/app/views/shared/autocomplete_docs/_extra_repositories.ru.html.haml +++ b/app/views/shared/autocomplete_docs/_extra_repositories.ru.html.haml @@ -1,14 +1,16 @@ -:markdown - - __Возможность подключить для сборки репозитории платформ как дополнительные источники пакетов.__ -
+%p + %strong Возможность подключить для сборки репозитории платформ как дополнительные источники пакетов. + %br +%p Требования для репозиториев: + %ul + %li использовать репозитории из других персональных платформ возможно только для сборки в персональную платформу. - - использовать репозитории из других персональных платформ возможно только для сборки в персональную платформу. - +%p Как подключить репозиторий: + %ul + %li добавьте имя платформы, затем из списка выберете репозиторий для поключения и нажмите кнопку "Добавить". - - добавьте имя платформы, затем из списка выберете репозиторий для поключения и нажмите кнопку "Добавить". - - _Пример: правильно ввести "uxteam_personal", неправильно: "uxteam_personal/main"._ \ No newline at end of file +%p + %em Пример: правильно ввести "uxteam_personal", неправильно: "uxteampersonal/main".