From 71104f61bbb117a6559671494c64eab7a2d1668c Mon Sep 17 00:00:00 2001 From: Wedge Date: Fri, 29 Apr 2016 17:10:30 +0300 Subject: [PATCH 1/5] New interface --- Gemfile | 10 +- Gemfile.lock | 18 - app/assets/images/logo-mini.png | Bin 3542 -> 981 bytes .../javascripts/angularjs/a_config.js.erb | 12 +- .../angularjs/angular-templates.js | 190 +++++ .../build_lists/build_lists_controller.js.erb | 304 ++++---- .../build_log_controller.js.coffee | 2 +- .../new_build_list_controller.js.coffee | 32 - .../controllers/activity_controller.js.coffee | 132 ---- .../angularjs/controllers/activity_feed.js | 39 + .../datepicker_controller.js.coffee.erb | 3 +- .../angularjs/controllers/platforms.js | 9 + .../controllers/platforms_controller.js | 20 - .../controllers/project_info_controller.js | 25 + .../controllers/projects_controller.js | 89 +-- .../controllers/rosa_abf_controller.js | 10 +- .../statistics_controller.js.coffee | 43 +- .../angularjs/directives/loading.js | 16 + .../angularjs/directives/widget-body.js | 22 + .../angularjs/directives/widget-footer.js | 18 + .../angularjs/directives/widget-header.js | 22 + .../angularjs/directives/widget.js | 21 + .../angularjs/models/build_list.js.erb | 2 +- .../services/activity_filter.js.coffee | 27 - .../angularjs/services/activity_service.js | 85 +++ .../services/build_lists_service.js.erb | 77 ++ .../angularjs/services/compile_html.js.coffee | 11 - .../angularjs/services/platforms_service.js | 11 + .../services/project_info_service.js | 11 + .../services/project_select_service.js | 10 + .../angularjs/services/projects_service.js | 15 + .../build_list_notification.html.haml | 18 - .../build_list_notification.html.slim | 15 + .../angularjs/templates/get_owners.html.slim | 2 +- .../angularjs/templates/new_day.html.slim | 2 + .../templates/search_collaborators.html.slim | 3 - app/assets/javascripts/jquery.rails.js | 555 ++++++++++++++ app/assets/javascripts/new_application.js | 43 +- app/assets/stylesheets/BootstrapXL.css | 680 ------------------ app/assets/stylesheets/custom_bootstrap.sass | 237 ------ app/assets/stylesheets/new_application.scss | 5 +- app/assets/stylesheets/rdash.css | 517 +++++++++++++ app/assets/stylesheets/timeline.css | 28 + app/assets/stylesheets/views/blame.sass | 12 - app/assets/stylesheets/views/diff.sass | 71 -- app/controllers/api/v1/jobs_controller.rb | 1 - app/controllers/home_controller.rb | 17 +- .../platforms/platforms_controller.rb | 2 - .../projects/build_lists_controller.rb | 16 +- .../projects/projects_controller.rb | 120 +--- app/models/concerns/project/github_api.rb | 10 +- app/models/product_build_list.rb | 1 + app/policies/project_policy.rb | 4 +- app/views/devise/passwords/edit.html.slim | 14 +- app/views/devise/passwords/new.html.slim | 22 +- app/views/devise/registrations/new.html.slim | 32 +- app/views/devise/sessions/new.html.slim | 39 +- app/views/home/_activity_tab.html.slim | 13 - app/views/home/_activity_tabsets.html.slim | 18 - app/views/home/_feed_tabs.html.haml | 5 - app/views/home/_filters.html.slim | 21 - app/views/home/_own_activity_tab.html.slim | 10 - app/views/home/_sidebar.html.slim | 30 - app/views/home/activity.html.slim | 7 - app/views/home/activity.json.jbuilder | 6 +- app/views/home/index.html.slim | 147 ++++ app/views/layouts/_flashes.html.slim | 12 +- app/views/layouts/_scroller.html.slim | 1 - app/views/layouts/application.html.slim | 71 +- app/views/layouts/invite.html.haml | 22 - app/views/layouts/loading.html.slim | 2 + app/views/layouts/menu/_new_top.html.slim | 74 +- app/views/layouts/sessions.html.slim | 68 +- app/views/platforms/base/_submenu.html.slim | 58 +- app/views/platforms/contents/index.html.slim | 2 +- .../platforms/maintainers/index.html.slim | 2 +- .../platforms/mass_builds/index.html.slim | 2 +- app/views/platforms/mass_builds/new.html.slim | 5 +- .../platforms/mass_builds/show.html.slim | 2 +- app/views/platforms/platforms/edit.html.slim | 2 +- app/views/platforms/platforms/index.html.slim | 45 +- .../platforms/platforms/index.json.jbuilder | 6 +- .../platforms/platforms/members.html.slim | 2 +- app/views/platforms/platforms/new.html.slim | 2 +- app/views/platforms/platforms/show.html.slim | 2 +- .../product_build_lists/new.html.slim | 2 +- .../product_build_lists/show.html.slim | 2 +- app/views/platforms/products/edit.html.slim | 2 +- app/views/platforms/products/index.html.slim | 2 +- app/views/platforms/products/new.html.slim | 2 +- app/views/platforms/products/show.html.slim | 2 +- .../platforms/repositories/index.html.slim | 2 +- .../platforms/repositories/show.html.slim | 2 +- app/views/projects/base/_submenu.html.slim | 57 -- .../_build_lists_ajax.json.jbuilder | 30 - .../projects/build_lists/_filter.html.slim | 90 +-- .../build_lists/_item_groups.html.slim | 47 +- .../projects/build_lists/_packages.html.slim | 99 ++- .../_platform_build_list.html.haml | 5 - .../_recreate_build_list.html.haml | 5 - .../projects/build_lists/_submenu.html.slim | 17 - .../projects/build_lists/index.html.slim | 91 --- app/views/projects/build_lists/new.html.slim | 11 +- .../new_build/_last_build_lists.html.slim | 53 -- app/views/projects/build_lists/show.html.slim | 357 +++++---- .../projects/projects/_aliases.html.slim | 15 - .../projects/_build_schedule.html.slim | 52 +- .../projects/projects/_filters.html.haml | 18 - app/views/projects/projects/_form.html.slim | 9 +- .../projects/projects/_project.html.haml | 14 - .../projects/projects/_project.json.jbuilder | 18 - .../projects/projects/dashboard.html.slim | 147 ++++ app/views/projects/projects/edit.html.slim | 33 +- app/views/projects/projects/index.html.slim | 38 - .../projects/projects/index.json.jbuilder | 17 +- .../projects/projects/mass_create.html.slim | 20 - .../projects/projects/mass_import.html.slim | 21 - app/views/projects/projects/new.html.slim | 21 +- .../projects/projects/preview.json.jbuilder | 1 - .../projects/project_info.json.jbuilder | 7 + .../shared/_angularjs_paginate.html.slim | 20 +- app/views/shared/_autocomplete_form.html.slim | 2 +- app/views/shared/_build_results.html.slim | 37 +- app/views/shared/_feed_commit.html.slim | 15 - app/views/shared/_feed_message.html.slim | 29 - app/views/shared/_header.html.slim | 20 +- app/views/statistics/_filter.html.slim | 14 +- app/views/statistics/index.html.slim | 12 +- config/application.rb | 2 +- config/initializers/github.rb | 2 +- config/initializers/redis.rb | 3 +- config/locales/dashboard.en.yml | 18 + config/locales/menu.en.yml | 2 - config/locales/menu.ru.yml | 2 - config/routes.rb | 31 +- 135 files changed, 2899 insertions(+), 3008 deletions(-) create mode 100644 app/assets/javascripts/angularjs/angular-templates.js delete mode 100644 app/assets/javascripts/angularjs/controllers/activity_controller.js.coffee create mode 100644 app/assets/javascripts/angularjs/controllers/activity_feed.js create mode 100644 app/assets/javascripts/angularjs/controllers/platforms.js delete mode 100644 app/assets/javascripts/angularjs/controllers/platforms_controller.js create mode 100644 app/assets/javascripts/angularjs/controllers/project_info_controller.js create mode 100644 app/assets/javascripts/angularjs/directives/loading.js create mode 100644 app/assets/javascripts/angularjs/directives/widget-body.js create mode 100644 app/assets/javascripts/angularjs/directives/widget-footer.js create mode 100644 app/assets/javascripts/angularjs/directives/widget-header.js create mode 100644 app/assets/javascripts/angularjs/directives/widget.js delete mode 100644 app/assets/javascripts/angularjs/services/activity_filter.js.coffee create mode 100644 app/assets/javascripts/angularjs/services/activity_service.js create mode 100644 app/assets/javascripts/angularjs/services/build_lists_service.js.erb delete mode 100644 app/assets/javascripts/angularjs/services/compile_html.js.coffee create mode 100644 app/assets/javascripts/angularjs/services/platforms_service.js create mode 100644 app/assets/javascripts/angularjs/services/project_info_service.js create mode 100644 app/assets/javascripts/angularjs/services/project_select_service.js create mode 100644 app/assets/javascripts/angularjs/services/projects_service.js delete mode 100644 app/assets/javascripts/angularjs/templates/build_list_notification.html.haml create mode 100644 app/assets/javascripts/angularjs/templates/build_list_notification.html.slim create mode 100644 app/assets/javascripts/angularjs/templates/new_day.html.slim delete mode 100644 app/assets/javascripts/angularjs/templates/search_collaborators.html.slim create mode 100644 app/assets/javascripts/jquery.rails.js delete mode 100644 app/assets/stylesheets/BootstrapXL.css delete mode 100644 app/assets/stylesheets/custom_bootstrap.sass create mode 100644 app/assets/stylesheets/rdash.css create mode 100644 app/assets/stylesheets/timeline.css delete mode 100644 app/assets/stylesheets/views/blame.sass delete mode 100644 app/assets/stylesheets/views/diff.sass delete mode 100644 app/views/home/_activity_tab.html.slim delete mode 100644 app/views/home/_activity_tabsets.html.slim delete mode 100644 app/views/home/_feed_tabs.html.haml delete mode 100644 app/views/home/_filters.html.slim delete mode 100644 app/views/home/_own_activity_tab.html.slim delete mode 100644 app/views/home/_sidebar.html.slim delete mode 100644 app/views/home/activity.html.slim create mode 100644 app/views/home/index.html.slim delete mode 100644 app/views/layouts/_scroller.html.slim delete mode 100644 app/views/layouts/invite.html.haml create mode 100644 app/views/layouts/loading.html.slim delete mode 100644 app/views/projects/base/_submenu.html.slim delete mode 100644 app/views/projects/build_lists/_build_lists_ajax.json.jbuilder delete mode 100644 app/views/projects/build_lists/_platform_build_list.html.haml delete mode 100644 app/views/projects/build_lists/_recreate_build_list.html.haml delete mode 100644 app/views/projects/build_lists/_submenu.html.slim delete mode 100644 app/views/projects/build_lists/index.html.slim delete mode 100644 app/views/projects/build_lists/new_build/_last_build_lists.html.slim delete mode 100644 app/views/projects/projects/_aliases.html.slim delete mode 100644 app/views/projects/projects/_filters.html.haml delete mode 100644 app/views/projects/projects/_project.html.haml delete mode 100644 app/views/projects/projects/_project.json.jbuilder create mode 100644 app/views/projects/projects/dashboard.html.slim delete mode 100644 app/views/projects/projects/index.html.slim delete mode 100644 app/views/projects/projects/mass_create.html.slim delete mode 100644 app/views/projects/projects/mass_import.html.slim delete mode 100644 app/views/projects/projects/preview.json.jbuilder create mode 100644 app/views/projects/projects/project_info.json.jbuilder delete mode 100644 app/views/shared/_feed_commit.html.slim delete mode 100644 app/views/shared/_feed_message.html.slim create mode 100644 config/locales/dashboard.en.yml diff --git a/Gemfile b/Gemfile index f231818ed..dc67bb74e 100644 --- a/Gemfile +++ b/Gemfile @@ -31,8 +31,6 @@ gem 'sprockets' gem 'will_paginate' gem 'meta-tags', require: 'meta_tags' gem 'haml-rails' -gem 'jquery-rails' -gem 'jquery-migrate-rails' gem 'ruby-haml-js' gem 'slim' gem 'simple_form', '3.1.0.rc2' @@ -45,27 +43,21 @@ gem 'ohm-expire', '~> 0.1.3' gem 'pygments.rb' -gem 'ffi' - gem 'attr_encrypted' # AngularJS related stuff +gem 'angular-rails-templates' gem 'underscore-rails' -gem 'angularjs-rails', '~> 1.3.14' gem 'ng-rails-csrf' -gem 'momentjs-rails' gem 'angular-i18n' gem 'js-routes' gem 'soundmanager-rails' -gem 'angular-ui-bootstrap-rails' -gem 'angular-rails-templates' gem 'ngmin-rails' gem 'time_diff' gem 'sass-rails' gem 'coffee-rails' -gem 'bootstrap-sass' gem 'font-awesome-rails' gem 'compass-rails' diff --git a/Gemfile.lock b/Gemfile.lock index 34ab1c311..bf47c4507 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -76,16 +76,11 @@ GEM railties (>= 3.1) sprockets (~> 2) tilt - angular-ui-bootstrap-rails (0.13.0) - angularjs-rails (1.3.14) arbre (1.0.3) activesupport (>= 3.0.0) arel (6.0.0) attr_encrypted (1.3.4) encryptor (>= 1.3.0) - autoprefixer-rails (5.2.0) - execjs - json bcrypt (3.1.10) better_errors (2.1.1) coderay (>= 1.0.0) @@ -93,9 +88,6 @@ GEM rack (>= 0.9.0) binding_of_caller (0.7.2) debug_inspector (>= 0.0.1) - bootstrap-sass (3.3.4.1) - autoprefixer-rails (>= 5.0.0.1) - sass (>= 3.2.19) bourbon (4.2.3) sass (~> 3.4) thor @@ -208,7 +200,6 @@ GEM jbuilder (2.2.16) activesupport (>= 3.0.0, < 5) multi_json (~> 1.2) - jquery-migrate-rails (1.2.1) jquery-rails (4.0.4) rails-dom-testing (~> 1.0) railties (>= 4.2.0) @@ -257,8 +248,6 @@ GEM modware (0.1.2) its-it key_struct (~> 0.4) - momentjs-rails (2.10.2) - railties (>= 3.1) mono_logger (1.1.0) multi_json (1.11.1) multipart-post (2.0.0) @@ -581,12 +570,9 @@ DEPENDENCIES ancestry angular-i18n angular-rails-templates - angular-ui-bootstrap-rails - angularjs-rails (~> 1.3.14) attr_encrypted better_errors binding_of_caller - bootstrap-sass cape capistrano capistrano_colors @@ -596,22 +582,18 @@ DEPENDENCIES devise factory_girl_rails faraday-http-cache - ffi font-awesome-rails friendly_id haml-rails highline (~> 1.6.20) hirb jbuilder - jquery-migrate-rails - jquery-rails js-routes localeapp mailcatcher meta-tags meta_request mock_redis - momentjs-rails newrelic_rpm ng-rails-csrf ngmin-rails diff --git a/app/assets/images/logo-mini.png b/app/assets/images/logo-mini.png index 3175f3b21b1851eaebd5f9b24e01f6d4b62b89fb..17ad15904bfe8eaedabc44e94e146bdd407fae25 100644 GIT binary patch literal 981 zcmV;`11kK9P)kdg00004XF*Lt006O% z3;baP0000WV@Og>004R>004l5008;`004mK004C`008P>0026e000+ooVrmw00002 zVoOIv0RM-N%)bBt010qNS#tmYE+YT{E+YYWr9XB6000McNliru-vkmC3?270!I=O6 z0?0{3K~zY`g_TQ4RACgy|M#j>Y9*tUMwFuTV5)_UJ*GEN7znkBR!LBcvLb@kEebbA z(4y#Nt6UT$M3hkk(F0vn5Qv#zmV_p$If^}WX6~=W+{wB3&YjM;x!<|x{Lgp3@0|ZJ zP(~@!a)nf>prok2s9U`nR6K(v-nETqM2RyaG2U{E27+E|w<1iN?PLKk!DV(*i2PRi z#^99gmUK^WpJIf_ql}HzQbRGh{s7Hb{~}w&smDYtrI{Y4Y~V>cX=08Sz~ClMsYjR` zwO#)(%r{1f0WiWoH^2!;bU2O>Em*(=XQ(7d5ygbKgayPnn+{M-!V&!qd5DVuv{350 zxRtyH;K&TXgMZPJvK_Gp3%HG$;qDEdV=>9XBtXQK{cD712VPYNhD5!kum;`Mili#fb5V_RQ$`}bO z;(X^iRhWp)Jn<)#6vzkm+nEPgLVl&|00009a7bBm000XU z000XU0RWnu7ytkYPiaF#P*7-ZbZ>KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ;mqRrNsHJd##*D~ju=bP7?-?v~|cv>vB zsJ6IeNwVZxrdjT`yl#bBIa#GxRa#xMMy;K#CDyyGyQdMSxlWT#tDe?p!?5wT$+oGt z8L;Kp2HUQ-ZMJ=3XJQv;x5ci*?vuTfeY$;({XGW_huIFR9a(?@3)XSs8O^N5RyOM=TTmp(3=8^+zpz2r)C z^>JO{deZfso3oq3?Wo(Y?l$ge?uXo;%ru`Vo>?<<(8I_>;8Eq#KMS9gFl*neeosSB zfoHYnBQIkwkyowPu(zdms`p{<7e4kra-ZWq<2*OsGTvEV%s0Td$hXT+!*8Bnh2KMe zBmZRodjHV?r+_5^X9J0WL4jKW`}lf%A-|44I@@LTvf1rHjG(ze6+w@Jt%Bvjts!X0 z?2xS?_ve_-kiKB_KiJlZ$9G`c^=E@oNG)mWWaNo-3TIW8)$Hg0Ub-~8?KhvJ>$ z3*&nim@mj(aCxE5!t{lw7O5^0EIO7zOo&c6l<+|iDySBWCGrz@C5{St!X3hAA}`T4 z(TLbXTq+(;@<=L8dXnssyft|w#WSTW<++3>sgS%(4NTpeI-VAqb|7ssJvzNHgOZVu zaYCvgO_R1~>SyL=cFU|~g|hy|Zi}}s9+d~lYqOB71z9Z$wnC=pR9Yz4DhIM>Wmjgu z&56o6maCpC&F##y%G;1PobR9i?GnNg;gYtchD%p19a!eQtZF&3JaKv33gZ<8D~47E ztUS1iwkmDaPpj=$m#%)jCVEY4fnLGNg2A-`YwHVD3gv};>)hAvT~AmqS>Lr``i7kw zJ{5_It`yrBmlc25DBO7E8;5VoznR>Ww5hAaxn$2~(q`%A-YuS64wkBy=9dm`4cXeX z4c}I@?e+FW+b@^RDBHV(wnMq2zdX3SWv9u`%{xC-q*U}&`cyXV(%rRT*Z6MH?i+i& z_B8C(+grT%{XWUQ+f@NoP1R=AW&26{v-dx)iK^-Nmiuj8txj!m?Z*Ss1N{dh4z}01 z)YTo*JycSU)+_5r4#yw9{+;i4Ee$peRgIj+;v;ZGdF1K$3E%e~4LaI(jC-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z00094Nkl7mJCWu2eTO3;piat zz*)gDgKn85{bmP)5Q-4E&6~Vr2pMj<d`#m(g@`@{72X-L#iA$>(HsCw@OBgc3^yi&p#dNp zX*Qd$o}QlK_`itV-`~FlfGB`jP1BBC*KLlw=ayyN1AZkp!hIEuQi z+tf7e2tWeBi(c)B0(iq1OFNEJ8&zS$FfJrXN&=YfH)@AORH@hNn*io@T|XVBsBPP~ zjIneklUZ_I_oS!)2l#d&pU|!pL+xDpNTAWIymh1KUX200=UGO!4h@bih zfEfXf%~q@Rg^$bPcXuEAaU2H6acae4anGj#^I67owW|T`I`KHRZTnWVu&04)wYt?u1N*qXzK*wA zt=|G1hx)(g+aek;4C994%5I@Y1HZ9w#{05+YGltP zPDNnGd)eK~w@3C+^!(qW!f~7$Uyo)3eLDaX|G0fd0mQj_+k6!^2R-D^0Jdm~Gn3Yy Q_W%F@07*qoM6N<$f*(?vC;$Ke diff --git a/app/assets/javascripts/angularjs/a_config.js.erb b/app/assets/javascripts/angularjs/a_config.js.erb index 19c3552a2..d6b6b3a5b 100644 --- a/app/assets/javascripts/angularjs/a_config.js.erb +++ b/app/assets/javascripts/angularjs/a_config.js.erb @@ -1,6 +1,5 @@ -var RosaABF = angular.module('RosaABF', ['ui.bootstrap', 'angular-i18n', 'angularMoment', - 'chieffancypants.loadingBar', 'ngSanitize', 'templates', - 'ngResource', 'ng-rails-csrf', 'ngCookies']); +var RosaABF = angular.module('RosaABF', ['ui.bootstrap', 'angular-i18n', 'angularMoment', 'templates', + 'ngResource', 'ng-rails-csrf', 'ngCookies', 'ngSanitize']); RosaABF.factory('LocalesHelper', ['$locale', function($locale) { var locales = { @@ -14,15 +13,14 @@ RosaABF.factory('LocalesHelper', ['$locale', function($locale) { } }]); -RosaABF.config(function(cfpLoadingBarProvider) { - cfpLoadingBarProvider.includeSpinner = false; -}); +RosaABF.config(['$compileProvider', function ($compileProvider) { + $compileProvider.debugInfoEnabled(false); +}]); var SoundNotificationsHelper = function() { var isOn = true; var statusChangedSound = null; soundManager.setup({ - // url: '/assets/swf/', preferFlash: false, onready: function() { statusChangedSound = soundManager.createSound({url: "<%=asset_path('garbage_shattering.wav')%>"}); diff --git a/app/assets/javascripts/angularjs/angular-templates.js b/app/assets/javascripts/angularjs/angular-templates.js new file mode 100644 index 000000000..03202fce1 --- /dev/null +++ b/app/assets/javascripts/angularjs/angular-templates.js @@ -0,0 +1,190 @@ +angular.module("u2i.bootstrap.tpls", ["uib/template/tabs/tab.html", "uib/template/tabs/tabset.html", "uib/template/typeahead/typeahead-match.html", + "uib/template/typeahead/typeahead-popup.html", "uib/template/pagination/pager.html", + "uib/template/pagination/pagination.html", "uib/template/datepicker/datepicker.html", + "uib/template/datepicker/popup.html", "uib/template/datepicker/year.html", + "uib/template/datepicker/month.html", "uib/template/datepicker/day.html"]); + +angular.module("uib/template/tabs/tab.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("uib/template/tabs/tab.html", + "
  • \n" + + " {{heading}}\n" + + "
  • \n" + + ""); +}]); + +angular.module("uib/template/tabs/tabset.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("uib/template/tabs/tabset.html", + "
    \n" + + "
      \n" + + "
      \n" + + "
      \n" + + "
      \n" + + "
      \n" + + "
      \n" + + ""); +}]); + +angular.module("uib/template/typeahead/typeahead-match.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("uib/template/typeahead/typeahead-match.html", + "\n" + + ""); +}]); + +angular.module("uib/template/typeahead/typeahead-popup.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("uib/template/typeahead/typeahead-popup.html", + "
        \n" + + "
      • \n" + + "
        \n" + + "
      • \n" + + "
      \n" + + ""); +}]); + +angular.module("uib/template/pagination/pager.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("uib/template/pagination/pager.html", + "\n" + + ""); +}]); + +angular.module("uib/template/pagination/pagination.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("uib/template/pagination/pagination.html", + "\n" + + ""); +}]); + +angular.module("uib/template/datepicker/datepicker.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("uib/template/datepicker/datepicker.html", + "
      \n" + + " \n" + + " \n" + + " \n" + + "
      \n" + + ""); +}]); + +angular.module("uib/template/datepicker/day.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("uib/template/datepicker/day.html", + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
      {{::label.abbr}}
      {{ weekNumbers[$index] }}\n" + + " \n" + + "
      \n" + + ""); +}]); + +angular.module("uib/template/datepicker/month.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("uib/template/datepicker/month.html", + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
      \n" + + " \n" + + "
      \n" + + ""); +}]); + +angular.module("uib/template/datepicker/popup.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("uib/template/datepicker/popup.html", + "
      \n" + + "
        \n" + + "
      • \n" + + "
      • \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
      • \n" + + "
      \n" + + "
      \n" + + ""); +}]); + +angular.module("uib/template/datepicker/year.html", []).run(["$templateCache", function($templateCache) { + $templateCache.put("uib/template/datepicker/year.html", + "\n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + " \n" + + "
      \n" + + " \n" + + "
      \n" + + ""); +}]); \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/build_lists/build_lists_controller.js.erb b/app/assets/javascripts/angularjs/build_lists/build_lists_controller.js.erb index 6ce776bca..cc9ff3899 100644 --- a/app/assets/javascripts/angularjs/build_lists/build_lists_controller.js.erb +++ b/app/assets/javascripts/angularjs/build_lists/build_lists_controller.js.erb @@ -1,188 +1,126 @@ -RosaABF.controller('BuildListsController', - ['$scope', '$http', '$location', '$timeout', '$cookies', - function($scope, $http, $location, $timeout, $cookies) { +RosaABF.controller('BuildListsController', ['$scope', 'BuildListsService', '$location', '$interval', '$uibModal', 'ProjectSelectService', +function($scope, BuildListsService, $location, $interval, $uibModal, ProjectSelectService) { + $scope.params = null; + $scope.build_lists = []; + $scope.isRequest = false; // Disable 'Search' button + $scope.opened = {}; + $scope.ProjectSelectService = ProjectSelectService; - $scope.params = null; - $scope.first_run = true; - $scope.server_status = null; - $scope.build_lists = []; - $scope.isRequest = false; // Disable 'Search' button - $scope.pages = []; - $scope.opened = {}; + var refresh, is_autoreload_on; + var default_filters = {page: '1', per_page: '25', 'ownership': 'owned'}; - $scope.map_priorities = { - <%=BuildList::WAITING_FOR_RESPONSE%>: 13, - <%=BuildList::BUILD_PENDING%>: 12, - <%=BuildList::RERUN_TESTS%>: 11, - <%=BuildList::BUILD_CANCELING%>: 10, - <%=BuildList::BUILD_CANCELED%>: 9, - <%=BuildList::BUILD_STARTED%>: 8, - <%=BuildList::RERUNNING_TESTS%>: 7, - <%=BuildList::BUILD_PUBLISH%>: 6, - <%=BuildList::BUILD_PUBLISHED%>: 5, - <%=BuildList::BUILD_ERROR%>: 4, - <%=BuildList::SUCCESS%>: 3, - <%=BuildList::TESTS_FAILED%>: 2, - <%=BuildList::FAILED_PUBLISH%>: 1, - <%=BuildList::REJECTED_PUBLISH%>: 0 - }; - - $scope.clear = function () { - //$scope.dt = null; - $scope.params = { page: '1', - per_page: '25', - filter: { ownership: 'owned' } - }; - }; - - $scope.init = function init() { - $scope.name_with_owner = $('#name_with_owner').val(); - if ($scope.name_with_owner) { - $scope.build_lists_path = Routes.project_build_lists_path($scope.name_with_owner, {format: 'json'}); + $scope.setAutoreload = function(autoreload) { + is_autoreload_on = autoreload; + if(autoreload) { + if(refresh) { + $interval.cancel(refresh); + } + refresh = $interval($scope.getBuildLists, 60000); } - else { - $scope.build_lists_path = Routes.build_lists_path({format: 'json'}); + else if(!autoreload && refresh) { + $interval.cancel(refresh); + refresh = null; } - - //$scope.isOpenServerStatus = $cookies.isOpenServerStatus === 'true' ? true : false; - $scope.isOpenFilters = $cookies.isOpenFilters === 'true' ? true : false; - }; - - // $scope.$watch('isOpenServerStatus', function(){ - // $cookies.isOpenServerStatus = $scope.isOpenServerStatus.toString(); - // }, true); - - $scope.$watch('isOpenFilters', function(){ - $cookies.isOpenFilters = $scope.isOpenFilters.toString(); - }, true); - - $scope.getBuildLists = function() { - if ( $scope.isRequest) { - return; - } - // Disable 'Search' button - $scope.isRequest = true; - - - $http.get($scope.build_lists_path, {params: $location.search()}).success(function(results) { - // Render Server status - $scope.$parent.server_status = results.server_status; - - // TMP fields - var dictionary = results.dictionary; - var build_lists = []; - var groups = {}; - - var to_open = []; - // Grouping of build_lists - _.each(results.build_lists, function(r){ - var bl = new BuildList(r, dictionary); - var key = bl.project_id + '-'; - key += bl.group_id ? bl.group_id : (bl.commit_hash + '-' + bl.user_id); - if (groups[key]) { - groups[key].addRelated(bl); - } else { - groups[key] = bl; - build_lists.push(bl); - if ( bl.id in $scope.opened ) { to_open.push(bl); } - } - }); - - // Adds all build_lists into the table (group by group) - $scope.build_lists = []; - $scope.opened = {}; - _.each(build_lists, function(bl){ - if (bl.related.length > 1) { - var sorted_build_lists = _.sortBy(bl.related, function(b) { return $scope.map_priorities[b.status]; }); - bl.clearRelated(); - var first_in_group = sorted_build_lists[0]; - first_in_group.clearRelated(); - _.each(sorted_build_lists, function(b){ - if (b != first_in_group) { first_in_group.addRelated(b); } - $scope.build_lists.push(b); - }); - } else { - $scope.build_lists.push(bl); - } - }); - // Shows groups which have been opened before - _.each(to_open, function(bl){ $scope.showRelated(bl, true); }); - - // Render pagination - $scope.page = results.page; - $scope.total_items = results.total_items; - - // Enable 'Search' button - $scope.isRequest = false; - }).error(function(data, status, headers, config) { - // Enable 'Search' button - $scope.isRequest = false; - });; - $scope.first_run = false; } - $scope.showRelated = function(build_list, disable_effect) { + $scope.getBuildLists = function() { + if ($scope.isRequest) { + return; + } + + ProjectSelectService.disable_bl = true; + $scope.isRequest = true; + + if(ProjectSelectService.project) { + var project = ProjectSelectService.project; + } + + var filter = Object.assign(Object.create(null), default_filters, $location.search()); + var fixed_filter = Object.create(null); + _.map(filter, function(val, key) { + if(key != "page" && key != "per_page") { + fixed_filter['filter[' + key + ']'] = val; + } + else { + fixed_filter[key] = val; + } + }); + + BuildListsService.getBuildLists(fixed_filter, project).then(function(res) { + _.each(res.build_lists, function(item) { + if(item.hasRelated) { + var chevronHtml = ""; + _.each(item.related, function(rel) { + chevronHtml += "
       
      "; + }); + item.chevronHtml = chevronHtml; + } + if(item.id in $scope.opened) { + $scope.showRelated(item); + } + }); + + $scope.build_lists = res.build_lists; + $scope.page = res.page; + $scope.total_items = res.total_items; + $location.search(Object.assign(filter, res.filter)); + $scope.per_page = filter.per_page; + $scope.isRequest = false; + ProjectSelectService.disable_bl = false; + ProjectSelectService.load_project_info = ProjectSelectService.project; + }); + } + + $scope.clearProject = function() { + ProjectSelectService.project = ""; + } + + $scope.showRelated = function(build_list) { build_list.relatedHidden = false; + $scope.opened[build_list.id] = true; _.each(build_list.related, function(bl){ bl.show = true; - $scope.opened[bl.id] = true; - // Waits for render of build_lists - if (!disable_effect) - $timeout(function() { - var tmp = $('#build-list-' + bl.id + ' td'); - $('#build-list-' + bl.id + ' td').effect('highlight', {}, 1000); - }, 100); }); } $scope.hideRelated = function(build_list) { build_list.relatedHidden = true; + delete $scope.opened[build_list.id]; _.each(build_list.related, function(bl){ bl.show = false; - delete $scope.opened[bl.id]; }); build_list.show = true; } - $scope.cancelRefresh = null; - $scope.refresh = function(force) { - if ($('#autoreload').is(':checked') || force) { - var params = {}; + $scope.openFilters = function() { + var turn_back_on = is_autoreload_on; + $scope.setAutoreload(false); - _.each($("#monitoring_filter").serializeArray(), function(a){ - if (a.value) { params[a.name] = a.value; } - }); - $location.search(params); - $scope.getBuildLists(); - } - if (!force) - $scope.cancelRefresh = $timeout($scope.refresh, 60000); - } - - - $scope.$on('$locationChangeSuccess', function(event) { - $scope.updateParams(); - if (!$scope.first_run) { $scope.getBuildLists(); } - }); - - $scope.updateParams = function() { - var params = $location.search(); - - $scope.params = { - page: params.page || 1, - per_page: params.per_page || 25, - filter: { - ownership: params['filter[ownership]'] || 'owned', - status: params['filter[status]'], - save_to_platform_id: params['filter[save_to_platform_id]'], - arch_id: params['filter[arch_id]'], - mass_build_id: params['filter[mass_build_id]'], - updated_at_start: params['filter[updated_at_start]'], - updated_at_end: params['filter[updated_at_end]'], - project_name: params['filter[project_name]'], - id: params['filter[id]'] + var FilterModalInstance = $uibModal.open({ + animation: $scope.animationsEnabled, + templateUrl: 'build_list_filters.html', + controller: 'FiltersInstanceController', + size: 'lg', + resolve: { + params: function() { + return $location.search(); + } } - } + }); + + FilterModalInstance.result.then(function(ret) { + $location.search(ret); + + $scope.getBuildLists(); + }, function(reason) { + if(reason == 'reset') { + $location.search(default_filters); + + $scope.getBuildLists(); + } + }).finally(function() { + $scope.setAutoreload(turn_back_on); + }); } $scope.goToPage = function(number) { @@ -190,7 +128,41 @@ RosaABF.controller('BuildListsController', $scope.getBuildLists(); } - $scope.updateParams(); - // Waits for render of filters - $timeout($scope.refresh, 100); + $scope.setAutoreload(true); + + var project_hash = $location.search(); + if(project_hash['project']) { + ProjectSelectService.project = project_hash['project']; + $location.search('project', null); + } + + $scope.$watch(function() { + return ProjectSelectService.project; + }, function() { + var turn_back_on = is_autoreload_on; + if(ProjectSelectService.project) { + $scope.widget_title = " | " + ProjectSelectService.project; + } + else { + $scope.widget_title = ""; + } + $scope.setAutoreload(false); + $scope.getBuildLists(); + $scope.setAutoreload(turn_back_on); + }); + }]); + +RosaABF.controller('FiltersInstanceController', ['$scope', '$uibModalInstance', 'params', +function($scope, $uibModalInstance, params) { + console.log(params); + $scope.params = params; + + $scope.apply = function() { + $uibModalInstance.close($scope.params); + } + + $scope.reset = function() { + $uibModalInstance.dismiss('reset'); + } +}]); \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/build_lists/build_log_controller.js.coffee b/app/assets/javascripts/angularjs/build_lists/build_log_controller.js.coffee index 7335c76ae..55219dbdf 100644 --- a/app/assets/javascripts/angularjs/build_lists/build_log_controller.js.coffee +++ b/app/assets/javascripts/angularjs/build_lists/build_log_controller.js.coffee @@ -1,4 +1,4 @@ -RosaABF.controller 'BuildLogController', ['$scope', '$http', '$timeout', ($scope, $http, $timeout) -> +RosaABF.controller 'BuildLogController', ['$scope', '$http', '$timeout', '$sanitize', ($scope, $http, $timeout, $sanitize) -> $scope.path = null $scope.log = null diff --git a/app/assets/javascripts/angularjs/build_lists/new_build_list_controller.js.coffee b/app/assets/javascripts/angularjs/build_lists/new_build_list_controller.js.coffee index bf2c88515..afa769379 100644 --- a/app/assets/javascripts/angularjs/build_lists/new_build_list_controller.js.coffee +++ b/app/assets/javascripts/angularjs/build_lists/new_build_list_controller.js.coffee @@ -144,33 +144,6 @@ NewBuildListController = (dataservice, $http) -> vm.selected_extra_build_list = null false - vm.updateFilterOwner = -> - vm.last_build_lists_filter.owner = !vm.last_build_lists_filter.owner; - updateLastBuilds() - - vm.updateFilterStatus = -> - vm.last_build_lists_filter.status = !vm.last_build_lists_filter.status; - updateLastBuilds() - - updateLastBuilds = -> - path = Routes.list_project_build_lists_path( - { - name_with_owner: vm.name_with_owner, - page: vm.last_build_lists_filter.page - owner_filter: vm.last_build_lists_filter.owner - status_filter: vm.last_build_lists_filter.status - } - ) - - $http.get(path).then (response) -> - vm.last_build_lists = response.data.build_lists - vm.total_items = response.data.total_items - false - - vm.goToPage = (page) -> - vm.last_build_lists_filter.page = page - updateLastBuilds() - vm.cloneBuildList = (id) -> path = Routes.new_project_build_list_path( { @@ -213,11 +186,6 @@ NewBuildListController = (dataservice, $http) -> vm.hidePlatform = (platform) -> vm.is_build_for_main_platform and platform.id isnt vm.build_for_platform_id - if !vm.last_build_lists - vm.last_build_lists = [] - vm.last_build_lists_filter = { owner: true, status: true, page: 1 } - updateLastBuilds() - init(dataservice) vm.selectSaveToRepository() if !dataservice.build_list_id return true diff --git a/app/assets/javascripts/angularjs/controllers/activity_controller.js.coffee b/app/assets/javascripts/angularjs/controllers/activity_controller.js.coffee deleted file mode 100644 index d35a4a102..000000000 --- a/app/assets/javascripts/angularjs/controllers/activity_controller.js.coffee +++ /dev/null @@ -1,132 +0,0 @@ -ActivityController = ($scope, $http, $timeout, $q, $filter, $location, ActivityFilter) -> - - calculateChangeDate = (feed)-> - prev_date = null - _.each(feed, (event)-> - cur_date = $filter('amDateFormat')(event.date, 'll') - event.is_date_changed = cur_date isnt prev_date - prev_date = cur_date - ) - - $scope.$watch (-> - vm.current_activity_tab.owner_uname_filter_tmp - ), () -> - vm.selectOwnerFilter({uname: null}, null, null) unless vm.current_activity_tab.owner_uname_filter_tmp - - $scope.$watch (-> - vm.current_activity_tab.project_name_filter_tmp - ), () -> - vm.selectProjectNameFilter({name: null}, null, null) unless vm.current_activity_tab.project_name_filter_tmp - - - vm = this - - vm.processing = false - vm.activity_tab = - filter: 'build' - build: {} - owner_filter: null - project_name_filter: null - owner_uname_filter_tmp: null - project_name_filter_tmp: null - - vm.own_activity_tab = $.extend({}, vm.activity_tab) - vm.current_activity_tab = vm.activity_tab - - vm.init = (active_tab)-> - switch active_tab - when 'activity' - vm.activity_tab.active = true - vm.current_activity_tab = vm.activity_tab - when 'own_activity' - vm.own_activity_tab.active = true - vm.current_activity_tab = vm.own_activity_tab - true - - vm.getContent = (tab)-> - switch tab - when 'activity' - vm.activity_tab.active = true - vm.own_activity_tab.active = false - vm.current_activity_tab = vm.activity_tab - vm.getActivityContent() - if $location.path() isnt '/' - $location.path('/').replace() - - when 'own_activity' - vm.activity_tab.active = false - vm.own_activity_tab.active = true - vm.current_activity_tab = vm.own_activity_tab - vm.getActivityContent() - if $location.path() isnt '/own_activity' - $location.path('/own_activity').replace() - - vm.getTimeLinefaClass = (content)-> - template = switch content.kind - when 'build_list_notification' then 'btn-success fa-gear' - else 'btn-warning fa-question' - template - - vm.getCurActivity = ()-> - vm.current_activity_tab[vm.current_activity_tab.filter] - - vm.getTemplate = (content)-> - content.kind + '.html' - - vm.load_more = ()-> - cur_tab = vm.getCurActivity() - path = cur_tab.next_page_link - return unless path - - $http.get(path).then (res)-> - cur_tab.feed.push.apply(cur_tab.feed, res.data.feed) - cur_tab.next_page_link = res.data.next_page_link - - vm.getActivityContent = ()-> - vm.processing = true - options = - owner_filter: vm.current_activity_tab.owner_filter - project_name_filter: vm.current_activity_tab.project_name_filter - format: 'json' - - if vm.activity_tab.active - path = Routes.root_path(options) - else - path = Routes.own_activity_path(options) - - $http.get(path).then (res)-> - feed = res.data.feed - vm.getCurActivity().feed = feed - vm.getCurActivity().next_page_link = res.data.next_page_link - calculateChangeDate(feed) - vm.processing = false - true - - vm.getOwnersList = (value)-> - return [] if value.length < 1 - ActivityFilter.get_owners(value) - - vm.selectOwnerFilter = (item, model, label)-> - return if vm.current_activity_tab.owner_filter is item.uname - - vm.current_activity_tab.owner_filter = item.uname - vm.current_activity_tab.project_name_filter = null - vm.current_activity_tab.project_name_filter_tmp = null - vm.getActivityContent() - true - - vm.getProjectNamesList = (value)-> - return [] if value.length < 1 - ActivityFilter.get_project_names(vm.current_activity_tab.owner_filter, value) - - vm.selectProjectNameFilter = (item, model, label)-> - return if vm.current_activity_tab.project_name_filter is item.name - vm.current_activity_tab.project_name_filter = item.name - vm.getActivityContent() - true - -angular - .module("RosaABF") - .controller "ActivityController", ActivityController - -ActivityController.$inject = ['$scope', '$http', '$timeout', '$q', '$filter', '$location', 'ActivityFilter'] diff --git a/app/assets/javascripts/angularjs/controllers/activity_feed.js b/app/assets/javascripts/angularjs/controllers/activity_feed.js new file mode 100644 index 000000000..7015a9a81 --- /dev/null +++ b/app/assets/javascripts/angularjs/controllers/activity_feed.js @@ -0,0 +1,39 @@ +RosaABF.controller('ActivityFeedController', ['$scope', 'ActivityService', 'ProjectSelectService', +function($scope, ActivityService, ProjectSelectService) { + $scope.feed = []; + $scope.next_link_present = false; + $scope.owner_tmp = ""; + $scope.project_tmp = ""; + $scope.no_loading = false; + + var owner_uname, project_name; + + $scope.getFeed = function(options, no_loading) { + if($scope.requesting) { + return; + } + $scope.no_loading = no_loading; + if(ProjectSelectService.project) { + if(!options) { + options = {}; + } + var split = ProjectSelectService.project.split('/'); + options.owner_uname = split[0]; + options.project_name = split[1]; + } + $scope.requesting = true; + ActivityService.getFeed(options).then(function(res) { + $scope.requesting = false; + $scope.next_link_present = res.next_link_present; + $scope.feed = res.feed; + }); + } + + $scope.$watch(function() { + return ProjectSelectService.project; + }, function() { + $scope.getFeed(); + }); + + $scope.getFeed(); +}]); \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/controllers/datepicker_controller.js.coffee.erb b/app/assets/javascripts/angularjs/controllers/datepicker_controller.js.coffee.erb index f2c223a69..abfce6b2c 100644 --- a/app/assets/javascripts/angularjs/controllers/datepicker_controller.js.coffee.erb +++ b/app/assets/javascripts/angularjs/controllers/datepicker_controller.js.coffee.erb @@ -51,11 +51,12 @@ DatePickerController = ($scope, datepickerPopupConfig) -> <% end %> #datepickerPopupConfig.appendToBody = 'true' + return vm + angular .module("RosaABF") .controller "DatePickerController", DatePickerController DatePickerController.$inject = [ '$scope' - 'datepickerPopupConfig' ] diff --git a/app/assets/javascripts/angularjs/controllers/platforms.js b/app/assets/javascripts/angularjs/controllers/platforms.js new file mode 100644 index 000000000..e045c3bb2 --- /dev/null +++ b/app/assets/javascripts/angularjs/controllers/platforms.js @@ -0,0 +1,9 @@ +RosaABF.controller('PlatformsController', ['$scope', 'PlatformsService', function($scope, PlatformsService) { + $scope.platforms = null; + + $scope.requesting = true; + PlatformsService.getPlatforms().then(function(platforms) { + $scope.requesting = false; + $scope.platforms = platforms; + }); +}]); diff --git a/app/assets/javascripts/angularjs/controllers/platforms_controller.js b/app/assets/javascripts/angularjs/controllers/platforms_controller.js deleted file mode 100644 index e86a951a6..000000000 --- a/app/assets/javascripts/angularjs/controllers/platforms_controller.js +++ /dev/null @@ -1,20 +0,0 @@ -RosaABF.controller('PlatformsCtrl', ['$scope', '$http', function($scope, $http) { - $scope.total_items = null; - $scope.page = null; - $scope.platforms = null; - - $scope.getPlatforms = function() { - $http.get(Routes.platforms_path({format: 'json', page: $scope.page})).then(function(res) { - $scope.page = res.data.page; - $scope.total_items = res.data.platforms_count; - $scope.platforms = res.data.platforms; - }); - }; - - $scope.goToPage = function(page) { - $scope.page = page; - $scope.getPlatforms(); - }; - - $scope.getPlatforms(); -}]); diff --git a/app/assets/javascripts/angularjs/controllers/project_info_controller.js b/app/assets/javascripts/angularjs/controllers/project_info_controller.js new file mode 100644 index 000000000..34793b1cf --- /dev/null +++ b/app/assets/javascripts/angularjs/controllers/project_info_controller.js @@ -0,0 +1,25 @@ +RosaABF.controller('ProjectInfoController', ['$scope', 'ProjectInfoService', 'ProjectSelectService', +function($scope, ProjectInfoService, ProjectSelectService) { + $scope.widget_title = ""; + $scope.$watch(function() { + return ProjectSelectService.load_project_info; + }, function() { + var project = ProjectSelectService.load_project_info; + if(project) { + $scope.requesting = true; + ProjectSelectService.disable_pi = true; + ProjectInfoService.getProjectInfo(project).then(function(res) { + $scope.project = project; + $scope.project_info = res; + $scope.requesting = false; + $scope.widget_title = " | " + project; + ProjectSelectService.disable_pi = false; + }); + } + else { + $scope.project_info = null; + $scope.project = ""; + $scope.widget_title = ""; + } + }); +}]); diff --git a/app/assets/javascripts/angularjs/controllers/projects_controller.js b/app/assets/javascripts/angularjs/controllers/projects_controller.js index 2960f27bd..d6653713b 100644 --- a/app/assets/javascripts/angularjs/controllers/projects_controller.js +++ b/app/assets/javascripts/angularjs/controllers/projects_controller.js @@ -1,73 +1,24 @@ -RosaABF.controller('ProjectsCtrl', ['$scope', '$http', function($scope, $http) { - $scope.total_items = null; - $scope.page = null; - $scope.projects = null; - $scope.filter_users = []; - $scope.filter_groups = []; - // remove_user_project_path(project), method: :delete +RosaABF.controller('ProjectsController', ['$scope', 'ProjectsService', 'ProjectSelectService', +function($scope, ProjectsService, ProjectSelectService) { + $scope.projects = null; + $scope.ProjectSelectService = ProjectSelectService; + $scope.search = ""; - $scope.init = function(total_items, page) { - $scope.total_items = total_items; - $scope.page = page; - }; + var promiseResolve = function(projects) { + $scope.requesting = false; + $scope.projects = projects; + } - $scope.getProjects = function() { - var params = { format: 'json', page: $scope.page, search: $scope.search, - users: $scope.filter_users, groups: $scope.filter_groups }; - $http.get(Routes.projects_path(params)).then(function(res) { - $scope.page = res.data.page; - $scope.total_items = res.data.projects_count; - $scope.projects = res.data.projects; - }); - }; + $scope.searchProjects = function(search) { + $scope.requesting = true; + $scope.search = search; + ProjectsService.getProjects(search).then(promiseResolve); + } - $scope.goToPage = function(page) { - $scope.page = page; - $scope.getProjects(); - }; + $scope.selectProject = function(project) { + ProjectSelectService.project = project; + } - $scope.leave_project = function(project) { - project.can_leave_project = false; - var path = Routes.remove_user_project_path(project.name_with_owner, {format: 'json'}); - $http.delete(path).success(function(res){ - //$scope.getProjects(); - // Find and remove item from an array - var i = $scope.projects.indexOf(project); - if(i != -1) { - $scope.projects.splice(i, 1); - } - }).error(function() { - $scope.getProjects(); - }); - }; - - $scope.change_user_filter = function(user_id) { - var position = $.inArray(user_id, $scope.filter_users); - var filter = 'user_filter_'+user_id+'_class'; - if( ~position ) { - $scope.filter_users.splice(position, 1); - $scope[filter] = false; - } - else { - $scope.filter_users.push(user_id); - $scope[filter] = true; - } - $scope.getProjects(); - }; - - $scope.change_group_filter = function(group_id) { - var position = $.inArray(group_id, $scope.filter_groups); - var filter = 'group_filter_'+group_id+'_class'; - if( ~position ) { - $scope.filter_groups.splice(position, 1); - $scope[filter] = false; - } - else { - $scope.filter_groups.push(group_id); - $scope[filter] = true; - } - $scope.getProjects(); - }; - - $scope.getProjects(); -}]); + $scope.requesting = true; + ProjectsService.getProjects().then(promiseResolve); +}]); \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/controllers/rosa_abf_controller.js b/app/assets/javascripts/angularjs/controllers/rosa_abf_controller.js index dd02af5ed..da2b844f1 100644 --- a/app/assets/javascripts/angularjs/controllers/rosa_abf_controller.js +++ b/app/assets/javascripts/angularjs/controllers/rosa_abf_controller.js @@ -1,8 +1,12 @@ -RosaABF.controller('RosaABFController', ['$scope', 'LocalesHelper', 'SoundNotificationsHelper', - function($scope, LocalesHelper, SoundNotificationsHelper) { +RosaABF.controller('RosaABFController', ['$scope', 'LocalesHelper', 'SoundNotificationsHelper', '$timeout', + function($scope, LocalesHelper, SoundNotificationsHelper, $timeout) { + + $scope.hideAlerts = false; $scope.init = function(locale, sound_notifications) { LocalesHelper.setLocale(locale); - moment.locale(locale); + //moment.locale(locale); SoundNotificationsHelper.enabled(sound_notifications); + $timeout(function() { $scope.hideAlerts = true; }, 5000); + console.log($scope); } }]); diff --git a/app/assets/javascripts/angularjs/controllers/statistics_controller.js.coffee b/app/assets/javascripts/angularjs/controllers/statistics_controller.js.coffee index a91d6bd23..83d4244fb 100644 --- a/app/assets/javascripts/angularjs/controllers/statistics_controller.js.coffee +++ b/app/assets/javascripts/angularjs/controllers/statistics_controller.js.coffee @@ -12,11 +12,7 @@ RosaABF.controller 'StatisticsController', ['$scope', '$http', '$timeout', ($sco '56, 132, 158', '77, 169, 68', '241, 128, 73', - '174, 199, 232', - # '255, 187, 120', - # '152, 223, 138', - # '214, 39, 40', - # '31, 119, 180' + '174, 199, 232' ] $scope.charts = {} @@ -25,12 +21,6 @@ RosaABF.controller 'StatisticsController', ['$scope', '$http', '$timeout', ($sco startingDay: 1 $scope.init = -> - $('#statistics-form .date_picker').datepicker - 'dateFormat': 'yy-mm-dd' - maxDate: 0 - minDate: -366 - showButtonPanel: true - $scope.update() true @@ -85,18 +75,6 @@ RosaABF.controller 'StatisticsController', ['$scope', '$http', '$timeout', ($sco if $scope.statistics.build_lists $scope.initBuildListsChart() - # PullRequests - if $scope.statistics.pull_requests - $scope.initPullRequestsChart() - - # Issues - if $scope.statistics.issues - $scope.initIssuesChart() - - # Commits - if $scope.statistics.commits - $scope.initCommitsChart() - .error (data, status, headers, config) -> console.log 'error:' $scope.loading = false @@ -157,23 +135,4 @@ RosaABF.controller 'StatisticsController', ['$scope', '$http', '$timeout', ($sco $scope.statistics.build_lists.build_published ] - $scope.initCommitsChart = -> - $scope.dateChart '#commits_chart', [ - $scope.statistics.commits.chart - ] - - $scope.initPullRequestsChart = -> - $scope.dateChart '#pull_requests_chart', [ - $scope.statistics.pull_requests.open, - $scope.statistics.pull_requests.merged - $scope.statistics.pull_requests.closed, - ] - - $scope.initIssuesChart = -> - $scope.dateChart '#issues_chart', [ - $scope.statistics.issues.open, - $scope.statistics.issues.reopen, - $scope.statistics.issues.closed - ] - ] \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/directives/loading.js b/app/assets/javascripts/angularjs/directives/loading.js new file mode 100644 index 000000000..1199a8022 --- /dev/null +++ b/app/assets/javascripts/angularjs/directives/loading.js @@ -0,0 +1,16 @@ +/** + * Loading Directive + * @see http://tobiasahlin.com/spinkit/ + */ + +angular + .module('RosaABF') + .directive('rdLoading', rdLoading); + +function rdLoading() { + var directive = { + restrict: 'AE', + template: '
      ' + }; + return directive; +}; \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/directives/widget-body.js b/app/assets/javascripts/angularjs/directives/widget-body.js new file mode 100644 index 000000000..4fc1bff8d --- /dev/null +++ b/app/assets/javascripts/angularjs/directives/widget-body.js @@ -0,0 +1,22 @@ +/** + * Widget Body Directive + */ + +angular + .module('RosaABF') + .directive('rdWidgetBody', rdWidgetBody); + +function rdWidgetBody() { + var directive = { + requires: '^rdWidget', + replace: true, + scope: { + loading: '&', + classes: '@' + }, + transclude: true, + template: '
      ', + restrict: 'E' + }; + return directive; +}; \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/directives/widget-footer.js b/app/assets/javascripts/angularjs/directives/widget-footer.js new file mode 100644 index 000000000..a9878d589 --- /dev/null +++ b/app/assets/javascripts/angularjs/directives/widget-footer.js @@ -0,0 +1,18 @@ +/** + * Widget Footer Directive + */ + +angular + .module('RosaABF') + .directive('rdWidgetFooter', rdWidgetFooter); + +function rdWidgetFooter() { + var directive = { + requires: '^rdWidget', + transclude: true, + replace: true, + template: '', + restrict: 'E' + }; + return directive; +}; \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/directives/widget-header.js b/app/assets/javascripts/angularjs/directives/widget-header.js new file mode 100644 index 000000000..8083351ec --- /dev/null +++ b/app/assets/javascripts/angularjs/directives/widget-header.js @@ -0,0 +1,22 @@ +/** + * Widget Header Directive + */ + +angular + .module('RosaABF') + .directive('rdWidgetHeader', rdWidgetTitle); + +function rdWidgetTitle() { + var directive = { + requires: '^rdWidget', + replace: true, + scope: { + title: '@', + icon: '@' + }, + transclude: true, + template: '
      {{title}}
      ', + restrict: 'E' + }; + return directive; +}; \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/directives/widget.js b/app/assets/javascripts/angularjs/directives/widget.js new file mode 100644 index 000000000..12dc58ec0 --- /dev/null +++ b/app/assets/javascripts/angularjs/directives/widget.js @@ -0,0 +1,21 @@ +/** + * Widget Directive + */ + +angular + .module('RosaABF') + .directive('rdWidget', rdWidget); + +function rdWidget() { + var directive = { + transclude: true, + template: '
      ', + replace: true, + restrict: 'EA' + }; + return directive; + + function link(scope, element, attrs) { + /* */ + } +}; \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/models/build_list.js.erb b/app/assets/javascripts/angularjs/models/build_list.js.erb index c2aacc8c3..34a0e8dd5 100644 --- a/app/assets/javascripts/angularjs/models/build_list.js.erb +++ b/app/assets/javascripts/angularjs/models/build_list.js.erb @@ -36,7 +36,7 @@ var BuildList = function(atts, dictionary) { self.version_link_text = self.commit_hash || self.project_version; self.version_link_url = Routes.commit_path(self.project.name_with_owner, self.version_link_text); } - self.project.url = Routes.project_path(self.project.name_with_owner); + self.project.url = '';//Routes.project_path(self.project.name_with_owner); } if (self.user) diff --git a/app/assets/javascripts/angularjs/services/activity_filter.js.coffee b/app/assets/javascripts/angularjs/services/activity_filter.js.coffee deleted file mode 100644 index a8d82e6ca..000000000 --- a/app/assets/javascripts/angularjs/services/activity_filter.js.coffee +++ /dev/null @@ -1,27 +0,0 @@ -ActivityFilterService = ($http) -> - get_owners: (val) -> - path = Routes.get_owners_list_path( - { - term: val - } - ) - - $http.get(path).then (response) -> - response.data - get_project_names: (owner, val) -> - path = Routes.get_project_names_list_path( - { - owner_uname: owner - term: val - } - ) - - $http.get(path).then (response) -> - response.data - - -angular - .module("RosaABF") - .factory "ActivityFilter", ActivityFilterService - -ActivityFilterService.$inject = ['$http'] diff --git a/app/assets/javascripts/angularjs/services/activity_service.js b/app/assets/javascripts/angularjs/services/activity_service.js new file mode 100644 index 000000000..9506fb82f --- /dev/null +++ b/app/assets/javascripts/angularjs/services/activity_service.js @@ -0,0 +1,85 @@ +angular.module("RosaABF").factory('ActivityService', ["$http", "$filter", function($http, $filter) { + var ActivityService = {}; + + var feed; + var next_page_link = null; + + var last_date; + var last_is_own = false; + var processFeed = function(feed) { + var res = []; + + _.each(feed, function(item) { + var cur_date = $filter('amDateFormat')(item.date, 'll') + if(cur_date != last_date) { + res.push({kind: 'new_day', date: cur_date, class: 'timeline-day'}); + last_date = cur_date; + } + res.push(item); + }); + + return res; + } + + ActivityService.getFeed = function(options) { + if(Object.prototype.toString.apply(options) != '[object Object]') { + options = {is_own: last_is_own, load_next_page: false}; + } + + var url; + if(!options['load_next_page']) { + last_date = null; + feed = {}; + params = {format: 'json'}; + if(options['owner_uname']) { + params['owner_filter'] = options['owner_uname']; + } + if(options['project_name']) { + params['project_name_filter'] = options['project_name']; + } + last_is_own = options['is_own']; + url = options['is_own'] ? Routes.own_activity_path(params) : Routes.activity_feeds_path(params); + } + else { + if(!next_page_link) { + return false; + } + + url = next_page_link; + } + + return $http.get(url).then(function(res) { + next_page_link = res.data.next_page_link; + + var new_feed = processFeed(res.data.feed); + var ret; + if(options['load_next_page']) { + ret = feed; + ret.push.apply(ret, new_feed); + } + else { + feed = ret = new_feed; + } + + return {feed: ret, next_link_present: !!next_page_link}; + }); + } + + ActivityService.getOwnersList = function(val) { + var path = Routes.get_owners_list_path({term: val}); + + return $http.get(path).then(function(res) { + return res.data; + }); + } + + ActivityService.getProjectNamesList = function(owner_uname, val) { + var path = Routes.get_project_names_list_path({owner_uname: owner_uname, term: val}); + + return $http.get(path).then(function(res) { + return res.data; + }); + } + + return ActivityService; +}]); \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/services/build_lists_service.js.erb b/app/assets/javascripts/angularjs/services/build_lists_service.js.erb new file mode 100644 index 000000000..3594172ab --- /dev/null +++ b/app/assets/javascripts/angularjs/services/build_lists_service.js.erb @@ -0,0 +1,77 @@ +angular.module("RosaABF").factory('BuildListsService', ["$http", function($http) { + var BuildListsService = {}; + + var map_priorities = { + <%=BuildList::WAITING_FOR_RESPONSE%>: 13, + <%=BuildList::BUILD_PENDING%>: 12, + <%=BuildList::RERUN_TESTS%>: 11, + <%=BuildList::BUILD_CANCELING%>: 10, + <%=BuildList::BUILD_CANCELED%>: 9, + <%=BuildList::BUILD_STARTED%>: 8, + <%=BuildList::RERUNNING_TESTS%>: 7, + <%=BuildList::BUILD_PUBLISH%>: 6, + <%=BuildList::BUILD_PUBLISHED%>: 5, + <%=BuildList::BUILD_ERROR%>: 4, + <%=BuildList::SUCCESS%>: 3, + <%=BuildList::TESTS_FAILED%>: 2, + <%=BuildList::FAILED_PUBLISH%>: 1, + <%=BuildList::REJECTED_PUBLISH%>: 0 + }; + + BuildListsService.getBuildLists = function(params, project) { + var url; + if(project) { + url = Routes.project_build_lists_path(project, {format: 'json'}); + } + else { + url = Routes.build_lists_path({format: 'json'}); + } + + return $http.get(url, {params: params}).then(function(results) { + // TMP fields + var dictionary = results.data.dictionary; + var build_lists = []; + var groups = {}; + + // Grouping of build_lists + _.each(results.data.build_lists, function(r){ + var bl = new BuildList(r, dictionary); + var key = bl.project_id + '-'; + key += bl.group_id ? bl.group_id : (bl.commit_hash + '-' + bl.user_id); + if (groups[key]) { + groups[key].addRelated(bl); + } + else { + groups[key] = bl; + build_lists.push(bl); + } + }); + + // Adds all build_lists into the table (group by group) + var build_lists_final = []; + _.each(build_lists, function(bl){ + if (bl.related.length > 1) { + var sorted_build_lists = _.sortBy(bl.related, function(b) { return map_priorities[b.status]; }); + bl.clearRelated(); + var first_in_group = sorted_build_lists[0]; + first_in_group.clearRelated(); + _.each(sorted_build_lists, function(b){ + if (b != first_in_group) { first_in_group.addRelated(b); } + build_lists_final.push(b); + }); + } else { + build_lists_final.push(bl); + } + }); + + return { + build_lists: build_lists_final, + page: results.data.page, + total_items: results.data.total_items, + filter: results.data.filter + }; + }); + } + + return BuildListsService; +}]); \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/services/compile_html.js.coffee b/app/assets/javascripts/angularjs/services/compile_html.js.coffee deleted file mode 100644 index df0f03519..000000000 --- a/app/assets/javascripts/angularjs/services/compile_html.js.coffee +++ /dev/null @@ -1,11 +0,0 @@ -compileHTML = ($compile) -> - run: (scope, data) -> - template = angular.element(data) - linkFn = $compile(template) - linkFn(scope) - -angular - .module("RosaABF") - .service "compileHTML", compileHTML - -compileHTML.$inject = ['$compile'] diff --git a/app/assets/javascripts/angularjs/services/platforms_service.js b/app/assets/javascripts/angularjs/services/platforms_service.js new file mode 100644 index 000000000..937120a8f --- /dev/null +++ b/app/assets/javascripts/angularjs/services/platforms_service.js @@ -0,0 +1,11 @@ +angular.module("RosaABF").factory('PlatformsService', ["$http", function($http) { + var PlatformsService = {}; + + PlatformsService.getPlatforms = function() { + return $http.get(Routes.platforms_path({ format: 'json' })).then(function(res) { + return res.data.platforms; + }); + } + + return PlatformsService; +}]); \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/services/project_info_service.js b/app/assets/javascripts/angularjs/services/project_info_service.js new file mode 100644 index 000000000..7cef8a85f --- /dev/null +++ b/app/assets/javascripts/angularjs/services/project_info_service.js @@ -0,0 +1,11 @@ +angular.module("RosaABF").factory('ProjectInfoService', ["$http", function($http) { + var ProjectInfoService = {}; + + ProjectInfoService.getProjectInfo = function(name_with_owner) { + return $http.get(Routes.project_info_path(name_with_owner, { format: 'json' })).then(function(res) { + return res.data.project_info; + }); + } + + return ProjectInfoService; +}]); \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/services/project_select_service.js b/app/assets/javascripts/angularjs/services/project_select_service.js new file mode 100644 index 000000000..921ff1d4d --- /dev/null +++ b/app/assets/javascripts/angularjs/services/project_select_service.js @@ -0,0 +1,10 @@ +angular.module("RosaABF").factory('ProjectSelectService', function() { + return { + project: "", + disable_bl: false, + disable_pi: false, + disable: function() { + return this.disable_bl || this.disable_pi; + } + }; +}); \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/services/projects_service.js b/app/assets/javascripts/angularjs/services/projects_service.js new file mode 100644 index 000000000..f8a5aa42c --- /dev/null +++ b/app/assets/javascripts/angularjs/services/projects_service.js @@ -0,0 +1,15 @@ +angular.module("RosaABF").factory('ProjectsService', ["$http", function($http) { + var ProjectsService = {}; + + ProjectsService.getProjects = function(search) { + var params = { format: 'json' }; + if(search) { + params.search = search; + } + return $http.get(Routes.projects_path(params)).then(function(res) { + return res.data.projects; + }); + } + + return ProjectsService; +}]); \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/templates/build_list_notification.html.haml b/app/assets/javascripts/angularjs/templates/build_list_notification.html.haml deleted file mode 100644 index 7a61cf295..000000000 --- a/app/assets/javascripts/angularjs/templates/build_list_notification.html.haml +++ /dev/null @@ -1,18 +0,0 @@ -%i.img-circle.btn-info.fa.fa-gears -.timeline-item{ 'ng-cloak' => true } - %h3.timeline-header - %a{ 'ng-href' => "{{item.user.link}}" } - %img{ 'ng-src' => "{{item.user.image}}" } - {{item.user.uname}} - %span.time{ popover: "{{item.date | amDateFormat:'ddd, LLL'}}", - "popover-trigger" => "mouseenter", 'popover-append-to-body' => 'true' } - %span.glyphicon.glyphicon-time - %span {{item.date | amDateFormat:'HH:mm'}} - .clearfix - .timeline-body - %p - {{'notification.build_list' | i18n}} - %a{ 'ng-href' => "{{item.build_list.link}}" } {{item.build_list.id}} - {{'notification.in_project' | i18n}} - %a{ 'ng-href' => "{{item.project_link}}" } {{item.project_name_with_owner}} - {{item.build_list.status_message}} diff --git a/app/assets/javascripts/angularjs/templates/build_list_notification.html.slim b/app/assets/javascripts/angularjs/templates/build_list_notification.html.slim new file mode 100644 index 000000000..80fa3866b --- /dev/null +++ b/app/assets/javascripts/angularjs/templates/build_list_notification.html.slim @@ -0,0 +1,15 @@ +.timeline-item + .row + a ng-href="{{item.user.link}}" + img src="{{item.user.image}}" + | {{item.user.uname}} + span.pull-right + | {{item.date | amDateFormat:'HH:mm'}} + .timeline-item-body + | {{'notification.build_list' | i18n}} + a ng-href="{{item.build_list.link}}" + | {{item.build_list.id}} + | {{'notification.in_project' | i18n}} + a ng-href="{{item.project_link}}" + | {{item.project_name_with_owner}} + | {{item.build_list.status_message}} \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/templates/get_owners.html.slim b/app/assets/javascripts/angularjs/templates/get_owners.html.slim index 7c6cadff6..af86c8efb 100644 --- a/app/assets/javascripts/angularjs/templates/get_owners.html.slim +++ b/app/assets/javascripts/angularjs/templates/get_owners.html.slim @@ -1,4 +1,4 @@ - size = Avatar::AVATAR_SIZES[:small] a img ng-src= "{{match.model.avatar_path}}" height= size width= size - span< bind-html-unsafe= "match.model.uname | typeaheadHighlight:query" + span< ng-bind-html= "match.model.uname | uibTypeaheadHighlight:query" diff --git a/app/assets/javascripts/angularjs/templates/new_day.html.slim b/app/assets/javascripts/angularjs/templates/new_day.html.slim new file mode 100644 index 000000000..cd22e134c --- /dev/null +++ b/app/assets/javascripts/angularjs/templates/new_day.html.slim @@ -0,0 +1,2 @@ +span + | {{item.date}} \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/templates/search_collaborators.html.slim b/app/assets/javascripts/angularjs/templates/search_collaborators.html.slim deleted file mode 100644 index 28fa91046..000000000 --- a/app/assets/javascripts/angularjs/templates/search_collaborators.html.slim +++ /dev/null @@ -1,3 +0,0 @@ -a - img ng-src = "{{match.model.avatar_path}}" - span< bind-html-unsafe = "match.model.fullname | typeaheadHighlight:query" diff --git a/app/assets/javascripts/jquery.rails.js b/app/assets/javascripts/jquery.rails.js new file mode 100644 index 000000000..bc9fceb37 --- /dev/null +++ b/app/assets/javascripts/jquery.rails.js @@ -0,0 +1,555 @@ +(function($, undefined) { + +/** + * Unobtrusive scripting adapter for jQuery + * https://github.com/rails/jquery-ujs + * + * Requires jQuery 1.8.0 or later. + * + * Released under the MIT license + * + */ + + // Cut down on the number of issues from people inadvertently including jquery_ujs twice + // by detecting and raising an error when it happens. + 'use strict'; + + if ( $.rails !== undefined ) { + $.error('jquery-ujs has already been loaded!'); + } + + // Shorthand to make it a little easier to call public rails functions from within rails.js + var rails; + var $document = $(document); + + $.rails = rails = { + // Link elements bound by jquery-ujs + linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote]:not([disabled]), a[data-disable-with], a[data-disable]', + + // Button elements bound by jquery-ujs + buttonClickSelector: 'button[data-remote]:not([form]):not(form button), button[data-confirm]:not([form]):not(form button)', + + // Select elements bound by jquery-ujs + inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]', + + // Form elements bound by jquery-ujs + formSubmitSelector: 'form', + + // Form input elements bound by jquery-ujs + formInputClickSelector: 'form input[type=submit], form input[type=image], form button[type=submit], form button:not([type]), input[type=submit][form], input[type=image][form], button[type=submit][form], button[form]:not([type])', + + // Form input elements disabled during form submission + disableSelector: 'input[data-disable-with]:enabled, button[data-disable-with]:enabled, textarea[data-disable-with]:enabled, input[data-disable]:enabled, button[data-disable]:enabled, textarea[data-disable]:enabled', + + // Form input elements re-enabled after form submission + enableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled, input[data-disable]:disabled, button[data-disable]:disabled, textarea[data-disable]:disabled', + + // Form required input elements + requiredInputSelector: 'input[name][required]:not([disabled]), textarea[name][required]:not([disabled])', + + // Form file input elements + fileInputSelector: 'input[type=file]:not([disabled])', + + // Link onClick disable selector with possible reenable after remote submission + linkDisableSelector: 'a[data-disable-with], a[data-disable]', + + // Button onClick disable selector with possible reenable after remote submission + buttonDisableSelector: 'button[data-remote][data-disable-with], button[data-remote][data-disable]', + + // Up-to-date Cross-Site Request Forgery token + csrfToken: function() { + return $('meta[name=csrf-token]').attr('content'); + }, + + // URL param that must contain the CSRF token + csrfParam: function() { + return $('meta[name=csrf-param]').attr('content'); + }, + + // Make sure that every Ajax request sends the CSRF token + CSRFProtection: function(xhr) { + var token = rails.csrfToken(); + if (token) xhr.setRequestHeader('X-CSRF-Token', token); + }, + + // Make sure that all forms have actual up-to-date tokens (cached forms contain old ones) + refreshCSRFTokens: function(){ + $('form input[name="' + rails.csrfParam() + '"]').val(rails.csrfToken()); + }, + + // Triggers an event on an element and returns false if the event result is false + fire: function(obj, name, data) { + var event = $.Event(name); + obj.trigger(event, data); + return event.result !== false; + }, + + // Default confirm dialog, may be overridden with custom confirm dialog in $.rails.confirm + confirm: function(message) { + return confirm(message); + }, + + // Default ajax function, may be overridden with custom function in $.rails.ajax + ajax: function(options) { + return $.ajax(options); + }, + + // Default way to get an element's href. May be overridden at $.rails.href. + href: function(element) { + return element[0].href; + }, + + // Checks "data-remote" if true to handle the request through a XHR request. + isRemote: function(element) { + return element.data('remote') !== undefined && element.data('remote') !== false; + }, + + // Submits "remote" forms and links with ajax + handleRemote: function(element) { + var method, url, data, withCredentials, dataType, options; + + if (rails.fire(element, 'ajax:before')) { + withCredentials = element.data('with-credentials') || null; + dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType); + + if (element.is('form')) { + method = element.data('ujs:submit-button-formmethod') || element.attr('method'); + url = element.data('ujs:submit-button-formaction') || element.attr('action'); + data = $(element[0]).serializeArray(); + // memoized value from clicked submit button + var button = element.data('ujs:submit-button'); + if (button) { + data.push(button); + element.data('ujs:submit-button', null); + } + element.data('ujs:submit-button-formmethod', null); + element.data('ujs:submit-button-formaction', null); + } else if (element.is(rails.inputChangeSelector)) { + method = element.data('method'); + url = element.data('url'); + data = element.serialize(); + if (element.data('params')) data = data + '&' + element.data('params'); + } else if (element.is(rails.buttonClickSelector)) { + method = element.data('method') || 'get'; + url = element.data('url'); + data = element.serialize(); + if (element.data('params')) data = data + '&' + element.data('params'); + } else { + method = element.data('method'); + url = rails.href(element); + data = element.data('params') || null; + } + + options = { + type: method || 'GET', data: data, dataType: dataType, + // stopping the "ajax:beforeSend" event will cancel the ajax request + beforeSend: function(xhr, settings) { + if (settings.dataType === undefined) { + xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script); + } + if (rails.fire(element, 'ajax:beforeSend', [xhr, settings])) { + element.trigger('ajax:send', xhr); + } else { + return false; + } + }, + success: function(data, status, xhr) { + element.trigger('ajax:success', [data, status, xhr]); + }, + complete: function(xhr, status) { + element.trigger('ajax:complete', [xhr, status]); + }, + error: function(xhr, status, error) { + element.trigger('ajax:error', [xhr, status, error]); + }, + crossDomain: rails.isCrossDomain(url) + }; + + // There is no withCredentials for IE6-8 when + // "Enable native XMLHTTP support" is disabled + if (withCredentials) { + options.xhrFields = { + withCredentials: withCredentials + }; + } + + // Only pass url to `ajax` options if not blank + if (url) { options.url = url; } + + return rails.ajax(options); + } else { + return false; + } + }, + + // Determines if the request is a cross domain request. + isCrossDomain: function(url) { + var originAnchor = document.createElement('a'); + originAnchor.href = location.href; + var urlAnchor = document.createElement('a'); + + try { + urlAnchor.href = url; + // This is a workaround to a IE bug. + urlAnchor.href = urlAnchor.href; + + // If URL protocol is false or is a string containing a single colon + // *and* host are false, assume it is not a cross-domain request + // (should only be the case for IE7 and IE compatibility mode). + // Otherwise, evaluate protocol and host of the URL against the origin + // protocol and host. + return !(((!urlAnchor.protocol || urlAnchor.protocol === ':') && !urlAnchor.host) || + (originAnchor.protocol + '//' + originAnchor.host === + urlAnchor.protocol + '//' + urlAnchor.host)); + } catch (e) { + // If there is an error parsing the URL, assume it is crossDomain. + return true; + } + }, + + // Handles "data-method" on links such as: + // Delete + handleMethod: function(link) { + var href = rails.href(link), + method = link.data('method'), + target = link.attr('target'), + csrfToken = rails.csrfToken(), + csrfParam = rails.csrfParam(), + form = $('
      '), + metadataInput = ''; + + if (csrfParam !== undefined && csrfToken !== undefined && !rails.isCrossDomain(href)) { + metadataInput += ''; + } + + if (target) { form.attr('target', target); } + + form.hide().append(metadataInput).appendTo('body'); + form.submit(); + }, + + // Helper function that returns form elements that match the specified CSS selector + // If form is actually a "form" element this will return associated elements outside the from that have + // the html form attribute set + formElements: function(form, selector) { + return form.is('form') ? $(form[0].elements).filter(selector) : form.find(selector); + }, + + /* Disables form elements: + - Caches element value in 'ujs:enable-with' data store + - Replaces element text with value of 'data-disable-with' attribute + - Sets disabled property to true + */ + disableFormElements: function(form) { + rails.formElements(form, rails.disableSelector).each(function() { + rails.disableFormElement($(this)); + }); + }, + + disableFormElement: function(element) { + var method, replacement; + + method = element.is('button') ? 'html' : 'val'; + replacement = element.data('disable-with'); + + if (replacement !== undefined) { + element.data('ujs:enable-with', element[method]()); + element[method](replacement); + } + + element.prop('disabled', true); + element.data('ujs:disabled', true); + }, + + /* Re-enables disabled form elements: + - Replaces element text with cached value from 'ujs:enable-with' data store (created in `disableFormElements`) + - Sets disabled property to false + */ + enableFormElements: function(form) { + rails.formElements(form, rails.enableSelector).each(function() { + rails.enableFormElement($(this)); + }); + }, + + enableFormElement: function(element) { + var method = element.is('button') ? 'html' : 'val'; + if (element.data('ujs:enable-with') !== undefined) { + element[method](element.data('ujs:enable-with')); + element.removeData('ujs:enable-with'); // clean up cache + } + element.prop('disabled', false); + element.removeData('ujs:disabled'); + }, + + /* For 'data-confirm' attribute: + - Fires `confirm` event + - Shows the confirmation dialog + - Fires the `confirm:complete` event + + Returns `true` if no function stops the chain and user chose yes; `false` otherwise. + Attaching a handler to the element's `confirm` event that returns a `falsy` value cancels the confirmation dialog. + Attaching a handler to the element's `confirm:complete` event that returns a `falsy` value makes this function + return false. The `confirm:complete` event is fired whether or not the user answered true or false to the dialog. + */ + allowAction: function(element) { + var message = element.data('confirm'), + answer = false, callback; + if (!message) { return true; } + + if (rails.fire(element, 'confirm')) { + try { + answer = rails.confirm(message); + } catch (e) { + (console.error || console.log).call(console, e.stack || e); + } + callback = rails.fire(element, 'confirm:complete', [answer]); + } + return answer && callback; + }, + + // Helper function which checks for blank inputs in a form that match the specified CSS selector + blankInputs: function(form, specifiedSelector, nonBlank) { + var foundInputs = $(), + input, + valueToCheck, + radiosForNameWithNoneSelected, + radioName, + selector = specifiedSelector || 'input,textarea', + requiredInputs = form.find(selector), + checkedRadioButtonNames = {}; + + requiredInputs.each(function() { + input = $(this); + if (input.is('input[type=radio]')) { + + // Don't count unchecked required radio as blank if other radio with same name is checked, + // regardless of whether same-name radio input has required attribute or not. The spec + // states https://www.w3.org/TR/html5/forms.html#the-required-attribute + radioName = input.attr('name'); + + // Skip if we've already seen the radio with this name. + if (!checkedRadioButtonNames[radioName]) { + + // If none checked + if (form.find('input[type=radio]:checked[name="' + radioName + '"]').length === 0) { + radiosForNameWithNoneSelected = form.find( + 'input[type=radio][name="' + radioName + '"]'); + foundInputs = foundInputs.add(radiosForNameWithNoneSelected); + } + + // We only need to check each name once. + checkedRadioButtonNames[radioName] = radioName; + } + } else { + valueToCheck = input.is('input[type=checkbox],input[type=radio]') ? input.is(':checked') : !!input.val(); + if (valueToCheck === nonBlank) { + foundInputs = foundInputs.add(input); + } + } + }); + return foundInputs.length ? foundInputs : false; + }, + + // Helper function which checks for non-blank inputs in a form that match the specified CSS selector + nonBlankInputs: function(form, specifiedSelector) { + return rails.blankInputs(form, specifiedSelector, true); // true specifies nonBlank + }, + + // Helper function, needed to provide consistent behavior in IE + stopEverything: function(e) { + $(e.target).trigger('ujs:everythingStopped'); + e.stopImmediatePropagation(); + return false; + }, + + // Replace element's html with the 'data-disable-with' after storing original html + // and prevent clicking on it + disableElement: function(element) { + var replacement = element.data('disable-with'); + + if (replacement !== undefined) { + element.data('ujs:enable-with', element.html()); // store enabled state + element.html(replacement); + } + + element.bind('click.railsDisable', function(e) { // prevent further clicking + return rails.stopEverything(e); + }); + element.data('ujs:disabled', true); + }, + + // Restore element to its original state which was disabled by 'disableElement' above + enableElement: function(element) { + if (element.data('ujs:enable-with') !== undefined) { + element.html(element.data('ujs:enable-with')); // set to old enabled state + element.removeData('ujs:enable-with'); // clean up cache + } + element.unbind('click.railsDisable'); // enable element + element.removeData('ujs:disabled'); + } + }; + + if (rails.fire($document, 'rails:attachBindings')) { + + $.ajaxPrefilter(function(options, originalOptions, xhr){ if ( !options.crossDomain ) { rails.CSRFProtection(xhr); }}); + + // This event works the same as the load event, except that it fires every + // time the page is loaded. + // + // See https://github.com/rails/jquery-ujs/issues/357 + // See https://developer.mozilla.org/en-US/docs/Using_Firefox_1.5_caching + $(window).on('pageshow.rails', function () { + $($.rails.enableSelector).each(function () { + var element = $(this); + + if (element.data('ujs:disabled')) { + $.rails.enableFormElement(element); + } + }); + + $($.rails.linkDisableSelector).each(function () { + var element = $(this); + + if (element.data('ujs:disabled')) { + $.rails.enableElement(element); + } + }); + }); + + $document.delegate(rails.linkDisableSelector, 'ajax:complete', function() { + rails.enableElement($(this)); + }); + + $document.delegate(rails.buttonDisableSelector, 'ajax:complete', function() { + rails.enableFormElement($(this)); + }); + + $document.delegate(rails.linkClickSelector, 'click.rails', function(e) { + var link = $(this), method = link.data('method'), data = link.data('params'), metaClick = e.metaKey || e.ctrlKey; + if (!rails.allowAction(link)) return rails.stopEverything(e); + + if (!metaClick && link.is(rails.linkDisableSelector)) rails.disableElement(link); + + if (rails.isRemote(link)) { + if (metaClick && (!method || method === 'GET') && !data) { return true; } + + var handleRemote = rails.handleRemote(link); + // Response from rails.handleRemote() will either be false or a deferred object promise. + if (handleRemote === false) { + rails.enableElement(link); + } else { + handleRemote.fail( function() { rails.enableElement(link); } ); + } + return false; + + } else if (method) { + rails.handleMethod(link); + return false; + } + }); + + $document.delegate(rails.buttonClickSelector, 'click.rails', function(e) { + var button = $(this); + + if (!rails.allowAction(button) || !rails.isRemote(button)) return rails.stopEverything(e); + + if (button.is(rails.buttonDisableSelector)) rails.disableFormElement(button); + + var handleRemote = rails.handleRemote(button); + // Response from rails.handleRemote() will either be false or a deferred object promise. + if (handleRemote === false) { + rails.enableFormElement(button); + } else { + handleRemote.fail( function() { rails.enableFormElement(button); } ); + } + return false; + }); + + $document.delegate(rails.inputChangeSelector, 'change.rails', function(e) { + var link = $(this); + if (!rails.allowAction(link) || !rails.isRemote(link)) return rails.stopEverything(e); + + rails.handleRemote(link); + return false; + }); + + $document.delegate(rails.formSubmitSelector, 'submit.rails', function(e) { + var form = $(this), + remote = rails.isRemote(form), + blankRequiredInputs, + nonBlankFileInputs; + + if (!rails.allowAction(form)) return rails.stopEverything(e); + + // Skip other logic when required values are missing or file upload is present + if (form.attr('novalidate') === undefined) { + if (form.data('ujs:formnovalidate-button') === undefined) { + blankRequiredInputs = rails.blankInputs(form, rails.requiredInputSelector, false); + if (blankRequiredInputs && rails.fire(form, 'ajax:aborted:required', [blankRequiredInputs])) { + return rails.stopEverything(e); + } + } else { + // Clear the formnovalidate in case the next button click is not on a formnovalidate button + // Not strictly necessary to do here, since it is also reset on each button click, but just to be certain + form.data('ujs:formnovalidate-button', undefined); + } + } + + if (remote) { + nonBlankFileInputs = rails.nonBlankInputs(form, rails.fileInputSelector); + if (nonBlankFileInputs) { + // Slight timeout so that the submit button gets properly serialized + // (make it easy for event handler to serialize form without disabled values) + setTimeout(function(){ rails.disableFormElements(form); }, 13); + var aborted = rails.fire(form, 'ajax:aborted:file', [nonBlankFileInputs]); + + // Re-enable form elements if event bindings return false (canceling normal form submission) + if (!aborted) { setTimeout(function(){ rails.enableFormElements(form); }, 13); } + + return aborted; + } + + rails.handleRemote(form); + return false; + + } else { + // Slight timeout so that the submit button gets properly serialized + setTimeout(function(){ rails.disableFormElements(form); }, 13); + } + }); + + $document.delegate(rails.formInputClickSelector, 'click.rails', function(event) { + var button = $(this); + + if (!rails.allowAction(button)) return rails.stopEverything(event); + + // Register the pressed submit button + var name = button.attr('name'), + data = name ? {name:name, value:button.val()} : null; + + var form = button.closest('form'); + if (form.length === 0) { + form = $('#' + button.attr('form')); + } + form.data('ujs:submit-button', data); + + // Save attributes from button + form.data('ujs:formnovalidate-button', button.attr('formnovalidate')); + form.data('ujs:submit-button-formaction', button.attr('formaction')); + form.data('ujs:submit-button-formmethod', button.attr('formmethod')); + }); + + $document.delegate(rails.formSubmitSelector, 'ajax:send.rails', function(event) { + if (this === event.target) rails.disableFormElements($(this)); + }); + + $document.delegate(rails.formSubmitSelector, 'ajax:complete.rails', function(event) { + if (this === event.target) rails.enableFormElements($(this)); + }); + + $(function(){ + rails.refreshCSRFTokens(); + }); + } + +})( jQuery ); diff --git a/app/assets/javascripts/new_application.js b/app/assets/javascripts/new_application.js index d54dffa86..ea716a30f 100644 --- a/app/assets/javascripts/new_application.js +++ b/app/assets/javascripts/new_application.js @@ -1,54 +1,15 @@ -//= require jquery -//= require jquery_ujs -//= require jquery-ui +//= require jquery.rails //= require js-routes -//= require bootstrap-sprockets - -//= require angular -//= require angular-sanitize -//= require angular-ui-bootstrap-tpls //= require angular-i18n -//= require angular-resource //= require ng-rails-csrf -//= require angular-cookies //= require soundmanager2-nodebug-jsmin //= require angular-rails-templates -//= require moment - //= require_tree ./angularjs -//= require loading-bar //= require underscore -//= require notifyjs -//= require notifyjs/styles/bootstrap/notify-bootstrap - -//= require lib/Chart -//= require lib/bootstrap-typeahead -//= require lib/custom-bootstrap-typeahead - -//= require extra/scroller - -//= require_self - -$(document).ready(function() { - $('.datetime_moment').each(function() { - var mtime = moment($(this).attr('origin_datetime'), 'YYYY-MM-DD HH:mm Z'); - $(this).attr('title', mtime.utc().format('YYYY-MM-DD HH:mm:ss UTC')); - }); - - window.updateTime = function () { - $('.datetime_moment').each(function() { - var time = moment($(this).attr('origin_datetime'), 'YYYY-MM-DD HH:mm Z'); - $(this).html(time.format('D MMM YYYY, HH:mm') + ' (' + time.fromNow() + ')'); - }); - }; - - updateTime(); - setInterval( updateTime, 15000 ); - -}); +//= require lib/Chart \ No newline at end of file diff --git a/app/assets/stylesheets/BootstrapXL.css b/app/assets/stylesheets/BootstrapXL.css deleted file mode 100644 index 91a6bfb3a..000000000 --- a/app/assets/stylesheets/BootstrapXL.css +++ /dev/null @@ -1,680 +0,0 @@ -/* -* https://github.com/lu4/BootstrapXL/blob/7c64e2ea5ee1f72ed3db9892c091d5a0380c4518/BootstrapXL.css -* -* CSS file with Bootstrap grid classes for screens bigger than 1600px. Just add this file after the Bootstrap CSS file and you will be able to use col-xl, col-xl-push, hidden-xl, etc. -* -* Author: Marc van Nieuwenhuijzen -* Company: WebVakman -* Site: WebVakman.nl -* -*/ -.visible-xs, -.visible-xs-block, -.visible-xs-inline, -.visible-xs-inline-block, -.visible-sm, -.visible-sm-block, -.visible-sm-inline, -.visible-sm-inline-block, -.visible-md, -.visible-md-block, -.visible-md-inline, -.visible-md-inline-block, -.visible-lg, -.visible-lg-block, -.visible-lg-inline, -.visible-lg-inline-block, -.visible-xl, -.visible-xl-block, -.visible-xl-inline, -.visible-xl-inline-block, -.visible-xx, -.visible-xx-block, -.visible-xx-inline, -.visible-xx-inline-block { - display: none !important; -} - -@media (max-width: 768px) { - .visible-xs { - display: block !important; - } - - table.visible-xs { - display: table; - } - - tr.visible-xs { - display: table-row !important; - } - - th.visible-xs, td.visible-xs { - display: table-cell !important; - } - - .visible-xs-block { - display: block !important; - } - - .visible-xs-inline { - display: inline !important; - } - - .visible-xs-inline-block { - display: inline-block !important; - } - - .hidden-xs { - display: none !important; - } -} - -@media (min-width: 768px) and (max-width: 991px) { - .visible-sm { - display: block !important; - } - - table.visible-sm { - display: table; - } - - tr.visible-sm { - display: table-row !important; - } - - th.visible-sm, td.visible-sm { - display: table-cell !important; - } - - .visible-sm-block { - display: block !important; - } - - .visible-sm-inline { - display: inline !important; - } - - .visible-sm-inline-block { - display: inline-block !important; - } - - .hidden-sm { - display: none !important; - } -} - -@media (min-width: 992px) and (max-width: 1199px) { - .visible-md { - display: block !important; - } - - table.visible-md { - display: table; - } - - tr.visible-md { - display: table-row !important; - } - - th.visible-md, td.visible-md { - display: table-cell !important; - } - - .visible-md-block { - display: block !important; - } - - .visible-md-inline { - display: inline !important; - } - - .visible-md-inline-block { - display: inline-block !important; - } - - .hidden-md { - display: none !important; - } -} - -@media (min-width: 1200px) { - .col-lg-3 { - width: 25%; - } - - .visible-lg { - display: block !important; - } - - table.visible-lg { - display: table; - } - - tr.visible-lg { - display: table-row !important; - } - - th.visible-lg, td.visible-lg { - display: table-cell !important; - } - - .visible-lg-block { - display: block !important; - } - - .visible-lg-inline { - display: inline !important; - } - - .visible-lg-inline-block { - display: inline-block !important; - } - - .hidden-lg { - display: none !important; - } -} - -@media (min-width: 1600px) { - .visible-lg { - display: none !important; - } -} - -@media (min-width: 1600px) { - .container { - width: 1570px; - } - - .col-xl-1, .col-xl-2, .col-xl-3, .col-xl-4, .col-xl-5, .col-xl-6, .col-xl-7, .col-xl-8, .col-xl-9, .col-xl-10, .col-xl-11, .col-xl-12 { - float: left; - } - - .col-xl-12 { - width: 100%; - } - - .col-xl-11 { - width: 91.66666667%; - } - - .col-xl-10 { - width: 83.33333333%; - } - - .col-xl-9 { - width: 75%; - } - - .col-xl-8 { - width: 66.66666667%; - } - - .col-xl-7 { - width: 58.33333333%; - } - - .col-xl-6 { - width: 50%; - } - - .col-xl-5 { - width: 41.66666667%; - } - - .col-xl-4 { - width: 33.33333333%; - } - - .col-xl-3 { - width: 25%; - } - - .col-xl-2 { - width: 16.66666667%; - } - - .col-xl-1 { - width: 8.33333333%; - } - - .col-xl-pull-12 { - right: 100%; - } - - .col-xl-pull-11 { - right: 91.66666667%; - } - - .col-xl-pull-10 { - right: 83.33333333%; - } - - .col-xl-pull-9 { - right: 75%; - } - - .col-xl-pull-8 { - right: 66.66666667%; - } - - .col-xl-pull-7 { - right: 58.33333333%; - } - - .col-xl-pull-6 { - right: 50%; - } - - .col-xl-pull-5 { - right: 41.66666667%; - } - - .col-xl-pull-4 { - right: 33.33333333%; - } - - .col-xl-pull-3 { - right: 25%; - } - - .col-xl-pull-2 { - right: 16.66666667%; - } - - .col-xl-pull-1 { - right: 8.33333333%; - } - - .col-xl-pull-0 { - right: auto; - } - - .col-xl-push-12 { - left: 100%; - } - - .col-xl-push-11 { - left: 91.66666667%; - } - - .col-xl-push-10 { - left: 83.33333333%; - } - - .col-xl-push-9 { - left: 75%; - } - - .col-xl-push-8 { - left: 66.66666667%; - } - - .col-xl-push-7 { - left: 58.33333333%; - } - - .col-xl-push-6 { - left: 50%; - } - - .col-xl-push-5 { - left: 41.66666667%; - } - - .col-xl-push-4 { - left: 33.33333333%; - } - - .col-xl-push-3 { - left: 25%; - } - - .col-xl-push-2 { - left: 16.66666667%; - } - - .col-xl-push-1 { - left: 8.33333333%; - } - - .col-xl-push-0 { - left: auto; - } - - .col-xl-offset-12 { - margin-left: 100%; - } - - .col-xl-offset-11 { - margin-left: 91.66666667%; - } - - .col-xl-offset-10 { - margin-left: 83.33333333%; - } - - .col-xl-offset-9 { - margin-left: 75%; - } - - .col-xl-offset-8 { - margin-left: 66.66666667%; - } - - .col-xl-offset-7 { - margin-left: 58.33333333%; - } - - .col-xl-offset-6 { - margin-left: 50%; - } - - .col-xl-offset-5 { - margin-left: 41.66666667%; - } - - .col-xl-offset-4 { - margin-left: 33.33333333%; - } - - .col-xl-offset-3 { - margin-left: 25%; - } - - .col-xl-offset-2 { - margin-left: 16.66666667%; - } - - .col-xl-offset-1 { - margin-left: 8.33333333%; - } - - .col-xl-offset-0 { - margin-left: 0; - } - - .visible-xl { - display: block !important; - } - - table.visible-xl { - display: table; - } - - tr.visible-xl { - display: table-row !important; - } - - th.visible-xl, td.visible-xl { - display: table-cell !important; - } - - .visible-xl-block { - display: block !important; - } - - .visible-xl-inline { - display: inline !important; - } - - .visible-xl-inline-block { - display: inline-block !important; - } - - .hidden-xl { - display: none !important; - } -} - -@media (min-width: 2048px) { - .visible-xl { - display: none !important; - } -} - -@media (min-width: 2048px) { - .container { - width: 1570px; - } - - .col-xx-1, .col-xx-2, .col-xx-3, .col-xx-4, .col-xx-5, .col-xx-6, .col-xx-7, .col-xx-8, .col-xx-9, .col-xx-10, .col-xx-11, .col-xx-12 { - float: left; - } - - .col-xx-12 { - width: 100%; - } - - .col-xx-11 { - width: 91.66666667%; - } - - .col-xx-10 { - width: 83.33333333%; - } - - .col-xx-9 { - width: 75%; - } - - .col-xx-8 { - width: 66.66666667%; - } - - .col-xx-7 { - width: 58.33333333%; - } - - .col-xx-6 { - width: 50%; - } - - .col-xx-5 { - width: 41.66666667%; - } - - .col-xx-4 { - width: 33.33333333%; - } - - .col-xx-3 { - width: 25%; - } - - .col-xx-2 { - width: 16.66666667%; - } - - .col-xx-1 { - width: 8.33333333%; - } - - .col-xx-pull-12 { - right: 100%; - } - - .col-xx-pull-11 { - right: 91.66666667%; - } - - .col-xx-pull-10 { - right: 83.33333333%; - } - - .col-xx-pull-9 { - right: 75%; - } - - .col-xx-pull-8 { - right: 66.66666667%; - } - - .col-xx-pull-7 { - right: 58.33333333%; - } - - .col-xx-pull-6 { - right: 50%; - } - - .col-xx-pull-5 { - right: 41.66666667%; - } - - .col-xx-pull-4 { - right: 33.33333333%; - } - - .col-xx-pull-3 { - right: 25%; - } - - .col-xx-pull-2 { - right: 16.66666667%; - } - - .col-xx-pull-1 { - right: 8.33333333%; - } - - .col-xx-pull-0 { - right: auto; - } - - .col-xx-push-12 { - left: 100%; - } - - .col-xx-push-11 { - left: 91.66666667%; - } - - .col-xx-push-10 { - left: 83.33333333%; - } - - .col-xx-push-9 { - left: 75%; - } - - .col-xx-push-8 { - left: 66.66666667%; - } - - .col-xx-push-7 { - left: 58.33333333%; - } - - .col-xx-push-6 { - left: 50%; - } - - .col-xx-push-5 { - left: 41.66666667%; - } - - .col-xx-push-4 { - left: 33.33333333%; - } - - .col-xx-push-3 { - left: 25%; - } - - .col-xx-push-2 { - left: 16.66666667%; - } - - .col-xx-push-1 { - left: 8.33333333%; - } - - .col-xx-push-0 { - left: auto; - } - - .col-xx-offset-12 { - margin-left: 100%; - } - - .col-xx-offset-11 { - margin-left: 91.66666667%; - } - - .col-xx-offset-10 { - margin-left: 83.33333333%; - } - - .col-xx-offset-9 { - margin-left: 75%; - } - - .col-xx-offset-8 { - margin-left: 66.66666667%; - } - - .col-xx-offset-7 { - margin-left: 58.33333333%; - } - - .col-xx-offset-6 { - margin-left: 50%; - } - - .col-xx-offset-5 { - margin-left: 41.66666667%; - } - - .col-xx-offset-4 { - margin-left: 33.33333333%; - } - - .col-xx-offset-3 { - margin-left: 25%; - } - - .col-xx-offset-2 { - margin-left: 16.66666667%; - } - - .col-xx-offset-1 { - margin-left: 8.33333333%; - } - - .col-xx-offset-0 { - margin-left: 0; - } - - .visible-xx { - display: block !important; - } - - table.visible-xx { - display: table; - } - - tr.visible-xx { - display: table-row !important; - } - - th.visible-xx, td.visible-xx { - display: table-cell !important; - } - - .visible-xx-block { - display: block !important; - } - - .visible-xx-inline { - display: inline !important; - } - - .visible-xx-inline-block { - display: inline-block !important; - } - - .hidden-xx { - display: none !important; - } -} \ No newline at end of file diff --git a/app/assets/stylesheets/custom_bootstrap.sass b/app/assets/stylesheets/custom_bootstrap.sass deleted file mode 100644 index c2ce93e9c..000000000 --- a/app/assets/stylesheets/custom_bootstrap.sass +++ /dev/null @@ -1,237 +0,0 @@ -article.container-fluid - background: #FFF - -$logo-mini-height: 32px -$mini-avatar-height: 30px - -.top_menu - min-height: $top-menu-height - margin-bottom: 0 - - .navbar-brand - padding: $top-menu-padding-vertical $navbar-padding-horizontal - height: $top-menu-height - - .navbar-nav - @media (min-width: $grid-float-breakpoint) - > li - > a - padding-top: $top-menu-padding-vertical - padding-bottom: $top-menu-padding-vertical - - .navbar-form, - .navbar-toggle - margin-top: (($top-menu-height - $input-height-base) / 2) - margin-bottom: (($top-menu-height - $input-height-base) / 2) - - .navbar-right .avatar - margin-top: (($top-menu-height - $mini-avatar-height) / 2) - margin-bottom: (($top-menu-height - $mini-avatar-height) / 2) - - a.navbar-brand - padding-top: (($top-menu-height - $logo-mini-height) / 2) - padding-bottom: (($top-menu-height - $logo-mini-height) / 2) - -.nav a, -.pagination a, -.carousel a, -.panel-title a, -i.fa-question-circle[data-toggle='modal'], -span.fa.fa-times, -.navbar a, ul.dropdown-menu a - cursor: pointer - -footer - padding-top: 20px - padding-bottom: 20px - text-align: center - background-color: $navbar-default-bg - - ul li - display: inline - padding: 0 - font-size: 12px - color: $navbar-default-link-color - - a - color: $navbar-default-link-color - - a:hover, - a:focus - color: $navbar-default-link-hover-color - -.offset5 - margin-top: 10px -.offset10 - margin-top: 10px -.offset20 - margin-top: 20px -.offset0 - margin-top: 0 - -.boffset5 - margin-bottom: 5px -.boffset10 - margin-bottom: 10px -.boffset20 - margin-bottom: 20px -.boffset0 - margin-bottom: 0 - -.loffset5 - margin-left: 5px -.loffset10 - margin-left: 10px - -.roffset5 - margin-right: 5px - -.boffset_auto - margin-bottom: auto - -.lroffset-15 - margin-left: 15px - margin-right: 15px - -.lpadding-5 - padding-left: 5px - -.ubpadding-5 - padding-top: 5px - padding-bottom: 5px - -.padding-5 - padding: 5px - -[ng\:cloak], -[ng-cloak], -[data-ng-cloak], -[x-ng-cloak], -.ng-cloak, -.x-ng-cloak - display: none !important - -table - tbody - td.build-list-statuses - background: #FFF !important - - .status - float: left - border: 1px solid #DDD - margin: 1px 2px - - .nocolor - background: #FFF - - td.build-list-chevrons - background: #FFF !important - a - cursor: pointer - - tr.group-start td - border-top: 2px solid #125687 - - tr.group-end td - border-bottom: 2px solid #125687 - - thead > tr > th.icon - width: 12px - -table.table-borderless > tbody > tr > td, -table.table-borderless > thead > tr > th - border: 0 - -.build-list - .panel-heading - .build-list-status - padding: 5px 10px - color: #000 - - .build-list-time - padding: 5px 10px - - .bg-nocolor - background-color: #fff - - form .row [class^=col-] - padding-top: 5px - padding-bottom: 5px - -.submenu - margin-bottom: 0 - -#submenu-navbar-collapse ul.left-border - border-left: 1px solid #dcdcdc - -#repo-block-navbar-collapse - padding-left: 0 - -form#clone_url - padding-left: 0px - padding-right: 1px - -#copy_to_clipboard.navbar-text.navbar-left - margin-left: 8px - -#git-help.navbar-text.navbar-left - margin-left: 8px - margin-right: 8px - -p.navbar-text.navbar-right.current_branch - margin-right: 0 - -#output.formatted - overflow-x: auto - -table.highlighttable - width: 100% - max-width: 100% - - td.linenos - min-width: 52px - width: 2% - cursor: pointer - - .highlight-line - background-color: #FF9900 - -textarea.resize-vertical - resize: vertical - -.label-flag - float: left - margin: 1px 2px - border: 1px solid - -.colors - a.fa - text-decoration: none - -.update-label, .update-status, .pointer - cursor: pointer - -.no-pointer - cursor: default !important - -#scroller - position: fixed - bottom: 20px - left: 20px - cursor: pointer - display: none - -nav.navbar - form#clone_url - width: 35% - .form-group - display: inline - input - width: 100% - -.pre-fail-reason - border: none - border-radius: 0 - background: none - padding: 0 - margin: 0 \ No newline at end of file diff --git a/app/assets/stylesheets/new_application.scss b/app/assets/stylesheets/new_application.scss index ddda2cf68..2aa275d46 100644 --- a/app/assets/stylesheets/new_application.scss +++ b/app/assets/stylesheets/new_application.scss @@ -35,10 +35,7 @@ $navbar-inverse-toggle-border-color: #ddd; $blockquote-font-size: 14px; -@import "bootstrap-sprockets"; -@import "bootstrap"; -@import "BootstrapXL"; -@import "custom_bootstrap"; +@import "rdash"; @import "timeline"; @import "font-awesome"; @import "loading-bar"; diff --git a/app/assets/stylesheets/rdash.css b/app/assets/stylesheets/rdash.css new file mode 100644 index 000000000..81ed5cb7e --- /dev/null +++ b/app/assets/stylesheets/rdash.css @@ -0,0 +1,517 @@ +.content-wrapper { + padding-left: 0; + margin-left: 0; + width: 100%; + height: auto; +} +@media only screen and (min-width: 561px) { + .page-wrapper.open { + padding-left: 250px; + } +} +@media only screen and (max-width: 560px) { + .page-wrapper.open { + padding-left: 70px; + } +} +.page-wrapper.open .sidebar-wrapper { + left: 150px; +} + +/** + * Hamburg Menu + * When the class of 'hamburg' is applied to the body tag of the document, + * the sidebar changes it's style to attempt to mimic a menu on a phone app, + * where the content is overlaying the content, rather than push it. + */ +@media only screen and (max-width: 560px) { + body.hamburg .page-wrapper { + padding-left: 0; + } + body.hamburg .page-wrapper:not(.open) .sidebar-wrapper { + position: absolute; + left: -100px; + } + body.hamburg .page-wrapper:not(.open) ul.sidebar .sidebar-title.separator { + display: none; + } + body.hamburg .page-wrapper.open .sidebar-wrapper { + position: fixed; + } + body.hamburg .page-wrapper.open .sidebar-wrapper ul.sidebar li.sidebar-main { + margin-left: 0px; + } + body.hamburg .sidebar-wrapper ul.sidebar li.sidebar-main, + body.hamburg .row.header .meta { + margin-left: 70px; + } + body.hamburg .sidebar-wrapper ul.sidebar li.sidebar-main, + body.hamburg .page-wrapper.open .sidebar-wrapper ul.sidebar li.sidebar-main { + transition: margin-left 0.4s ease 0s; + } +} + +/** + * Header + */ +.row.header { + height: 60px; + background: #fff; + /*margin-bottom: 15px;*/ +} +.row.header > div:last-child { + padding-right: 0; +} +.row.header .meta .page { + font-size: 17px; + padding-top: 11px; +} +.row.header .meta .breadcrumb-links { + font-size: 10px; +} +.row.header .meta div { + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; +} +.row.header .login a { + padding: 18px; + display: block; +} +.row.header .user { + min-width: 130px; +} +.row.header .user > .item { + width: 65px; + height: 60px; + float: right; + display: inline-block; + text-align: center; + vertical-align: middle; +} +.row.header .user > .item a { + color: #919191; + display: block; +} +.row.header .user > .item i { + font-size: 20px; + line-height: 55px; +} +.row.header .user > .item img { + width: 40px; + height: 40px; + margin-top: 10px; + border-radius: 2px; +} +.row.header .user > .item ul.dropdown-menu { + border-radius: 2px; + -webkit-box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05); + box-shadow: 0 6px 12px rgba(0, 0, 0, 0.05); +} +.row.header .user > .item ul.dropdown-menu .dropdown-header { + text-align: center; +} +.row.header .user > .item ul.dropdown-menu li.link { + text-align: left; +} +.row.header .user > .item ul.dropdown-menu li.link a { + padding-left: 7px; + padding-right: 7px; +} +.row.header .user > .item ul.dropdown-menu:before { + position: absolute; + top: -7px; + right: 23px; + display: inline-block; + border-right: 7px solid transparent; + border-bottom: 7px solid rgba(0, 0, 0, 0.2); + border-left: 7px solid transparent; + content: ''; +} +.row.header .user > .item ul.dropdown-menu:after { + position: absolute; + top: -6px; + right: 24px; + display: inline-block; + border-right: 6px solid transparent; + border-bottom: 6px solid #ffffff; + border-left: 6px solid transparent; + content: ''; +} + +.loading { + width: 40px; + height: 40px; + position: relative; + margin: 100px auto; +} +.double-bounce1, +.double-bounce2 { + width: 100%; + height: 100%; + border-radius: 50%; + background-color: #333; + opacity: 0.6; + position: absolute; + top: 0; + left: 0; + -webkit-animation: bounce 2s infinite ease-in-out; + animation: bounce 2s infinite ease-in-out; +} +.double-bounce2 { + -webkit-animation-delay: -1s; + animation-delay: -1s; +} +@-webkit-keyframes bounce { + 0%, + 100% { + -webkit-transform: scale(0); + } + 50% { + -webkit-transform: scale(1); + } +} +@keyframes bounce { + 0%, + 100% { + transform: scale(0); + -webkit-transform: scale(0); + } + 50% { + transform: scale(1); + -webkit-transform: scale(1); + } +} + +/* Fonts */ +@font-face { + font-family: 'Montserrat'; +/* src: url('../fonts/montserrat-regular-webfont.eot'); + src: url('../fonts/montserrat-regular-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/montserrat-regular-webfont.woff') format('woff'), url('../fonts/montserrat-regular-webfont.ttf') format('truetype'), url('../fonts/montserrat-regular-webfont.svg#montserratregular') format('svg'); +*/ + font-weight: normal; + font-style: normal; +} +@media screen and (-webkit-min-device-pixel-ratio: 0) { + @font-face { + font-family: 'Montserrat'; +/* src: url('../fonts/montserrat-regular-webfont.svg') format('svg'); */ + } + select { + font-family: Arial, Helvetica, sans-serif; + } +} +/* Base */ +html { + overflow-y: scroll; +} +body { + background: #f3f3f3; + font-family: "Montserrat"; + color: #333333 !important; +} +.row { + margin-left: 0 !important; + margin-right: 0 !important; +} +.alerts-container .alert:last-child { + margin-bottom: 0; +} +.page-wrapper { + padding-left: 70px; + height: 100%; +} +.sidebar-wrapper { + margin-left: -150px; + left: -30px; + width: 250px; + position: fixed; + height: 100%; + z-index: 999; +} +.page-wrapper, +.sidebar-wrapper { + transition: all .4s ease 0s; +} +.green { + background: #23ae89 !important; +} +.blue { + background: #2361ae !important; +} +.orange { + background: #d3a938 !important; +} +.red { + background: #ae2323 !important; +} +.form-group .help-block.form-group-inline-message { + padding-top: 5px; +} +div.input-mask { + padding-top: 7px; +} + + +/* #592727 RED */ +/* #2f5927 GREEN */ +/* #30426a BLUE (default)*/ +/* Sidebar background color */ +/* Sidebar header and footer color */ +/* Sidebar title text colour */ +/* Sidebar menu item hover color */ +/** + * Sidebar + */ +.sidebar-wrapper { + background: #30426a; +} +ul.sidebar .sidebar-main a, +.sidebar-footer, +ul.sidebar .sidebar-list a:hover, +.page-wrapper:not(.open) ul.sidebar .sidebar-title.separator { + /* Sidebar header and footer color */ + background: #2d3e63; +} +ul.sidebar { + position: absolute; + top: 0; + bottom: 0; + padding: 0; + margin: 0; + list-style: none; + text-indent: 20px; + overflow-x: hidden; + overflow-y: auto; +} +ul.sidebar li a { + color: #fff; + display: block; + float: left; + text-decoration: none; + width: 250px; +} +ul.sidebar .sidebar-main { + height: 65px; +} +ul.sidebar .sidebar-main a { + font-size: 18px; + line-height: 60px; +} +ul.sidebar .sidebar-main a:hover { + cursor: pointer; +} +ul.sidebar .sidebar-main .menu-icon { + float: right; + font-size: 18px; + padding-right: 28px; + line-height: 60px; +} +ul.sidebar .sidebar-title { + color: #738bc0; + font-size: 12px; + height: 35px; + line-height: 40px; + text-transform: uppercase; + transition: all .6s ease 0s; +} +ul.sidebar .sidebar-list { + height: 40px; +} +ul.sidebar .sidebar-list a { + text-indent: 25px; + font-size: 15px; + color: #b2bfdc; + line-height: 40px; +} +ul.sidebar .sidebar-list a:hover { + color: #fff; + border-left: 3px solid #e99d1a; + text-indent: 22px; +} +ul.sidebar .sidebar-list a:hover .menu-icon { + text-indent: 25px; +} +ul.sidebar .sidebar-list .menu-icon { + float: right; + padding-right: 29px; + line-height: 40px; + width: 70px; +} +.page-wrapper:not(.open) ul.sidebar { + bottom: 0; +} +.page-wrapper:not(.open) ul.sidebar .sidebar-title { + display: none; + height: 0px; + text-indent: -100px; +} +.page-wrapper:not(.open) ul.sidebar .sidebar-title.separator { + display: block; + height: 2px; + margin: 13px 0; +} +.page-wrapper:not(.open) ul.sidebar .sidebar-list a:hover span { + border-left: 3px solid #e99d1a; + text-indent: 22px; +} +.page-wrapper:not(.open) .sidebar-footer { + display: none; +} +.sidebar-footer { + position: absolute; + height: 40px; + bottom: 0; + width: 100%; + padding: 0; + margin: 0; + transition: all .6s ease 0s; + text-align: center; +} +.sidebar-footer div a { + color: #b2bfdc; + font-size: 12px; + line-height: 43px; +} +.sidebar-footer div a:hover { + color: #ffffff; + text-decoration: none; +} + +/* #592727 RED */ +/* #2f5927 GREEN */ +/* #30426a BLUE (default)*/ +/* Sidebar background color */ +/* Sidebar header and footer color */ +/* Sidebar title text colour */ +/* Sidebar menu item hover color */ + +/** + * Widgets + */ +.widget { + -webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); + -moz-box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); + box-shadow: 0 1px 1px rgba(0, 0, 0, 0.05); + background: #ffffff; + border: 1px solid transparent; + border-radius: 2px; + border-color: #e9e9e9; +} +.widget .widget-header .pagination, +.widget .widget-footer .pagination { + margin: 0; +} +.widget .widget-header { + color: #767676; + background-color: #f6f6f6; + padding: 10px 15px; + border-bottom: 1px solid #e9e9e9; + line-height: 30px; +} +.widget .widget-header i { + margin-right: 5px; +} +.widget .widget-body { + padding: 20px; +} +.widget .widget-body table thead { + background: #fafafa; +} +.widget .widget-body table thead * { + font-size: 14px !important; +} +.widget .widget-body table tbody * { + font-size: 13px !important; +} +.widget .widget-body .error { + color: #ff0000; +} +.widget .widget-body button { + margin-left: 5px; +} +.widget .widget-body div.alert { + margin-bottom: 10px; +} +.widget .widget-body.large { + height: 350px; + overflow-y: auto; +} +.widget .widget-body.medium { + height: 250px; + overflow-y: auto; +} +.widget .widget-body.small { + height: 150px; + overflow-y: auto; +} +.widget .widget-body.no-padding { + padding: 0; +} +.widget .widget-body.no-padding .error, +.widget .widget-body.no-padding .message { + padding: 20px; +} +.widget .widget-footer { + border-top: 1px solid #e9e9e9; + padding: 10px; +} +.widget .widget-icon { + background: #30426a; + width: 65px; + height: 65px; + border-radius: 50%; + text-align: center; + vertical-align: middle; + margin-right: 15px; +} +.widget .widget-icon i { + line-height: 66px; + color: #ffffff; + font-size: 30px; +} +.widget .widget-footer { + border-top: 1px solid #e9e9e9; + padding: 10px; +} +.widget .widget-title .pagination, +.widget .widget-footer .pagination { + margin: 0; +} +.widget .widget-content .title { + font-size: 28px; + display: block; +} +.no-left-gutter { + /*padding-right:0;*/ + padding-left: 0; +} +.top-space { + margin-top: 15px; +} +.bottom-space { + margin-bottom: 15px; +} +table tbody td.build-list-statuses .status { + float: left; + border: 1px solid #DDD; + margin: 1px 2px; +} +table tbody td.build-list-statuses { + background: none !important; +} +table tbody td.build-list-chevrons { + background: none !important; +} +table tbody tr.group-start td { + border-top: 2px solid #125687 +} +table tbody tr.group-end td { + border-bottom: 2px solid #125687 +} +.no-align { + text-align: left; +} +.form-inline > * { + margin-left: 5px; +} \ No newline at end of file diff --git a/app/assets/stylesheets/timeline.css b/app/assets/stylesheets/timeline.css new file mode 100644 index 000000000..742daf415 --- /dev/null +++ b/app/assets/stylesheets/timeline.css @@ -0,0 +1,28 @@ +ul.timeline { + list-style: none; + padding: 0; + margin-bottom: 0; +} +ul.timeline > li.timeline-day { + margin-top: 5px; + padding: 5px; + border-bottom: none; +} +ul.timeline > li.timeline-day span { + padding: 3px; + border-radius: 3px; + border: 1px solid rgb(221, 221, 221); + background: rgb(250, 250, 250); +} +ul.timeline > li { + border-bottom: 1px solid rgb(221, 221, 221); +} +ul.timeline > li:last-of-type { + border-bottom: none; +} +ul.timeline > li div.timeline-item { + padding: 10px; +} +ul.timeline > li div.timeline-item > div.timeline-item-body { + margin-top: 5px; +} \ No newline at end of file diff --git a/app/assets/stylesheets/views/blame.sass b/app/assets/stylesheets/views/blame.sass deleted file mode 100644 index 48c0572cd..000000000 --- a/app/assets/stylesheets/views/blame.sass +++ /dev/null @@ -1,12 +0,0 @@ -table.table.blame - tr - td - padding-top: 0 - padding-bottom: 0 - - pre - margin-bottom: 0 - border: 0 - .highlight - pre - background: none diff --git a/app/assets/stylesheets/views/diff.sass b/app/assets/stylesheets/views/diff.sass deleted file mode 100644 index 5e6448143..000000000 --- a/app/assets/stylesheets/views/diff.sass +++ /dev/null @@ -1,71 +0,0 @@ -.table-responsive.overflow-auto - border: 1px solid #DDD - overflow-x: auto - -table.table.diff.inline - margin-bottom: 0 - - tr.changes - pre - padding: 0 - margin: 0 - background: none - border: none - - .diff-content - padding: 0 - margin: 0 - tr - td.header - background: whitesmoke - padding: 0 0 0 10px - - td.code, td.line_numbers - padding: 0 0 0 10px - border-top: none - - td.line_numbers - background-color: #ECECEC - border-right: 1px solid #DDD - text-align: right - vertical-align: middle - padding: 0 6px - width: 40px - - td.code.del - background-color: #FFDDDD - - .idiff - background-color: #F2ACAD - - td.code.ins - background-color: #DDFFDD - - td.code.highlight-line - background-color: #FFFFCC - - tr.inline-comments - border-top: 1px solid #DDD - - .add_line-comment - position: absolute - width: 25px - height: 18px - margin-left: -103px - margin-top: 0 - cursor: pointer - opacity: 0 - filter: alpha(Opacity=0) - -moz-opacity: 0 - - tr:hover .add_line-comment - opacity: 1 - filter: alpha(Opacity=100) - -moz-opacity: 1 - - .line-comment, #new_inline_comment - max-width: 700px - -div.file div.top - min-height: 28px - background: #ededed diff --git a/app/controllers/api/v1/jobs_controller.rb b/app/controllers/api/v1/jobs_controller.rb index beb1b0c15..d84b52f1d 100644 --- a/app/controllers/api/v1/jobs_controller.rb +++ b/app/controllers/api/v1/jobs_controller.rb @@ -119,7 +119,6 @@ class Api::V1::JobsController < Api::V1::BaseController arches = params[:arches].to_s.split(',') native_arches = params[:native_arches].to_s.split(',') native_arches &= arches if !arches.empty? - puts native_arches native_arches.present? ? Arch.where(name: native_arches).pluck(:id) : [] end end diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index 0eb918ff1..fa774eb35 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -2,12 +2,14 @@ class HomeController < ApplicationController before_action :authenticate_user!, except: [:root] skip_after_action :verify_authorized + def index + redirect_to projects_dashboard_path + end + def activity(is_my_activity = false) - #@filter = :build @activity_feeds = current_user.activity_feeds .by_project_name(params[:project_name_filter]) .by_owner_uname(params[:owner_filter]) - #@activity_feeds = @activity_feeds.where(kind: "ActivityFeed::#{@filter.upcase}".constantize) unless @filter == :all @activity_feeds = if is_my_activity @activity_feeds.where(creator_id: current_user) @@ -17,8 +19,17 @@ class HomeController < ApplicationController @activity_feeds = @activity_feeds.paginate page: current_page + if @activity_feeds.next_page + if is_my_activity + method = :own_activity_path + else + method = :activity_feeds_path + end + @next_page_link = method.to_proc.call(self, page: @activity_feeds.next_page, owner_filter: params[:owner_filter], + project_name_filter: params[:project_name_filter], format: :json) + end + respond_to do |format| - format.html { render 'activity' } format.json { render 'activity' } format.atom end diff --git a/app/controllers/platforms/platforms_controller.rb b/app/controllers/platforms/platforms_controller.rb index bdda87fb4..d3fb34269 100644 --- a/app/controllers/platforms/platforms_controller.rb +++ b/app/controllers/platforms/platforms_controller.rb @@ -11,8 +11,6 @@ class Platforms::PlatformsController < Platforms::BaseController format.json { @platforms = PlatformPolicy::Scope.new(current_user, Platform).related - @platforms_count = @platforms.count - @platforms = @platforms.paginate(page: current_page, per_page: Platform.per_page) } end end diff --git a/app/controllers/projects/build_lists_controller.rb b/app/controllers/projects/build_lists_controller.rb index ea2367b96..be81d6756 100644 --- a/app/controllers/projects/build_lists_controller.rb +++ b/app/controllers/projects/build_lists_controller.rb @@ -16,7 +16,6 @@ class Projects::BuildListsController < Projects::BaseController params[:filter].each{|k,v| params[:filter].delete(k) if v.blank? } if params[:filter] respond_to do |format| - format.html format.json do @filter = BuildList::Filter.new(@project, current_user, params[:filter] || {}) params[:page] = params[:page].to_i == 0 ? nil : params[:page] @@ -84,7 +83,8 @@ class Projects::BuildListsController < Projects::BaseController else BuildList.where(id: build_lists.map(&:id)).update_all(group_id: build_lists[0].id) if build_lists.size > 1 flash[:notice] = notices.join('
      ').html_safe - redirect_to project_build_lists_path(@project) + puts root_path(anchor: "project=" + @project.name_with_owner) + redirect_to root_path(anchor: "?project=" + @project.name_with_owner) end end @@ -153,18 +153,6 @@ class Projects::BuildListsController < Projects::BaseController } end - def list - @build_lists = @project.build_lists - @build_lists = @build_lists.where(user_id: current_user) if params[:owner_filter] == 'true' - @build_lists = @build_lists.where(status: [BuildList::BUILD_ERROR, BuildList::FAILED_PUBLISH, BuildList::REJECTED_PUBLISH]) if params[:status_filter] == 'true' - - @total_build_lists = @build_lists.count - - @build_lists = @build_lists.recent.paginate(page: current_page) - - render partial: 'build_lists_ajax', layout: false - end - protected def build_list_params diff --git a/app/controllers/projects/projects_controller.rb b/app/controllers/projects/projects_controller.rb index 801fd40e6..546e014d6 100644 --- a/app/controllers/projects/projects_controller.rb +++ b/app/controllers/projects/projects_controller.rb @@ -8,70 +8,57 @@ class Projects::ProjectsController < Projects::BaseController def index authorize :project - @projects = ProjectPolicy::Scope.new(current_user, Project).membered.search(params[:search]) respond_to do |format| - format.html { - @groups = current_user.groups - @owners = User.where(id: @projects.where(owner_type: 'User').uniq.pluck(:owner_id)) - } format.json { - groups = params[:groups] || [] - owners = params[:users] || [] - @projects = @projects.by_owners(groups, owners) if groups.present? || owners.present? - @projects_count = @projects.count - @projects = @projects.recent.paginate(page: current_page, per_page: Project.per_page) + if not params[:search].present? + @projects = Project.find(current_user.build_lists.group(:project_id).limit(10).pluck(:project_id)) + else + @projects = ProjectPolicy::Scope.new(current_user, Project).membered.search(params[:search]).limit(20) + end } end end + def project_info + authorize @project + respond_to do |format| + format.json { + @github_basic_info = @project.github_data + @commits = [] + @project.github_branches.each do |branch| + last_commit_info = @project.github_last_commit(branch.name)[0] + if last_commit_info + last_commit = { + branch: branch.name, + url: last_commit_info['html_url'], + sha: last_commit_info['sha'], + message: last_commit_info['commit']['message'] + } + if last_commit_info['committer'] + last_commit[:committer_login] = last_commit_info['committer']['login'] + last_commit[:committer_url] = last_commit_info['committer']['html_url'] + else + last_commit[:committer_login] = last_commit_info['commit']['author']['name'] + last_commit[:committer_url] = '' + end + @commits << last_commit + end + end + } + end + end + + def dashboard + authorize :project + end + def new authorize :project @project = Project.new end - def mass_import - authorize :project - @project = Project.new(mass_import: true) - end - - def mass_create - authorize :project - @project = Project.new(mass_create: true) - end - - def run_mass_import - @project = Project.new project_params - @project.owner = choose_owner - authorize @project - @project.valid? - @project.errors.messages.slice! :url - if @project.errors.messages.blank? # We need only url validation - @project.init_mass_import - flash[:notice] = t('flash.project.mass_import_added_to_queue') - redirect_to projects_path - else - render :mass_import - end - end - - def run_mass_create - @project = Project.new project_params - @project.owner = choose_owner - authorize @project - @project.valid? - @project.errors.messages.slice! :url - if @project.errors.messages.blank? # We need only url validation - @project.init_mass_create - flash[:notice] = t('flash.project.mass_create_added_to_queue') - redirect_to projects_path - else - render :mass_create - end - end - def edit authorize @project - @project_aliases = Project.project_aliases(@project).paginate(page: current_page) end def create @@ -96,7 +83,7 @@ class Projects::ProjectsController < Projects::BaseController format.html do if @project.update_attributes(project_params) flash[:notice] = t('flash.project.saved') - redirect_to @project + redirect_to root_path else flash[:error] = t('flash.project.save_error') flash[:warning] = @project.errors.full_messages.join('. ') @@ -137,31 +124,6 @@ class Projects::ProjectsController < Projects::BaseController redirect_to @project.owner end - def sections - authorize @project, :update? - if request.patch? - if @project.update_attributes(project_params) - flash[:notice] = t('flash.project.saved') - redirect_to sections_project_path(@project) - else - @project.save - flash[:error] = t('flash.project.save_error') - end - end - end - - def remove_user - authorize @project - @project.relations.by_actor(current_user).destroy_all - respond_to do |format| - format.html do - flash[:notice] = t("flash.project.user_removed") - redirect_to projects_path - end - format.json { render nothing: true } - end - end - def autocomplete_maintainers authorize @project term, limit = params[:query], params[:limit] || 10 @@ -179,10 +141,6 @@ class Projects::ProjectsController < Projects::BaseController redirect_to 'https://github.com/' + @project.github_get_organization + '/' + @project.name + '/compare/' + params[:diff] end - def bl_redirect - redirect_to controller: "build_lists", action: "index" - end - protected def project_params diff --git a/app/models/concerns/project/github_api.rb b/app/models/concerns/project/github_api.rb index 6a2f913ce..78643c738 100644 --- a/app/models/concerns/project/github_api.rb +++ b/app/models/concerns/project/github_api.rb @@ -4,7 +4,7 @@ module Project::GithubApi extend ActiveSupport::Concern def github_data - Octokit.repo github_get_organization + '/' + name rescue nil + Octokit.repo github_get_organization + '/' + name rescue {} end def github_branches @@ -15,6 +15,14 @@ module Project::GithubApi Octokit.tags github_get_organization + '/' + name rescue [] end + def github_last_commit(branch = nil) + if branch.present? + Octokit.commits github_get_organization + '/' + name, sha: branch, per_page: 1 rescue [] + else + Octokit.commits github_get_organization + '/' + name, per_page: 1 rescue [] + end + end + def github_get_organization return github_organization if github_organization.presence APP_CONFIG['github_organization'] diff --git a/app/models/product_build_list.rb b/app/models/product_build_list.rb index 9b0a746f0..bb2e3bc4e 100644 --- a/app/models/product_build_list.rb +++ b/app/models/product_build_list.rb @@ -5,6 +5,7 @@ class ProductBuildList < ActiveRecord::Base include EventLoggable include ProductBuildLists::Statusable include ProductBuildLists::AbfWorkerable + include EventLoggable LIVE_TIME = 2.week # for autostart MAX_LIVE_TIME = 3.month # for manual start; diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb index f8810c9a8..8c7aa8174 100644 --- a/app/policies/project_policy.rb +++ b/app/policies/project_policy.rb @@ -3,6 +3,7 @@ class ProjectPolicy < ApplicationPolicy def index? !user.guest? end + alias_method :dashboard?, :index? alias_method :autocomplete_project?, :index? alias_method :remove_user?, :index? alias_method :preview?, :index? @@ -15,11 +16,12 @@ class ProjectPolicy < ApplicationPolicy local_reader? end - alias_method :commit?, :show? + alias_method :commit?, :show? alias_method :read?, :show? alias_method :archive?, :show? alias_method :get_id?, :show? alias_method :refs_list?, :show? + alias_method :project_info?, :show? def fork? !user.guest? && show? diff --git a/app/views/devise/passwords/edit.html.slim b/app/views/devise/passwords/edit.html.slim index e2564e5ac..1b1738e5c 100644 --- a/app/views/devise/passwords/edit.html.slim +++ b/app/views/devise/passwords/edit.html.slim @@ -1,13 +1,11 @@ -.panel.panel-default - .panel-heading - h4= t('devise.passwords.new_password') - .panel-body - +rd-widget + rd-widget-header title=t('devise.passwords.new_password') + rd-widget-body = simple_form_for resource, url: password_path(resource_name), html: { method: :put } do |f| = f.hidden_field :reset_password_token = f.input :password = f.input :password_confirmation - hr - .pull-right - = f.button :submit, t('devise.passwords.edit_button') + .row + .pull-right + = f.button :submit, t('devise.passwords.edit_button') diff --git a/app/views/devise/passwords/new.html.slim b/app/views/devise/passwords/new.html.slim index 9cd1e413d..e0cf70f90 100644 --- a/app/views/devise/passwords/new.html.slim +++ b/app/views/devise/passwords/new.html.slim @@ -1,12 +1,12 @@ -.panel.panel-default - .panel-heading - h4= t('devise.passwords.forgot') - .panel-body +.row.top-space + .col-md-6.col-md-offset-3 + rd-widget + rd-widget-header title=t('devise.passwords.forgot') + rd-widget-body + = simple_form_for resource, url: password_path(resource_name), html: { method: :post } do |f| + = hidden_field_tag :invitation_token, @invitation_token - = simple_form_for resource, url: password_path(resource_name), html: { method: :post } do |f| - = hidden_field_tag :invitation_token, @invitation_token - - = f.input :email - hr - .pull-right - = f.button :submit, t('devise.passwords.send') + = f.input :email + .row + .pull-right + = f.button :submit, t('devise.passwords.send') diff --git a/app/views/devise/registrations/new.html.slim b/app/views/devise/registrations/new.html.slim index 1673f366d..b10e7431e 100644 --- a/app/views/devise/registrations/new.html.slim +++ b/app/views/devise/registrations/new.html.slim @@ -1,18 +1,16 @@ +.row.top-space + .col-md-6.col-md-offset-3 + rd-widget + rd-widget-header title=t('layout.devise.shared_links.sign_up') + rd-widget-body + = simple_form_for resource, url: registration_path(resource_name) do |f| + = hidden_field_tag :invitation_token, @invitation_token -.panel.panel-default - .panel-heading - h4= t('layout.devise.shared_links.sign_up') - .panel-body - - = simple_form_for resource, url: registration_path(resource_name) do |f| - = hidden_field_tag :invitation_token, @invitation_token - - = f.input :uname - = f.input :name - = f.input :email - = f.input :password - = f.input :password_confirmation - - hr - .pull-right - = f.button :submit, t('layout.devise.shared_links.sign_up') \ No newline at end of file + = f.input :uname + = f.input :name + = f.input :email + = f.input :password + = f.input :password_confirmation + .row + .pull-right + = f.button :submit, t('layout.devise.shared_links.sign_up') \ No newline at end of file diff --git a/app/views/devise/sessions/new.html.slim b/app/views/devise/sessions/new.html.slim index d3b7e060f..41d884cda 100644 --- a/app/views/devise/sessions/new.html.slim +++ b/app/views/devise/sessions/new.html.slim @@ -1,22 +1,19 @@ +.row.top-space + .col-md-6.col-md-offset-3 + rd-widget + rd-widget-header title=t('layout.devise.shared_links.sign_in') + rd-widget-body + - login = t('devise.sessions.login'); password = t('devise.sessions.password') + = hidden_field_tag :login_default, login + = hidden_field_tag :password_default, password + = simple_form_for resource, url: session_path(resource_name) do |f| -.panel.panel-default - .panel-heading - h4= t('layout.devise.shared_links.sign_in') - .panel-body - - - - login = t('devise.sessions.login'); password = t('devise.sessions.password') - = hidden_field_tag :login_default, login - = hidden_field_tag :password_default, password - = simple_form_for resource, url: session_path(resource_name) do |f| - - = f.input :login - = f.input :password - - hr - .pull-left - = f.input :remember_me, as: :boolean, checked: true - .pull-right - = f.button :submit, t('layout.devise.shared_links.sign_in') - -= link_to t('layout.devise.shared_links.forgot_password'), new_password_path(resource_name) + = f.input :login + = f.input :password + .row + .pull-left + = f.input :remember_me, as: :boolean, checked: true + .pull-right + = f.button :submit, t('layout.devise.shared_links.sign_in') + .row + = link_to t('layout.devise.shared_links.forgot_password'), new_password_path(resource_name) diff --git a/app/views/home/_activity_tab.html.slim b/app/views/home/_activity_tab.html.slim deleted file mode 100644 index 200630291..000000000 --- a/app/views/home/_activity_tab.html.slim +++ /dev/null @@ -1,13 +0,0 @@ -tab[ heading= t('activity_menu.activity_feed') - active= "actCtrl.activity_tab.active" - select = "actCtrl.getContent('activity')" ] - .row - .col-md-3.offset10== render 'sidebar' - .col-md-9.offset10 - h3 - = t 'layout.activity_feed.header' - = link_to image_tag('rss.ico', width: '15px', height: '15px', class: 'atom_icon'), - atom_activity_feeds_path(format: 'atom', token: current_user.authentication_token) - i< class= 'fa fa-spinner fa-spin fa-lg offset10 boffset10' ng-show= 'actCtrl.processing' - - == render 'activity_tabsets' diff --git a/app/views/home/_activity_tabsets.html.slim b/app/views/home/_activity_tabsets.html.slim deleted file mode 100644 index 8532bc437..000000000 --- a/app/views/home/_activity_tabsets.html.slim +++ /dev/null @@ -1,18 +0,0 @@ -div ng-hide= 'actCtrl.processing' - / The time line - .row.offset10 - .col-md-12.col-sm-12 - ul.timeline - / timeline time label - li.time-label ng-repeat-start= 'item in actCtrl.getCurActivity().feed' - span ng-show= "item.is_date_changed" - | {{item.date | amDateFormat:'ll'}} - / timeline item - li ng-include= "actCtrl.getTemplate(item)" - .hide ng-repeat-end= true - li - i.img-circle.bg-primary.fa.fa-clock-o - hr - btn.center-block.btn.btn-primary[ ng-show= 'actCtrl.getCurActivity().next_page_link' - ng-click= "actCtrl.load_more()" ] - = t('layout.activity_feed.load_messages') diff --git a/app/views/home/_feed_tabs.html.haml b/app/views/home/_feed_tabs.html.haml deleted file mode 100644 index fbf09a3bb..000000000 --- a/app/views/home/_feed_tabs.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -.sub-menu.activity-tabs - %nav - %ul - - (collection = t 'feed_menu').each do |base, title| - %li= link_to title, root_path(filter: base), class: @filter == base ? 'active' : '' diff --git a/app/views/home/_filters.html.slim b/app/views/home/_filters.html.slim deleted file mode 100644 index 5830cc3b8..000000000 --- a/app/views/home/_filters.html.slim +++ /dev/null @@ -1,21 +0,0 @@ -hr - h4 - => t('layout.relations.filters') - -.form-group - = text_field_tag :owner_uname, nil, - class: 'form-control', - placeholder: t('search.placeholders.owner_filter'), - 'ng-model' => 'actCtrl.current_activity_tab.owner_uname_filter_tmp', - 'typeahead' => 'owner.uname for owner in actCtrl.getOwnersList($viewValue)', - 'typeahead-on-select' => 'actCtrl.selectOwnerFilter($item, $model, $label)', - 'typeahead-template-url' => "get_owners.html" - -.form-group - = text_field_tag :project_name, nil, - class: 'form-control', - placeholder: t('search.placeholders.name_filter'), - 'ng-model' => 'actCtrl.current_activity_tab.project_name_filter_tmp', - 'ng-value' => 'actCtrl.current_activity_tab.project_name_filter_tmp', - 'typeahead' => 'project.name for project in actCtrl.getProjectNamesList($viewValue)', - 'typeahead-on-select' => 'actCtrl.selectProjectNameFilter($item, $model, $label)' diff --git a/app/views/home/_own_activity_tab.html.slim b/app/views/home/_own_activity_tab.html.slim deleted file mode 100644 index 970aa76d9..000000000 --- a/app/views/home/_own_activity_tab.html.slim +++ /dev/null @@ -1,10 +0,0 @@ -tab[ heading= t('activity_menu.own_activity') - active= "actCtrl.own_activity_tab.active" - select = "actCtrl.getContent('own_activity')" ] - .row - .col-md-3.offset10== render 'sidebar' - .col-md-9.offset10 - h3 - = t 'layout.activity_feed.own_header' - i< class= 'fa fa-spinner fa-spin fa-lg offset10 boffset10' ng-show= 'actCtrl.processing' - == render 'activity_tabsets' diff --git a/app/views/home/_sidebar.html.slim b/app/views/home/_sidebar.html.slim deleted file mode 100644 index 63e473323..000000000 --- a/app/views/home/_sidebar.html.slim +++ /dev/null @@ -1,30 +0,0 @@ -p - = link_to t('layout.activity_feed.new_project'), new_project_path, - class: 'btn btn-primary btn-small', role: 'button' -== render 'filters' -hr -h5= t('layout.activity_feed.my_last_projects') - -ul.nav.nav-pills.nav-stacked - - current_user.projects.order(updated_at: :desc).limit(5).each do |project| - li - = link_to project_path(project) do - = fa_visibility_icon project - = project.name_with_owner - li - = link_to t('layout.activity_feed.all_my_projects'), projects_path - -hr -- midnight = Time.now.utc.to_date -h5= t 'layout.activity_feed.my_builds_by_day' -ul.nav.nav-pills.nav-stacked - - ['BuildList::BUILD_PUBLISHED', 'BuildList::SUCCESS', 'BuildList::BUILD_STARTED', - 'BuildList::BUILD_PENDING', 'BuildList::BUILD_ERROR'].each do |state| - li - a[ href = build_lists_path(filter: {status: state.constantize, 'updated_at_start(1i)' => midnight.year, - 'updated_at_start(2i)' => midnight.month, 'updated_at_start(3i)' => midnight.day}) ] - span.badge.pull-right - = BuildList.for_status(state.constantize).for_user(current_user).for_notified_date_period(midnight, nil).count - = t "layout.build_lists.statuses.#{state.demodulize.downcase}" - li - a[ href = build_lists_path ]=t 'layout.activity_feed.all_my_builds' diff --git a/app/views/home/activity.html.slim b/app/views/home/activity.html.slim deleted file mode 100644 index 6f0e73f56..000000000 --- a/app/views/home/activity.html.slim +++ /dev/null @@ -1,7 +0,0 @@ --set_meta_tags title: nil -.row - .col-xs-12.col-md-10.col-md-offset-1[ ng-controller= 'ActivityController as actCtrl' - ng-init= "actCtrl.init('#{action_name}')" ] - tabset.offset10 ng-cloak= true - == render 'activity_tab' - == render 'own_activity_tab' diff --git a/app/views/home/activity.json.jbuilder b/app/views/home/activity.json.jbuilder index 048229a85..f5748d915 100644 --- a/app/views/home/activity.json.jbuilder +++ b/app/views/home/activity.json.jbuilder @@ -1,9 +1,5 @@ if @activity_feeds.next_page - json.next_page_link root_path(filter: @filter, - page: @activity_feeds.next_page, - owner_filter: @owner_filter, - project_name_filter: @project_name_filter, - format: :json) + json.next_page_link @next_page_link end json.feed do diff --git a/app/views/home/index.html.slim b/app/views/home/index.html.slim new file mode 100644 index 000000000..e36f7d88d --- /dev/null +++ b/app/views/home/index.html.slim @@ -0,0 +1,147 @@ +.row.top-space + .col-md-6 + rd-widget + div ng-controller="ProjectsController" + rd-widget-header title=(t "dashboard.projects.title") icon="fa-cube" + input.form-control.input-sm [ng-model="search" placeholder=(t "dashboard.projects.search") + ng-change="searchProjects(search)" ng-model-options="{ debounce: 500 }"] + rd-widget-body classes="medium no-padding" loading="requesting" + .table-responsive + table.table ng-cloak=true + thead + tr + th ng-show="search" = t 'dashboard.projects.name' + th ng-hide="search" = t 'dashboard.projects.last_projects' + th + th + tbody + tr ng-repeat = 'item in projects' + td + button[ ng-click = 'selectProject(item.name_with_owner)' + ng-disabled="ProjectSelectService.disable()" class="btn btn-xs btn-link"] {{::item.name_with_owner}} + td + a[ ng-href = '{{::item.new_build_list_link}}'] = t 'dashboard.projects.new_build' + td + a[ ng-href = '{{::item.edit_link}}' + ng-show='::item.edit_link' target='_blank'] = t 'project_menu.settings' + - if policy(:project).create? + rd-widget-footer + ul.nav.nav-justified + li + = link_to t('layout.projects.new'), new_project_path, target: '_blank' + .col-md-6 + rd-widget + div ng-controller="ProjectInfoController" + rd-widget-header title=(t('dashboard.project_info.title') + '{{widget_title}}') + rd-widget-body class="medium" loading="requesting" + div ng-hide="widget_title" + = t('dashboard.project_info.select') + div ng-show="widget_title" + div + a ng-href="{{project_info.html_url}}" target="_blank" + | {{project}} + div.bottom-space + | {{project_info.description}} + div + div.bottom-space ng-repeat="commit in project_info.commits" + div + span + | {{::commit.branch}} + span.pull-right + a ng-href="{{::commit.committer_url}}" target="_blank" + | {{::commit.committer_login}} + div + a ng-href="{{::commit.url}}" target="_blank" + | {{::commit.sha}} + div + | {{::commit.message}} + +.row.top-space + .col-md-12 + == render 'projects/build_lists/filter' + rd-widget + div ng-controller="BuildListsController" + rd-widget-header title="Build Lists{{widget_title}}" icon="fa-gears" + .form-inline ng-init="autoreload=true" + button ng-model="autoreload" ng-click="setAutoreload(autoreload)" class="btn btn-default" uib-btn-checkbox="" + = t 'layout.autoreload_page' + button class="btn btn-default" ng-click="openFilters()" ng-disabled="isRequest" + | Filters + button [class="btn btn-default" ng-show="widget_title" + ng-click="clearProject()" ng-disabled="ProjectSelectService.disable()"] + | Clear selected project + rd-widget-body classes="large no-padding" loading="isRequest" + .row + table.table.table-condensed + thead + tr + th + th= t('activerecord.attributes.build_list.id') + th= t('activerecord.attributes.build_list.status') + th= t('activerecord.attributes.build_list.project') + th= t('diff') + th= t('activerecord.attributes.build_list.project_version') + th= t('activerecord.attributes.build_list.save_to_repository') + th= t('activerecord.attributes.build_list.arch_short') + th= t('activerecord.attributes.build_list.user') + th= t('activerecord.attributes.build_list.hostname') + th= t('activerecord.attributes.build_list.updated_at') + tbody + tr[ ng-repeat = 'bl in build_lists' + class = '{{::bl.status_color}}' + id = 'build-list-{{::bl.id}}' + ng-class = "{'group-start': !bl.relatedHidden, 'group-end': bl.lastRelated}" + ng-show = 'bl.show' ] + td.build-list-chevrons + a.expand ng-show = '::bl.hasRelated' + span.fa.fa-chevron-down ng-show = 'bl.relatedHidden' ng-click = 'showRelated(bl)' + span.fa.fa-chevron-up ng-hide = 'bl.relatedHidden' ng-click = 'hideRelated(bl)' + / id + td.build-list-statuses + + a[ ng-href = '{{::bl.url}}' ] {{::bl.id}} + div ng-show = '::bl.hasRelated' ng-bind-html="::bl.chevronHtml" + + / status + td + | {{::bl.human_status | i18n}} + br + time ng-show = '::bl.duration' + | {{::bl.duration}} + time ng-show = '::bl.average_build_time' + | /{{::bl.average_build_time}} + + / project + td.centered ng-hide = '::bl.project' colspan = 2 + = t('layout.projects.unexisted_project') + td ng-show = '::bl.project' + | {{::bl.project.name_with_owner}} + + / diff + td + a ng-href = '{{::bl.version_link_url}}' ng-show = '::bl.project' + | {{::bl.version_link_text}} + + / project_version + td[] {{::bl.version_release}} + + / save_to_repository + td + a[ ng-href = '{{::bl.save_to_repository_url}}' ] {{::bl.save_to_repository_name}} + + / arch_short + td[ ng-show = '::bl.arch' ] {{::bl.arch.name}} + td[ ng-hide = '::bl.arch' ]= t('layout.arches.unexisted_arch') + + / user + td + a[ ng-href = '{{::bl.user.url}}' ] {{::bl.user.fullname}} + + / hostname + td[] {{::bl.hostname}} + + / updated_at + td title = '{{::bl.updated_at_utc}}' + | {{::bl.updated_at | amDateFormat:'YYYY-MM-DD HH:mm' }} + rd-widget-footer ng-show="total_items > per_page" + == angularjs_paginate( per_page: 'per_page' ) \ No newline at end of file diff --git a/app/views/layouts/_flashes.html.slim b/app/views/layouts/_flashes.html.slim index 977823508..9ee207dc2 100644 --- a/app/views/layouts/_flashes.html.slim +++ b/app/views/layouts/_flashes.html.slim @@ -1,6 +1,6 @@ -.row - .col-lx-12.col-md-10.col-md-offset-1 - - flash.each do |type, message| - .alert.text-center class = alert_class(type) - button.close[ type = 'button' data-dismiss = 'alert' aria-hidden = true ] × - == message +- unless flash.empty? + .row.top-space.alerts-container ng-hide="hideAlerts" + .col-md-10.col-md-offset-1 + - flash.each do |type, message| + uib-alert.alert.text-center class=alert_class(type) + == message \ No newline at end of file diff --git a/app/views/layouts/_scroller.html.slim b/app/views/layouts/_scroller.html.slim deleted file mode 100644 index 8f854ef8f..000000000 --- a/app/views/layouts/_scroller.html.slim +++ /dev/null @@ -1 +0,0 @@ -#scroller.fa.fa-arrow-circle-up.fa-2x.text-primary.hidden-xs \ No newline at end of file diff --git a/app/views/layouts/application.html.slim b/app/views/layouts/application.html.slim index c28a821e7..edefc7554 100644 --- a/app/views/layouts/application.html.slim +++ b/app/views/layouts/application.html.slim @@ -3,36 +3,59 @@ html head meta name="viewport" content="width=device-width, initial-scale=1.0" meta content="text/html; charset=utf-8" http-equiv="Content-Type" - == render 'shared/header' == csrf_meta_tag = display_meta_tags site: APP_CONFIG['project_name'], reverse: true, separator: '-' - if user_signed_in? = auto_discovery_link_tag :atom, atom_activity_feeds_path(format: 'atom', token: current_user.authentication_token), title: t("layout.atom_link_tag_title", nickname: current_user.uname, app_name: APP_CONFIG['project_name']) + script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.js" type="text/javascript" + link href='//netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css' rel='stylesheet' + link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css' == stylesheet_link_tag 'new_application', cache: 'application' - body[ ng-app='RosaABF' ng-controller='RosaABFController' - ng-init="init('#{I18n.locale}', #{!!current_user.try(:sound_notifications)})" ] - == render 'layouts/menu/new_top' - == yield :submenu if content_for?(:submenu) + body[ ng-app='RosaABF' ng-controller='RosaABFController' ng-strict-di='' + ng-init="init('#{I18n.locale}', #{!!current_user.try(:sound_notifications)})" ng-cloak="true"] + .page-wrapper.open + .sidebar-wrapper + ul.sidebar + li.sidebar-main + a href="/" + = link_to image_tag('logo-mini.png', alt: 'ABF'), root_path + == render 'layouts/menu/new_top' - - if current_user || APP_CONFIG['anonymous_access'] - - if (flash_notify = FlashNotify.published_first_cached) && flash_notify.should_show?(cookies[:flash_notify_hash]) - javascript: - var FLASH_HASH_ID = "#{flash_notify.hash_id}"; - .notify.alert.alert-dismissable.text-center class=alert_class(flash_notify.status) - button.close type='button' data-dismiss='alert' aria-hidden=true - = flash_notify.body(I18n.locale).html_safe + .content-wrapper + .page-content + .row.header + .col-md-12 + .user.pull-right + - if current_user + .item.dropdown(uib-dropdown) + a(uib-dropdown-toggle) + = image_tag avatar_url(current_user), alt: 'avatar' + ul.dropdown-menu.dropdown-menu-right + li.link= link_to current_user.uname, current_user + li.link= link_to t('layout.settings.label'), profile_settings_path + li.divider + li.link= link_to t('layout.logout'), destroy_user_session_path, method: :delete + - else + ul.nav.navbar-nav + li= link_to t('layout.devise.shared_links.sign_up'), new_user_registration_path + li= link_to t('layout.devise.shared_links.sign_in'), new_user_session_path + .meta + .page + == yield :submenu if content_for?(:submenu) + == render 'layouts/noscript' + == render "layouts/flashes" - == render 'layouts/noscript' - == render "layouts/flashes" + == yield - article.container-fluid - == yield - == render 'layouts/menu/new_bottom' - == javascript_include_tag 'new_application', cache: 'application' - - if I18n.locale == :ru - == javascript_include_tag 'moment/ru.js', cache: 'moment' - == javascript_include_tag 'angular-locale_ru-ru', cache: 'angular-locale' - == yield :additional_scripts if content_for?(:additional_scripts) - - == render '/layouts/scroller' + script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.12.0/moment.min.js" type="text/javascript" + script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-resource.js" type="text/javascript" + script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-cookies.js" type="text/javascript" + script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-sanitize.js" type="text/javascript" + script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/1.2.5/ui-bootstrap-tpls.js" type="text/javascript" + script src="https://code.jquery.com/jquery-2.2.2.min.js" integrity="sha256-36cp2Co+/62rEAAYHLmRCPIych47CvdM+uTBJwSzWjI=" crossorigin="anonymous" + == javascript_include_tag 'new_application', cache: 'application' + == yield :additional_scripts if content_for?(:additional_scripts) + - if I18n.locale == :ru + == javascript_include_tag 'moment/ru.js', cache: 'moment' + == javascript_include_tag 'angular-locale_ru-ru', cache: 'angular-locale' \ No newline at end of file diff --git a/app/views/layouts/invite.html.haml b/app/views/layouts/invite.html.haml deleted file mode 100644 index 246ff32ad..000000000 --- a/app/views/layouts/invite.html.haml +++ /dev/null @@ -1,22 +0,0 @@ -!!! -%html - %head - %meta{content: "text/html; charset=utf-8", "http-equiv" => "Content-Type"}/ - %title=t 'invites.title' - %script{src: "http://html5shiv.googlecode.com/svn/trunk/html5.js", type: "text/javascript"} - %link{href: "/styles/prereg.css", rel: "stylesheet", type: "text/css"}/ - %body - .wrap - = yield :nav if content_for?(:nav) - / Top block - %header - .logo - .text=t 'invites.header' - .both - / Page - %article - =yield - .both - / Footer - %footer= render "layouts/menu/bottom" - = render 'layouts/counters' if !current_user.try(:admin?) && Rails.env.production? diff --git a/app/views/layouts/loading.html.slim b/app/views/layouts/loading.html.slim new file mode 100644 index 000000000..35ab6f610 --- /dev/null +++ b/app/views/layouts/loading.html.slim @@ -0,0 +1,2 @@ +div ng-if="false" + \ No newline at end of file diff --git a/app/views/layouts/menu/_new_top.html.slim b/app/views/layouts/menu/_new_top.html.slim index c58f7be3d..dafcc45c0 100644 --- a/app/views/layouts/menu/_new_top.html.slim +++ b/app/views/layouts/menu/_new_top.html.slim @@ -1,62 +1,12 @@ -nav.navbar.navbar-inverse.top_menu role = "navigation" - .container-fluid - / Brand and toggle get grouped for better mobile display - .navbar-header - button.navbar-toggle[ data-target = "#top-menu-navbar-collapse" data-toggle = "collapse" type = "button" ] - span.sr-only Toggle navigation - span.icon-bar - span.icon-bar - span.icon-bar - = link_to image_tag('logo-mini.png', alt: 'ABF'), root_path, class: 'navbar-brand' - / Collect the nav links, forms, and other content for toggling - #top-menu-navbar-collapse.collapse.navbar-collapse - ul.nav.navbar-nav - - (collection = t 'top_menu').each do |base, title| - - if policy(base.to_s.singularize.to_sym).index? - li class=top_menu_class(base) - a href=send("#{base}_path") - i.fa.hidden-sm class=top_menu_icon(base) - i.fa.visible-sm-inline-block.fa-2x class=top_menu_icon(base) - span.hidden-sm - =< title - li - a href="http://repoclosure.openmandriva.org" - i.fa.hidden-sm class="fa-bicycle" - i.fa.visible-sm-inline-block.fa-2x class="fa-bicycle" - span.hidden-sm - =< t('repoclosure') - - if current_user.try(:admin?) - li class=top_menu_class('admin') - a href=admin_users_path target="_blank" - i.fa.fa-lock.hidden-sm - i.fa.fa-lock.visible-sm-inline-block.fa-2x - span.hidden-sm - =< t('admins_menu_header') - li - = form_tag search_index_path, method: 'get', class: 'navbar-form navbar-left', - role: 'search' do - .form-group - = text_field_tag 'query', @query, placeholder: t('layout.search.header'), class: 'form-control' - ul.nav.navbar-nav.navbar-right - - if current_user - li.hidden-xs - .avatar - = image_tag avatar_url(current_user), alt: 'avatar', class: 'img-responsive' - li.dropdown - a.dropdown[ data-toggle = 'dropdown' href = '#' id = 'userMenuLabel' - aria-haspopup = 'true' aria-expanded = 'false' ] - span.visible-xs-inline-block.visible-lg-inline-block> - = current_user.uname - i.fa.fa-cog.hidden-sm - i.fa.fa-cog.visible-sm-inline-block.fa-2x - ul.dropdown-menu role = 'menu' aria-labelledby = 'userMenuLabel' - li= link_to current_user.uname, current_user - li= link_to t('layout.settings.label'), profile_settings_path - li.divider - li= link_to t('layout.logout'), destroy_user_session_path, method: :delete - - else - ul.nav.navbar-nav - li= link_to t('layout.devise.shared_links.sign_up'), new_user_registration_path - li= link_to t('layout.devise.shared_links.sign_in'), new_user_session_path - / /.navbar-collapse - / /.container-fluid +-if current_user + -if policy(:project).dashboard? + li.sidebar-list + a href=projects_dashboard_path + =t 'dashboard.dashboard_name' + span.menu-icon.fa.fa-tachometer + - (collection = t 'top_menu').each do |base, title| + - if policy(base.to_s.singularize.to_sym).index? + li.sidebar-list + a href=send("#{base}_path") + = title + span.menu-icon.fa class=top_menu_icon(base) \ No newline at end of file diff --git a/app/views/layouts/sessions.html.slim b/app/views/layouts/sessions.html.slim index 5c36f0851..edefc7554 100644 --- a/app/views/layouts/sessions.html.slim +++ b/app/views/layouts/sessions.html.slim @@ -3,27 +3,59 @@ html head meta name="viewport" content="width=device-width, initial-scale=1.0" meta content="text/html; charset=utf-8" http-equiv="Content-Type" - == render 'shared/header' == csrf_meta_tag = display_meta_tags site: APP_CONFIG['project_name'], reverse: true, separator: '-' + - if user_signed_in? + = auto_discovery_link_tag :atom, atom_activity_feeds_path(format: 'atom', token: current_user.authentication_token), title: t("layout.atom_link_tag_title", nickname: current_user.uname, app_name: APP_CONFIG['project_name']) + script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular.js" type="text/javascript" + link href='//netdna.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css' rel='stylesheet' + link href='https://fonts.googleapis.com/css?family=Montserrat' rel='stylesheet' type='text/css' == stylesheet_link_tag 'new_application', cache: 'application' - body - == render 'layouts/menu/new_top' - == render 'layouts/noscript' - == render "layouts/flashes" + body[ ng-app='RosaABF' ng-controller='RosaABFController' ng-strict-di='' + ng-init="init('#{I18n.locale}', #{!!current_user.try(:sound_notifications)})" ng-cloak="true"] + .page-wrapper.open + .sidebar-wrapper + ul.sidebar + li.sidebar-main + a href="/" + = link_to image_tag('logo-mini.png', alt: 'ABF'), root_path + == render 'layouts/menu/new_top' + + .content-wrapper + .page-content + .row.header + .col-md-12 + .user.pull-right + - if current_user + .item.dropdown(uib-dropdown) + a(uib-dropdown-toggle) + = image_tag avatar_url(current_user), alt: 'avatar' + ul.dropdown-menu.dropdown-menu-right + li.link= link_to current_user.uname, current_user + li.link= link_to t('layout.settings.label'), profile_settings_path + li.divider + li.link= link_to t('layout.logout'), destroy_user_session_path, method: :delete + - else + ul.nav.navbar-nav + li= link_to t('layout.devise.shared_links.sign_up'), new_user_registration_path + li= link_to t('layout.devise.shared_links.sign_in'), new_user_session_path + .meta + .page + == yield :submenu if content_for?(:submenu) + == render 'layouts/noscript' + == render "layouts/flashes" - article.container-fluid.offset10 - .row - .col-md-6.col-md-offset-3 - .panel.panel-primary - .panel-heading - = image_tag 'logo.png', class: 'img-responsive center-block img-rounded' == yield - == render 'layouts/menu/new_bottom' - == javascript_include_tag 'new_application', cache: 'application' - == javascript_include_tag 'login' - - if I18n.locale == :ru - == javascript_include_tag 'moment/ru.js', cache: 'moment' - == javascript_include_tag 'angular-locale_ru-ru', cache: 'angular-locale' - == yield :additional_scripts if content_for?(:additional_scripts) \ No newline at end of file + + script src="https://cdnjs.cloudflare.com/ajax/libs/moment.js/2.12.0/moment.min.js" type="text/javascript" + script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-resource.js" type="text/javascript" + script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-cookies.js" type="text/javascript" + script src="//ajax.googleapis.com/ajax/libs/angularjs/1.5.3/angular-sanitize.js" type="text/javascript" + script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-bootstrap/1.2.5/ui-bootstrap-tpls.js" type="text/javascript" + script src="https://code.jquery.com/jquery-2.2.2.min.js" integrity="sha256-36cp2Co+/62rEAAYHLmRCPIych47CvdM+uTBJwSzWjI=" crossorigin="anonymous" + == javascript_include_tag 'new_application', cache: 'application' + == yield :additional_scripts if content_for?(:additional_scripts) + - if I18n.locale == :ru + == javascript_include_tag 'moment/ru.js', cache: 'moment' + == javascript_include_tag 'angular-locale_ru-ru', cache: 'angular-locale' \ No newline at end of file diff --git a/app/views/platforms/base/_submenu.html.slim b/app/views/platforms/base/_submenu.html.slim index 1d44f7b4a..13f3ddb51 100644 --- a/app/views/platforms/base/_submenu.html.slim +++ b/app/views/platforms/base/_submenu.html.slim @@ -5,39 +5,33 @@ .container-fluid / Brand and toggle get grouped for better mobile display .navbar-header - button.navbar-toggle data-target='#submenu-navbar-collapse' data-toggle='collapse' type='button' - span.sr-only Toggle navigation - span.icon-bar - span.icon-bar - span.icon-bar .navbar-brand = link_to platform_printed_name(@platform), @platform / Collect the nav links, forms, and other content for toggling - #submenu-navbar-collapse.collapse.navbar-collapse - ul.nav.navbar-nav.left-border + ul.nav.navbar-nav.left-border - li class=('active' if act == :show && contr == :platforms) - = link_to t("layout.platforms.about"), platform_path(@platform) - li class=('active' if contr == :repositories) - = link_to t("layout.repositories.list_header"), platform_repositories_path(@platform) - li class=('active' if contr == :contents) - = link_to t('layout.platforms.contents'), platform_contents_path(@platform) - - if policy(@platform).show? - li class=('active' if act == :index && contr == :maintainers) - = link_to t("layout.platforms.maintainers"), platform_maintainers_path(@platform) - li class=('active' if contr == :mass_builds) - = link_to t("layout.platforms.mass_build"), platform_mass_builds_path(@platform) - - if policy(@platform.products.build).show? - li class=('active' if contr == :products) - = link_to t("layout.products.list_header"), platform_products_path(@platform) - - if policy(@platform).update? - li class=('active' if act == :edit && contr == :platforms) - = link_to t("platform_menu.settings"), edit_platform_path(@platform) - - if policy(@platform).local_admin_manage? - li class=('active' if act == :members && contr == :platforms) - = link_to t("layout.platforms.members"), members_platform_path(@platform) - - if policy(@platform).edit? - li class=('active' if contr == :key_pairs) - = link_to t("layout.key_pairs.header"), platform_key_pairs_path(@platform) - li class=('active' if contr == :tokens) - = link_to t('layout.tokens.header'), platform_tokens_path(@platform) + li class=('active' if act == :show && contr == :platforms) + = link_to t("layout.platforms.about"), platform_path(@platform) + li class=('active' if contr == :repositories) + = link_to t("layout.repositories.list_header"), platform_repositories_path(@platform) + li class=('active' if contr == :contents) + = link_to t('layout.platforms.contents'), platform_contents_path(@platform) + - if policy(@platform).show? + li class=('active' if act == :index && contr == :maintainers) + = link_to t("layout.platforms.maintainers"), platform_maintainers_path(@platform) + li class=('active' if contr == :mass_builds) + = link_to t("layout.platforms.mass_build"), platform_mass_builds_path(@platform) + - if policy(@platform.products.build).show? + li class=('active' if contr == :products) + = link_to t("layout.products.list_header"), platform_products_path(@platform) + - if policy(@platform).update? + li class=('active' if act == :edit && contr == :platforms) + = link_to t("platform_menu.settings"), edit_platform_path(@platform) + - if policy(@platform).local_admin_manage? + li class=('active' if act == :members && contr == :platforms) + = link_to t("layout.platforms.members"), members_platform_path(@platform) + - if policy(@platform).edit? + li class=('active' if contr == :key_pairs) + = link_to t("layout.key_pairs.header"), platform_key_pairs_path(@platform) + li class=('active' if contr == :tokens) + = link_to t('layout.tokens.header'), platform_tokens_path(@platform) diff --git a/app/views/platforms/contents/index.html.slim b/app/views/platforms/contents/index.html.slim index bf96cd23a..3e33f277c 100644 --- a/app/views/platforms/contents/index.html.slim +++ b/app/views/platforms/contents/index.html.slim @@ -1,7 +1,7 @@ - set_meta_tags title: [title_object(@platform), t('layout.platforms.contents')] = render 'platforms/base/submenu' -.col-xs-12.col-md-10.col-md-offset-1 +.col-xs-12.col-md-12 h3 = t('layout.platforms.contents_of') |   diff --git a/app/views/platforms/maintainers/index.html.slim b/app/views/platforms/maintainers/index.html.slim index 5ca369922..b12a21f1f 100644 --- a/app/views/platforms/maintainers/index.html.slim +++ b/app/views/platforms/maintainers/index.html.slim @@ -1,7 +1,7 @@ - set_meta_tags title: [title_object(@platform), t('layout.maintainers.list_header')] / FIXME: no these 'base' links! = render 'platforms/base/submenu' -.col-xs-12.col-md-10.col-md-offset-1 +.col-xs-12.col-md-12 .row / = render partial: 'list', object: @maintainers / = will_paginate @maintainers diff --git a/app/views/platforms/mass_builds/index.html.slim b/app/views/platforms/mass_builds/index.html.slim index 23c234def..2e5a077b5 100644 --- a/app/views/platforms/mass_builds/index.html.slim +++ b/app/views/platforms/mass_builds/index.html.slim @@ -1,6 +1,6 @@ = render 'platforms/base/submenu' -.col-xs-12.col-md-10.col-md-offset-1 +.col-md-12 .row - if policy(@platform.mass_builds.build).create? a.btn.btn-primary href=new_platform_mass_build_path(@platform) diff --git a/app/views/platforms/mass_builds/new.html.slim b/app/views/platforms/mass_builds/new.html.slim index 9224c2fd5..845e18c60 100644 --- a/app/views/platforms/mass_builds/new.html.slim +++ b/app/views/platforms/mass_builds/new.html.slim @@ -2,12 +2,11 @@ = render 'platforms/base/submenu' -.col-xs-12.col-md-10.col-md-offset-1 - +.col-md-12 .row[ ng-controller = 'NewMassBuildController as newMassBuildCtrl' ng-cloak = true ] = simple_form_for @mass_build, url: platform_mass_builds_path(@platform) do |f| - .col-md-4.col-md-offset-2 + .col-md-8 = f.input :description, as: :text, input_html: { class: 'resize-vertical' } b diff --git a/app/views/platforms/mass_builds/show.html.slim b/app/views/platforms/mass_builds/show.html.slim index 51e033297..92ca35e13 100644 --- a/app/views/platforms/mass_builds/show.html.slim +++ b/app/views/platforms/mass_builds/show.html.slim @@ -7,7 +7,7 @@ = render 'submenu' -.col-xs-12.col-md-10.col-md-offset-1 +.col-md-12 .row h3 = t('activerecord.models.mass_build') diff --git a/app/views/platforms/platforms/edit.html.slim b/app/views/platforms/platforms/edit.html.slim index f5420457f..5eed0fd33 100644 --- a/app/views/platforms/platforms/edit.html.slim +++ b/app/views/platforms/platforms/edit.html.slim @@ -1,7 +1,7 @@ - set_meta_tags title: [title_object(@platform), t('layout.platforms.edit')] = render 'submenu' -.container.col-md-offset-2.col-md-8 +.container.col-md-12 .row = simple_form_for @platform, wrapper_mappings: { boolean: :vertical_boolean } do |f| = render 'form', f: f diff --git a/app/views/platforms/platforms/index.html.slim b/app/views/platforms/platforms/index.html.slim index a35dbd503..495c84101 100644 --- a/app/views/platforms/platforms/index.html.slim +++ b/app/views/platforms/platforms/index.html.slim @@ -1,23 +1,24 @@ - set_meta_tags title: t('layout.platforms.list_header') -.row ng-controller='PlatformsCtrl' - .col-md-6.col-md-offset-3 ng-cloak=true - - if policy(:platform).create? - a.btn.btn-primary href=new_platform_path - = t('layout.platforms.new') - table.table.table-hover.offset10 - thead - tr - th - th= t 'activerecord.attributes.platform.name' - th= t 'activerecord.attributes.platform.distrib_type' - tbody - tr ng-repeat='item in platforms' - td - i.fa.fa-lg ng-class='item.visibility_class' - td - a ng-href="{{item.link}}" - | {{item.name}} - td - | {{item.distrib_type}} - - = angularjs_paginate per_page: Platform.per_page +.row.top-space ng-controller='PlatformsController' + .col-md-6.col-md-offset-3 + rd-widget + rd-widget-header title=(t('layout.platforms.list_header')) + rd-widget-body class="no-padding" + table.table.table-hover + thead + tr + th= t 'activerecord.attributes.platform.name' + th= t 'activerecord.attributes.platform.distrib_type' + tbody + tr ng-repeat='item in platforms' + td + a ng-href="{{item.link}}" + | {{item.name}} + td + | {{item.distrib_type}} + - if policy(:platform).create? + rd-widget-footer + ul.nav.nav-justified + li + a href=new_platform_path + = t('layout.platforms.new') \ No newline at end of file diff --git a/app/views/platforms/platforms/index.json.jbuilder b/app/views/platforms/platforms/index.json.jbuilder index 56acd2e81..d872425b6 100644 --- a/app/views/platforms/platforms/index.json.jbuilder +++ b/app/views/platforms/platforms/index.json.jbuilder @@ -4,10 +4,6 @@ json.platforms do json.name platform_printed_name(item) json.link platform_path(item) json.distrib_type item.distrib_type - json.visibility_class fa_platform_visibility_icon(item) end end -end - -json.page params[:page] -json.platforms_count @platforms_count +end \ No newline at end of file diff --git a/app/views/platforms/platforms/members.html.slim b/app/views/platforms/platforms/members.html.slim index ebbf4e2bd..70eee08db 100644 --- a/app/views/platforms/platforms/members.html.slim +++ b/app/views/platforms/platforms/members.html.slim @@ -1,7 +1,7 @@ -set_meta_tags title: [title_object(@platform), t('layout.platforms.members')] = render 'submenu' -.container.col-md-offset-2.col-md-8 +.container.col-md-12 .row = render "shared/members_table", remove_members_path: remove_members_platform_path(@platform), diff --git a/app/views/platforms/platforms/new.html.slim b/app/views/platforms/platforms/new.html.slim index 9f576cd00..19169fc31 100644 --- a/app/views/platforms/platforms/new.html.slim +++ b/app/views/platforms/platforms/new.html.slim @@ -1,7 +1,7 @@ .container .row - .col-md-offset-2.col-md-8 + .col-md-12 = simple_form_for @platform, html: { class: 'form-horizontal' }, wrapper: :horizontal_form, wrapper_mappings: { boolean: :horizontal_boolean } do |f| diff --git a/app/views/platforms/platforms/show.html.slim b/app/views/platforms/platforms/show.html.slim index 1bcd2904e..eb30539e1 100644 --- a/app/views/platforms/platforms/show.html.slim +++ b/app/views/platforms/platforms/show.html.slim @@ -7,7 +7,7 @@ = render 'submenu' -.col-xs-12.col-md-10.col-md-offset-1 +.col-md-12 .row .col-md-6 h3 diff --git a/app/views/platforms/product_build_lists/new.html.slim b/app/views/platforms/product_build_lists/new.html.slim index 613fdfe9c..b85c996db 100644 --- a/app/views/platforms/product_build_lists/new.html.slim +++ b/app/views/platforms/product_build_lists/new.html.slim @@ -2,7 +2,7 @@ = render 'submenu' -.container.col-md-offset-2.col-md-8 +.container.col-md-12 .row - pbl = @product_build_list = simple_form_for @product_build_list, url: platform_product_product_build_lists_path(@platform, @product) do |f| diff --git a/app/views/platforms/product_build_lists/show.html.slim b/app/views/platforms/product_build_lists/show.html.slim index 3218d143d..be3399828 100644 --- a/app/views/platforms/product_build_lists/show.html.slim +++ b/app/views/platforms/product_build_lists/show.html.slim @@ -10,7 +10,7 @@ - product = pbl.product - platform = product.platform -.container.col-md-offset-2.col-md-8 ng-controller='ProductBuildListController' +.container.col-md-12 ng-controller='ProductBuildListController' .row h3 = t('layout.product_build_lists.main_data') diff --git a/app/views/platforms/products/edit.html.slim b/app/views/platforms/products/edit.html.slim index 73d8421b6..27161b584 100644 --- a/app/views/platforms/products/edit.html.slim +++ b/app/views/platforms/products/edit.html.slim @@ -1,7 +1,7 @@ - set_meta_tags title: [title_object(@product), t('title_editing')] = render 'submenu' -.container.col-md-offset-2.col-md-8 +.container.col-md-12 .row h3 = t('layout.products.edit_header') diff --git a/app/views/platforms/products/index.html.slim b/app/views/platforms/products/index.html.slim index 71b025715..9934a4106 100644 --- a/app/views/platforms/products/index.html.slim +++ b/app/views/platforms/products/index.html.slim @@ -2,7 +2,7 @@ = render 'submenu' if params[:platform_id] -.container.col-md-offset-2.col-md-8 +.container.col-md-12 .row - if policy(@platform.products.build).create? diff --git a/app/views/platforms/products/new.html.slim b/app/views/platforms/products/new.html.slim index e74fe13e5..00e4dd9a7 100644 --- a/app/views/platforms/products/new.html.slim +++ b/app/views/platforms/products/new.html.slim @@ -2,7 +2,7 @@ = render 'submenu' -.container.col-md-offset-2.col-md-8 +.container.col-md-12 .row = simple_form_for [@platform, @product] do |f| = render 'form', f: f diff --git a/app/views/platforms/products/show.html.slim b/app/views/platforms/products/show.html.slim index 20b7d8b6b..e610a11b6 100644 --- a/app/views/platforms/products/show.html.slim +++ b/app/views/platforms/products/show.html.slim @@ -7,7 +7,7 @@ = render 'submenu' -.container.col-md-offset-2.col-md-8 +.container.col-md-12 .row h3 diff --git a/app/views/platforms/repositories/index.html.slim b/app/views/platforms/repositories/index.html.slim index 43b041d16..790bcc6cc 100644 --- a/app/views/platforms/repositories/index.html.slim +++ b/app/views/platforms/repositories/index.html.slim @@ -8,7 +8,7 @@ = render 'submenu' if params[:platform_id] -.container.col-md-offset-2.col-md-8 +.container.col-md-12 - if policy(@platform.repositories.build).create? .row a.btn.btn-primary href=new_platform_repository_path(@platform) diff --git a/app/views/platforms/repositories/show.html.slim b/app/views/platforms/repositories/show.html.slim index cbc8236ce..b50509d7c 100644 --- a/app/views/platforms/repositories/show.html.slim +++ b/app/views/platforms/repositories/show.html.slim @@ -6,7 +6,7 @@ description: truncate(@repository.description, length: 200) } = render 'submenu' -.container.col-md-offset-2.col-md-8 +.container.col-md-12 .row h3 = t("layout.repositories.about") diff --git a/app/views/projects/base/_submenu.html.slim b/app/views/projects/base/_submenu.html.slim deleted file mode 100644 index fe9ae0604..000000000 --- a/app/views/projects/base/_submenu.html.slim +++ /dev/null @@ -1,57 +0,0 @@ -- content_for :submenu do - - act = action_name.to_sym; contr = controller_name.to_sym; - - github_success = @project.github_data != nil - - github_base_url = @project.github_data.html_url unless not github_success - nav.navbar.navbar-default role='navigation' - .container-fluid ng-cloak = true - / Brand and toggle get grouped for better mobile display - .navbar-header - button.navbar-toggle data-target='#submenu-navbar-collapse' data-toggle='collapse' type='button' - span.sr-only Toggle navigation - span.icon-bar - span.icon-bar - span.icon-bar - .navbar-brand - = fa_visibility_icon @project - = link_to @project.owner.uname, @project.owner - | / - = link_to @project.name, project_path(@project) - / Collect the nav links, forms, and other content for toggling - #submenu-navbar-collapse.collapse.navbar-collapse - ul.nav.navbar-nav.left-border - - if github_success - li - a href=github_base_url target="_blank" - i.fa.fa-github> - = t('project_menu.github') - - if @project.is_package - li class=('active' if contr == :build_lists) - a href=project_build_lists_path(@project) - i.fa.fa-cogs> - = t('project_menu.builds') - - - if github_success and @project.github_data.has_issues - li - a href=(github_base_url + "/issues") target="_blank" - i.fa.fa-exclamation-circle> - = t('project_menu.tracker', count: @project.github_data.open_issues_count) - - if github_success - li - a href=(github_base_url + "/pulls") target="_blank" - i.fa.fa-tasks> - = t('project_menu.pull_requests') - - if github_success and @project.github_data.has_wiki - li - a href=(github_base_url + "/wiki") target="_blank" - i.fa.fa-book> - = t('project_menu.wiki') - - if policy(@project).update? - li class=('active' if act.in?(%i[edit update sections]) && contr == :projects) - a href=edit_project_path(@project) - i.fa.fa-cog> - = t('project_menu.settings') - - if contr == :build_lists && act == :index - .clearfix - == render 'server_status' - / /.navbar-collapse - / /.container-fluid diff --git a/app/views/projects/build_lists/_build_lists_ajax.json.jbuilder b/app/views/projects/build_lists/_build_lists_ajax.json.jbuilder deleted file mode 100644 index bb9eaa923..000000000 --- a/app/views/projects/build_lists/_build_lists_ajax.json.jbuilder +++ /dev/null @@ -1,30 +0,0 @@ -json.build_lists @build_lists do |bl| - json.id bl.id - json.path build_list_path(bl) - json.human_status bl.human_status - - json.version do - json.name build_list_version_name(bl) - json.path get_build_list_version_path(bl) - json.release get_version_release(bl) - end - - if bl.build_for_platform && bl.save_to_platform.personal? - build_for = " (#{bl.build_for_platform.name})" - end - - json.save_to_repository do - json.path platform_repository_path(bl.save_to_platform, bl.save_to_repository) - json.name "#{bl.save_to_platform.name}/#{bl.save_to_repository.name}#{build_for}" - end - - json.arch bl.arch.try(:name) || t('layout.arches.unexisted_arch') - json.user do - json.path user_path(bl.user) if bl.user - json.fullname bl.user.try(:fullname) - end - - json.updated_at bl.updated_at -end - -json.total_items @total_build_lists diff --git a/app/views/projects/build_lists/_filter.html.slim b/app/views/projects/build_lists/_filter.html.slim index e7cb640ff..0741171a5 100644 --- a/app/views/projects/build_lists/_filter.html.slim +++ b/app/views/projects/build_lists/_filter.html.slim @@ -1,92 +1,60 @@ -- html_options = { class: 'form-control' } -.panel.panel-info - .panel-heading.pointer ng-click = 'isOpenFilters = !isOpenFilters' - span.fa.fa-filter.fa-lg - =< t 'layout.build_lists.filters' - span.pull-right.fa ng-class = "{'fa-chevron-down': isOpenFilters, 'fa-chevron-up': !isOpenFilters}" - .panel-body ng-show = 'isOpenFilters' - = form_for :filter, html: { class: :form, id: 'monitoring_filter' }, authenticity_token: false do |f| - .row +script type="text/ng-template" id="build_list_filters.html" + .modal-header + | Bleh + .modal-body + .row + - html_options = { class: 'form-control' } + = form_for :filter, html: { id: 'monitoring_filter' }, authenticity_token: false do |f| .col-xl-12.col-md-4 h4= t 'layout.build_lists.ownership.header' - =f.hidden_field :ownership, value: '{{params.filter.ownership}}' if current_user .btn-group.btn-group-justified - ['owned', (@project ? nil : 'related'), 'everything'].compact.each do |ownership| .btn-group - button.btn.btn-default[ ng-model = 'params.filter.ownership' - btn-radio = "'#{ownership}'" - type = 'button' - disabled = !current_user ] + label.btn.btn-default [ ng-model = 'params.ownership' + uib-btn-radio = "'#{ownership}'" ] = t "layout.build_lists.ownership.#{ownership}" h4= t 'number_rows' - =hidden_field_tag :per_page, '{{params.per_page}}' - =hidden_field_tag :page, '{{params.page}}' .btn-group.btn-group-justified -BuildList::Filter::PER_PAGE.each do |num| .btn-group - button.btn.btn-default[ ng-model = 'params.per_page' btn-radio = "'#{num}'" type = 'button' ]= num + label.btn.btn-default[ ng-model = 'params.per_page' uib-btn-radio = "'#{num}'" ]= num h4= t 'activerecord.attributes.build_list.status' = f.select :status, BuildList::STATUSES.collect{ |status| [BuildList.human_status(status), status] }, { include_blank: true }, - html_options.merge(id: 'status', 'ng-model' => 'params.filter.status') + html_options.merge(id: 'status', 'ng-model' => 'params.status') .col-xl-12.col-md-4 h4= t 'activerecord.models.platform' = f.select :save_to_platform_id, filter_by_save_to_platform, { include_blank: true }, - html_options.merge(id: 'platform', 'ng-model' => 'params.filter.save_to_platform_id') + html_options.merge(id: 'platform', 'ng-model' => 'params.save_to_platform_id') h4= t 'activerecord.attributes.build_list.arch' = f.select :arch_id, Arch.recent.collect{ |arch| [arch.name, arch.id] }, { include_blank: true }, - html_options.merge(id: 'architecture', 'ng-model' => 'params.filter.arch_id') + html_options.merge(id: 'architecture', 'ng-model' => 'params.arch_id') h4= t 'activerecord.models.mass_build' = f.select :mass_build_id, mass_build_options, { include_blank: true }, - html_options.merge(id: 'mass_build', 'ng-model' => 'params.filter.mass_build_id') + html_options.merge(id: 'mass_build', 'ng-model' => 'params.mass_build_id') .col-xl-12.col-md-4 .row ng-controller = 'DatePickerController as datePickerCtrl' -[:updated_at_start, :updated_at_end].each do |attr| - .col-xl-12.col-md-6 - h4= t attr == :updated_at_start ? '_on' : 'until' - = f.text_field attr, size: 10, class: 'form-control', - 'datepicker-popup' => '{{datePickerCtrl.format}}', - 'ng-model' => "$scope.$parent.params.filter.#{attr}", - 'is-open' => "datePickerCtrl.#{attr}_opened", - min: 'datePickerCtrl.minDate', - max: 'datePickerCtrl.maxDate', - 'datepicker-options' => 'datePickerCtrl.dateOptions', - 'date-disabled' => "datePickerCtrl.disabled(date, mode)", - 'ng-click' => "datePickerCtrl.open_#{attr}($event)" - h4.medium= t 'layout.build_lists.project_name_search' - input#filter_project_name.form-control[ name = 'filter[project_name]' - size = '30' - type = 'text' - value = '{{params.filter.filter_project_name}}' - disabled = @project.present? ] + h4= t attr == :updated_at_start ? '_on' : 'until' + = f.text_field attr, size: 10, class: 'form-control', + 'uib-datepicker-popup' => '{{datePickerCtrl.format}}', + 'ng-model' => "$scope.$parent.params.#{attr}", + 'is-open' => "datePickerCtrl.#{attr}_opened", + min: 'datePickerCtrl.minDate', + max: 'datePickerCtrl.maxDate', + 'datepicker-options' => 'datePickerCtrl.dateOptions', + 'date-disabled' => "datePickerCtrl.disabled(date, mode)", + 'ng-click' => "datePickerCtrl.open_#{attr}($event)" - h4= t 'layout.build_lists.id_search' - input#filter_id.form-control[ name = 'filter{id}' - size = '30' - type = 'text' - value = '{{params.filter.id}}' - disabled = @project.present? ] - - .clearfix - .col-xl-12.col-md-4.offset10 - = label_tag :autoreload do - = check_box_tag :autoreload, true, true - = t 'layout.autoreload_page' - .col-xl-12.col-xl-offset-0.col-md-4.col-md-offset-4.offset10 - .btn-group.btn-group-justified - .btn-group ng-show = 'isRequest' - button.btn.btn-default type = 'button' disabled = true - = t('layout.processing') - .btn-group ng-hide = 'isRequest' - button.btn.btn-primary type = 'button' ng-click = 'refresh(true)' - i.fa.fa-search - = t('layout.search.header') - .btn-group - button.btn.btn-primary[ type = 'button' ng-click = 'clear()' ]= t('reset') + .modal-footer + button.btn.btn-primary type = 'button' ng-click = 'apply()' + i.fa.fa-search + = t('layout.search.header') + button.btn.btn-primary[ type = 'button' ng-click = 'reset()' ]= t('reset') diff --git a/app/views/projects/build_lists/_item_groups.html.slim b/app/views/projects/build_lists/_item_groups.html.slim index d9e65c749..9696cf16a 100644 --- a/app/views/projects/build_lists/_item_groups.html.slim +++ b/app/views/projects/build_lists/_item_groups.html.slim @@ -1,26 +1,23 @@ -.row - h3 - = t('layout.build_lists.items_header') - h4 ng-hide='build_list.item_groups' - = t("layout.build_lists.no_items_data") +rd-widget ng-show='build_list.item_groups' + rd-widget-header title=t('layout.build_lists.items_header') + rd-widget-body + div ng-repeat='group in build_list.item_groups' + .row ng-repeat='item in group' + h4 + | {{item.name + ' #' + item.level}} -div ng-repeat='group in build_list.item_groups' - .row ng-repeat='item in group' - h4 - | {{item.name + ' #' + item.level}} - - table.table - thead - tr - th= t('activerecord.attributes.build_list/item.name') - th= t('activerecord.attributes.build_list/item.version') - th= t('activerecord.attributes.build_list/item.status') - tbody - tr class="{{build_list.itemStatusColor(item.status)}}" - td - | {{item.name}} - td - a ng-href='{{item.path.href}}' - | {{item.path.text}} - td - | {{build_list.humanStatus(item.status) | i18n}} \ No newline at end of file + table.table + thead + tr + th= t('activerecord.attributes.build_list/item.name') + th= t('activerecord.attributes.build_list/item.version') + th= t('activerecord.attributes.build_list/item.status') + tbody + tr class="{{build_list.itemStatusColor(item.status)}}" + td + | {{item.name}} + td + a ng-href='{{item.path.href}}' + | {{item.path.text}} + td + | {{build_list.humanStatus(item.status) | i18n}} \ No newline at end of file diff --git a/app/views/projects/build_lists/_packages.html.slim b/app/views/projects/build_lists/_packages.html.slim index 3719a8ee7..39b386ea2 100644 --- a/app/views/projects/build_lists/_packages.html.slim +++ b/app/views/projects/build_lists/_packages.html.slim @@ -1,51 +1,50 @@ -.row ng-show='build_list.packages' - hr - h3 - = t('layout.build_lists.packages_header') - table.table.table-hover - thead - tr - th - th= t('activerecord.attributes.build_list/package.fullname') - th= t('activerecord.attributes.build_list/package.name') - th= t('activerecord.attributes.build_list/package.epoch') - th= t('activerecord.attributes.build_list/package.version') - th= t('activerecord.attributes.build_list/package.release') - tbody - tr ng-repeat-start='package in build_list.packages' - td - a.expand ng-show='package.dependent_projects' - span.fa.fa-chevron-up[ - ng-show = 'package.show_dependent_projects' - ng-click = 'package.show_dependent_projects = false' ] - span.fa.fa-chevron-down[ - ng-hide = 'package.show_dependent_projects' - ng-click = 'package.show_dependent_projects = true' ] - td - div ng-if='!package.url' - | {{package.fullname}} - a ng-if='package.url' ng-href="{{package.url}}" - | {{package.fullname}} - td - | {{package.name}} - td - | {{package.epoch}} - td - | {{package.version}} - td - | {{package.release}} +rd-widget ng-show='build_list.packages' + rd-widget-header title=t('layout.build_lists.packages_header') + rd-widget-body class="no-padding" + table.table.table-hover + thead + tr + th + th= t('activerecord.attributes.build_list/package.fullname') + th= t('activerecord.attributes.build_list/package.name') + th= t('activerecord.attributes.build_list/package.epoch') + th= t('activerecord.attributes.build_list/package.version') + th= t('activerecord.attributes.build_list/package.release') + tbody + tr ng-repeat-start='package in build_list.packages' + td + a.expand ng-show='package.dependent_projects' + span.fa.fa-chevron-up[ + ng-show = 'package.show_dependent_projects' + ng-click = 'package.show_dependent_projects = false' ] + span.fa.fa-chevron-down[ + ng-hide = 'package.show_dependent_projects' + ng-click = 'package.show_dependent_projects = true' ] + td + div ng-if='!package.url' + | {{package.fullname}} + a ng-if='package.url' ng-href="{{package.url}}" + | {{package.fullname}} + td + | {{package.name}} + td + | {{package.epoch}} + td + | {{package.version}} + td + | {{package.release}} - tr[ - ng-repeat-end = '' - ng-show = 'package.show_dependent_projects' - ng-repeat = 'project in package.dependent_projects' ] - td - td - a ng-href="{{project.url}}" - | {{project.name}} - td - p ng-repeat='package in project.dependent_packages' - | {{package}} - td colspan=3 - a ng-href='{{project.new_url}}' - = t('layout.build_lists.create_build_list') \ No newline at end of file + tr[ + ng-repeat-end = '' + ng-show = 'package.show_dependent_projects' + ng-repeat = 'project in package.dependent_projects' ] + td + td + a ng-href="{{project.url}}" + | {{project.name}} + td + p ng-repeat='package in project.dependent_packages' + | {{package}} + td colspan=3 + a ng-href='{{project.new_url}}' + = t('layout.build_lists.create_build_list') \ No newline at end of file diff --git a/app/views/projects/build_lists/_platform_build_list.html.haml b/app/views/projects/build_lists/_platform_build_list.html.haml deleted file mode 100644 index 750e324c1..000000000 --- a/app/views/projects/build_lists/_platform_build_list.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -%tr{id: "row#{platform_build_list_counter}"} - %td= link_to platform_build_list.id, platform_build_list - %td= platform_build_list.human_status - %td= link_to platform_build_list.project.name, platform_build_list.project - %td= platform_build_list.updated_at diff --git a/app/views/projects/build_lists/_recreate_build_list.html.haml b/app/views/projects/build_lists/_recreate_build_list.html.haml deleted file mode 100644 index 4a0890e66..000000000 --- a/app/views/projects/build_lists/_recreate_build_list.html.haml +++ /dev/null @@ -1,5 +0,0 @@ -= form_for [build_list.project, build_list.project.build_lists.new], html: { class: :form, method: :post } do |f| - = hidden_field_tag :build_list_id, build_list.id - = f.hidden_field :project_id - = f.submit t('layout.build_lists.recreate_build_list'), data: {'disable-with' => t('layout.processing')} -.both \ No newline at end of file diff --git a/app/views/projects/build_lists/_submenu.html.slim b/app/views/projects/build_lists/_submenu.html.slim deleted file mode 100644 index c51e96fee..000000000 --- a/app/views/projects/build_lists/_submenu.html.slim +++ /dev/null @@ -1,17 +0,0 @@ -- content_for :submenu do - nav.navbar.navbar-default.submenu role="navigation" - .container-fluid ng-cloak = true - .navbar-header - ul.nav.navbar-nav - - if @build_list && @build_list.project - li - = link_to project_path(@build_list.project) do - = fa_visibility_icon @build_list.project - = @build_list.project.name_with_owner - - else - li class=('active' if controller_name == 'build_lists') - = link_to t('layout.projects.list_header'), build_lists_path - li class=('active' if controller_name == 'product_build_lists') - = link_to t('layout.products.list_header'), product_build_lists_path - - == render 'server_status' if action_name == 'index' diff --git a/app/views/projects/build_lists/index.html.slim b/app/views/projects/build_lists/index.html.slim deleted file mode 100644 index e95aedca0..000000000 --- a/app/views/projects/build_lists/index.html.slim +++ /dev/null @@ -1,91 +0,0 @@ --set_meta_tags title: t('.title') - -.row.offset10 ng-controller = 'BuildListsController' ng-init = 'init()' ng-cloak = true - = hidden_field_tag :name_with_owner, @project.try(:name_with_owner) - .col-xl-2.col-sm-12 - -if @project && policy(@project.build_lists.build).create? - - button.btn.btn-primary.btn-block[ id = 'filter_new_build' - type = 'button' - onclick = "location.href='#{new_project_build_list_path(@project)}'" ] - i.fa.fa-plus - =< t('layout.build_lists.new_header') - .offset10 - == render 'filter' - .col-xl-10.col-sm-12 - table.table.table-condensed - thead - tr - th - th= t('activerecord.attributes.build_list.id') - th= t('activerecord.attributes.build_list.status') - th= t('activerecord.attributes.build_list.project') - th= t('diff') - th= t('activerecord.attributes.build_list.project_version') - th= t('activerecord.attributes.build_list.save_to_repository') - th= t('activerecord.attributes.build_list.arch_short') - th= t('activerecord.attributes.build_list.user') - th= t('activerecord.attributes.build_list.hostname') - th= t('activerecord.attributes.build_list.updated_at') - tbody - tr[ ng-repeat = 'bl in build_lists' - class = '{{bl.status_color}}' - id = 'build-list-{{bl.id}}' - ng-class = "{'group-start': !bl.relatedHidden, 'group-end': bl.lastRelated}" - ng-show = 'bl.show' ] - td.build-list-chevrons - a.expand ng-show = 'bl.hasRelated' - span.fa.fa-chevron-down ng-show = 'bl.relatedHidden' ng-click = 'showRelated(bl)' - span.fa.fa-chevron-up ng-hide = 'bl.relatedHidden' ng-click = 'hideRelated(bl)' - / id - td.build-list-statuses - - a[ ng-href = '{{bl.url}}' ] {{bl.id}} - div ng-show = 'bl.hasRelated' - div[ ng-repeat = 'related in bl.related' ng-class = '"status bg-" + related.status_color']   - - / status - td - | {{bl.human_status | i18n}} - br - time ng-show = 'bl.duration' - | {{bl.duration}} - time ng-show = 'bl.average_build_time' - | /{{bl.average_build_time}} - - / project - td.centered ng-hide = 'bl.project' colspan = 2 - = t('layout.projects.unexisted_project') - td ng-show = 'bl.project' - a[ ng-href = '{{bl.project.url}}' ] {{bl.project.name_with_owner}} - - / diff - td - a ng-href = '{{bl.version_link_url}}' ng-show = 'bl.project' - | {{bl.version_link_text}} - - / project_version - td[] {{bl.version_release}} - - / save_to_repository - td - a[ ng-href = '{{bl.save_to_repository_url}}' ] {{bl.save_to_repository_name}} - - / arch_short - td[ ng-show = 'bl.arch' ] {{bl.arch.name}} - td[ ng-hide = 'bl.arch' ]= t('layout.arches.unexisted_arch') - - / user - td - a[ ng-href = '{{bl.user.url}}' ] {{bl.user.fullname}} - - / hostname - td[] {{bl.hostname}} - - / updated_at - td title = '{{bl.updated_at_utc}}' - | {{ bl.updated_at | amDateFormat:'YYYY-MM-DD HH:mm' }} - - == angularjs_paginate( per_page: 'params.per_page' ) - -== render @project ? 'projects/base/submenu' : 'projects/build_lists/submenu' diff --git a/app/views/projects/build_lists/new.html.slim b/app/views/projects/build_lists/new.html.slim index ce7722694..3b670544a 100644 --- a/app/views/projects/build_lists/new.html.slim +++ b/app/views/projects/build_lists/new.html.slim @@ -1,6 +1,7 @@ -set_meta_tags title: [title_object(@project), t('layout.build_lists.new_header')] -.col-xs-12.col-md-10.col-md-offset-1 ng-controller = 'NewBuildListController as newBuildCtrl' ng-cloak = true - #new_form== render 'projects/build_lists/new_build/new_form', project: @project, build_list: @build_list - br - == render 'projects/build_lists/new_build/last_build_lists', project: @project - == render 'projects/base/submenu' +.row.top-space + .col-xs-12.col-md-10.col-md-offset-1 ng-controller = 'NewBuildListController as newBuildCtrl' ng-cloak = true + rd-widget + rd-widget-header title=(t('layout.build_lists.new_header') + ' | ' + title_object(@project)) + rd-widget-body + == render 'projects/build_lists/new_build/new_form', project: @project, build_list: @build_list \ No newline at end of file diff --git a/app/views/projects/build_lists/new_build/_last_build_lists.html.slim b/app/views/projects/build_lists/new_build/_last_build_lists.html.slim deleted file mode 100644 index 1e2597767..000000000 --- a/app/views/projects/build_lists/new_build/_last_build_lists.html.slim +++ /dev/null @@ -1,53 +0,0 @@ -h3= t 'layout.build_lists.last_build_lists' -h4= t 'layout.relations.filters' - -.checkbox - label - = check_box_tag :owner_filter_build_lists, true, - (params[:owner_filter] || 'true') == 'true', - 'ng-click' => 'newBuildCtrl.updateFilterOwner()', - 'ng-value' => 'newBuildCtrl.last_builds_filter.owner' - = t 'layout.build_lists.only_my_build_lists' - -.checkbox - label - = check_box_tag :status_filter_build_lists, true, - (params[:status_filter] || 'true') == 'true', - 'ng-value' => 'newBuildCtrl.last_builds_filter.status', - 'ng-click' => 'newBuildCtrl.updateFilterStatus()' - = t 'layout.build_lists.failed_build_lists' - -table.table - thead - tr - th= t('activerecord.attributes.build_list.id') - th= t('activerecord.attributes.build_list.status') - th= t('diff') - th= t('activerecord.attributes.build_list.project_version') - th= t('activerecord.attributes.build_list.save_to_repository') - th= t('activerecord.attributes.build_list.arch_short') - th= t('activerecord.attributes.build_list.user') - th= t('activerecord.attributes.build_list.updated_at') - tbody - tr[ ng-repeat = 'last in newBuildCtrl.last_build_lists' ] - td - a[ ng-href = '{{ last.path }}' ] {{ last.id }} - br - a[ ng-click = 'newBuildCtrl.cloneBuildList(last.id)' href = '#new_build_list' ]= t 'layout.clone' - td[] {{ last.human_status }} - td - a[ ng-href = '{{ last.version.path }}' ] {{ last.version.name }} - td[] {{ last.version.release }} - td - a[ ng-href = '{{ last.save_to_repository.path }}' ] {{ last.save_to_repository.name }} - td[] {{ last.arch }} - td - a[ ng-href = '{{ last.user.path }}' ] {{ last.user.fullname }} - td - span[ am-time-ago = 'last.updated_at' - title = "{{ last.updated_at | amDateFormat:'ddd, LLL' }}" ] - -= angularjs_paginate( per_page: BuildList.per_page, - total_items: 'newBuildCtrl.total_items', - page: 'newBuildCtrl.page', - select_page: 'newBuildCtrl.goToPage(newBuildCtrl.page)' ) diff --git a/app/views/projects/build_lists/show.html.slim b/app/views/projects/build_lists/show.html.slim index 8abc9f21c..4889c0d47 100644 --- a/app/views/projects/build_lists/show.html.slim +++ b/app/views/projects/build_lists/show.html.slim @@ -1,202 +1,193 @@ - title = title_object(@build_list.project) - set_meta_tags title: [title, t('activerecord.models.build_list')] -- description = @build_list.packages.map(&:fullname) * ', ' -- title = t('activerecord.models.build_list') + ' - ' + title -- set_meta_tags og: { title: title, description: truncate(description, length: 255) } -- set_meta_tags twitter: { title: title, description: truncate(description, length: 200) } - -= render 'submenu' - -row[ ng-controller='BuildListController' +div[ ng-controller='BuildListController' ng-cloak =true ] - = hidden_field_tag :build_list_id, @build_list.id - .col-md-8.col-md-offset-2.alert.alert-info - .alert.pull-left.submenu ng-class='"alert-" + build_list.status_color' - p - | {{build_list.human_status | i18n}} + .row.top-space + = hidden_field_tag :build_list_id, @build_list.id + .col-md-12 + .alert.pull-left ng-class='"alert-" + build_list.status_color' + p + | {{build_list.human_status | i18n}} - p.alert.alert-info.pull-right.submenu title = '{{build_list.updated_at_utc}}' - | {{ build_list.updated_at | amDateFormat:'ddd, D MMM YYYY, HH:mm' }} ( - span am-time-ago = 'build_list.updated_at' - | ) + p.alert.alert-info.pull-right title = '{{build_list.updated_at_utc}}' + | {{ build_list.updated_at | amDateFormat:'ddd, D MMM YYYY, HH:mm' }} ( + span am-time-ago = 'build_list.updated_at' + | ) - .col-md-8.col-md-offset-2 - - = form_for @build_list, url: publish_build_list_path(@build_list) do |f| - - h3= t('layout.build_lists.main_data') - table.table.table-borderless.table-condensed - thead - tr - th.col-md-4 - th - tr - td= t('activerecord.attributes.build_list.container_path') - td - - url = container_url - = link_to url, url, - 'ng-show' => "build_list.container_status == #{ BuildList::BUILD_PUBLISHED }" - p ng-show="build_list.container_status == #{ BuildList::BUILD_PUBLISH }" - = t('layout.build_lists.creating') - - tr - td= t('activerecord.attributes.build_list.id') - td= @build_list.id - - tr - td= t('activerecord.attributes.build_list.user') - td= link_to @build_list.user.try(:fullname), @build_list.user - - tr - td= t('activerecord.attributes.build_list.publisher') - td ng-show='build_list.publisher' - a ng-href='{{build_list.publisher.path}}' - | {{build_list.publisher.fullname}} - - tr - td= t('activerecord.attributes.build_list.build_for_platform') - td - - if bfp = @build_list.build_for_platform - = link_to bfp.name, bfp - - else - = t('layout.build_lists.platform_deleted') - - tr - td= t('activerecord.attributes.build_list.save_to_repository') - td - = link_to "#{@build_list.save_to_platform.name}/#{@build_list.save_to_repository.name}", - [@build_list.save_to_platform, @build_list.save_to_repository] - - tr - td= t('activerecord.attributes.build_list.include_testing_subrepository') - td= t("layout.#{@build_list.include_testing_subrepository?}_") - - tr - td= t('activerecord.attributes.build_list.include_repos') - td= Repository.where(id: @build_list.include_repos).pluck(:name).join(', ') - - tr - td= t('activerecord.attributes.build_list.auto_publish_status') - td= t("layout.build_lists.auto_publish_status.#{@build_list.auto_publish_status}") - - tr - td= t('activerecord.attributes.build_list.auto_create_container') - td= t("layout.#{@build_list.auto_create_container?}_") - - tr - td= t('activerecord.attributes.build_list.use_cached_chroot') - td= t("layout.#{@build_list.use_cached_chroot?}_") - - tr - td= t('activerecord.attributes.build_list.use_extra_tests') - td= t("layout.#{@build_list.use_extra_tests?}_") - - tr - td= t('activerecord.attributes.build_list.save_buildroot') - td= t("layout.#{@build_list.save_buildroot?}_") - - tr - td= t('activerecord.attributes.build_list.project_version') - -# td= link_to @build_list.project_version, tree_path(@build_list.project, @build_list.project_version) - - tr - td= t('diff') - td= build_list_version_link(@build_list) - - tr - td= t('activerecord.attributes.build_list.arch') - td= @build_list.arch.name - - tr - td= t('activerecord.attributes.build_list.hostname') - td= @build_list.hostname - - tr.bg-danger ng-show = 'build_list.fail_reason' - td= t('activerecord.attributes.build_list.fail_reason') - td - | {{build_list.fail_reason}} - - tr - td= t('activerecord.attributes.build_list.updated_at') - td - | {{build_list.updated_at_utc}} - - - if @build_list.external_nodes.present? - tr - td= t('activerecord.attributes.build_list.external_nodes') - td= I18n.t("layout.build_lists.external_nodes.#{@build_list.external_nodes}") - - tr - td= t('activerecord.attributes.build_list.builder') - td - a ng-href='{{build_list.builder.path}}' ng-show = 'build_list.builder' - | {{build_list.builder.fullname}} - - tr - td= t('activerecord.attributes.build_list.is_circle') - td= t("layout.#{@build_list.is_circle?}_") - - - if @build_list.extra_build_lists.present? || @build_list.extra_repositories.present? - tr - td= t('activerecord.attributes.build_list.extra_repositories') - td - - Repository.where(id: @build_list.extra_repositories).each do |repo| - p - = link_to "#{repo.platform.name}/#{repo.name}", [repo.platform, repo] - - BuildList.where(id: @build_list.extra_build_lists).each do |bl| - p - = link_to "#{bl.id} (#{bl.project.name} - #{bl.arch.name})", bl - - - if @build_list.extra_params.present? - tr - td= t('activerecord.attributes.build_list.extra_params.label') - td - - @build_list.extra_params.each do |k, v| + .row + .col-md-12 + rd-widget + rd-widget-header title=t('layout.build_lists.main_data') + rd-widget-body class="no-padding" + table.table.table-borderless.table-condensed tr + td= t('activerecord.attributes.build_list.container_path') td - i - = t("activerecord.attributes.build_list.extra_params.#{k}") + - url = container_url + = link_to url, url, + 'ng-show' => "build_list.container_status == #{ BuildList::BUILD_PUBLISHED }" + p ng-show="build_list.container_status == #{ BuildList::BUILD_PUBLISH }" + = t('layout.build_lists.creating') + + tr + td= t('activerecord.attributes.build_list.id') + td= @build_list.id + + tr + td= t('activerecord.attributes.build_list.user') + td= link_to @build_list.user.try(:fullname), @build_list.user + + tr ng-show='build_list.publisher' + td= t('activerecord.attributes.build_list.publisher') td - = v + a ng-href='{{build_list.publisher.path}}' + | {{build_list.publisher.fullname}} - - if @build_list.mass_build_id.present? - tr - td= t('activerecord.attributes.mass_build_id') - td - = link_to @build_list.mass_build.name, - platform_mass_build_path(@build_list.save_to_platform, @build_list.mass_build_id) + tr + td= t('activerecord.attributes.build_list.build_for_platform') + td + - if bfp = @build_list.build_for_platform + = link_to bfp.name, bfp + - else + = t('layout.build_lists.platform_deleted') - tr ng-show='build_list.human_duration' - td - td - | {{build_list.human_duration }} + tr + td= t('activerecord.attributes.build_list.save_to_repository') + td + = link_to "#{@build_list.save_to_platform.name}/#{@build_list.save_to_repository.name}", + [@build_list.save_to_platform, @build_list.save_to_repository] - tr.alert.alert-danger ng-hide='build_list.extra_build_lists_published' - td colspan=2 - = t('layout.build_lists.publish_with_extra_fail') + tr + td= t('activerecord.attributes.build_list.include_testing_subrepository') + td= t("layout.#{@build_list.include_testing_subrepository?}_") - - unless @build_list.valid_branch_for_publish? - tr.alert.alert-danger - td colspan=2 - = t('layout.build_lists.wrong_branch_for_publish_html', - branch: @build_list.save_to_repository.publish_builds_only_from_branch) + tr + td= t('activerecord.attributes.build_list.include_repos') + td= Repository.where(id: @build_list.include_repos).pluck(:name).join(', ') - tr.alert.alert-danger ng-show='build_list.can_publish && build_list.can_publish_in_future && !build_list.can_publish_into_repository' - td colspan=2 - = t('flash.build_list.not_all_build_lists_success') + tr + td= t('activerecord.attributes.build_list.auto_publish_status') + td= t("layout.build_lists.auto_publish_status.#{@build_list.auto_publish_status}") - hr - .row - = render 'buttons', build_list: @build_list + tr + td= t('activerecord.attributes.build_list.auto_create_container') + td= t("layout.#{@build_list.auto_create_container?}_") - .row.offset10 ng-show="build_list.status == #{BuildList::BUILD_STARTED}" - = render 'shared/log', { build_started: true, get_log_path: log_build_list_path(@build_list) } + tr + td= t('activerecord.attributes.build_list.use_cached_chroot') + td= t("layout.#{@build_list.use_cached_chroot?}_") - hr + tr + td= t('activerecord.attributes.build_list.use_extra_tests') + td= t("layout.#{@build_list.use_extra_tests?}_") + + tr + td= t('activerecord.attributes.build_list.save_buildroot') + td= t("layout.#{@build_list.save_buildroot?}_") + + tr + td= t('activerecord.attributes.build_list.project_version') + td= @build_list.project_version + + tr + td= t('diff') + td= build_list_version_link(@build_list) + + tr + td= t('activerecord.attributes.build_list.arch') + td= @build_list.arch.name + + tr + td= t('activerecord.attributes.build_list.hostname') + td= @build_list.hostname + + tr.bg-danger ng-show = 'build_list.fail_reason' + td= t('activerecord.attributes.build_list.fail_reason') + td + | {{build_list.fail_reason}} + + tr + td= t('activerecord.attributes.build_list.updated_at') + td + | {{build_list.updated_at_utc}} + + - if @build_list.external_nodes.present? + tr + td= t('activerecord.attributes.build_list.external_nodes') + td= I18n.t("layout.build_lists.external_nodes.#{@build_list.external_nodes}") + + tr ng-show = 'build_list.builder' + td= t('activerecord.attributes.build_list.builder') + td + a ng-href='{{build_list.builder.path}}' + | {{build_list.builder.fullname}} + + tr + td= t('activerecord.attributes.build_list.is_circle') + td= t("layout.#{@build_list.is_circle?}_") + + - if @build_list.extra_build_lists.present? || @build_list.extra_repositories.present? + tr + td= t('activerecord.attributes.build_list.extra_repositories') + td + - Repository.where(id: @build_list.extra_repositories).each do |repo| + p + = link_to "#{repo.platform.name}/#{repo.name}", [repo.platform, repo] + - BuildList.where(id: @build_list.extra_build_lists).each do |bl| + p + = link_to "#{bl.id} (#{bl.project.name} - #{bl.arch.name})", bl + + - if @build_list.extra_params.present? + tr + td= t('activerecord.attributes.build_list.extra_params.label') + td + - @build_list.extra_params.each do |k, v| + tr + td + i + = t("activerecord.attributes.build_list.extra_params.#{k}") + td + = v + + - if @build_list.mass_build_id.present? + tr + td= t('activerecord.attributes.mass_build_id') + td + = link_to @build_list.mass_build.name, + platform_mass_build_path(@build_list.save_to_platform, @build_list.mass_build_id) + + tr ng-show='build_list.human_duration' + td + td + | {{build_list.human_duration }} + + tr.alert.alert-danger ng-hide='build_list.extra_build_lists_published' + td colspan=2 + = t('layout.build_lists.publish_with_extra_fail') + + - unless @build_list.valid_branch_for_publish? + tr.alert.alert-danger + td colspan=2 + = t('layout.build_lists.wrong_branch_for_publish_html', + branch: @build_list.save_to_repository.publish_builds_only_from_branch) + + tr.alert.alert-danger ng-show='build_list.can_publish && build_list.can_publish_in_future && !build_list.can_publish_into_repository' + td colspan=2 + = t('flash.build_list.not_all_build_lists_success') + rd-widget-footer + = form_for @build_list, url: publish_build_list_path(@build_list), html: {class: :"form-inline"} do |f| + = render 'buttons', build_list: @build_list + + .row.top-space ng-show="build_list.status == #{BuildList::BUILD_STARTED}" + = render 'shared/log', { build_started: true, get_log_path: log_build_list_path(@build_list) } + + .row.top-space + .col-md-12 = render 'item_groups' - = render 'packages' - .row - hr - = render 'shared/build_results', subject: @build_list + .row.top-space + .col-md-6 + = render 'packages' + .col-md-6 + = render 'shared/build_results', subject: @build_list \ No newline at end of file diff --git a/app/views/projects/projects/_aliases.html.slim b/app/views/projects/projects/_aliases.html.slim deleted file mode 100644 index 0f8b03029..000000000 --- a/app/views/projects/projects/_aliases.html.slim +++ /dev/null @@ -1,15 +0,0 @@ -.col-sm-9.col-sm-offset-3 - - h3= t('.header') - - table.table.table-condensed.offset10 - thead - tr - th= t('.name') - tbody - - @project_aliases.each do |project| - tr - td - = fa_visibility_icon @project - = link_to project.name_with_owner, project_path(project) - = will_paginate @project_aliases diff --git a/app/views/projects/projects/_build_schedule.html.slim b/app/views/projects/projects/_build_schedule.html.slim index a31a6aadc..65736dc5b 100644 --- a/app/views/projects/projects/_build_schedule.html.slim +++ b/app/views/projects/projects/_build_schedule.html.slim @@ -1,28 +1,30 @@ -.col-sm-9.col-sm-offset-3[ ng-controller = 'ProjectScheduleController' - ng-init = "name_with_owner = '#{@project.name_with_owner}'" - ng-cloak = 'true' ] +.row.top-space + rd-widget + rd-widget-header title=t("layout.projects.build_schedule") + rd-widget-body + .row[ ng-controller = 'ProjectScheduleController' + ng-init = "name_with_owner = '#{@project.name_with_owner}'" + ng-cloak = 'true' ] - h3= t("layout.projects.build_schedule") + => t('activerecord.attributes.project.autostart_status') - => t('activerecord.attributes.project.autostart_status') + select[ ng-options = 'k as (v | i18n) for (k, v) in statuses' + ng-model = 'autostart_status' + ng-change = 'updateStatus()' + ng-init = "autostart_status = '#{@project.autostart_status}'" ] + option[ value = '' ] - select[ ng-options = 'k as (v | i18n) for (k, v) in statuses' - ng-model = 'autostart_status' - ng-change = 'updateStatus()' - ng-init = "autostart_status = '#{@project.autostart_status}'" ] - option[ value = '' ] - - table.table.table-condensed.offset10 - thead - tr - th= t('activerecord.attributes.repository.name') - th= t('activerecord.attributes.build_list.auto_publish_status') - th= t('activerecord.attributes.project_to_repository.enabled') - tbody[ ng-init = "items = #{available_project_to_repositories(@project)}" ] - tr[ ng-repeat = "item in items" ] - td - a[ ng-href = '{{item.repository_path}}' ] {{item.repository_name}} - td - input[ type = 'checkbox' ng-model = "item.auto_publish" ng-change = 'updateSchedule(item)' ] - td - input[ type = 'checkbox' ng-model = "item.enabled" ng-change = 'updateSchedule(item)' ] + table.table.table-condensed.offset10 + thead + tr + th= t('activerecord.attributes.repository.name') + th= t('activerecord.attributes.build_list.auto_publish_status') + th= t('activerecord.attributes.project_to_repository.enabled') + tbody[ ng-init = "items = #{available_project_to_repositories(@project)}" ] + tr[ ng-repeat = "item in items" ] + td + a[ ng-href = '{{item.repository_path}}' ] {{item.repository_name}} + td + input[ type = 'checkbox' ng-model = "item.auto_publish" ng-change = 'updateSchedule(item)' ] + td + input[ type = 'checkbox' ng-model = "item.enabled" ng-change = 'updateSchedule(item)' ] diff --git a/app/views/projects/projects/_filters.html.haml b/app/views/projects/projects/_filters.html.haml deleted file mode 100644 index 0b2c3dcbc..000000000 --- a/app/views/projects/projects/_filters.html.haml +++ /dev/null @@ -1,18 +0,0 @@ -- if current_user - %input.form-control{ name: 'search', size: '30', type: 'text', 'ng-model' => 'search', - placeholder: t('layout.find_project'), 'ng-change' => 'getProjects()' } - - if policy(:project).create? - %hr.offset10 - %p= link_to t('layout.projects.new'), new_project_path, class: 'btn btn-primary' - - if policy(:project).mass_import? - %p= link_to t('layout.projects.mass_import'), mass_import_projects_path, class: 'btn btn-primary' - - if policy(:project).mass_create? - %p= link_to t('layout.projects.mass_create'), mass_create_projects_path, class: 'btn btn-primary' - %hr.offset10 - %h3=t('layout.relations.filters') - %ul.nav.nav-pills.nav-stacked - - options_for_filters(@projects, @groups, @owners).each do |options| - %li{ 'ng-class' => "{active: #{options[:class_name]}_filter_#{options[:id]}_class}" } - %a{ href: '#', 'ng-click' => "change_#{options[:class_name]}_filter(#{options[:id]})" } - %span.badge.pull-right= options[:count] - = options[:uname] diff --git a/app/views/projects/projects/_form.html.slim b/app/views/projects/projects/_form.html.slim index 3ce2236a7..b8fbd9c09 100644 --- a/app/views/projects/projects/_form.html.slim +++ b/app/views/projects/projects/_form.html.slim @@ -1,5 +1,5 @@ - act = controller.action_name.to_sym -div ng-controller = 'ProjectFromController' ng-cloak = 'true' +div ng-controller = 'ProjectFormController' ng-cloak = 'true' = f.input :name = f.input :github_organization @@ -39,12 +39,13 @@ div ng-controller = 'ProjectFromController' ng-cloak = 'true' - if [:new, :create].include? act = f.input :srpm, as: :file - .col-sm-offset-3.col-sm-9 - = submit_button_tag + .form-group + .col-sm-offset-3.col-sm-9 + = submit_button_tag - content_for :additional_scripts do javascript: - RosaABF.controller('ProjectFromController', ['$scope', function($scope) { + RosaABF.controller('ProjectFormController', ['$scope', function($scope) { $scope.project = { is_package: #{@project.is_package}, publish_i686_into_x86_64: #{@project.publish_i686_into_x86_64} diff --git a/app/views/projects/projects/_project.html.haml b/app/views/projects/projects/_project.html.haml deleted file mode 100644 index f67a4424d..000000000 --- a/app/views/projects/projects/_project.html.haml +++ /dev/null @@ -1,14 +0,0 @@ -%tr{id: "Row#{project_counter}"} - %td - = link_to project do - .table-sort-left= image_tag visibility_icon(project.visibility) - .table-sort-right= link_to project.name_with_owner, project_path(project) - - alone_member = alone_member? project - %td - - c = participant_class(alone_member, project) - %span{class: c, title: t("layout.relations.#{c}")} - = t("layout.collaborators.role_names.#{current_user.best_role project}") - %td.td5 - - unless project.owner == current_user or !alone_member - = link_to remove_user_project_path(project), method: :delete, data: { confirm: t("layout.confirm") } do - %span.delete   diff --git a/app/views/projects/projects/_project.json.jbuilder b/app/views/projects/projects/_project.json.jbuilder deleted file mode 100644 index 18bf8b43a..000000000 --- a/app/views/projects/projects/_project.json.jbuilder +++ /dev/null @@ -1,18 +0,0 @@ -json.project do |proj| - proj.visibility project.visibility.to_s - - proj.name project.name_with_owner - proj.link project_path(project) - - proj.role t("layout.collaborators.role_names.#{current_user.best_role project}").force_encoding(Encoding::UTF_8) - - proj.leave_link remove_user_project_path(project) unless project.owner == current_user or !alone_member? project - proj.rights_class participant_class(alone_member?(project), project) - proj.title t("layout.relations.#{participant_class(alone_member?(project), project)}") - - proj.owner do |owner| - owner.name project.owner.uname - owner.type project.owner.class.to_s.underscore - owner.link project.owner.class == User ? user_path(project.owner) : group_path(project.owner) - end -end diff --git a/app/views/projects/projects/dashboard.html.slim b/app/views/projects/projects/dashboard.html.slim new file mode 100644 index 000000000..e36f7d88d --- /dev/null +++ b/app/views/projects/projects/dashboard.html.slim @@ -0,0 +1,147 @@ +.row.top-space + .col-md-6 + rd-widget + div ng-controller="ProjectsController" + rd-widget-header title=(t "dashboard.projects.title") icon="fa-cube" + input.form-control.input-sm [ng-model="search" placeholder=(t "dashboard.projects.search") + ng-change="searchProjects(search)" ng-model-options="{ debounce: 500 }"] + rd-widget-body classes="medium no-padding" loading="requesting" + .table-responsive + table.table ng-cloak=true + thead + tr + th ng-show="search" = t 'dashboard.projects.name' + th ng-hide="search" = t 'dashboard.projects.last_projects' + th + th + tbody + tr ng-repeat = 'item in projects' + td + button[ ng-click = 'selectProject(item.name_with_owner)' + ng-disabled="ProjectSelectService.disable()" class="btn btn-xs btn-link"] {{::item.name_with_owner}} + td + a[ ng-href = '{{::item.new_build_list_link}}'] = t 'dashboard.projects.new_build' + td + a[ ng-href = '{{::item.edit_link}}' + ng-show='::item.edit_link' target='_blank'] = t 'project_menu.settings' + - if policy(:project).create? + rd-widget-footer + ul.nav.nav-justified + li + = link_to t('layout.projects.new'), new_project_path, target: '_blank' + .col-md-6 + rd-widget + div ng-controller="ProjectInfoController" + rd-widget-header title=(t('dashboard.project_info.title') + '{{widget_title}}') + rd-widget-body class="medium" loading="requesting" + div ng-hide="widget_title" + = t('dashboard.project_info.select') + div ng-show="widget_title" + div + a ng-href="{{project_info.html_url}}" target="_blank" + | {{project}} + div.bottom-space + | {{project_info.description}} + div + div.bottom-space ng-repeat="commit in project_info.commits" + div + span + | {{::commit.branch}} + span.pull-right + a ng-href="{{::commit.committer_url}}" target="_blank" + | {{::commit.committer_login}} + div + a ng-href="{{::commit.url}}" target="_blank" + | {{::commit.sha}} + div + | {{::commit.message}} + +.row.top-space + .col-md-12 + == render 'projects/build_lists/filter' + rd-widget + div ng-controller="BuildListsController" + rd-widget-header title="Build Lists{{widget_title}}" icon="fa-gears" + .form-inline ng-init="autoreload=true" + button ng-model="autoreload" ng-click="setAutoreload(autoreload)" class="btn btn-default" uib-btn-checkbox="" + = t 'layout.autoreload_page' + button class="btn btn-default" ng-click="openFilters()" ng-disabled="isRequest" + | Filters + button [class="btn btn-default" ng-show="widget_title" + ng-click="clearProject()" ng-disabled="ProjectSelectService.disable()"] + | Clear selected project + rd-widget-body classes="large no-padding" loading="isRequest" + .row + table.table.table-condensed + thead + tr + th + th= t('activerecord.attributes.build_list.id') + th= t('activerecord.attributes.build_list.status') + th= t('activerecord.attributes.build_list.project') + th= t('diff') + th= t('activerecord.attributes.build_list.project_version') + th= t('activerecord.attributes.build_list.save_to_repository') + th= t('activerecord.attributes.build_list.arch_short') + th= t('activerecord.attributes.build_list.user') + th= t('activerecord.attributes.build_list.hostname') + th= t('activerecord.attributes.build_list.updated_at') + tbody + tr[ ng-repeat = 'bl in build_lists' + class = '{{::bl.status_color}}' + id = 'build-list-{{::bl.id}}' + ng-class = "{'group-start': !bl.relatedHidden, 'group-end': bl.lastRelated}" + ng-show = 'bl.show' ] + td.build-list-chevrons + a.expand ng-show = '::bl.hasRelated' + span.fa.fa-chevron-down ng-show = 'bl.relatedHidden' ng-click = 'showRelated(bl)' + span.fa.fa-chevron-up ng-hide = 'bl.relatedHidden' ng-click = 'hideRelated(bl)' + / id + td.build-list-statuses + + a[ ng-href = '{{::bl.url}}' ] {{::bl.id}} + div ng-show = '::bl.hasRelated' ng-bind-html="::bl.chevronHtml" + + / status + td + | {{::bl.human_status | i18n}} + br + time ng-show = '::bl.duration' + | {{::bl.duration}} + time ng-show = '::bl.average_build_time' + | /{{::bl.average_build_time}} + + / project + td.centered ng-hide = '::bl.project' colspan = 2 + = t('layout.projects.unexisted_project') + td ng-show = '::bl.project' + | {{::bl.project.name_with_owner}} + + / diff + td + a ng-href = '{{::bl.version_link_url}}' ng-show = '::bl.project' + | {{::bl.version_link_text}} + + / project_version + td[] {{::bl.version_release}} + + / save_to_repository + td + a[ ng-href = '{{::bl.save_to_repository_url}}' ] {{::bl.save_to_repository_name}} + + / arch_short + td[ ng-show = '::bl.arch' ] {{::bl.arch.name}} + td[ ng-hide = '::bl.arch' ]= t('layout.arches.unexisted_arch') + + / user + td + a[ ng-href = '{{::bl.user.url}}' ] {{::bl.user.fullname}} + + / hostname + td[] {{::bl.hostname}} + + / updated_at + td title = '{{::bl.updated_at_utc}}' + | {{::bl.updated_at | amDateFormat:'YYYY-MM-DD HH:mm' }} + rd-widget-footer ng-show="total_items > per_page" + == angularjs_paginate( per_page: 'per_page' ) \ No newline at end of file diff --git a/app/views/projects/projects/edit.html.slim b/app/views/projects/projects/edit.html.slim index 8bad4555a..e27474301 100644 --- a/app/views/projects/projects/edit.html.slim +++ b/app/views/projects/projects/edit.html.slim @@ -1,20 +1,21 @@ -set_meta_tags title: [title_object(@project), t('layout.projects.edit')] -== render 'submenu' -.container.col-md-offset-2.col-md-8 - .row +.row.top-space + .col-md-offset-2.col-md-8 + rd-widget + rd-widget-header title=( title_object(@project) + ' | ' + t('layout.projects.edit') ) + rd-widget-body + = simple_form_for @project, html: { class: 'form-horizontal' }, + wrapper: :horizontal_form, + wrapper_mappings: { boolean: :horizontal_boolean } do |f| + == render "form", f: f - = simple_form_for @project, html: { class: 'form-horizontal' }, - wrapper: :horizontal_form, - wrapper_mappings: { boolean: :horizontal_boolean } do |f| - == render "form", f: f + .row + .col-sm-offset-3.col-sm-9 + => t("layout.projects.delete_warning") + - if policy(@project).destroy? + = link_to t("layout.delete"), project_path(@project), method: :delete, + data: { confirm: t("layout.projects.confirm_delete") }, + class: 'btn btn-danger' - == render 'build_schedule' - - hr.col-sm-12 - .col-sm-9.col-sm-offset-3 - => t("layout.projects.delete_warning") - - if policy(@project).destroy? - = link_to t("layout.delete"), project_path(@project), method: :delete, - data: { confirm: t("layout.projects.confirm_delete") }, - class: 'btn btn-danger' + == render 'build_schedule' \ No newline at end of file diff --git a/app/views/projects/projects/index.html.slim b/app/views/projects/projects/index.html.slim deleted file mode 100644 index 0ee3fb2ce..000000000 --- a/app/views/projects/projects/index.html.slim +++ /dev/null @@ -1,38 +0,0 @@ --set_meta_tags title: t('layout.projects.list_header') -.col-xs-12.col-md-10.col-md-offset-1 ng-controller = 'ProjectsCtrl' - .row.offset10 - .col-md-3.col-sm-4== render 'filters' - .col-md-9.col-sm-8 - .toolbar - span - i.fa.fa-lg.fa-user.text-success.roffset5 - = t 'layout.relations.user_owner' - i.fa.fa-lg.fa-user.text-success.roffset5.loffset10 - = t 'layout.relations.group_owner' - i.fa.fa-lg.fa-group.text-primary.roffset5.loffset10 - = t 'layout.relations.user' - i.fa.fa-lg.fa-group.text-primary.roffset5.loffset10 - = t 'layout.relations.group' - - table.table.table-hover.offset10 ng-cloak = true - thead - tr - th - th= t 'activerecord.attributes.project.name' - th - th= t 'layout.projects.role' - th= t 'layout.projects.remove_user' - tbody - tr ng-repeat = 'item in projects' - td - i.fa ng-class = 'item.visibility_class' - td - a[ ng-href = '{{item.link}}' ] {{item.name_with_owner}} - td - i.fa.roffset5 ng-class = 'item.participant_class' - td[] {{item.user_role_name}} - td - span.fa.fa-lg.fa-times.text-danger[ confirmed-click = 'leave_project(item)' - ng-show = 'item.can_leave_project' ng-confirm-click = t('layout.confirm') ] - - = angularjs_paginate per_page: Project.per_page diff --git a/app/views/projects/projects/index.json.jbuilder b/app/views/projects/projects/index.json.jbuilder index dacd2cd57..b24875eac 100644 --- a/app/views/projects/projects/index.json.jbuilder +++ b/app/views/projects/projects/index.json.jbuilder @@ -1,16 +1,9 @@ json.projects do json.array!(@projects) do |item| - alone_member = alone_member?(item) - json.cache! item, expires_in: 10.minutes do - json.visibility_class fa_visibility_icon(item) - json.name_with_owner item.name_with_owner - json.link project_path(item) - json.participant_class participant_class(alone_member, item) - json.user_role_name t("layout.collaborators.role_names.#{current_user.best_role item}") - json.can_leave_project item.owner != current_user && alone_member + json.cache! item, expires_in: 1.minutes do + json.name_with_owner item.name_with_owner + json.new_build_list_link new_project_build_list_path(item.name_with_owner) + json.edit_link edit_project_path(item) if policy(item).update? end end -end - -json.page params[:page] -json.projects_count @projects_count +end \ No newline at end of file diff --git a/app/views/projects/projects/mass_create.html.slim b/app/views/projects/projects/mass_create.html.slim deleted file mode 100644 index 5253e1308..000000000 --- a/app/views/projects/projects/mass_create.html.slim +++ /dev/null @@ -1,20 +0,0 @@ -.container.col-md-offset-2.col-md-8 - h3 - = title t("layout.projects.mass_create") - .row ng-init="owner = 'me'" - = simple_form_for @project, url: run_mass_create_projects_path do |f| - = f.hidden_field :mass_create - = f.input :url - = f.input :add_to_repository_id, - as: :grouped_select, - collection: mass_import_repositories_for_group_select, - group_method: :last, - include_blank: false - - = render 'owner', f: f - - = f.input :visibility, - collection: project_visibility_options, - include_blank: false - - = f.button :submit, t('layout.add') diff --git a/app/views/projects/projects/mass_import.html.slim b/app/views/projects/projects/mass_import.html.slim deleted file mode 100644 index 1c94da5dc..000000000 --- a/app/views/projects/projects/mass_import.html.slim +++ /dev/null @@ -1,21 +0,0 @@ -.container.col-md-offset-2.col-md-8 - h3 - = title t("layout.projects.mass_import") - .row ng-init="owner = 'me'" - = simple_form_for @project, url: run_mass_import_projects_path do |f| - = f.hidden_field :mass_import - = f.input :url - = f.input :srpms_list, as: :text - = f.input :add_to_repository_id, - as: :grouped_select, - collection: mass_import_repositories_for_group_select, - group_method: :last, - include_blank: false - - = render 'owner', f: f - - = f.input :visibility, - collection: project_visibility_options, - include_blank: false - - = f.button :submit, t('layout.add') diff --git a/app/views/projects/projects/new.html.slim b/app/views/projects/projects/new.html.slim index 1e4cf9081..8cd089a80 100644 --- a/app/views/projects/projects/new.html.slim +++ b/app/views/projects/projects/new.html.slim @@ -1,11 +1,10 @@ -.container - .row - .col-md-offset-2.col-md-8 - = simple_form_for @project, html: { class: 'form-horizontal' }, - wrapper: :horizontal_form, - wrapper_mappings: { boolean: :horizontal_boolean, - file: :horizontal_file_input } do |f| - .col-sm-offset-3.col-sm-9 - h3 - = title t('layout.projects.new') - = render 'form', f: f +.row.top-space + .col-md-offset-2.col-md-8 + rd-widget + rd-widget-header title=(title t('layout.projects.new')) + rd-widget-body + = simple_form_for @project, html: { class: 'form-horizontal' }, + wrapper: :horizontal_form, + wrapper_mappings: { boolean: :horizontal_boolean, + file: :horizontal_file_input } do |f| + = render 'form', f: f diff --git a/app/views/projects/projects/preview.json.jbuilder b/app/views/projects/projects/preview.json.jbuilder deleted file mode 100644 index fb18c9a12..000000000 --- a/app/views/projects/projects/preview.json.jbuilder +++ /dev/null @@ -1 +0,0 @@ -json.html markdown(params[:text]) diff --git a/app/views/projects/projects/project_info.json.jbuilder b/app/views/projects/projects/project_info.json.jbuilder new file mode 100644 index 000000000..8eb028b05 --- /dev/null +++ b/app/views/projects/projects/project_info.json.jbuilder @@ -0,0 +1,7 @@ +json.project_info do |proj| + proj.(@github_basic_info, :html_url, :description) + + proj.commits @commits do |commit| + proj.(commit, :branch, :url, :sha, :message, :committer_login, :committer_url) + end +end \ No newline at end of file diff --git a/app/views/shared/_angularjs_paginate.html.slim b/app/views/shared/_angularjs_paginate.html.slim index 7f29b9c5c..a81009560 100644 --- a/app/views/shared/_angularjs_paginate.html.slim +++ b/app/views/shared/_angularjs_paginate.html.slim @@ -2,13 +2,13 @@ / $scope.goToPage = (number) -> / $location.search('page', number) -pagination[ boundary-links = 'true' - total-items = total_items - ng-model = page - previous-text = "‹" next-text = "›" - first-text = "«" last-text = "»" - items-per-page = per_page - max-size = 5 - rotate = 'false' - ng-show = "#{total_items} > #{per_page}" - ng-change = select_page ] +uib-pagination[ boundary-links = 'true' + total-items = total_items + ng-model = page + previous-text = "‹" next-text = "›" + first-text = "«" last-text = "»" + items-per-page = per_page + max-size = 5 + rotate = 'false' + ng-show = "#{total_items} > #{per_page}" + ng-change = select_page ] diff --git a/app/views/shared/_autocomplete_form.html.slim b/app/views/shared/_autocomplete_form.html.slim index 0e6d73792..ccc051fb7 100644 --- a/app/views/shared/_autocomplete_form.html.slim +++ b/app/views/shared/_autocomplete_form.html.slim @@ -32,7 +32,7 @@ h4 type = 'text' ng-model = "#{ctrl_as}selected_#{var_name}" placeholder = placeholder - typeahead = "extra.label for extra in #{ctrl_as}get#{field}($viewValue)" + uib-typeahead = "extra.label for extra in #{ctrl_as}get#{field}($viewValue)" typeahead-on-select = "#{ctrl_as}select#{func_name}($item, $model, $label)" ] .col-md-4 button[ class='btn btn-primary' type='button' diff --git a/app/views/shared/_build_results.html.slim b/app/views/shared/_build_results.html.slim index 215242507..17176f9cf 100644 --- a/app/views/shared/_build_results.html.slim +++ b/app/views/shared/_build_results.html.slim @@ -1,22 +1,15 @@ -h3 - = subject.class.human_attribute_name(subject.is_a?(BuildList) ? 'logs' : 'results') -h4 ng-hide='subject.results' - = t('layout.no_') -table.table.table-hover ng-show='subject.results' - thead - tr - th= t 'activerecord.attributes.product_build_list/results.file_name' - th= t 'activerecord.attributes.product_build_list/results.sha1' - th= t 'activerecord.attributes.product_build_list/results.size' - th= t 'activerecord.attributes.product_build_list/results.created_at' - tbody - tr ng-repeat='item in subject.results' - td - a ng-href='{{item.url}}' - | {{item.file_name}} - td - | {{item.sha1}} - td - | {{item.size}} - td - | {{item.created_at}} +rd-widget ng-show='subject.results' + rd-widget-header title=subject.class.human_attribute_name(subject.is_a?(BuildList) ? 'logs' : 'results') + rd-widget-body class="no-padding" + table.table.table-hover ng-show='subject.results' + thead + tr + th= t 'activerecord.attributes.product_build_list/results.file_name' + th= t 'activerecord.attributes.product_build_list/results.size' + tbody + tr ng-repeat='item in subject.results' + td + a ng-href='{{item.url}}' + | {{item.file_name}} + td + | {{item.size}} diff --git a/app/views/shared/_feed_commit.html.slim b/app/views/shared/_feed_commit.html.slim deleted file mode 100644 index 313c434c4..000000000 --- a/app/views/shared/_feed_commit.html.slim +++ /dev/null @@ -1,15 +0,0 @@ -.pull-left.roffset5 - img alt='avatar' src=presenter.image -.pull-left - strong= presenter.header - =< datetime_moment(presenter.date, tag: :strong) - .clearfix - span=> presenter.caption - - if presenter.expandable? && presenter.content? - span.glyphicon.glyphicon-chevron-down.pointer[ - data-toggle = 'collapse' - data-target = "#commit_message_#{item_no}" ] -.clearfix -- if presenter.content? - .collapse id="commit_message_#{item_no}" - .well.well-sm== markdown(presenter.content) diff --git a/app/views/shared/_feed_message.html.slim b/app/views/shared/_feed_message.html.slim deleted file mode 100644 index 5a5b8389c..000000000 --- a/app/views/shared/_feed_message.html.slim +++ /dev/null @@ -1,29 +0,0 @@ --if presenter.is_reference_to_issue.nil? || presenter.reference_project.nil? || policy(presenter.reference_project).show? - .panel.panel-default[ id = (presenter.comment_id? ? presenter.comment_anchor : '') ] - .panel-body - .pull-left.roffset5 - img alt = 'avatar' src = presenter.image - - - if presenter.buttons? - .pull-right - => raw presenter.buttons.join(' ').html_safe - - .pull-left - strong= presenter.header - p= datetime_moment(presenter.date, tag: :strong) - - - if presenter.caption? - .clearfix - span= presenter.caption - - if presenter.expandable? and presenter.content? - span.data-expander.collapsed[ id = "expand#{item_no}"]   - - .clearfix - - if presenter.content? - .offset10 - =presenter.issue_referenced_state if presenter.issue_referenced_state? - .fulltext[ class = "#{presenter.expandable? ? "hidden" : ''} #{presenter.caption? ? "" : "alone"}" - id = (presenter.expandable? ? "content-expand#{item_no}" : '') ] - .md_and_cm[ class = (presenter.is_reference_to_issue ? '' : 'cm-s-default') ] - = presenter.is_reference_to_issue ? presenter.content : markdown(presenter.content) - .clearfix diff --git a/app/views/shared/_header.html.slim b/app/views/shared/_header.html.slim index bd2f86460..af9b33b2d 100644 --- a/app/views/shared/_header.html.slim +++ b/app/views/shared/_header.html.slim @@ -1,14 +1,14 @@ -link rel='canonical' href=facebook_meta_url +/ link rel='canonical' href=facebook_meta_url / meta property='og:title' content=facebook_meta_title -meta property='og:type' content='website' -meta property='og:url' content=facebook_meta_url -meta property='og:image' content=facebook_meta_image -meta property='og:site_name' content=facebook_site_name -meta property='fb:app_id' content=facebook_meta_app_id +/ meta property='og:type' content='website' +/ meta property='og:url' content=facebook_meta_url +/ meta property='og:image' content=facebook_meta_image +/ meta property='og:site_name' content=facebook_site_name +/ meta property='fb:app_id' content=facebook_meta_app_id / meta property='og:description' content=facebook_meta_description / meta name='Description' content=facebook_meta_description -meta property='twitter:card' content='summary' -meta property='twitter:site' content='@abf_io' -meta property='twitter:image' content=facebook_meta_image -meta property='twitter:url' content=facebook_meta_url +/ meta property='twitter:card' content='summary' +/ meta property='twitter:site' content='@abf_io' +/ meta property='twitter:image' content=facebook_meta_image +/ meta property='twitter:url' content=facebook_meta_url diff --git a/app/views/statistics/_filter.html.slim b/app/views/statistics/_filter.html.slim index 80f5e2988..4ff8178cc 100644 --- a/app/views/statistics/_filter.html.slim +++ b/app/views/statistics/_filter.html.slim @@ -1,11 +1,7 @@ - user ||= false .row .col-md-12 - - h3.text-info - = t('.header') - - form#statistics-form.form-inline.alert.alert-info.centered + form#statistics-form.form-inline.centered .form-group> label.control-label> = t('.range_label') @@ -20,8 +16,8 @@ size: 7, readonly: true, ng_disabled: 'loading', - datepicker_popup: 'yyyy-MM-dd', - datepicker_options: 'dateOptions', + uib_datepicker_popup: 'yyyy-MM-dd', + uib_datepicker_options: 'dateOptions', is_open: 'range_start_opened', show_button_bar: false @@ -43,8 +39,8 @@ size: 7, ng_disabled: 'loading', readonly: true, - datepicker_popup: 'yyyy-MM-dd', - datepicker_options: 'dateOptions', + uib_datepicker_popup: 'yyyy-MM-dd', + uib_datepicker_options: 'dateOptions', is_open: 'range_end_opened', show_button_bar: false diff --git a/app/views/statistics/index.html.slim b/app/views/statistics/index.html.slim index f98ef650b..5cdc96eb7 100644 --- a/app/views/statistics/index.html.slim +++ b/app/views/statistics/index.html.slim @@ -1,6 +1,10 @@ - set_meta_tags title: t('.header') -.container#manage-statistics ng-controller='StatisticsController' ng-init='init()' - - = render 'filter' - = render 'build_lists' \ No newline at end of file +.row.top-space + .col-md-8.col-md-offset-2 + rd-widget + rd-widget-header title=t('.header') + rd-widget-body + div#manage-statistics ng-controller='StatisticsController' ng-init='init()' + = render 'filter' + = render 'build_lists' \ No newline at end of file diff --git a/config/application.rb b/config/application.rb index d1193cd41..5a2c80a29 100644 --- a/config/application.rb +++ b/config/application.rb @@ -68,4 +68,4 @@ module Rosa config.angular_templates.ignore_prefix = 'angularjs/templates/' end -end +end \ No newline at end of file diff --git a/config/initializers/github.rb b/config/initializers/github.rb index abea6ed25..0a4b18ba3 100644 --- a/config/initializers/github.rb +++ b/config/initializers/github.rb @@ -8,7 +8,7 @@ Octokit.configure do |c| end Octokit.middleware = Faraday::RackBuilder.new do |builder| store = ActiveSupport::Cache.lookup_store(:redis_store, ENV['REDIS_URL'].to_s + '/1') - builder.use Faraday::HttpCache, store: store, shared_cache: false + builder.use Faraday::HttpCache, store: store, shared_cache: false, serializer: Marshal builder.use Octokit::Response::RaiseError builder.adapter Faraday.default_adapter end \ No newline at end of file diff --git a/config/initializers/redis.rb b/config/initializers/redis.rb index 9fc5e65e8..b3c076007 100644 --- a/config/initializers/redis.rb +++ b/config/initializers/redis.rb @@ -1,6 +1,6 @@ class Redis def self.connect! - url = ENV["REDIS_URL"] || "redis://localhost:6379/#{::Rails.env.test? ? 1 : 0}" + url = ENV["REDIS_URL"] || "redis://localhost:6379/#{::Rails.env.test? ? 2 : 0}" opts = { url: url } opts[:logger] = ::Rails.logger if ::Rails.application.config.log_redis @@ -10,3 +10,4 @@ class Redis end Redis.connect! +Redis::Semaphore.new(:job_shift_lock).delete! \ No newline at end of file diff --git a/config/locales/dashboard.en.yml b/config/locales/dashboard.en.yml new file mode 100644 index 000000000..524d9ecd3 --- /dev/null +++ b/config/locales/dashboard.en.yml @@ -0,0 +1,18 @@ +en: + dashboard: + dashboard_name: Projects/Build lists + filters: Filters + + projects: + title: Projects + last_projects: Projects you've worked with + name: Project name + search: Search + new_build: New build + + project_info: + title: Project information + select: Please select a project + + platforms: + title: Platforms \ No newline at end of file diff --git a/config/locales/menu.en.yml b/config/locales/menu.en.yml index 0b5c36ab9..e6878b3ff 100644 --- a/config/locales/menu.en.yml +++ b/config/locales/menu.en.yml @@ -5,8 +5,6 @@ en: products: Products top_menu: platforms: Platforms - projects: Projects - build_lists: Task monitoring groups: Groups statistics: Statistics bottom_menu: diff --git a/config/locales/menu.ru.yml b/config/locales/menu.ru.yml index 6d9264282..48c3af847 100644 --- a/config/locales/menu.ru.yml +++ b/config/locales/menu.ru.yml @@ -5,8 +5,6 @@ ru: personal_repository: Мой репозиторий top_menu: platforms: Платформы - projects: Проекты - build_lists: Мониторинг задач groups: Группы statistics: Статистика bottom_menu: diff --git a/config/routes.rb b/config/routes.rb index cd6183413..fc32ff166 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -121,14 +121,13 @@ Rails.application.routes.draw do get '/forbidden' => 'pages#forbidden', as: 'forbidden' get '/terms-of-service' => 'pages#tos', as: 'tos' + get '/activity.:format' => 'home#activity', as: 'activity_feeds', format: /json/ get '/activity_feeds.:format' => 'home#activity', as: 'atom_activity_feeds', format: /atom/ - get '/own_activity' => 'home#own_activity', as: 'own_activity' - get '/get_owners_list' => 'home#get_owners_list' - get '/get_project_names_list' => 'home#get_project_names_list' + get '/own_activity.:format' => 'home#own_activity', as: 'own_activity', format: /json/ if APP_CONFIG['anonymous_access'] authenticated do - root to: 'home#activity' + root to: 'home#index' end unauthenticated do root to: 'statistics#index', as: :unauthenticated_root @@ -137,7 +136,7 @@ Rails.application.routes.draw do #end end else - root to: 'home#activity' + root to: 'home#index' end scope module: 'platforms' do @@ -263,31 +262,23 @@ Rails.application.routes.draw do end end - resources :projects, only: [:index, :new, :create] do - collection do - post :run_mass_import - get :mass_import - post :run_mass_create - get :mass_create - end - end + get '/projects_dashboard' => 'projects#dashboard', as: :projects_dashboard + + resources :projects, only: [:index, :new, :create] + scope '*name_with_owner', name_with_owner: Project::OWNER_AND_NAME_REGEXP do # project scope as: 'project' do - resources :build_lists, only: [:index, :new, :create] do - get :list, on: :collection - end + resources :build_lists, only: [:index, :new, :create] put 'schedule' => 'projects#schedule' end # Resource + get '/project_info.:format' => 'projects#project_info', as: :project_info, format: /json/ get '/autocomplete_maintainers' => 'projects#autocomplete_maintainers', as: :autocomplete_maintainers get '/modify' => 'projects#edit', as: :edit_project - patch '/' => 'projects#update' + patch '/' => 'projects#update', as: :project delete '/' => 'projects#destroy' - # Member - delete '/remove_user' => 'projects#remove_user', as: :remove_user_project - get '/' => "projects#bl_redirect", as: :project get '/commit/:sha' => 'projects#commit', as: :commit get '/diff/:diff' => 'projects#diff', as: :diff, format: false, diff: /.*/ end From 7dc0a74348f5a70678fc1653d7c9b5edcbe25e4d Mon Sep 17 00:00:00 2001 From: Wedge Date: Mon, 2 May 2016 16:06:29 +0300 Subject: [PATCH 2/5] Move build list items around --- app/views/projects/build_lists/new.html.slim | 2 +- app/views/projects/build_lists/show.html.slim | 12 +- .../projects/projects/dashboard.html.slim | 117 +++++++++--------- 3 files changed, 65 insertions(+), 66 deletions(-) diff --git a/app/views/projects/build_lists/new.html.slim b/app/views/projects/build_lists/new.html.slim index 3b670544a..ec086aa89 100644 --- a/app/views/projects/build_lists/new.html.slim +++ b/app/views/projects/build_lists/new.html.slim @@ -1,6 +1,6 @@ -set_meta_tags title: [title_object(@project), t('layout.build_lists.new_header')] .row.top-space - .col-xs-12.col-md-10.col-md-offset-1 ng-controller = 'NewBuildListController as newBuildCtrl' ng-cloak = true + .col-md-12 ng-controller = 'NewBuildListController as newBuildCtrl' ng-cloak = true rd-widget rd-widget-header title=(t('layout.build_lists.new_header') + ' | ' + title_object(@project)) rd-widget-body diff --git a/app/views/projects/build_lists/show.html.slim b/app/views/projects/build_lists/show.html.slim index 4889c0d47..40e16d93c 100644 --- a/app/views/projects/build_lists/show.html.slim +++ b/app/views/projects/build_lists/show.html.slim @@ -16,7 +16,7 @@ div[ ng-controller='BuildListController' | ) .row - .col-md-12 + div ng-class="{'col-md-6': build_list.packages || build_list.results, 'col-md-12': !build_list.packages && !build_list.results}" rd-widget rd-widget-header title=t('layout.build_lists.main_data') rd-widget-body class="no-padding" @@ -178,6 +178,10 @@ div[ ng-controller='BuildListController' rd-widget-footer = form_for @build_list, url: publish_build_list_path(@build_list), html: {class: :"form-inline"} do |f| = render 'buttons', build_list: @build_list + .col-md-6 + = render 'packages' + .top-space ng-show="build_list.packages" + = render 'shared/build_results', subject: @build_list .row.top-space ng-show="build_list.status == #{BuildList::BUILD_STARTED}" = render 'shared/log', { build_started: true, get_log_path: log_build_list_path(@build_list) } @@ -186,8 +190,4 @@ div[ ng-controller='BuildListController' .col-md-12 = render 'item_groups' - .row.top-space - .col-md-6 - = render 'packages' - .col-md-6 - = render 'shared/build_results', subject: @build_list \ No newline at end of file + .row.top-space \ No newline at end of file diff --git a/app/views/projects/projects/dashboard.html.slim b/app/views/projects/projects/dashboard.html.slim index e36f7d88d..904a5afeb 100644 --- a/app/views/projects/projects/dashboard.html.slim +++ b/app/views/projects/projects/dashboard.html.slim @@ -1,61 +1,3 @@ -.row.top-space - .col-md-6 - rd-widget - div ng-controller="ProjectsController" - rd-widget-header title=(t "dashboard.projects.title") icon="fa-cube" - input.form-control.input-sm [ng-model="search" placeholder=(t "dashboard.projects.search") - ng-change="searchProjects(search)" ng-model-options="{ debounce: 500 }"] - rd-widget-body classes="medium no-padding" loading="requesting" - .table-responsive - table.table ng-cloak=true - thead - tr - th ng-show="search" = t 'dashboard.projects.name' - th ng-hide="search" = t 'dashboard.projects.last_projects' - th - th - tbody - tr ng-repeat = 'item in projects' - td - button[ ng-click = 'selectProject(item.name_with_owner)' - ng-disabled="ProjectSelectService.disable()" class="btn btn-xs btn-link"] {{::item.name_with_owner}} - td - a[ ng-href = '{{::item.new_build_list_link}}'] = t 'dashboard.projects.new_build' - td - a[ ng-href = '{{::item.edit_link}}' - ng-show='::item.edit_link' target='_blank'] = t 'project_menu.settings' - - if policy(:project).create? - rd-widget-footer - ul.nav.nav-justified - li - = link_to t('layout.projects.new'), new_project_path, target: '_blank' - .col-md-6 - rd-widget - div ng-controller="ProjectInfoController" - rd-widget-header title=(t('dashboard.project_info.title') + '{{widget_title}}') - rd-widget-body class="medium" loading="requesting" - div ng-hide="widget_title" - = t('dashboard.project_info.select') - div ng-show="widget_title" - div - a ng-href="{{project_info.html_url}}" target="_blank" - | {{project}} - div.bottom-space - | {{project_info.description}} - div - div.bottom-space ng-repeat="commit in project_info.commits" - div - span - | {{::commit.branch}} - span.pull-right - a ng-href="{{::commit.committer_url}}" target="_blank" - | {{::commit.committer_login}} - div - a ng-href="{{::commit.url}}" target="_blank" - | {{::commit.sha}} - div - | {{::commit.message}} - .row.top-space .col-md-12 == render 'projects/build_lists/filter' @@ -144,4 +86,61 @@ td title = '{{::bl.updated_at_utc}}' | {{::bl.updated_at | amDateFormat:'YYYY-MM-DD HH:mm' }} rd-widget-footer ng-show="total_items > per_page" - == angularjs_paginate( per_page: 'per_page' ) \ No newline at end of file + == angularjs_paginate( per_page: 'per_page' ) +.row.top-space + .col-md-6 + rd-widget + div ng-controller="ProjectsController" + rd-widget-header title=(t "dashboard.projects.title") icon="fa-cube" + input.form-control.input-sm [ng-model="search" placeholder=(t "dashboard.projects.search") + ng-change="searchProjects(search)" ng-model-options="{ debounce: 500 }"] + rd-widget-body classes="medium no-padding" loading="requesting" + .table-responsive + table.table ng-cloak=true + thead + tr + th ng-show="search" = t 'dashboard.projects.name' + th ng-hide="search" = t 'dashboard.projects.last_projects' + th + th + tbody + tr ng-repeat = 'item in projects' + td + button[ ng-click = 'selectProject(item.name_with_owner)' + ng-disabled="ProjectSelectService.disable()" class="btn btn-xs btn-link"] {{::item.name_with_owner}} + td + a[ ng-href = '{{::item.new_build_list_link}}'] = t 'dashboard.projects.new_build' + td + a[ ng-href = '{{::item.edit_link}}' + ng-show='::item.edit_link' target='_blank'] = t 'project_menu.settings' + - if policy(:project).create? + rd-widget-footer + ul.nav.nav-justified + li + = link_to t('layout.projects.new'), new_project_path, target: '_blank' + .col-md-6 + rd-widget + div ng-controller="ProjectInfoController" + rd-widget-header title=(t('dashboard.project_info.title') + '{{widget_title}}') + rd-widget-body class="medium" loading="requesting" + div ng-hide="widget_title" + = t('dashboard.project_info.select') + div ng-show="widget_title" + div + a ng-href="{{project_info.html_url}}" target="_blank" + | {{project}} + div.bottom-space + | {{project_info.description}} + div + div.bottom-space ng-repeat="commit in project_info.commits" + div + span + | {{::commit.branch}} + span.pull-right + a ng-href="{{::commit.committer_url}}" target="_blank" + | {{::commit.committer_login}} + div + a ng-href="{{::commit.url}}" target="_blank" + | {{::commit.sha}} + div + | {{::commit.message}} \ No newline at end of file From 9f825906f43ab65d7c7d779e345571a5ff32675d Mon Sep 17 00:00:00 2001 From: Wedge Date: Wed, 4 May 2016 18:49:30 +0300 Subject: [PATCH 3/5] Revamp interface --- .../build_lists/build_lists_controller.js.erb | 49 ++---- .../controllers/rosa_abf_controller.js | 20 ++- app/controllers/home_controller.rb | 2 +- .../projects/build_lists_controller.rb | 1 + .../projects/projects_controller.rb | 1 + app/views/layouts/application.html.slim | 7 +- app/views/layouts/menu/_new_top.html.slim | 5 - .../projects/build_lists/_buttons.html.slim | 112 +++++++------- .../projects/build_lists/index.html.slim | 80 ++++++++++ app/views/projects/build_lists/show.html.slim | 31 ++-- .../projects/projects/dashboard.html.slim | 146 ------------------ app/views/projects/projects/index.html.slim | 29 ++++ .../projects/projects/index.json.jbuilder | 1 + config/locales/menu.en.yml | 2 + config/routes.rb | 2 - 15 files changed, 223 insertions(+), 265 deletions(-) create mode 100644 app/views/projects/build_lists/index.html.slim delete mode 100644 app/views/projects/projects/dashboard.html.slim create mode 100644 app/views/projects/projects/index.html.slim diff --git a/app/assets/javascripts/angularjs/build_lists/build_lists_controller.js.erb b/app/assets/javascripts/angularjs/build_lists/build_lists_controller.js.erb index cc9ff3899..a68b00671 100644 --- a/app/assets/javascripts/angularjs/build_lists/build_lists_controller.js.erb +++ b/app/assets/javascripts/angularjs/build_lists/build_lists_controller.js.erb @@ -1,11 +1,11 @@ -RosaABF.controller('BuildListsController', ['$scope', 'BuildListsService', '$location', '$interval', '$uibModal', 'ProjectSelectService', -function($scope, BuildListsService, $location, $interval, $uibModal, ProjectSelectService) { +RosaABF.controller('BuildListsController', ['$scope', 'BuildListsService', '$location', '$interval', '$uibModal', +function($scope, BuildListsService, $location, $interval, $uibModal) { $scope.params = null; $scope.build_lists = []; $scope.isRequest = false; // Disable 'Search' button $scope.opened = {}; - $scope.ProjectSelectService = ProjectSelectService; + var selectedProject = ""; var refresh, is_autoreload_on; var default_filters = {page: '1', per_page: '25', 'ownership': 'owned'}; @@ -23,17 +23,20 @@ function($scope, BuildListsService, $location, $interval, $uibModal, ProjectSele } } - $scope.getBuildLists = function() { + $scope.getBuildLists = function(project) { if ($scope.isRequest) { return; } - ProjectSelectService.disable_bl = true; - $scope.isRequest = true; - - if(ProjectSelectService.project) { - var project = ProjectSelectService.project; + if(selectedProject) { + project = selectedProject; } + else { + selectedProject = project; + } + + $scope.widgetTitle = project; + $scope.isRequest = true; var filter = Object.assign(Object.create(null), default_filters, $location.search()); var fixed_filter = Object.create(null); @@ -66,15 +69,9 @@ function($scope, BuildListsService, $location, $interval, $uibModal, ProjectSele $location.search(Object.assign(filter, res.filter)); $scope.per_page = filter.per_page; $scope.isRequest = false; - ProjectSelectService.disable_bl = false; - ProjectSelectService.load_project_info = ProjectSelectService.project; }); } - $scope.clearProject = function() { - ProjectSelectService.project = ""; - } - $scope.showRelated = function(build_list) { build_list.relatedHidden = false; $scope.opened[build_list.id] = true; @@ -129,28 +126,6 @@ function($scope, BuildListsService, $location, $interval, $uibModal, ProjectSele } $scope.setAutoreload(true); - - var project_hash = $location.search(); - if(project_hash['project']) { - ProjectSelectService.project = project_hash['project']; - $location.search('project', null); - } - - $scope.$watch(function() { - return ProjectSelectService.project; - }, function() { - var turn_back_on = is_autoreload_on; - if(ProjectSelectService.project) { - $scope.widget_title = " | " + ProjectSelectService.project; - } - else { - $scope.widget_title = ""; - } - $scope.setAutoreload(false); - $scope.getBuildLists(); - $scope.setAutoreload(turn_back_on); - }); - }]); RosaABF.controller('FiltersInstanceController', ['$scope', '$uibModalInstance', 'params', diff --git a/app/assets/javascripts/angularjs/controllers/rosa_abf_controller.js b/app/assets/javascripts/angularjs/controllers/rosa_abf_controller.js index da2b844f1..716b6e375 100644 --- a/app/assets/javascripts/angularjs/controllers/rosa_abf_controller.js +++ b/app/assets/javascripts/angularjs/controllers/rosa_abf_controller.js @@ -7,6 +7,24 @@ RosaABF.controller('RosaABFController', ['$scope', 'LocalesHelper', 'SoundNotifi //moment.locale(locale); SoundNotificationsHelper.enabled(sound_notifications); $timeout(function() { $scope.hideAlerts = true; }, 5000); - console.log($scope); } + var mobileView = 992; + + $scope.getWidth = function() { + return window.innerWidth; + }; + + $scope.$watch($scope.getWidth, function(newValue, oldValue) { + if (newValue >= mobileView) { + $scope.toggle = true; + } + else { + $scope.toggle = false; + } + }); + + $scope.toggleSidebar = function() { + $scope.toggle = !$scope.toggle; + }; + }]); diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index fa774eb35..44b565b45 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -3,7 +3,7 @@ class HomeController < ApplicationController skip_after_action :verify_authorized def index - redirect_to projects_dashboard_path + redirect_to projects_path end def activity(is_my_activity = false) diff --git a/app/controllers/projects/build_lists_controller.rb b/app/controllers/projects/build_lists_controller.rb index be81d6756..89f824681 100644 --- a/app/controllers/projects/build_lists_controller.rb +++ b/app/controllers/projects/build_lists_controller.rb @@ -16,6 +16,7 @@ class Projects::BuildListsController < Projects::BaseController params[:filter].each{|k,v| params[:filter].delete(k) if v.blank? } if params[:filter] respond_to do |format| + format.html format.json do @filter = BuildList::Filter.new(@project, current_user, params[:filter] || {}) params[:page] = params[:page].to_i == 0 ? nil : params[:page] diff --git a/app/controllers/projects/projects_controller.rb b/app/controllers/projects/projects_controller.rb index 546e014d6..0c784ea73 100644 --- a/app/controllers/projects/projects_controller.rb +++ b/app/controllers/projects/projects_controller.rb @@ -9,6 +9,7 @@ class Projects::ProjectsController < Projects::BaseController def index authorize :project respond_to do |format| + format.html format.json { if not params[:search].present? @projects = Project.find(current_user.build_lists.group(:project_id).limit(10).pluck(:project_id)) diff --git a/app/views/layouts/application.html.slim b/app/views/layouts/application.html.slim index edefc7554..f0c70a780 100644 --- a/app/views/layouts/application.html.slim +++ b/app/views/layouts/application.html.slim @@ -14,12 +14,13 @@ html body[ ng-app='RosaABF' ng-controller='RosaABFController' ng-strict-di='' ng-init="init('#{I18n.locale}', #{!!current_user.try(:sound_notifications)})" ng-cloak="true"] - .page-wrapper.open + .page-wrapper ng-class="{'open': toggle}" .sidebar-wrapper ul.sidebar li.sidebar-main - a href="/" - = link_to image_tag('logo-mini.png', alt: 'ABF'), root_path + a ng-click="toggleSidebar()" + = image_tag('logo-mini.png', alt: 'ABF') + span class="menu-icon glyphicon glyphicon-transfer" == render 'layouts/menu/new_top' .content-wrapper diff --git a/app/views/layouts/menu/_new_top.html.slim b/app/views/layouts/menu/_new_top.html.slim index dafcc45c0..5d027cc1c 100644 --- a/app/views/layouts/menu/_new_top.html.slim +++ b/app/views/layouts/menu/_new_top.html.slim @@ -1,9 +1,4 @@ -if current_user - -if policy(:project).dashboard? - li.sidebar-list - a href=projects_dashboard_path - =t 'dashboard.dashboard_name' - span.menu-icon.fa.fa-tachometer - (collection = t 'top_menu').each do |base, title| - if policy(base.to_s.singularize.to_sym).index? li.sidebar-list diff --git a/app/views/projects/build_lists/_buttons.html.slim b/app/views/projects/build_lists/_buttons.html.slim index ee5a6045c..6aee9e547 100644 --- a/app/views/projects/build_lists/_buttons.html.slim +++ b/app/views/projects/build_lists/_buttons.html.slim @@ -1,67 +1,71 @@ - if policy(build_list).cancel? - = link_to t("layout.build_lists.cancel"), - cancel_build_list_path(build_list), - method: :put, + .row + = link_to t("layout.build_lists.cancel"), + cancel_build_list_path(build_list), + method: :put, + data: { confirm: t('layout.confirm') }, + class: 'btn btn-primary', + 'ng-show' => 'build_list.can_cancel' + +.row.top-space ng-show="build_list.can_publish && build_list.status == #{BuildList::BUILD_PUBLISHED}" + = submit_tag t('layout.publish_again'), + data: { confirm: t("layout.publish_again_warning") }, + name: 'publish', + class: 'btn btn-primary' + +.row.top-space ng-show="build_list.can_publish && build_list.can_publish_in_future && build_list.extra_build_lists_published && build_list.status == #{BuildList::TESTS_FAILED}" + = submit_tag t('layout.publish'), + data: { confirm: t('layout.build_lists.tests_failed') }, + name: 'publish', + class: 'btn btn-primary' + +.row.top-space ng-show="build_list.can_publish && build_list.can_publish_in_future && build_list.extra_build_lists_published && build_list.status != #{BuildList::TESTS_FAILED} && build_list.status != #{BuildList::BUILD_PUBLISHED}" + = submit_tag t('layout.publish'), data: { confirm: t('layout.confirm') }, - class: 'btn btn-primary roffset5 boffset5', - 'ng-show' => 'build_list.can_cancel' + name: 'publish', + class: 'btn btn-primary' + -= submit_tag t('layout.publish_again'), - data: { confirm: t("layout.publish_again_warning") }, - name: 'publish', - class: 'btn btn-primary roffset5 boffset5', - 'ng-show' => "build_list.can_publish && build_list.status == #{BuildList::BUILD_PUBLISHED}" - -= submit_tag t('layout.publish'), - data: { confirm: t('layout.build_lists.tests_failed') }, - name: 'publish', - class: 'btn btn-primary roffset5 boffset5', - 'ng-show' => "build_list.can_publish && build_list.can_publish_in_future && build_list.extra_build_lists_published && build_list.status == #{BuildList::TESTS_FAILED}" - -= submit_tag t('layout.publish'), - data: { confirm: t('layout.confirm') }, - name: 'publish', - class: 'btn btn-primary roffset5 boffset5', - 'ng-show' => "build_list.can_publish && build_list.can_publish_in_future && build_list.extra_build_lists_published && build_list.status != #{BuildList::TESTS_FAILED} && build_list.status != #{BuildList::BUILD_PUBLISHED}" - -= link_to t('layout.publish_into_testing'), - publish_into_testing_build_list_path(build_list), - method: :put, - data: { confirm: t('layout.confirm') }, - class: 'btn btn-primary roffset5 boffset5', - 'ng-show' => 'build_list.can_publish_into_testing' +.row.top-space ng-show='build_list.can_publish_into_testing' + = link_to t('layout.publish_into_testing'), + publish_into_testing_build_list_path(build_list), + method: :put, + data: { confirm: t('layout.confirm') }, + class: 'btn btn-primary' - if policy(build_list).reject_publish? - = link_to t('layout.reject_publish'), - reject_publish_build_list_path(build_list), - method: :put, - data: { confirm: t('layout.confirm') }, - class: 'btn btn-primary roffset5 boffset5', - 'ng-show' => 'build_list.can_reject_publish' + .row.top-space ng-show='build_list.can_reject_publish' + = link_to t('layout.reject_publish'), + reject_publish_build_list_path(build_list), + method: :put, + data: { confirm: t('layout.confirm') }, + class: 'btn btn-primary' - if policy(build_list).rerun_tests? - = link_to t('layout.build_lists.rerun_tests'), - rerun_tests_build_list_path(build_list), - method: :put, - data: { confirm: t('layout.confirm') }, - class: 'btn btn-primary roffset5 boffset5', - 'ng-show' => "build_list.status == #{BuildList::TESTS_FAILED} || build_list.status == #{BuildList::SUCCESS}" + .row.top-space ng-show="build_list.status == #{BuildList::TESTS_FAILED} || build_list.status == #{BuildList::SUCCESS}" + = link_to t('layout.build_lists.rerun_tests'), + rerun_tests_build_list_path(build_list), + method: :put, + data: { confirm: t('layout.confirm') }, + class: 'btn btn-primary' - if policy(build_list).create_container? - = link_to t('layout.build_lists.create_container'), - create_container_build_list_path(build_list), - method: :put, - data: { confirm: t("layout.confirm") }, - class: 'btn btn-primary roffset5 boffset5', - 'ng-show' => 'build_list.can_create_container' + .row.top-space ng-show='build_list.can_create_container' + = link_to t('layout.build_lists.create_container'), + create_container_build_list_path(build_list), + method: :put, + data: { confirm: t("layout.confirm") }, + class: 'btn btn-primary' - if policy(build_list).create? - = link_to t('layout.build_lists.recreate_build_list'), new_project_build_list_path(build_list.project, - build_list_id: build_list.id), - class: 'btn btn-primary roffset5 boffset5' + .row.top-space + = link_to t('layout.build_lists.recreate_build_list'), new_project_build_list_path(build_list.project, + build_list_id: build_list.id), + class: 'btn btn-primary' - if can_run_dependent_build_lists?(build_list) - = link_to t('projects.build_lists.dependent_projects.title'), - dependent_projects_build_list_path(build_list), - class: 'btn btn-primary roffset5 boffset5', - 'ng-show' => 'build_list.dependent_projects_exists' + .row.top-space ng-show='build_list.dependent_projects_exists' + = link_to t('projects.build_lists.dependent_projects.title'), + dependent_projects_build_list_path(build_list), + class: 'btn btn-primary' + diff --git a/app/views/projects/build_lists/index.html.slim b/app/views/projects/build_lists/index.html.slim new file mode 100644 index 000000000..9055bf76c --- /dev/null +++ b/app/views/projects/build_lists/index.html.slim @@ -0,0 +1,80 @@ +.row.top-space + .col-md-12 ng-controller="BuildListsController" ng-init=('getBuildLists("'+params[:name_with_owner].to_s+'")') + == render 'projects/build_lists/filter' + rd-widget + rd-widget-header title="Build Lists {{::widgetTitle}}" icon="fa-gears" + .form-inline ng-init="autoreload=true" + button ng-model="autoreload" ng-click="setAutoreload(autoreload)" class="btn btn-default" uib-btn-checkbox="" + = t 'layout.autoreload_page' + button class="btn btn-default" ng-click="openFilters()" ng-disabled="isRequest" + | Filters + rd-widget-body classes="no-padding" loading="isRequest" + .row + table.table.table-condensed + thead + tr + th + th= t('activerecord.attributes.build_list.id') + th= t('activerecord.attributes.build_list.status') + th= t('activerecord.attributes.build_list.project') + th= t('diff') + th= t('activerecord.attributes.build_list.project_version') + th= t('activerecord.attributes.build_list.save_to_repository') + th= t('activerecord.attributes.build_list.arch_short') + th= t('activerecord.attributes.build_list.user') + th= t('activerecord.attributes.build_list.hostname') + tbody + tr[ ng-repeat = 'bl in build_lists' + class = '{{::bl.status_color}}' + id = 'build-list-{{::bl.id}}' + ng-class = "{'group-start': !bl.relatedHidden, 'group-end': bl.lastRelated}" + ng-show = 'bl.show' ] + td.build-list-chevrons + a.expand ng-show = '::bl.hasRelated' + span.fa.fa-chevron-down ng-show = 'bl.relatedHidden' ng-click = 'showRelated(bl)' + span.fa.fa-chevron-up ng-hide = 'bl.relatedHidden' ng-click = 'hideRelated(bl)' + / id + td.build-list-statuses + + a[ ng-href = '{{::bl.url}}' ] {{::bl.id}} + div ng-show = '::bl.hasRelated' ng-bind-html="::bl.chevronHtml" + + / status + td + | {{::bl.human_status | i18n}} + br + time ng-show = '::bl.duration' + | {{::bl.duration}} + time ng-show = '::bl.average_build_time' + | /{{::bl.average_build_time}} + + / project + td.centered ng-hide = '::bl.project' colspan = 2 + = t('layout.projects.unexisted_project') + td ng-show = '::bl.project' + | {{::bl.project.name_with_owner}} + + / diff + td + a ng-href = '{{::bl.version_link_url}}' ng-show = '::bl.project' + | {{::bl.version_link_text}} + + / project_version + td[] {{::bl.version_release}} + + / save_to_repository + td + a[ ng-href = '{{::bl.save_to_repository_url}}' ] {{::bl.save_to_repository_name}} + + / arch_short + td[ ng-show = '::bl.arch' ] {{::bl.arch.name}} + td[ ng-hide = '::bl.arch' ]= t('layout.arches.unexisted_arch') + + / user + td + a[ ng-href = '{{::bl.user.url}}' ] {{::bl.user.fullname}} + + / hostname + td[] {{::bl.hostname}} + rd-widget-footer ng-show="total_items > per_page" + == angularjs_paginate( per_page: 'per_page' ) \ No newline at end of file diff --git a/app/views/projects/build_lists/show.html.slim b/app/views/projects/build_lists/show.html.slim index 40e16d93c..ae508e9de 100644 --- a/app/views/projects/build_lists/show.html.slim +++ b/app/views/projects/build_lists/show.html.slim @@ -16,7 +16,16 @@ div[ ng-controller='BuildListController' | ) .row - div ng-class="{'col-md-6': build_list.packages || build_list.results, 'col-md-12': !build_list.packages && !build_list.results}" + .col-md-8 + = render 'packages' + .col-md-4 + = render 'shared/build_results', subject: @build_list + + .row.top-space ng-show="build_list.status == #{BuildList::BUILD_STARTED}" + = render 'shared/log', { build_started: true, get_log_path: log_build_list_path(@build_list) } + + .row.top-space + .col-md-10 rd-widget rd-widget-header title=t('layout.build_lists.main_data') rd-widget-body class="no-padding" @@ -175,19 +184,9 @@ div[ ng-controller='BuildListController' tr.alert.alert-danger ng-show='build_list.can_publish && build_list.can_publish_in_future && !build_list.can_publish_into_repository' td colspan=2 = t('flash.build_list.not_all_build_lists_success') - rd-widget-footer + .col-md-2 + rd-widget + rd-widget-header title="Actions" + rd-widget-body = form_for @build_list, url: publish_build_list_path(@build_list), html: {class: :"form-inline"} do |f| - = render 'buttons', build_list: @build_list - .col-md-6 - = render 'packages' - .top-space ng-show="build_list.packages" - = render 'shared/build_results', subject: @build_list - - .row.top-space ng-show="build_list.status == #{BuildList::BUILD_STARTED}" - = render 'shared/log', { build_started: true, get_log_path: log_build_list_path(@build_list) } - - .row.top-space - .col-md-12 - = render 'item_groups' - - .row.top-space \ No newline at end of file + = render 'buttons', build_list: @build_list \ No newline at end of file diff --git a/app/views/projects/projects/dashboard.html.slim b/app/views/projects/projects/dashboard.html.slim deleted file mode 100644 index 904a5afeb..000000000 --- a/app/views/projects/projects/dashboard.html.slim +++ /dev/null @@ -1,146 +0,0 @@ -.row.top-space - .col-md-12 - == render 'projects/build_lists/filter' - rd-widget - div ng-controller="BuildListsController" - rd-widget-header title="Build Lists{{widget_title}}" icon="fa-gears" - .form-inline ng-init="autoreload=true" - button ng-model="autoreload" ng-click="setAutoreload(autoreload)" class="btn btn-default" uib-btn-checkbox="" - = t 'layout.autoreload_page' - button class="btn btn-default" ng-click="openFilters()" ng-disabled="isRequest" - | Filters - button [class="btn btn-default" ng-show="widget_title" - ng-click="clearProject()" ng-disabled="ProjectSelectService.disable()"] - | Clear selected project - rd-widget-body classes="large no-padding" loading="isRequest" - .row - table.table.table-condensed - thead - tr - th - th= t('activerecord.attributes.build_list.id') - th= t('activerecord.attributes.build_list.status') - th= t('activerecord.attributes.build_list.project') - th= t('diff') - th= t('activerecord.attributes.build_list.project_version') - th= t('activerecord.attributes.build_list.save_to_repository') - th= t('activerecord.attributes.build_list.arch_short') - th= t('activerecord.attributes.build_list.user') - th= t('activerecord.attributes.build_list.hostname') - th= t('activerecord.attributes.build_list.updated_at') - tbody - tr[ ng-repeat = 'bl in build_lists' - class = '{{::bl.status_color}}' - id = 'build-list-{{::bl.id}}' - ng-class = "{'group-start': !bl.relatedHidden, 'group-end': bl.lastRelated}" - ng-show = 'bl.show' ] - td.build-list-chevrons - a.expand ng-show = '::bl.hasRelated' - span.fa.fa-chevron-down ng-show = 'bl.relatedHidden' ng-click = 'showRelated(bl)' - span.fa.fa-chevron-up ng-hide = 'bl.relatedHidden' ng-click = 'hideRelated(bl)' - / id - td.build-list-statuses - - a[ ng-href = '{{::bl.url}}' ] {{::bl.id}} - div ng-show = '::bl.hasRelated' ng-bind-html="::bl.chevronHtml" - - / status - td - | {{::bl.human_status | i18n}} - br - time ng-show = '::bl.duration' - | {{::bl.duration}} - time ng-show = '::bl.average_build_time' - | /{{::bl.average_build_time}} - - / project - td.centered ng-hide = '::bl.project' colspan = 2 - = t('layout.projects.unexisted_project') - td ng-show = '::bl.project' - | {{::bl.project.name_with_owner}} - - / diff - td - a ng-href = '{{::bl.version_link_url}}' ng-show = '::bl.project' - | {{::bl.version_link_text}} - - / project_version - td[] {{::bl.version_release}} - - / save_to_repository - td - a[ ng-href = '{{::bl.save_to_repository_url}}' ] {{::bl.save_to_repository_name}} - - / arch_short - td[ ng-show = '::bl.arch' ] {{::bl.arch.name}} - td[ ng-hide = '::bl.arch' ]= t('layout.arches.unexisted_arch') - - / user - td - a[ ng-href = '{{::bl.user.url}}' ] {{::bl.user.fullname}} - - / hostname - td[] {{::bl.hostname}} - - / updated_at - td title = '{{::bl.updated_at_utc}}' - | {{::bl.updated_at | amDateFormat:'YYYY-MM-DD HH:mm' }} - rd-widget-footer ng-show="total_items > per_page" - == angularjs_paginate( per_page: 'per_page' ) -.row.top-space - .col-md-6 - rd-widget - div ng-controller="ProjectsController" - rd-widget-header title=(t "dashboard.projects.title") icon="fa-cube" - input.form-control.input-sm [ng-model="search" placeholder=(t "dashboard.projects.search") - ng-change="searchProjects(search)" ng-model-options="{ debounce: 500 }"] - rd-widget-body classes="medium no-padding" loading="requesting" - .table-responsive - table.table ng-cloak=true - thead - tr - th ng-show="search" = t 'dashboard.projects.name' - th ng-hide="search" = t 'dashboard.projects.last_projects' - th - th - tbody - tr ng-repeat = 'item in projects' - td - button[ ng-click = 'selectProject(item.name_with_owner)' - ng-disabled="ProjectSelectService.disable()" class="btn btn-xs btn-link"] {{::item.name_with_owner}} - td - a[ ng-href = '{{::item.new_build_list_link}}'] = t 'dashboard.projects.new_build' - td - a[ ng-href = '{{::item.edit_link}}' - ng-show='::item.edit_link' target='_blank'] = t 'project_menu.settings' - - if policy(:project).create? - rd-widget-footer - ul.nav.nav-justified - li - = link_to t('layout.projects.new'), new_project_path, target: '_blank' - .col-md-6 - rd-widget - div ng-controller="ProjectInfoController" - rd-widget-header title=(t('dashboard.project_info.title') + '{{widget_title}}') - rd-widget-body class="medium" loading="requesting" - div ng-hide="widget_title" - = t('dashboard.project_info.select') - div ng-show="widget_title" - div - a ng-href="{{project_info.html_url}}" target="_blank" - | {{project}} - div.bottom-space - | {{project_info.description}} - div - div.bottom-space ng-repeat="commit in project_info.commits" - div - span - | {{::commit.branch}} - span.pull-right - a ng-href="{{::commit.committer_url}}" target="_blank" - | {{::commit.committer_login}} - div - a ng-href="{{::commit.url}}" target="_blank" - | {{::commit.sha}} - div - | {{::commit.message}} \ No newline at end of file diff --git a/app/views/projects/projects/index.html.slim b/app/views/projects/projects/index.html.slim new file mode 100644 index 000000000..26ad69ea8 --- /dev/null +++ b/app/views/projects/projects/index.html.slim @@ -0,0 +1,29 @@ +.row.top-space + .col-md-6 + rd-widget + div ng-controller="ProjectsController" + rd-widget-header title=(t "dashboard.projects.title") icon="fa-cube" + input.form-control.input-sm [ng-model="search" placeholder=(t "dashboard.projects.search") + ng-change="searchProjects(search)" ng-model-options="{ debounce: 500 }"] + rd-widget-body classes="medium no-padding" loading="requesting" + .table-responsive + table.table ng-cloak=true + thead + tr + th ng-show="search" = t 'dashboard.projects.name' + th ng-hide="search" = t 'dashboard.projects.last_projects' + th + th + tbody + tr ng-repeat = 'item in projects' + td + a ng-href="{{::item.project_link}}" {{::item.name_with_owner}} + td + a[ ng-href = '{{::item.new_build_list_link}}'] = t 'dashboard.projects.new_build' + td + a[ ng-href = '{{::item.edit_link}}' ng-show='::item.edit_link'] = t 'project_menu.settings' + - if policy(:project).create? + rd-widget-footer + ul.nav.nav-justified + li + = link_to t('layout.projects.new'), new_project_path, target: '_blank' \ No newline at end of file diff --git a/app/views/projects/projects/index.json.jbuilder b/app/views/projects/projects/index.json.jbuilder index b24875eac..7306bffb8 100644 --- a/app/views/projects/projects/index.json.jbuilder +++ b/app/views/projects/projects/index.json.jbuilder @@ -2,6 +2,7 @@ json.projects do json.array!(@projects) do |item| json.cache! item, expires_in: 1.minutes do json.name_with_owner item.name_with_owner + json.project_link project_build_lists_path(item.name_with_owner) json.new_build_list_link new_project_build_list_path(item.name_with_owner) json.edit_link edit_project_path(item) if policy(item).update? end diff --git a/config/locales/menu.en.yml b/config/locales/menu.en.yml index e6878b3ff..5947b5fe6 100644 --- a/config/locales/menu.en.yml +++ b/config/locales/menu.en.yml @@ -4,6 +4,8 @@ en: personal_repository: My repository products: Products top_menu: + projects: Projects + build_lists: Build Lists platforms: Platforms groups: Groups statistics: Statistics diff --git a/config/routes.rb b/config/routes.rb index fc32ff166..c978249a2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -262,8 +262,6 @@ Rails.application.routes.draw do end end - get '/projects_dashboard' => 'projects#dashboard', as: :projects_dashboard - resources :projects, only: [:index, :new, :create] scope '*name_with_owner', name_with_owner: Project::OWNER_AND_NAME_REGEXP do # project From 87f510858b2d59415096f3bd9180e23700139e38 Mon Sep 17 00:00:00 2001 From: Wedge Date: Wed, 4 May 2016 18:58:34 +0300 Subject: [PATCH 4/5] Bugfixes --- .../angularjs/build_lists/build_lists_controller.js.erb | 2 +- app/controllers/projects/build_lists_controller.rb | 3 +-- app/views/projects/build_lists/new_build/_new_form.html.haml | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/app/assets/javascripts/angularjs/build_lists/build_lists_controller.js.erb b/app/assets/javascripts/angularjs/build_lists/build_lists_controller.js.erb index a68b00671..eb6b8d0ce 100644 --- a/app/assets/javascripts/angularjs/build_lists/build_lists_controller.js.erb +++ b/app/assets/javascripts/angularjs/build_lists/build_lists_controller.js.erb @@ -15,7 +15,7 @@ function($scope, BuildListsService, $location, $interval, $uibModal) { if(refresh) { $interval.cancel(refresh); } - refresh = $interval($scope.getBuildLists, 60000); + refresh = $interval(function() { $scope.getBuildLists() }, 60000); } else if(!autoreload && refresh) { $interval.cancel(refresh); diff --git a/app/controllers/projects/build_lists_controller.rb b/app/controllers/projects/build_lists_controller.rb index 89f824681..4197e04d9 100644 --- a/app/controllers/projects/build_lists_controller.rb +++ b/app/controllers/projects/build_lists_controller.rb @@ -84,8 +84,7 @@ class Projects::BuildListsController < Projects::BaseController else BuildList.where(id: build_lists.map(&:id)).update_all(group_id: build_lists[0].id) if build_lists.size > 1 flash[:notice] = notices.join('
      ').html_safe - puts root_path(anchor: "project=" + @project.name_with_owner) - redirect_to root_path(anchor: "?project=" + @project.name_with_owner) + redirect_to project_build_lists_path(@project.name_with_owner) end end diff --git a/app/views/projects/build_lists/new_build/_new_form.html.haml b/app/views/projects/build_lists/new_build/_new_form.html.haml index ee762feb9..6cc11788e 100644 --- a/app/views/projects/build_lists/new_build/_new_form.html.haml +++ b/app/views/projects/build_lists/new_build/_new_form.html.haml @@ -49,8 +49,8 @@ = hidden_field_tag :from_build_list_id, params[:build_list_id] if params[:build_list_id].present? - .col-xs-12.col-sm-8.col-sm-offset-2 - %hr + .row.top-space + .pull-right = button_tag type: :submit, data: {'disable-with' => t('layout.processing')}, class: 'btn btn-primary btn-lg btn-block' do From eb37a63d3aa315cf8c20eabd3e0b521aebcff606 Mon Sep 17 00:00:00 2001 From: Wedge Date: Sun, 22 May 2016 15:25:00 +0300 Subject: [PATCH 5/5] Continuing work on the new interface --- .../controllers/members_controller.js | 13 + .../product_build_list_controller.js.erb | 7 +- .../controllers/profile_controller.js.coffee | 37 +-- .../projects_versions_typeahead_controller.js | 33 ++ .../angularjs/directives/widget-footer.js | 1 - .../angularjs/directives/widget-header.js | 5 +- .../platforms/contents_controller.js.coffee | 17 +- .../repository_projects_controller.js.coffee | 102 +++---- app/assets/stylesheets/rdash.css | 31 +- .../platforms/products_controller.rb | 7 +- .../platforms/repositories_controller.rb | 3 + app/helpers/paginate_helper.rb | 3 +- app/models/platform.rb | 10 +- app/policies/project_policy.rb | 1 + app/policies/repository_policy.rb | 5 +- app/views/groups/members/index.html.slim | 2 +- app/views/groups/profile/edit.html.slim | 40 +-- app/views/groups/profile/index.html.haml | 39 +-- app/views/groups/profile/show.html.slim | 47 ++- app/views/layouts/application.html.slim | 5 +- app/views/platforms/base/_submenu.html.slim | 14 +- app/views/platforms/contents/index.html.slim | 114 +++---- .../platforms/mass_builds/index.html.slim | 59 ++-- .../platforms/mass_builds/show.html.slim | 288 +++++++++--------- .../mass_builds/show_fail_reason.slim | 69 ++--- app/views/platforms/platforms/_form.html.slim | 13 +- app/views/platforms/platforms/edit.html.slim | 85 ++---- app/views/platforms/platforms/index.html.slim | 11 +- app/views/platforms/platforms/show.html.slim | 124 ++++---- .../_product_build_list.html.slim | 5 +- .../product_build_lists/new.html.slim | 52 ++-- .../product_build_lists/show.html.slim | 215 ++++++------- app/views/platforms/products/_form.html.slim | 41 +-- .../autocomplete_project.json.jbuilder | 1 - app/views/platforms/products/edit.html.slim | 16 +- app/views/platforms/products/index.html.slim | 21 +- app/views/platforms/products/new.html.slim | 12 +- .../products/project_versions.json.jbuilder | 1 + app/views/platforms/products/show.html.slim | 81 +++-- .../repositories/_proj_list.html.slim | 72 ++--- .../platforms/repositories/edit.html.slim | 119 ++++---- .../platforms/repositories/index.html.slim | 26 +- .../repositories/manage_projects.html.slim | 20 ++ .../platforms/repositories/new.html.slim | 13 +- .../repositories/projects_list.html.slim | 13 - .../repositories/remove_project.html.slim | 10 - .../platforms/repositories/show.html.slim | 54 ++-- .../projects/build_lists/_buttons.html.slim | 23 +- .../projects/build_lists/index.html.slim | 2 +- app/views/projects/build_lists/show.html.slim | 6 +- app/views/projects/projects/index.html.slim | 4 +- app/views/search/_project.html.slim | 7 - app/views/search/index.html.slim | 63 ++-- .../shared/_angularjs_paginate.html.slim | 32 +- app/views/shared/_members_table.html.slim | 144 ++++----- app/views/statistics/index.html.slim | 2 +- app/views/users/profile/_projects.html.slim | 77 +---- app/views/users/profile/show.html.slim | 66 ++-- config/application.yml.sample | 4 +- config/locales/models/repository.en.yml | 1 + config/routes.rb | 8 +- lib/ext/bootstrap_link_renderer.rb | 7 +- 62 files changed, 1126 insertions(+), 1277 deletions(-) create mode 100644 app/assets/javascripts/angularjs/controllers/members_controller.js create mode 100644 app/assets/javascripts/angularjs/controllers/projects_versions_typeahead_controller.js create mode 100644 app/views/platforms/products/project_versions.json.jbuilder create mode 100644 app/views/platforms/repositories/manage_projects.html.slim delete mode 100644 app/views/platforms/repositories/projects_list.html.slim delete mode 100644 app/views/platforms/repositories/remove_project.html.slim diff --git a/app/assets/javascripts/angularjs/controllers/members_controller.js b/app/assets/javascripts/angularjs/controllers/members_controller.js new file mode 100644 index 000000000..b88d3b43e --- /dev/null +++ b/app/assets/javascripts/angularjs/controllers/members_controller.js @@ -0,0 +1,13 @@ +RosaABF.controller('MembersController', ['$scope', '$http', +function($scope, $http) { + $scope.getUsers = function(name) { + var params = {format: 'json', query: name}; + return $http.get(Routes.autocomplete_user_uname_autocompletes_path(params)).then(function(response) { + return response.data; + }); + } + + $scope.select = function($item, $model, $name) { + $scope.memberId = $item.id; + } +}]); \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/controllers/product_build_list_controller.js.erb b/app/assets/javascripts/angularjs/controllers/product_build_list_controller.js.erb index 07d6eb181..c1eb1992d 100644 --- a/app/assets/javascripts/angularjs/controllers/product_build_list_controller.js.erb +++ b/app/assets/javascripts/angularjs/controllers/product_build_list_controller.js.erb @@ -1,9 +1,13 @@ RosaABF.controller('ProductBuildListController', ['$scope', '$http', '$timeout', 'SoundNotificationsHelper', function($scope, $http, $timeout, SoundNotificationsHelper) { - $scope.id = $('#product_build_list_id').val(); $scope.pbl = null; $scope.subject = {}; // See: shared/build_results + $scope.init = function(id) { + $scope.id = id; + $scope.refresh(); + } + $scope.getProductBuildList = function() { $http.get(Routes.product_build_list_path($scope.id, {format: 'json'})).success(function(results) { var product_build_list = results.product_build_list; @@ -26,7 +30,6 @@ RosaABF.controller('ProductBuildListController', ['$scope', '$http', '$timeout', } $scope.cancelRefresh = $timeout($scope.refresh, 10000); } - $scope.refresh(); $scope.updateStatus = function() { $http.put( diff --git a/app/assets/javascripts/angularjs/controllers/profile_controller.js.coffee b/app/assets/javascripts/angularjs/controllers/profile_controller.js.coffee index 076202622..abd6b3b17 100644 --- a/app/assets/javascripts/angularjs/controllers/profile_controller.js.coffee +++ b/app/assets/javascripts/angularjs/controllers/profile_controller.js.coffee @@ -1,24 +1,22 @@ -RosaABF.controller 'ProfileController', ['$scope', '$http', '$location', ($scope, $http, $location) -> +RosaABF.controller 'ProfileController', ['$scope', '$http', ($scope, $http) -> - $scope.subject = $('#subject_uname').val() $scope.processing = true $scope.projects = [] $scope.page = null $scope.total_items = null - $scope.term = null - $scope.visibility = 'all' - # Fixes: redirect to page after form submit - $("#search_projects_form").on 'submit', -> - false + $scope.init = (subject) -> + $scope.subject = subject + $scope.refresh() + return $scope.refresh = -> $scope.processing = true params = term: $scope.term - visibility: $scope.visibility + visibility: 'all' page: $scope.page format: 'json' @@ -33,23 +31,16 @@ RosaABF.controller 'ProfileController', ['$scope', '$http', '$location', ($scope true - $scope.search = -> - params = - term: $scope.term - visibility: $scope.visibility - $location.search params - - $scope.$on '$locationChangeSuccess', (event) -> - $scope.updateParams() + $scope.search = (term) -> + $scope.term = term $scope.refresh() - - $scope.updateParams = -> - params = $location.search() - $scope.term = params['term'] - $scope.visibility = params['visibility'] if params['visibility'] - $scope.page = params['page'] + return $scope.goToPage = (number) -> - $location.search 'page', number + $scope.page = number + $scope.refresh() + return + + return ] \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/controllers/projects_versions_typeahead_controller.js b/app/assets/javascripts/angularjs/controllers/projects_versions_typeahead_controller.js new file mode 100644 index 000000000..d3b9d0be0 --- /dev/null +++ b/app/assets/javascripts/angularjs/controllers/projects_versions_typeahead_controller.js @@ -0,0 +1,33 @@ +RosaABF.controller('ProjectsVersionsTypeaheadController', ['$scope', '$http', '$sce', function($scope, $http, $sce) { + $scope.loadingVersions = false; + + $scope.init = function(platform, projectName, projectId, projectVersion) { + $scope.platform = platform; + $scope.project = projectName; + $scope.projectId = projectId; + if(projectId) { + var params = {id: projectId}; + if(projectVersion) { + params.projectVersion = projectVersion; + } + $scope.selectProject(params); + } + } + + $scope.getProjects = function(query) { + var params = { query: query, format: 'json'}; + return $http.get(Routes.autocomplete_project_platform_products_path($scope.platform, params)).then(function(res) { + return res.data; + }); + } + + $scope.selectProject = function($item) { + $scope.projectId = $item.id; + $scope.loadingVersions = true; + var params = {project_id: $item.id, format: 'json', project_version: $item.projectVersion}; + $http.get(Routes.project_versions_platform_products_path($scope.platform, params)).then(function(res) { + $scope.projectVersions = $sce.trustAsHtml(res.data.project_versions); + $scope.loadingVersions = false; + }); + } +}]); \ No newline at end of file diff --git a/app/assets/javascripts/angularjs/directives/widget-footer.js b/app/assets/javascripts/angularjs/directives/widget-footer.js index a9878d589..e868bf221 100644 --- a/app/assets/javascripts/angularjs/directives/widget-footer.js +++ b/app/assets/javascripts/angularjs/directives/widget-footer.js @@ -8,7 +8,6 @@ angular function rdWidgetFooter() { var directive = { - requires: '^rdWidget', transclude: true, replace: true, template: '', diff --git a/app/assets/javascripts/angularjs/directives/widget-header.js b/app/assets/javascripts/angularjs/directives/widget-header.js index 8083351ec..1f7891d2e 100644 --- a/app/assets/javascripts/angularjs/directives/widget-header.js +++ b/app/assets/javascripts/angularjs/directives/widget-header.js @@ -12,10 +12,11 @@ function rdWidgetTitle() { replace: true, scope: { title: '@', - icon: '@' + icon: '@', + customClass: '@' }, transclude: true, - template: '
      {{title}}
      ', + template: '
      {{title}}
      ', restrict: 'E' }; return directive; diff --git a/app/assets/javascripts/angularjs/platforms/contents_controller.js.coffee b/app/assets/javascripts/angularjs/platforms/contents_controller.js.coffee index 25335dada..49490f4ff 100644 --- a/app/assets/javascripts/angularjs/platforms/contents_controller.js.coffee +++ b/app/assets/javascripts/angularjs/platforms/contents_controller.js.coffee @@ -1,6 +1,5 @@ RosaABF.controller 'ContentsController', ['$scope', '$http', '$location', ($scope, $http, $location) -> - $scope.platform = $('#platform_name').val() $scope.processing = true $scope.contents = [] $scope.folders = [] @@ -16,9 +15,9 @@ RosaABF.controller 'ContentsController', ['$scope', '$http', '$location', ($scop params = platform_id: $scope.platform - path: $('#path').val() - term: $('#platform_term').val() - page: $('#page').val() + path: $scope.path + term: $scope.term + page: $scope.page format: 'json' $http.get(Routes.platform_contents_path(params)).success( (data) -> @@ -54,8 +53,8 @@ RosaABF.controller 'ContentsController', ['$scope', '$http', '$location', ($scop ) true - $scope.search = -> - $location.search('term', $('#platform_term').val()) + $scope.search = (term) -> + $location.search('term', term) $scope.$on '$locationChangeSuccess', (event) -> $scope.updateParams() @@ -63,9 +62,9 @@ RosaABF.controller 'ContentsController', ['$scope', '$http', '$location', ($scop $scope.updateParams = -> params = $location.search() - $('#path').val(params['path']) - $('#platform_term').val(params['term']) - $('#page').val(params['page']) + $scope.path = params['path'] + $scope.term = params['term'] + $scope.page = params['page'] $scope.goToPage = (number) -> $location.search('page', number) diff --git a/app/assets/javascripts/angularjs/platforms/repository_projects_controller.js.coffee b/app/assets/javascripts/angularjs/platforms/repository_projects_controller.js.coffee index 1a3bda291..48603e354 100644 --- a/app/assets/javascripts/angularjs/platforms/repository_projects_controller.js.coffee +++ b/app/assets/javascripts/angularjs/platforms/repository_projects_controller.js.coffee @@ -1,63 +1,63 @@ -RosaABF.controller 'RepositoryProjectsController', ['$scope', '$http', '$location', 'confirmMessage', ($scope, $http, $location, confirmMessage) -> +RosaABF.controller 'RepositoryProjectsController', +['$scope', '$http', 'confirmMessage', + ($scope, $http, confirmMessage) -> + $scope.page = 1 + $scope.owner_name = "" + $scope.project_name = "" + $scope.processing = true + $scope.projects = [] + $scope.total_items = null - $scope.added = $('#added').val() - $scope.platform_id = $('#platform_id').val() - $scope.repository_id = $('#repository_id').val() - $scope.processing = true - $scope.projects = [] - $scope.total_items = null + $scope.init = (added, repository_id, platform_id) -> + $scope.added = added + $scope.platform_id = platform_id + $scope.repository_id = repository_id + $scope.refresh() + true - # Fixes: redirect to page after form submit - $("#search_projects_form").on 'submit', -> - false + $scope.refresh = -> + $scope.processing = true - $scope.refresh = -> - $scope.processing = true + params = + added: $scope.added + owner_name: $scope.owner_name + project_name: $scope.project_name + page: $scope.page + sSortDir_0: 'asc' + format: 'json' - params = - added: $scope.added - owner_name: $('#project_owner').val() - project_name: $('#project_name').val() - page: $('#page').val() - format: 'json' + path = Routes.projects_list_platform_repository_path $scope.platform_id, $scope.repository_id + $http.get(path, params: params).success (data) -> + $scope.projects = data.projects + $scope.total_items = data.total_items + $scope.processing = false + .error -> + $scope.projects = [] + $scope.processing = false - path = Routes.projects_list_platform_repository_path $scope.platform_id, $scope.repository_id - $http.get(path, params: params).success (data) -> - $scope.projects = data.projects - $scope.total_items = data.total_items - $scope.processing = false - .error -> - $scope.projects = [] - $scope.processing = false + true - true + $scope.search = (owner, name) -> + $scope.owner_name = owner + $scope.project_name = name + $scope.refresh() + true - $scope.search = -> - params = - owner_name: $('#project_owner').val() - project_name: $('#project_name').val() - $location.search(params) + $scope.goToPage = (number) -> + $scope.page = number + $scope.refresh() + true - $scope.$on '$locationChangeSuccess', (event) -> - $scope.updateParams() - $scope.refresh() + $scope.removeProject = (project) -> + return false unless confirmMessage.show() + $http.delete(project.remove_path).success (data) -> + $.notify(data.message, 'success') - $scope.updateParams = -> - params = $location.search() - $('#project_owner').val(params['owner_name']) - $('#project_name').val(params['project_name']) - $('#page').val(params['page']) + $scope.projects = _.reject($scope.projects, (pr) -> + return pr.id is project.id + ) + false - $scope.goToPage = (number) -> - $location.search('page', number) - $scope.removeProject = (project) -> - return false unless confirmMessage.show() - $http.delete(project.remove_path).success (data) -> - $.notify(data.message, 'success') - - $scope.projects = _.reject($scope.projects, (pr) -> - return pr.id is project.id - ) - false + return ] \ No newline at end of file diff --git a/app/assets/stylesheets/rdash.css b/app/assets/stylesheets/rdash.css index 81ed5cb7e..faf15eab6 100644 --- a/app/assets/stylesheets/rdash.css +++ b/app/assets/stylesheets/rdash.css @@ -1,3 +1,6 @@ +a { + cursor: pointer; +} .content-wrapper { padding-left: 0; margin-left: 0; @@ -57,7 +60,6 @@ .row.header { height: 60px; background: #fff; - /*margin-bottom: 15px;*/ } .row.header > div:last-child { padding-right: 0; @@ -433,6 +435,10 @@ ul.sidebar .sidebar-list .menu-icon { .widget .widget-body div.alert { margin-bottom: 10px; } +.widget .widget-body.huge { + height: 700px; + overflow-y: auto; +} .widget .widget-body.large { height: 350px; overflow-y: auto; @@ -492,6 +498,9 @@ ul.sidebar .sidebar-list .menu-icon { .bottom-space { margin-bottom: 15px; } +.no-margin { + margin: 0; +} table tbody td.build-list-statuses .status { float: left; border: 1px solid #DDD; @@ -514,4 +523,24 @@ table tbody tr.group-end td { } .form-inline > * { margin-left: 5px; +} +.buttons-block > div { + margin-bottom: 15px; +} +.buttons-block > div:last-of-kind { + margin-bottom: 0; +} +.pre-fail-reason { + border: none; + border-radius: 0; + background: none; + padding: 0; + margin: 0; +} +.navbar-account > li > a { + padding-top: 20px !important; + padding-bottom: 20px !important; +} +table { + margin-bottom: 0 !important; } \ No newline at end of file diff --git a/app/controllers/platforms/products_controller.rb b/app/controllers/platforms/products_controller.rb index 573e42ddc..d58792ce1 100644 --- a/app/controllers/platforms/products_controller.rb +++ b/app/controllers/platforms/products_controller.rb @@ -4,7 +4,7 @@ class Platforms::ProductsController < Platforms::BaseController before_action :authenticate_user! skip_before_action :authenticate_user!, only: [:index, :show] if APP_CONFIG['anonymous_access'] - before_action :load_product, except: %i(index new create autocomplete_project) + before_action :load_product, except: %i(index new create autocomplete_project project_versions) def index authorize @platform.products.new @@ -56,7 +56,10 @@ class Platforms::ProductsController < Platforms::BaseController authorize :project @items = ProjectPolicy::Scope.new(current_user, Project).membered. by_owner_and_name(params[:query]).limit(20) - #items.select! {|e| e.repo.branches.count > 0} + end + + def project_versions + authorize @project = Project.find(params[:project_id]) end private diff --git a/app/controllers/platforms/repositories_controller.rb b/app/controllers/platforms/repositories_controller.rb index fb6e970f4..cab89e9c4 100644 --- a/app/controllers/platforms/repositories_controller.rb +++ b/app/controllers/platforms/repositories_controller.rb @@ -77,6 +77,9 @@ class Platforms::RepositoriesController < Platforms::BaseController end end + def manage_projects + end + def add_project authorize @repository if projects_list = params.try(:[], :repository).try(:[], :projects_list) diff --git a/app/helpers/paginate_helper.rb b/app/helpers/paginate_helper.rb index 6da4337b7..1863f8644 100644 --- a/app/helpers/paginate_helper.rb +++ b/app/helpers/paginate_helper.rb @@ -25,7 +25,8 @@ module PaginateHelper per_page: params[:per_page].to_i > 0 ? params[:per_page] : 20, total_items: 'total_items', page: 'page', - select_page: "goToPage(page)" + select_page: "goToPage(page)", + rd_widget_footer: false } ) diff --git a/app/models/platform.rb b/app/models/platform.rb index dba42a5f6..a6b61e0fa 100644 --- a/app/models/platform.rb +++ b/app/models/platform.rb @@ -215,11 +215,11 @@ class Platform < ActiveRecord::Base def symlink_directory # umount_directory_for_rsync # TODO ignore errors - system("ln -s #{path} #{symlink_path}") - Arch.all.each do |arch| - str = "country=Russian Federation,city=Moscow,latitude=52.18,longitude=48.88,bw=1GB,version=2011,arch=#{arch.name},type=distrib,url=#{public_downloads_url}\n" - File.open(File.join(symlink_path, "#{name}.#{arch.name}.list"), 'w') {|f| f.write(str) } - end + #system("ln -s #{path} #{symlink_path}") + #Arch.all.each do |arch| + # str = "country=Russian Federation,city=Moscow,latitude=52.18,longitude=48.88,bw=1GB,version=2011,arch=#{arch.name},type=distrib,url=#{public_downloads_url}\n" + # File.open(File.join(symlink_path, "#{name}.#{arch.name}.list"), 'w') {|f| f.write(str) } + #end end later :symlink_directory, queue: :middle diff --git a/app/policies/project_policy.rb b/app/policies/project_policy.rb index 8c7aa8174..2ec4d165c 100644 --- a/app/policies/project_policy.rb +++ b/app/policies/project_policy.rb @@ -5,6 +5,7 @@ class ProjectPolicy < ApplicationPolicy end alias_method :dashboard?, :index? alias_method :autocomplete_project?, :index? + alias_method :project_versions?, :index? alias_method :remove_user?, :index? alias_method :preview?, :index? diff --git a/app/policies/repository_policy.rb b/app/policies/repository_policy.rb index 9331d2d15..98d082a26 100644 --- a/app/policies/repository_policy.rb +++ b/app/policies/repository_policy.rb @@ -36,10 +36,11 @@ class RepositoryPolicy < ApplicationPolicy alias_method :add_member?, :packages? alias_method :sync_lock_file?, :packages? - def add_project? + def manage_projects? is_admin? || local_admin?(record.platform) || repository_user_ids.include?(user.id) end - alias_method :remove_project?, :add_project? + alias_method :add_project?, :manage_projects? + alias_method :remove_project?, :manage_projects? def settings? is_admin? || owner?(record.platform) || local_admin?(record.platform) diff --git a/app/views/groups/members/index.html.slim b/app/views/groups/members/index.html.slim index 5a67744b1..2461943db 100644 --- a/app/views/groups/members/index.html.slim +++ b/app/views/groups/members/index.html.slim @@ -2,7 +2,7 @@ = render 'groups/base/submenu' -.container.col-md-offset-2.col-md-8 +.container.col-md-offset-1.col-md-10 .row = render 'shared/members_table', remove_members_path: remove_group_members_path(@group), diff --git a/app/views/groups/profile/edit.html.slim b/app/views/groups/profile/edit.html.slim index b60062b27..6451fe282 100644 --- a/app/views/groups/profile/edit.html.slim +++ b/app/views/groups/profile/edit.html.slim @@ -2,24 +2,26 @@ = render 'groups/base/submenu' -.container.col-md-offset-2.col-md-8 - .row - = simple_form_for @group, - html: { class: 'form-horizontal' }, - url: profile_group_path(@group), - wrapper: :horizontal_form, - wrapper_mappings: { boolean: :horizontal_boolean, - file: :horizontal_file_input } do |f| +.row + .col-md-offset-2.col-md-8 + rd-widget + rd-widget-header title=t('layout.groups.edit') + rd-widget-body + = simple_form_for @group, + html: { class: 'form-horizontal' }, + url: profile_group_path(@group), + wrapper: :horizontal_form, + wrapper_mappings: { boolean: :horizontal_boolean, + file: :horizontal_file_input } do |f| - = render 'form', f: f + = render 'form', f: f - - if policy(@group).destroy? - .row - hr - .alert.alert-danger - = t('layout.groups.delete_warning') - = link_to t('layout.delete'), - profile_group_path(@group), - method: :delete, - data: { confirm: t("layout.groups.confirm_delete") }, - class: 'btn btn-danger' + - if policy(@group).destroy? + .row.top-space + .alert.alert-danger + = t('layout.groups.delete_warning') + = link_to t('layout.delete'), + profile_group_path(@group), + method: :delete, + data: { confirm: t("layout.groups.confirm_delete") }, + class: 'btn btn-danger' \ No newline at end of file diff --git a/app/views/groups/profile/index.html.haml b/app/views/groups/profile/index.html.haml index d01c36abc..22681d44d 100644 --- a/app/views/groups/profile/index.html.haml +++ b/app/views/groups/profile/index.html.haml @@ -1,19 +1,22 @@ -set_meta_tags title: t('layout.groups.list_header') -.row - .col-md-6.col-md-offset-3 - = link_to t("layout.groups.new"), new_group_path, class: "btn btn-primary" - %table.table.table-hover.offset10 - %thead - %tr - %th= t 'layout.groups.group' - %th= t 'layout.groups.description' - %th.col-sm-1= t 'layout.groups.leave_group' - %tbody - - @groups.each do |group| - %tr - %td= link_to group.name, group_path(group) - %td= group.description - %td - - if group.owner_id != current_user.id - = link_to remove_user_group_path(group), method: :delete do - %span.fa.fa-lg.fa-times.text-danger +.row.top-space + .col-md-8.col-md-offset-2 + %rd-widget + %rd-widget-header{title: t('layout.groups.list_header')} + = link_to t("layout.groups.new"), new_group_path, class: "btn btn-primary pull-right" + %rd-widget-body{class: "no-padding"} + %table.table.table-condensed + %thead + %tr + %th= t 'layout.groups.group' + %th= t 'layout.groups.description' + %th= t 'layout.groups.leave_group' + %tbody + - @groups.each do |group| + %tr + %td= link_to group.name, group_path(group) + %td= group.description + %td + - if group.owner_id != current_user.id + = link_to remove_user_group_path(group), method: :delete do + %span.fa.fa-lg.fa-times.text-danger diff --git a/app/views/groups/profile/show.html.slim b/app/views/groups/profile/show.html.slim index 5f94992ce..525ad8eda 100644 --- a/app/views/groups/profile/show.html.slim +++ b/app/views/groups/profile/show.html.slim @@ -1,35 +1,30 @@ - title = title_object(@group) - set_meta_tags title: title -- set_meta_tags og: { title: title, description: truncate(@group.description, length: 255) } -- set_meta_tags twitter: { title: title, description: truncate(@group.description, length: 200) } - = render 'groups/base/submenu' .row - .col-md-2.col-md-offset-1 - - size = User::AVATAR_SIZES[:big] - = image_tag avatar_url(@group, :big), - alt: @group.uname, height: size, width: size - .col-md-8 - h2 - = @group.uname - h4 - = t('activerecord.attributes.group.description') - p - = @group.description -hr -.row + .col-md-10.col-md-offset-1 + rd-widget + rd-widget-header title=title + rd-widget-body + .row + .col-md-2 + - size = User::AVATAR_SIZES[:big] + = image_tag avatar_url(@group, :big), + alt: @group.uname, height: size, width: size + .col-md-10 + p + = @group.description +.row.top-space .col-md-8.col-md-offset-1 ng-controller='ProfileController' = render 'users/profile/projects', subject: @group .col-md-2 - .panel.panel-default - .panel-heading - b - = t('layout.collaborators.members') - .panel-body - - size = User::AVATAR_SIZES[:micro] - - @members.each do |member| - p - => image_tag avatar_url(member, :micro), alt: member.uname, height: size, width: size - = link_to member.uname.truncate(20), member + rd-widget + rd-widget-header title=t('layout.collaborators.members') + rd-widget-body + - size = User::AVATAR_SIZES[:micro] + - @members.each do |member| + p + => image_tag avatar_url(member, :micro), alt: member.uname, height: size, width: size + = link_to member.uname.truncate(20), member diff --git a/app/views/layouts/application.html.slim b/app/views/layouts/application.html.slim index f0c70a780..c6a33d50c 100644 --- a/app/views/layouts/application.html.slim +++ b/app/views/layouts/application.html.slim @@ -38,11 +38,14 @@ html li.divider li.link= link_to t('layout.logout'), destroy_user_session_path, method: :delete - else - ul.nav.navbar-nav + ul.nav.navbar-nav.navbar-account li= link_to t('layout.devise.shared_links.sign_up'), new_user_registration_path li= link_to t('layout.devise.shared_links.sign_in'), new_user_session_path .meta .page + = form_tag search_index_path, method: 'get', role: 'search', class: 'navbar-left' do + = text_field_tag 'query', @query, placeholder: t('layout.search.header'), class: 'form-control' + == yield :submenu if content_for?(:submenu) == render 'layouts/noscript' == render "layouts/flashes" diff --git a/app/views/platforms/base/_submenu.html.slim b/app/views/platforms/base/_submenu.html.slim index 13f3ddb51..8180fff81 100644 --- a/app/views/platforms/base/_submenu.html.slim +++ b/app/views/platforms/base/_submenu.html.slim @@ -17,8 +17,8 @@ li class=('active' if contr == :contents) = link_to t('layout.platforms.contents'), platform_contents_path(@platform) - if policy(@platform).show? - li class=('active' if act == :index && contr == :maintainers) - = link_to t("layout.platforms.maintainers"), platform_maintainers_path(@platform) + / li class=('active' if act == :index && contr == :maintainers) + / = link_to t("layout.platforms.maintainers"), platform_maintainers_path(@platform) li class=('active' if contr == :mass_builds) = link_to t("layout.platforms.mass_build"), platform_mass_builds_path(@platform) - if policy(@platform.products.build).show? @@ -30,8 +30,8 @@ - if policy(@platform).local_admin_manage? li class=('active' if act == :members && contr == :platforms) = link_to t("layout.platforms.members"), members_platform_path(@platform) - - if policy(@platform).edit? - li class=('active' if contr == :key_pairs) - = link_to t("layout.key_pairs.header"), platform_key_pairs_path(@platform) - li class=('active' if contr == :tokens) - = link_to t('layout.tokens.header'), platform_tokens_path(@platform) + / - if policy(@platform).edit? + / li class=('active' if contr == :key_pairs) + / = link_to t("layout.key_pairs.header"), platform_key_pairs_path(@platform) + / li class=('active' if contr == :tokens) + / = link_to t('layout.tokens.header'), platform_tokens_path(@platform) diff --git a/app/views/platforms/contents/index.html.slim b/app/views/platforms/contents/index.html.slim index 3e33f277c..6037ac4ef 100644 --- a/app/views/platforms/contents/index.html.slim +++ b/app/views/platforms/contents/index.html.slim @@ -1,73 +1,53 @@ - set_meta_tags title: [title_object(@platform), t('layout.platforms.contents')] = render 'platforms/base/submenu' -.col-xs-12.col-md-12 - h3 - = t('layout.platforms.contents_of') - |   - = @platform.name +.row + .col-xs-12.col-md-12 ng-controller='ContentsController' ng-init=('platform="'+@platform.name+'"') + rd-widget + rd-widget-header title=(t('layout.platforms.contents_of') + ' ' + @platform.name) + input.form-control.pull-right [ placeholder=t('simple_form.placeholders.platform.term') ng-model="term" + ng-model-options="{ debounce: 500 }" ng-change="search(term)" ] + rd-widget-body loading='processing' class="no-padding huge" + .path + ol.breadcrumb.no-margin + li= link_to @platform.name, '#', 'ng-click' => 'open($event, "/")' + li ng-repeat='folder in folders' ng-show='$middle' + a[ href='#' ng-click='open($event, folder.path)' ] {{folder.name}} + li.active[ ng-repeat='fold in folders' ng-show='$last && !$first' ] {{fold.name}} + .clearfix - #contents ng-controller='ContentsController' + - can_remove = policy(@platform).remove_file? + table.table + tbody + tr ng-show='back' + td + a.pointer ng-click="open($event, back)" .. + td + td + - if can_remove + td - = simple_form_for @platform, html: { 'ng-submit' => 'search()', id: 'search_contents_form' } do |f| - = f.hidden_field :name - = hidden_field_tag 'path' - = hidden_field_tag 'page' + tr ng-repeat='content in contents' + td ng-show='content.is_folder' + span.glyphicon.glyphicon-folder-close + |   + span + a.pointer.files-see ng-click="open($event, content)" {{content.name}} + td ng-hide='content.is_folder' + span.glyphicon.glyphicon-file + |   + span + a.pointer.files-see ng-href='{{content.download_url}}' {{content.name}} + td + a.pointer ng-href='{{content.build_list.url}}' ng-show='content.build_list' + = t('activerecord.models.build_list') + td + | {{content.size}} + - if can_remove + td ng-show='content.is_folder' + td.buttons ng-hide='content.is_folder' + span.pointer.text-danger.glyphicon.glyphicon-remove[ + confirmed-click ="destroy(content)" + ng-confirm-click=t('layout.confirm') ] - .row - .col-md-6 - = f.input :term, label: false - .col-md-6 - = f.button :submit, t('layout.search.header') - hr - - .text-center ng-show='processing' - = image_tag 'loading-large.gif' - - .path ng-hide='processing' - ol.breadcrumb - li= link_to @platform.name, '#', 'ng-click' => 'open($event, "/")' - li ng-repeat='folder in folders' ng-show='$middle' - a[ href='#' ng-click='open($event, folder.path)' ] {{folder.name}} - li.active[ ng-repeat='fold in folders' ng-show='$last && !$first' ] {{fold.name}} - .clearfix - - - can_remove = policy(@platform).remove_file? - table.table ng-hide='processing' - tbody - - tr ng-show='back' - td - a.pointer ng-click="open($event, back)" .. - td - td - - if can_remove - td - - tr ng-repeat='content in contents' - td ng-show='content.is_folder' - span.glyphicon.glyphicon-folder-close - |   - span - a.pointer.files-see ng-click="open($event, content)" {{content.name}} - td ng-hide='content.is_folder' - span.glyphicon.glyphicon-file - |   - span - a.pointer.files-see ng-href='{{content.download_url}}' {{content.name}} - td - a.pointer ng-href='{{content.build_list.url}}' ng-show='content.build_list' - = t('activerecord.models.build_list') - td - | {{content.size}} - - if can_remove - td ng-show='content.is_folder' - td.buttons ng-hide='content.is_folder' - div ng-show='content.processing' - = t('layout.processing') - span.pointer.text-danger.glyphicon.glyphicon-remove[ - confirmed-click ="destroy(content)" - ng-confirm-click=t('layout.confirm') - ng-hide ="content.processing" ] - - = angularjs_paginate + = angularjs_paginate rd_widget_footer: true diff --git a/app/views/platforms/mass_builds/index.html.slim b/app/views/platforms/mass_builds/index.html.slim index 2e5a077b5..6aa8449a2 100644 --- a/app/views/platforms/mass_builds/index.html.slim +++ b/app/views/platforms/mass_builds/index.html.slim @@ -1,35 +1,26 @@ = render 'platforms/base/submenu' - -.col-md-12 - .row - - if policy(@platform.mass_builds.build).create? - a.btn.btn-primary href=new_platform_mass_build_path(@platform) - = t('layout.mass_builds.new') - hr - - = simple_form_for @mass_build, url: platform_mass_builds_path(@platform), method: :get do |f| - .row - .col-md-6 - = f.input :description, label: false - .col-md-6 - = f.button :submit, t('layout.search.header') - - hr - table.table.table-striped - thead - tr - th= t('activerecord.attributes.mass_build.id') - th= t('activerecord.attributes.mass_build.name') - th= t('activerecord.attributes.mass_build.description') - th= t('activerecord.attributes.mass_build.created_at') - th - tbody - - @mass_builds.each do |mass_build| - tr - td= mass_build.id - td= link_to_mass_build(mass_build) - td= mass_build.description - td= mass_build.created_at.to_s - td= link_to t('layout.show'), platform_mass_build_path(@platform, mass_build.id) - - = will_paginate @mass_builds +.row + .col-md-12 + rd-widget + rd-widget-header + - if policy(@platform.mass_builds.build).create? + a.btn.btn-primary.pull-right href=new_platform_mass_build_path(@platform) + = t('layout.mass_builds.new') + rd-widget-body class="no-padding" + table.table.table-striped + thead + tr + th= t('activerecord.attributes.mass_build.id') + th= t('activerecord.attributes.mass_build.name') + th= t('activerecord.attributes.mass_build.description') + th= t('activerecord.attributes.mass_build.created_at') + th + tbody + - @mass_builds.each do |mass_build| + tr + td= mass_build.id + td= link_to_mass_build(mass_build) + td= mass_build.description + td= mass_build.created_at.to_s + td= link_to t('layout.show'), platform_mass_build_path(@platform, mass_build.id) + = will_paginate @mass_builds, rd_widget_footer: true diff --git a/app/views/platforms/mass_builds/show.html.slim b/app/views/platforms/mass_builds/show.html.slim index 92ca35e13..ab09c8e34 100644 --- a/app/views/platforms/mass_builds/show.html.slim +++ b/app/views/platforms/mass_builds/show.html.slim @@ -1,159 +1,151 @@ - title = title_object(@mass_build) - set_meta_tags title: title -- set_meta_tags og: { title: title, - description: truncate(@mass_build.description, length: 255) } -- set_meta_tags twitter: { title: title, - description: truncate(@mass_build.description, length: 200) } = render 'submenu' -.col-md-12 - .row - h3 - = t('activerecord.models.mass_build') +.row + .col-md-4 + rd-widget + rd-widget-header title=t('activerecord.models.mass_build') + rd-widget-body class="no-padding" + table.table.table-striped + tr + td + b= t('activerecord.attributes.mass_build.name') + td= link_to_mass_build(@mass_build) + tr + td + b= t('activerecord.attributes.mass_build.id') + td= @mass_build.id + tr + td + b= t('activerecord.attributes.mass_build.arch_names') + td= @mass_build.arch_names + tr + td + b= t('activerecord.attributes.mass_build.build_for_platform') + td= link_to @mass_build.build_for_platform.name, platform_path(@mass_build.build_for_platform) + - if @mass_build.external_nodes.present? + tr + td + b= t('activerecord.attributes.build_list.external_nodes') + td= I18n.t("layout.build_lists.external_nodes.#{@mass_build.external_nodes}") + tr + td + b= t('activerecord.attributes.mass_build.auto_publish_status') + td= t("layout.build_lists.auto_publish_status.#{@mass_build.auto_publish_status}") + tr + td + b= t('activerecord.attributes.mass_build.auto_create_container') + td= t("layout.#{@mass_build.auto_create_container?}_") + tr + td + b= t('activerecord.attributes.mass_build.increase_release_tag') + td= t("layout.#{@mass_build.increase_release_tag?}_") + tr + td + b= t('activerecord.attributes.mass_build.include_testing_subrepository') + td= t("layout.#{@mass_build.include_testing_subrepository?}_") + tr + td + b= t('activerecord.attributes.mass_build.use_cached_chroot') + td= t("layout.#{@mass_build.use_cached_chroot?}_") + tr + td + b= t('activerecord.attributes.mass_build.use_extra_tests') + td= t("layout.#{@mass_build.use_extra_tests?}_") + tr + td + b= t('activerecord.attributes.mass_build.created_at') + td= @mass_build.created_at + tr + td + b= t('activerecord.attributes.mass_build.description') + td= @mass_build.description - table.table.table-striped - tr - td - b= t('activerecord.attributes.mass_build.name') - td= link_to_mass_build(@mass_build) - tr - td - b= t('activerecord.attributes.mass_build.id') - td= @mass_build.id - tr - td - b= t('activerecord.attributes.mass_build.arch_names') - td= @mass_build.arch_names - tr - td - b= t('activerecord.attributes.mass_build.build_for_platform') - td= link_to @mass_build.build_for_platform.name, platform_path(@mass_build.build_for_platform) - - if @mass_build.external_nodes.present? - tr - td - b= t('activerecord.attributes.build_list.external_nodes') - td= I18n.t("layout.build_lists.external_nodes.#{@mass_build.external_nodes}") - tr - td - b= t('activerecord.attributes.mass_build.auto_publish_status') - td= t("layout.build_lists.auto_publish_status.#{@mass_build.auto_publish_status}") - tr - td - b= t('activerecord.attributes.mass_build.auto_create_container') - td= t("layout.#{@mass_build.auto_create_container?}_") - tr - td - b= t('activerecord.attributes.mass_build.increase_release_tag') - td= t("layout.#{@mass_build.increase_release_tag?}_") - tr - td - b= t('activerecord.attributes.mass_build.include_testing_subrepository') - td= t("layout.#{@mass_build.include_testing_subrepository?}_") - tr - td - b= t('activerecord.attributes.mass_build.use_cached_chroot') - td= t("layout.#{@mass_build.use_cached_chroot?}_") - tr - td - b= t('activerecord.attributes.mass_build.use_extra_tests') - td= t("layout.#{@mass_build.use_extra_tests?}_") - tr - td - b= t('activerecord.attributes.mass_build.created_at') - td= @mass_build.created_at - tr - td - b= t('activerecord.attributes.mass_build.description') - td= @mass_build.description + tr + td + b= t("activerecord.attributes.build_list.extra_repositories") + td + - if @mass_build.extra_repositories.present? + - Repository.where(id: @mass_build.extra_repositories).each do |repo| + p= link_to "#{repo.platform.name}/#{repo.name}", [repo.platform, repo] + - else + = t('layout.false_') - tr - td - b= t("activerecord.attributes.build_list.extra_repositories") - td - - if @mass_build.extra_repositories.present? - - Repository.where(id: @mass_build.extra_repositories).each do |repo| - p= link_to "#{repo.platform.name}/#{repo.name}", [repo.platform, repo] - - else - = t('layout.false_') + tr + td + b= t("activerecord.attributes.build_list.extra_mass_builds") + td + - if @mass_build.extra_mass_builds.present? + - MassBuild.where(id: @mass_build.extra_mass_builds).each do |mb| + p= link_to "#{mb.id} - #{mb.name}", platform_mass_build_path(mb.save_to_platform, mb) + - else + = t('layout.false_') - tr - td - b= t("activerecord.attributes.build_list.extra_mass_builds") - td - - if @mass_build.extra_mass_builds.present? - - MassBuild.where(id: @mass_build.extra_mass_builds).each do |mb| - p= link_to "#{mb.id} - #{mb.name}", platform_mass_build_path(mb.save_to_platform, mb) - - else - = t('layout.false_') + tr + td + b= t("activerecord.attributes.build_list.extra_build_lists") + td + - if @mass_build.extra_build_lists.present? + - BuildList.where(id: @mass_build.extra_build_lists).each do |bl| + p= link_to "#{bl.id} (#{bl.project.name} - #{bl.arch.name})", bl + - else + = t('layout.false_') - tr - td - b= t("activerecord.attributes.build_list.extra_build_lists") - td - - if @mass_build.extra_build_lists.present? - - BuildList.where(id: @mass_build.extra_build_lists).each do |bl| - p= link_to "#{bl.id} (#{bl.project.name} - #{bl.arch.name})", bl - - else - = t('layout.false_') + .col-md-8 + rd-widget + rd-widget-header title=t('layout.mass_builds.statuses') + rd-widget-body class="no-padding" + table.table.table-striped + - MassBuild::COUNT_STATUSES.each do |status| + - path = build_lists_path+"#?#{{filter: {mass_build_id: @mass_build.id, ownership: 'everything'}.merge(status != :build_lists ? {status: BuildList.status_by_human(status)} : {})}.to_param}" + tr + td + = link_to t("layout.build_lists.statuses.#{status}") + ": ", path + td= @mass_build.send "#{status}_count" - tr - td - td - tr - td - b= t('layout.mass_builds.statuses') - td - - MassBuild::COUNT_STATUSES.each do |status| - - path = build_lists_path+"#?#{{filter: {mass_build_id: @mass_build.id, ownership: 'everything'}.merge(status != :build_lists ? {status: BuildList.status_by_human(status)} : {})}.to_param}" - tr - td - = link_to t("layout.build_lists.statuses.#{status}") + ": ", path - td= @mass_build.send "#{status}_count" - - tr - td - td - tr - td - b= t('layout.mass_builds.lists') - td - - if @mass_build.projects_list.present? - = link_to_list @platform, @mass_build, 'projects_list' + tr + td + b= t('layout.mass_builds.lists') + td + - if @mass_build.projects_list.present? + = link_to_list @platform, @mass_build, 'projects_list' + |   + = link_to_list @platform, @mass_build, 'failed_builds_list' + |   + = link_to_list @platform, @mass_build, 'tests_failed_builds_list' + |   + = link_to_list @platform, @mass_build, 'success_builds_list' + rd-widget-footer + .buttons-block + - if policy(@mass_build).publish? + - unless @mass_build.auto_publish_status == BuildList::AUTO_PUBLISH_STATUS_DEFAULT + = link_to t('layout.mass_builds.publish_success'), + publish_platform_mass_build_path(@platform, @mass_build.id), + method: :post, + data: { confirm: t("layout.confirm") }, + class: 'btn btn-success' + |   + = link_to t('layout.mass_builds.publish_test_failed'), + publish_platform_mass_build_path(@platform, @mass_build.id, status: 'test_failed'), + method: :post, + data: { confirm: t("layout.confirm") }, + class: 'btn btn-warning' |   - = link_to_list @platform, @mass_build, 'failed_builds_list' - |   - = link_to_list @platform, @mass_build, 'tests_failed_builds_list' - |   - = link_to_list @platform, @mass_build, 'success_builds_list' - .buttons_block - - if policy(@mass_build).publish? - - unless @mass_build.auto_publish_status == BuildList::AUTO_PUBLISH_STATUS_DEFAULT - = link_to t('layout.mass_builds.publish_success'), - publish_platform_mass_build_path(@platform, @mass_build.id), - method: :post, - data: { confirm: t("layout.confirm") }, - class: 'btn btn-success' - hr - = link_to t('layout.mass_builds.publish_test_failed'), - publish_platform_mass_build_path(@platform, @mass_build.id, status: 'test_failed'), - method: :post, - data: { confirm: t("layout.confirm") }, - class: 'btn btn-warning' - hr - - if policy(@mass_build).cancel? - = link_to t('layout.cancel'), - cancel_platform_mass_build_path(@platform, @mass_build.id), - method: :post, - class: 'btn btn-danger', - data: { confirm: t('layout.mass_builds.cancel_confirm') } - hr - - if policy(@mass_build).create? - = link_to t('layout.mass_builds.recreate'), - new_platform_mass_build_path(@platform, mass_build_id: @mass_build.id), - class: 'btn btn-primary' - - if policy(@mass_build).show_fail_reason? && @mass_build.build_error_count > 0 - hr - = link_to t('layout.mass_builds.show_fail_reason_link'), - show_fail_reason_platform_mass_build_path, - class: 'btn btn-info' \ No newline at end of file + - if policy(@mass_build).cancel? + = link_to t('layout.cancel'), + cancel_platform_mass_build_path(@platform, @mass_build.id), + method: :post, + class: 'btn btn-danger', + data: { confirm: t('layout.mass_builds.cancel_confirm') } + |   + - if policy(@mass_build).create? + = link_to t('layout.mass_builds.recreate'), + new_platform_mass_build_path(@platform, mass_build_id: @mass_build.id), + class: 'btn btn-primary' + |   + - if policy(@mass_build).show_fail_reason? && @mass_build.build_error_count > 0 + = link_to t('layout.mass_builds.show_fail_reason_link'), + show_fail_reason_platform_mass_build_path, + class: 'btn btn-info' \ No newline at end of file diff --git a/app/views/platforms/mass_builds/show_fail_reason.slim b/app/views/platforms/mass_builds/show_fail_reason.slim index f7aef8f2f..97141024c 100644 --- a/app/views/platforms/mass_builds/show_fail_reason.slim +++ b/app/views/platforms/mass_builds/show_fail_reason.slim @@ -3,37 +3,38 @@ = render 'submenu' -.col-xs-12.col-md-10.col-md-offset-1 - .row - h3 - = t('layout.mass_builds.show_fail_reason.title') - = link_to t('layout.mass_builds.show_fail_reason.return'), platform_mass_build_path - .row - -if !@items.empty? - table.table.table-condensed - thead - tr - th - = t("activerecord.attributes.build_list.id") - th - = t("activerecord.attributes.build_list.project") - th - = t("activerecord.attributes.build_list.arch") - th - = t("activerecord.attributes.build_list.fail_reason") - tbody - - @items.each do |item| - tr - td - = link_to item[0], build_list_path(item[0]) - td - = link_to item[1], project_path(item[1]) - td - = item[2] - td - pre.pre-fail-reason - = item[3] - -else - = t('layout.mass_builds.show_fail_reason.no_failed_builds') - .row - =will_paginate @build_lists \ No newline at end of file +.row + .col-md-12 + rd-widget + rd-widget-header title=t('layout.mass_builds.show_fail_reason.title') + rd-widget-body + .row + = link_to t('layout.mass_builds.show_fail_reason.return'), platform_mass_build_path + .row.top-space + -if !@items.empty? + table.table.table-condensed + thead + tr + th + = t("activerecord.attributes.build_list.id") + th + = t("activerecord.attributes.build_list.project") + th + = t("activerecord.attributes.build_list.arch") + th + = t("activerecord.attributes.build_list.fail_reason") + tbody + - @items.each do |item| + tr + td + = link_to item[0], build_list_path(item[0]) + td + = link_to item[1], project_path(item[1]) + td + = item[2] + td + pre.pre-fail-reason + = item[3] + -else + = t('layout.mass_builds.show_fail_reason.no_failed_builds') + =will_paginate @build_lists, rd_widget_footer: true \ No newline at end of file diff --git a/app/views/platforms/platforms/_form.html.slim b/app/views/platforms/platforms/_form.html.slim index b0c99a688..8826f8acb 100644 --- a/app/views/platforms/platforms/_form.html.slim +++ b/app/views/platforms/platforms/_form.html.slim @@ -26,17 +26,6 @@ - if %w(edit update).include? controller.action_name - - if policy(@platform).change_visibility? - dl.dl-horizontal - dt - = t('activerecord.attributes.platform.visibility') - dd - = link_to t("layout.platforms.change_visibility_from_#{@platform.visibility}"), - change_visibility_platform_path(@platform), - method: :post, - data: { confirm: t("layout.platforms.confirm_change_visibility") }, - class: 'btn btn-xs btn-warning' - - unless @platform.personal? h3 = t('layout.platform_arch_settings.extra_settings') @@ -60,7 +49,7 @@ input_html: { value: setting.time_living / 60 }, label: false -.col-sm-offset-3.col-sm-9 +.pull-right => submit_button_tag => t('layout.or') a.btn.btn-default href=(@platform.new_record? ? root_path : platform_path(@platform)) diff --git a/app/views/platforms/platforms/edit.html.slim b/app/views/platforms/platforms/edit.html.slim index 5eed0fd33..3a976cc06 100644 --- a/app/views/platforms/platforms/edit.html.slim +++ b/app/views/platforms/platforms/edit.html.slim @@ -1,63 +1,30 @@ - set_meta_tags title: [title_object(@platform), t('layout.platforms.edit')] = render 'submenu' -.container.col-md-12 - .row - = simple_form_for @platform, wrapper_mappings: { boolean: :vertical_boolean } do |f| - = render 'form', f: f - hr - .row +.row + .col-md-12 + rd-widget + rd-widget-header title=t('layout.platforms.edit') + rd-widget-body + .row + = simple_form_for @platform, wrapper_mappings: { boolean: :vertical_boolean } do |f| + = render 'form', f: f + .row + - if policy(@platform).destroy? + hr + p + = t("layout.platforms.delete_warning") + = link_to t("layout.delete"), + platform_path(@platform), + method: :delete, + data: { confirm: t("layout.platforms.confirm_delete") }, + class: 'btn btn-danger' - - if policy(@platform).regenerate_metadata? - h4= t('layout.platforms.metadata') - - table.table - tbody - tr - td= t('activerecord.attributes.regeneration_status.status') - td= t("layout.regeneration_statuses.statuses.#{@platform.human_status}") - - tr - td= t('activerecord.attributes.regeneration_status.last_regenerated_at') - td= @platform.last_regenerated_at - - tr - td= t('activerecord.attributes.regeneration_status.last_regenerated_status') - td= t("layout.regeneration_statuses.last_regenerated_statuses.#{@platform.human_regeneration_status}") - tr - td= t('activerecord.attributes.regeneration_status.last_regenerated_log_sha1') - td= link_to_file_store('regeneration.log', @platform.last_regenerated_log_sha1) - tr - td= t('activerecord.attributes.platform.automatic_metadata_regeneration') - td ng-controller='AutomaticMetadataRegenerationController' ng-init="platform_id = #{@platform.id}" - select ng-options='k as (v | i18n) for (k, v) in items' ng-model='amr' ng-change='update()' ng-init="amr = '#{@platform.automatic_metadata_regeneration.to_s}'" - option value='' - tr - td - td - br - = link_to t('layout.regeneration_statuses.regenerate_metadata'), - regenerate_metadata_platform_path(@platform), - method: :put, - data: { confirm: t('layout.confirm') }, - class: 'btn btn-xs btn-warning' - - - - if policy(@platform).destroy? - hr - p - = t("layout.platforms.delete_warning") - = link_to t("layout.delete"), - platform_path(@platform), - method: :delete, - data: { confirm: t("layout.platforms.confirm_delete") }, - class: 'btn btn-danger' - - - if policy(@platform).clear? - p - = t("layout.repositories.clear_warning") - = link_to t("layout.repositories.clear"), - clear_platform_path(@platform), - class: 'btn btn-danger', - data: { confirm: t('layout.repositories.clear_confirm') }, - method: :put + - if policy(@platform).clear? + p + = t("layout.repositories.clear_warning") + = link_to t("layout.repositories.clear"), + clear_platform_path(@platform), + class: 'btn btn-danger', + data: { confirm: t('layout.repositories.clear_confirm') }, + method: :put diff --git a/app/views/platforms/platforms/index.html.slim b/app/views/platforms/platforms/index.html.slim index 495c84101..0fba7cec0 100644 --- a/app/views/platforms/platforms/index.html.slim +++ b/app/views/platforms/platforms/index.html.slim @@ -3,6 +3,9 @@ .col-md-6.col-md-offset-3 rd-widget rd-widget-header title=(t('layout.platforms.list_header')) + - if policy(:platform).create? + a.btn.btn-primary.pull-right href=new_platform_path + = t('layout.platforms.new') rd-widget-body class="no-padding" table.table.table-hover thead @@ -15,10 +18,4 @@ a ng-href="{{item.link}}" | {{item.name}} td - | {{item.distrib_type}} - - if policy(:platform).create? - rd-widget-footer - ul.nav.nav-justified - li - a href=new_platform_path - = t('layout.platforms.new') \ No newline at end of file + | {{item.distrib_type}} \ No newline at end of file diff --git a/app/views/platforms/platforms/show.html.slim b/app/views/platforms/platforms/show.html.slim index eb30539e1..1659669e8 100644 --- a/app/views/platforms/platforms/show.html.slim +++ b/app/views/platforms/platforms/show.html.slim @@ -1,78 +1,68 @@ - title = title_object(@platform) - set_meta_tags title: title -- set_meta_tags og: { title: title, - description: truncate(@platform.description, length: 255) } -- set_meta_tags twitter: { title: title, - description: truncate(@platform.description, length: 200) } = render 'submenu' -.col-md-12 - .row - .col-md-6 - h3 - = t('layout.platforms.about') - |   - = link_to @platform.name, platform_contents_path(@platform) +.row + .col-md-6 + rd-widget + rd-widget-header title=t('layout.platforms.about') + - if policy(@platform).clone? + a.btn.btn-primary.pull-right href=clone_platform_path(@platform) + = t('layout.platforms.clone') + rd-widget-body class="no-padding" + table.table.table-condensed + tr + td + b= t('activerecord.attributes.platform.description') + td= @platform.description - .row - .col-md-4 - b= t('activerecord.attributes.platform.description') - .col-md-8= @platform.description + - if @platform.parent + tr + td + b= t('activerecord.attributes.platform.parent') + td + = link_to @platform.parent.description, platform_path(@platform.parent) + tr + td + b= t('layout.platforms.owner') + td= link_to @platform.owner.try(:uname) + ' (' + @platform.owner.try(:name) + ')', url_for(@platform.owner) - - if @platform.parent - .row - .col-md-4 - b= t('activerecord.attributes.platform.parent') - .col-md-8 - = link_to @platform.parent.description, platform_path(@platform.parent) + tr + td + b= t('layout.platforms.visibility') + td= t("layout.visibilities.#{@platform.visibility}") - .row - .col-md-4 - b= t('layout.platforms.owner') - .col-md-8= link_to @platform.owner.try(:name), url_for(@platform.owner) + tr + td + b= t('layout.platforms.platform_type') + td= @platform.platform_type - .row - .col-md-4 - b= t('layout.platforms.visibility') - .col-md-8= t("layout.visibilities.#{@platform.visibility}") + tr + td + b= t('layout.platforms.distrib_type') + td= @platform.distrib_type - .row - .col-md-4 - b= t('layout.platforms.platform_type') - .col-md-8= @platform.platform_type + - if @platform.platform_type == 'personal' and @platform.visibility == 'open' + .col-md-6 ng-controller='PlatformSysReposController' ng-init="init(#{@platform.id})" + rd-widget + rd-widget-header title=t('layout.platforms.sys_repos_header') + rd-widget-body + .row + .col-md-4 + b= t('layout.platforms.target_platform') + .col-md-8 + select ng-model='platform' ng-change='updateCommand()' + option ng-repeat='platform in platforms' ng-value='platform' + | {{ platform }} - .row - .col-md-4 - b= t('layout.platforms.distrib_type') - .col-md-8= @platform.distrib_type - - - if policy(@platform).clone? - .row - .col-md-4 - .col-md-8 - a.btn.btn-primary href=clone_platform_path(@platform) - = t('layout.platforms.clone') - - - if @platform.platform_type == 'personal' and @platform.visibility == 'open' - .col-md-6 ng-controller='PlatformSysReposController' ng-init="init(#{@platform.id})" - h3= t('layout.platforms.sys_repos_header') - - .row - .col-md-4 - b= t('layout.platforms.target_platform') - .col-md-8 - select ng-model='platform' ng-change='updateCommand()' - option ng-repeat='platform in platforms' ng-value='platform' - | {{ platform }} - - .row - .col-md-4 - b= t('layout.platforms.target_architecture') - .col-md-8 - select ng-model='arch' ng-change='updateCommand()' - option ng-repeat='arch in arches' ng-value='arch' - | {{ arch }} - .row - br - textarea.form-control readonly='readonly' ng-model='command' rows=3 ng-click='selectAll($event)' + .row + .col-md-4 + b= t('layout.platforms.target_architecture') + .col-md-8 + select ng-model='arch' ng-change='updateCommand()' + option ng-repeat='arch in arches' ng-value='arch' + | {{ arch }} + .row + br + textarea.form-control readonly='readonly' ng-model='command' rows=3 ng-click='selectAll($event)' diff --git a/app/views/platforms/product_build_lists/_product_build_list.html.slim b/app/views/platforms/product_build_lists/_product_build_list.html.slim index 0b615548b..fae9a2a1a 100644 --- a/app/views/platforms/product_build_lists/_product_build_list.html.slim +++ b/app/views/platforms/product_build_lists/_product_build_list.html.slim @@ -15,7 +15,4 @@ tr td.text-center - if policy(pbl).destroy? && pbl.can_destroy? = link_to platform_product_product_build_list_path(platform, product, pbl), method: :delete, data: { confirm: t('layout.confirm') } do - span.glyphicon.glyphicon-remove - - td - = datetime_moment pbl.updated_at \ No newline at end of file + span.glyphicon.glyphicon-remove \ No newline at end of file diff --git a/app/views/platforms/product_build_lists/new.html.slim b/app/views/platforms/product_build_lists/new.html.slim index b85c996db..d6703c71e 100644 --- a/app/views/platforms/product_build_lists/new.html.slim +++ b/app/views/platforms/product_build_lists/new.html.slim @@ -1,39 +1,25 @@ - set_meta_tags title: [title_object(@product), t('layout.product_build_lists.new')] = render 'submenu' +.row + .col-md-12 + rd-widget + rd-widget-header title=t('layout.product_build_lists.new') + rd-widget-body + - pbl = @product_build_list + = simple_form_for @product_build_list, url: platform_product_product_build_lists_path(@platform, @product) do |f| + = f.input :project, + input_html: { value: pbl.project.name_with_owner }, + disabled: true -.container.col-md-12 - .row - - pbl = @product_build_list - = simple_form_for @product_build_list, url: platform_product_product_build_lists_path(@platform, @product) do |f| - = f.input :project, - input_html: { value: pbl.project.name_with_owner }, - disabled: true + = f.input :project_version, + as: :grouped_select, + collection: versions_for_group_select(pbl.project), + group_method: :last, + include_blank: false - = f.input :project_version, - as: :grouped_select, - collection: versions_for_group_select(pbl.project), - group_method: :last, - include_blank: false + = f.input :main_script + = f.input :params + = f.input :time_living, input_html: { value: (pbl.time_living.to_i / 60) } - = f.input :main_script - = f.input :params - = f.input :time_living, input_html: { value: (pbl.time_living.to_i / 60) } - - = f.button :submit, t('layout.projects.build_button') - - .row - hr - h4= t('layout.product_build_lists.work_env') - pre - i - = '/home/vagrant/iso_builder - ' - = t('layout.product_build_lists.iso_builder_folder') - pre - i - = '/home/vagrant/results - ' - = t('layout.product_build_lists.results_folder') - pre - i - = '/home/vagrant/archives - ' - = t('layout.product_build_lists.archives_folder') + = f.button :submit, t('layout.projects.build_button') \ No newline at end of file diff --git a/app/views/platforms/product_build_lists/show.html.slim b/app/views/platforms/product_build_lists/show.html.slim index be3399828..96eb019ad 100644 --- a/app/views/platforms/product_build_lists/show.html.slim +++ b/app/views/platforms/product_build_lists/show.html.slim @@ -1,8 +1,5 @@ - title = title_object(@product_build_list.product) - set_meta_tags title: [title, t('layout.product_build_lists.show')] -- description = @product_build_list.results.map{ |r| r['file_name'] }.select{ |n| n =~ /.iso$/ } * ', ' -- set_meta_tags og: { title: title, description: description } -- set_meta_tags twitter: { title: title, description: description } = render 'submenu' @@ -10,130 +7,118 @@ - product = pbl.product - platform = product.platform -.container.col-md-12 ng-controller='ProductBuildListController' - .row - h3 - = t('layout.product_build_lists.main_data') +.row ng-controller='ProductBuildListController' ng-init=("init("+pbl.id.to_s+")") + .col-md-6 + rd-widget + rd-widget-header title=t('layout.product_build_lists.main_data') + rd-widget-body class="no-padding" + table.table.table-condensed + tr + td + = t('activerecord.attributes.product_build_list.id') + td + = pbl.id - .row - = hidden_field_tag :product_build_list_id, pbl.id - .col-md-6 - b - = t('activerecord.attributes.product_build_list.id') - .col-md-6 - = pbl.id + tr + td + = t('activerecord.attributes.product_build_list.status') + td + | {{pbl.human_status}} - .row - .col-md-6 - b - = t('activerecord.attributes.product_build_list.status') - .col-md-6 - | {{pbl.human_status}} + - if pbl.user + tr + td + = t('activerecord.attributes.product_build_list.user') + td + = link_to pbl.user.try(:fullname), pbl.user - - if pbl.user - .row - .col-md-6 - b - = t('activerecord.attributes.product_build_list.user') - .col-md-6 - = link_to pbl.user.try(:fullname), pbl.user + tr + td + = t('activerecord.attributes.product_build_list.product') + td + = link_to pbl.product.name, platform_product_path(platform, product) - .row - .col-md-6 - b - = t('activerecord.attributes.product_build_list.product') - .col-md-6 - = link_to pbl.product.name, platform_product_path(platform, product) + tr + td + = t('activerecord.attributes.product_build_list.project') + td + = link_to pbl.project.name_with_owner, project_path(pbl.project) - .row - .col-md-6 - b - = t('activerecord.attributes.product_build_list.project') - .col-md-6 - = link_to pbl.project.name_with_owner, project_path(pbl.project) + tr + td + = t('activerecord.attributes.product_build_list.project_version') + td + = product_build_list_version_link(pbl, true) - .row - .col-md-6 - b - = t('activerecord.attributes.product_build_list.project_version') - .col-md-6 - = product_build_list_version_link(pbl, true) + tr + td + = t('activerecord.attributes.product_build_list.main_script') + td + = pbl.main_script - .row - .col-md-6 - b - = t('activerecord.attributes.product_build_list.main_script') - .col-md-6 - = pbl.main_script + tr + td + = t('activerecord.attributes.product_build_list.params') + td + = pbl.params - .row - .col-md-6 - b - = t('activerecord.attributes.product_build_list.params') - .col-md-6 - = pbl.params + tr + td + = t('activerecord.attributes.product_build_list.time_living') + td + = pbl.time_living / 60 - .row - .col-md-6 - b - = t('activerecord.attributes.product_build_list.time_living') - .col-md-6 - = pbl.time_living / 60 + tr + td + = t('activerecord.attributes.product_build_list.autostarted') + td + = t("layout.#{pbl.autostarted}_") - .row - .col-md-6 - b - = t('activerecord.attributes.product_build_list.autostarted') - .col-md-6 - = t("layout.#{pbl.autostarted}_") + tr + td + = t('activerecord.attributes.product_build_list.notified_at') + td + | {{pbl.notified_at}} - .row - .col-md-6 - b - = t('activerecord.attributes.product_build_list.notified_at') - .col-md-6 - | {{pbl.notified_at}} + - if policy(pbl).update? + tr ng-show="pbl.status == #{ ProductBuildList::BUILD_COMPLETED }" + td + = t('activerecord.attributes.product_build_list.not_delete') + td + = select_tag 'not_delete', + options_for_select(product_build_list_delete_options), + { ng_model: "pbl.not_delete", ng_change: 'updateStatus()'} + .row.alert.alert-danger.top-space ng-hide='pbl.not_delete != "false"' + - days = pbl.autostarted? ? ProductBuildList::LIVE_TIME : ProductBuildList::MAX_LIVE_TIME + - days = (pbl.created_at.to_date - days.ago.to_date).to_i + - if days > 1 + = t('layout.product_build_lists.will_be_removed_n_days', n: days) + - else + = t('layout.product_build_lists.will_be_removed_today') - - if policy(pbl).update? - .row ng-show="pbl.status == #{ ProductBuildList::BUILD_COMPLETED }" - .col-md-6 - b - = t('activerecord.attributes.product_build_list.not_delete') - .col-md-6 - = select_tag 'not_delete', - options_for_select(product_build_list_delete_options), - { ng_model: "pbl.not_delete", ng_change: 'updateStatus()'} + - if policy(pbl).cancel? || policy(pbl).destroy? + rd-widget-footer ng-show="pbl.can_cancel || pbl.can_destroy" + - if policy(pbl).cancel? + a.btn.btn-warning[ + href=cancel_platform_product_product_build_list_path(pbl.product.platform, pbl.product, pbl) + data-method = 'put' + data-confirm = t('layout.confirm') + ng-show = 'pbl.can_cancel' ] + = t('layout.build_lists.cancel') + |   - .row.alert.alert-danger.offset10 ng-hide='pbl.not_delete' - - days = pbl.autostarted? ? ProductBuildList::LIVE_TIME : ProductBuildList::MAX_LIVE_TIME - - days = (pbl.created_at.to_date - days.ago.to_date).to_i - - if days > 1 - = t('layout.product_build_lists.will_be_removed_n_days', n: days) - - else - = t('layout.product_build_lists.will_be_removed_today') - - .row - hr - - if policy(pbl).cancel? - a.btn.btn-warning[ - href=cancel_platform_product_product_build_list_path(pbl.product.platform, pbl.product, pbl) - data-method = 'put' - data-confirm = t('layout.confirm') - ng-show = 'pbl.can_cancel' ] - = t('layout.build_lists.cancel') - |   - - - if policy(pbl).destroy? - a.btn.btn-danger[ - href=platform_product_product_build_list_path(pbl.product.platform, pbl.product, pbl) - data-method = 'delete' - data-confirm = t('layout.confirm') - ng-show = 'pbl.can_destroy' ] - = t('layout.product_build_lists.delete') - - .row.offset10 ng-show="pbl.status == #{ProductBuildList::BUILD_STARTED}" - = render 'shared/log', { build_started: true, get_log_path: log_platform_product_product_build_list_path(pbl.product.platform, pbl.product, pbl) } - - .row + - if policy(pbl).destroy? + a.btn.btn-danger[ + href=platform_product_product_build_list_path(pbl.product.platform, pbl.product, pbl) + data-method = 'delete' + data-confirm = t('layout.confirm') + ng-show = 'pbl.can_destroy' ] + = t('layout.product_build_lists.delete') + .col-md-6 = render 'shared/build_results', subject: pbl +.row ng-show="pbl.status == #{ProductBuildList::BUILD_STARTED}" + .col-md-12 + = render 'shared/log', { build_started: true, get_log_path: log_platform_product_product_build_list_path(pbl.product.platform, pbl.product, pbl) } + + diff --git a/app/views/platforms/products/_form.html.slim b/app/views/platforms/products/_form.html.slim index 323714a7f..62d0341ac 100644 --- a/app/views/platforms/products/_form.html.slim +++ b/app/views/platforms/products/_form.html.slim @@ -1,33 +1,22 @@ = f.input :name = f.input :description, as: :text -= f.input :project_id, as: :string, - input_html: { 'data-ajax' => autocomplete_project_platform_products_path(@platform), - value: @product.project.try(:name_with_owner) } -= hidden_field_tag 'product[project_id]', @product.project_id, id: 'src_project_id' +div ng-controller="ProjectsVersionsTypeaheadController" ng-init=('init("'+@platform.name+'","'+@product.project.try(:name_with_owner).to_s+'","'+@product.project_id.to_s+'","'+@product.project_version+'")') + = f.input :project_id, as: :string, + input_html: { uib_typeahead: 'project.name for project in getProjects($viewValue)', + typeahead_wait_ms: 200, + typeahead_on_select: 'selectProject($item)', + ng_model: 'project', + typeahead_editable: 'false', + value: '{{project}}', + ng_disabled: 'loadingVersions' } + = hidden_field_tag 'product[project_id]', '', value: '{{projectId}}' -- content_for :additional_scripts do - coffee: - product_projects = [] - - $('#product_project_id').typeahead - val: 'data' - ajax: - url: $('#product_project_id').data('ajax') - preProcess: (data) -> - product_projects = data - onSelect: (i) -> - $('#src_project_id').val i.value - project = _.find product_projects, (p) -> - p.id.toString() == i.value - if project - $('#product_project_version').html project.project_versions - -= f.input :project_version, - as: :grouped_select, - collection: versions_for_group_select(@product.project), - group_method: :last, - include_blank: false + = f.input :project_version, + as: :grouped_select, + group_method: :last, + include_blank: false, + input_html: { ng_disabled: 'loadingVersions', ng_bind_html: 'projectVersions' } = f.input :main_script = f.input :params diff --git a/app/views/platforms/products/autocomplete_project.json.jbuilder b/app/views/platforms/products/autocomplete_project.json.jbuilder index 23d37eba6..e2503eb00 100644 --- a/app/views/platforms/products/autocomplete_project.json.jbuilder +++ b/app/views/platforms/products/autocomplete_project.json.jbuilder @@ -1,5 +1,4 @@ json.array!(@items) do |item| json.id item.id json.name item.name_with_owner - json.project_versions grouped_options_for_select(versions_for_group_select(item)) end diff --git a/app/views/platforms/products/edit.html.slim b/app/views/platforms/products/edit.html.slim index 27161b584..c4813ab15 100644 --- a/app/views/platforms/products/edit.html.slim +++ b/app/views/platforms/products/edit.html.slim @@ -1,13 +1,11 @@ - set_meta_tags title: [title_object(@product), t('title_editing')] = render 'submenu' -.container.col-md-12 - .row - h3 - = t('layout.products.edit_header') - |   - = link_to @product.name, platform_product_path(@platform, @product) - - = simple_form_for [@platform, @product] do |f| - = render 'form', f: f +.row + .col-md-12 + rd-widget + rd-widget-header title=(t('layout.products.edit_header')+' '+@product.name) + rd-widget-body + = simple_form_for [@platform, @product] do |f| + = render 'form', f: f diff --git a/app/views/platforms/products/index.html.slim b/app/views/platforms/products/index.html.slim index 9934a4106..2efa492e0 100644 --- a/app/views/platforms/products/index.html.slim +++ b/app/views/platforms/products/index.html.slim @@ -1,15 +1,14 @@ -set_meta_tags title: [title_object(@platform), t('layout.products.list_header')] = render 'submenu' if params[:platform_id] - -.container.col-md-12 - .row - - - if policy(@platform.products.build).create? - a.btn.btn-primary href=new_platform_product_path(@platform) - = t('layout.products.new') - hr - - = render 'list', object: @products - = will_paginate @products +.row + .col-md-8.col-md-offset-2 + rd-widget + rd-widget-header title=t('layout.products.list_header') + - if policy(@platform.products.build).create? + a.btn.btn-primary.pull-right href=new_platform_product_path(@platform) + = t('layout.products.new') + rd-widget-body class="no-padding" + = render 'list', object: @products + = will_paginate @products, rd_widget_footer: true diff --git a/app/views/platforms/products/new.html.slim b/app/views/platforms/products/new.html.slim index 00e4dd9a7..4a1b79fbc 100644 --- a/app/views/platforms/products/new.html.slim +++ b/app/views/platforms/products/new.html.slim @@ -1,8 +1,10 @@ - set_meta_tags title: [title_object(@platform), t('layout.products.new')] = render 'submenu' - -.container.col-md-12 - .row - = simple_form_for [@platform, @product] do |f| - = render 'form', f: f +.row + .col-md-10.col-md-offset-1 + rd-widget + rd-widget-header title=t('layout.products.new') + rd-widget-body + = simple_form_for [@platform, @product] do |f| + = render 'form', f: f diff --git a/app/views/platforms/products/project_versions.json.jbuilder b/app/views/platforms/products/project_versions.json.jbuilder new file mode 100644 index 000000000..c1dce6d1f --- /dev/null +++ b/app/views/platforms/products/project_versions.json.jbuilder @@ -0,0 +1 @@ +json.project_versions grouped_options_for_select(versions_for_group_select(@project), params[:project_version]) \ No newline at end of file diff --git a/app/views/platforms/products/show.html.slim b/app/views/platforms/products/show.html.slim index e610a11b6..f0355e1e6 100644 --- a/app/views/platforms/products/show.html.slim +++ b/app/views/platforms/products/show.html.slim @@ -1,49 +1,42 @@ - title = title_object(@product) - set_meta_tags title: title -- set_meta_tags og: { title: title, - description: truncate(@product.description, length: 255) } -- set_meta_tags twitter: { title: title, - description: truncate(@product.description, length: 200) } = render 'submenu' -.container.col-md-12 - .row - - h3 - = t('layout.products.about') - |   - = @product.name - - p= @product.description - - - if policy(@product).update? - a.btn.btn-primary href=edit_platform_product_path(@platform, @product) - = t('layout.edit') - |   - - if policy(@product).destroy? - a.btn.btn-danger[ href = platform_product_path(@platform, @product) - data-method = 'delete' - data-confirm = t('layout.products.confirm_delete') ] - = t('layout.delete') - |   - - if policy(@product.product_build_lists.build).create? - a.btn.btn-primary href=new_platform_product_product_build_list_path(@platform, @product) - = t('layout.products.build') - - hr - - h3= t("layout.products.build_lists_monitoring") - - table.table.table-striped - thead - tr - th= t("activerecord.attributes.product_build_list.id") - th= t("activerecord.attributes.product_build_list.status") - th= t("activerecord.attributes.product_build_list.product") - th= t("layout.product_build_lists.action") - th= t("activerecord.attributes.product_build_list.notified_at") - tbody - = render partial: 'platforms/product_build_lists/product_build_list', - collection: @product_build_lists - = will_paginate @product_build_lists +.row + .col-md-6 + rd-widget + rd-widget-header title=(t('layout.products.about')+" "+@product.name) + - if @product.description.to_s != "" + rd-widget-body + p= @product.description + - if policy(@product).update? || policy(@product).destroy? || policy(@product.product_build_lists.build).create? + rd-widget-footer + - if policy(@product).update? + a.btn.btn-primary href=edit_platform_product_path(@platform, @product) + = t('layout.edit') + |   + - if policy(@product).destroy? + a.btn.btn-danger[ href = platform_product_path(@platform, @product) + data-method = 'delete' + data-confirm = t('layout.products.confirm_delete') ] + = t('layout.delete') + |   + - if policy(@product.product_build_lists.build).create? + a.btn.btn-primary href=new_platform_product_product_build_list_path(@platform, @product) + = t('layout.products.build') + .col-md-6 + rd-widget + rd-widget-header title=t("layout.products.build_lists_monitoring") + rd-widget-body class="no-padding" + table.table.table-striped + thead + tr + th= t("activerecord.attributes.product_build_list.id") + th= t("activerecord.attributes.product_build_list.status") + th= t("activerecord.attributes.product_build_list.product") + th= t("layout.product_build_lists.action") + tbody + = render partial: 'platforms/product_build_lists/product_build_list', + collection: @product_build_lists + = will_paginate @product_build_lists, rd_widget_footer: true diff --git a/app/views/platforms/repositories/_proj_list.html.slim b/app/views/platforms/repositories/_proj_list.html.slim index 07a8d8fdd..5d6f5aaf2 100644 --- a/app/views/platforms/repositories/_proj_list.html.slim +++ b/app/views/platforms/repositories/_proj_list.html.slim @@ -1,42 +1,32 @@ -div ng-controller='RepositoryProjectsController' - = simple_form_for :project, - html: { ng_submit: 'search()', - id: 'search_projects_form', - class: 'well' } do |f| - - = hidden_field_tag :added, controller.action_name.to_sym == :show - = hidden_field_tag :repository_id, @repository.id - = hidden_field_tag :platform_id, @repository.platform_id - = hidden_field_tag :page - .row - .col-md-5 - = f.input :owner, label: false - .col-md-5 - = f.input :name, label: false - .col-md-2 - = f.button :submit, t('layout.search.header') - - table.table.table-striped - thead - tr - th= t("activerecord.attributes.project.name") - th= t("activerecord.attributes.project.description") - th - tbody ng-hide='processing' - tr ng-repeat='project in projects' ng-cloak = true - - td - i.fa ng-class='project.visibility_class' - |   - a ng-href='{{project.path}}' - | {{project.name}} - td - a ng-href='{{project.add_path}}' ng-show='project.add_path' - = t('layout.add') - a.pointer[ng-href = '' - ng-show = 'project.remove_path' - ng-click = 'removeProject(project)'] - span.glyphicon.glyphicon-remove +div ng-controller='RepositoryProjectsController' ng-init=("init("+(controller.action_name.to_sym == :show).to_s+","+repository.id.to_s+","+repository.platform_id.to_s+")") + rd-widget + rd-widget-header title=t("layout.projects.list_header") custom-class="col-sm-8" + .col-md-6 + input [ ng-model="search_owner" ng-change="search(search_owner, search_name)" class="form-control" + placeholder=t("simple_form.placeholders.project.owner") ng-model-options="{ debounce: 500 }" ] + .col-md-6 + input [ ng-model="search_name" ng-change="search(search_owner, search_name)" class="form-control" + placeholder=t("simple_form.placeholders.project.name") ng-model-options="{ debounce: 500 }"] + rd-widget-body class="no-padding" loading="processing" + table.table.table-striped + thead + tr + th= t("activerecord.attributes.project.name") + th + tbody ng-hide='processing' + tr ng-repeat='project in projects' ng-cloak = true + td + i.fa ng-class='project.visibility_class' |   - - = angularjs_paginate + a ng-href='{{project.path}}' + | {{project.name}} + td + a ng-href='{{project.add_path}}' ng-show='project.add_path' + = t('layout.add') + a.pointer[ng-href = '' + ng-show = 'project.remove_path' + ng-click = 'removeProject(project)'] + span.glyphicon.glyphicon-remove + |   + rd-widget-footer ng-show="total_items > 20" + = angularjs_paginate \ No newline at end of file diff --git a/app/views/platforms/repositories/edit.html.slim b/app/views/platforms/repositories/edit.html.slim index c8bc77d46..3650c8e67 100644 --- a/app/views/platforms/repositories/edit.html.slim +++ b/app/views/platforms/repositories/edit.html.slim @@ -1,73 +1,66 @@ -set_meta_tags title: [title_object(@repository), t('layout.repositories.edit')] = render 'submenu' -.container.col-md-offset-2.col-md-8 - .row - h3 - = t("layout.repositories.about") - |   - i - = @repository.name - - .row - - = simple_form_for @repository, url: platform_repository_path(@platform, @repository) do |f| - = render "form", f: f - hr +.row + .col-md-6 + rd-widget + rd-widget-header title=(t("layout.repositories.about") + " " + @repository.name) + rd-widget-body + = simple_form_for @repository, url: platform_repository_path(@platform, @repository) do |f| + = render "form", f: f - if policy(@repository).update? - .row - h3= t('layout.repositories.extra_actions') + .col-md-6 + rd-widget + rd-widget-header title=t('layout.repositories.extra_actions') + rd-widget-body + - if @platform.main? + .row + - if @repository.sync_lock_file_exists? + - label = t('layout.repositories.remove_sync_lock_file') + - path = sync_lock_file_platform_repository_path(@platform, @repository, remove: true) + - else + - label = t('layout.repositories.add_sync_lock_file') + - path = sync_lock_file_platform_repository_path(@platform, @repository) + = simple_form_for @repository, url: path, html: { method: :put } do |f| + .col-md-8 + = t('layout.repositories.sync_lock_file_info') + .col-md-2 + = f.button :submit, label, data: { confirm: t('layout.confirm') }, class: 'btn-warning' - - if @platform.main? - .row - - if @repository.sync_lock_file_exists? - - label = t('layout.repositories.remove_sync_lock_file') - - path = sync_lock_file_platform_repository_path(@platform, @repository, remove: true) - - else - - label = t('layout.repositories.add_sync_lock_file') - - path = sync_lock_file_platform_repository_path(@platform, @repository) - = simple_form_for @repository, url: path, html: { method: :put } do |f| - .col-md-8 - = t('layout.repositories.sync_lock_file_info') - .col-md-2 - = f.button :submit, label, data: { confirm: t('layout.confirm') }, class: 'btn-warning' + .row.offset10 + = simple_form_for @repository, url: regenerate_metadata_platform_repository_path(@platform, @repository), html: { method: :put } do |f| + .col-md-6 + = t('layout.repositories.regenerate_metadata') + .col-md-2 + - if @platform.personal? + = f.input :build_for_platform_id, collection: platform_options, label: false, include_blank: false + .col-md-2 + = f.button :submit, t('layout.repositories.regenerate_metadata'), data: { confirm: t('layout.confirm') }, class: 'btn-warning' - .row.offset10 - = simple_form_for @repository, url: regenerate_metadata_platform_repository_path(@platform, @repository), html: { method: :put } do |f| - .col-md-6 - = t('layout.repositories.regenerate_metadata') - .col-md-2 - - if @platform.personal? - = f.input :build_for_platform_id, collection: platform_options, label: false, include_blank: false - .col-md-2 - = f.button :submit, t('layout.repositories.regenerate_metadata'), data: { confirm: t('layout.confirm') }, class: 'btn-warning' - - - if @repository.repository_statuses.present? - .row - hr - table.table.table-striped - thead - tr - th= t('activerecord.attributes.regeneration_status.status') - th= t('activerecord.attributes.regeneration_status.last_regenerated_status') - th= t('activerecord.attributes.regeneration_status.last_regenerated_log_sha1') - th= t('activerecord.attributes.regeneration_status.last_regenerated_at') - - unless @platform.main? - th= t('activerecord.models.platform') - tbody - - @repository.repository_statuses.sort_by{ |s| s.platform.name }.each do |status| - tr - td= t("layout.regeneration_statuses.statuses.#{status.human_status}") - td= t("layout.regeneration_statuses.last_regenerated_statuses.#{status.human_regeneration_status}") - td= link_to_file_store('regeneration.log', status.last_regenerated_log_sha1) - td= status.last_regenerated_at - - unless @platform.main? - td= status.platform.name - hr - - .row - - if @platform.main? + - if @repository.repository_statuses.present? + .row.top-space + table.table.table-striped + thead + tr + th= t('activerecord.attributes.regeneration_status.status') + th= t('activerecord.attributes.regeneration_status.last_regenerated_status') + th= t('activerecord.attributes.regeneration_status.last_regenerated_log_sha1') + th= t('activerecord.attributes.regeneration_status.last_regenerated_at') + - unless @platform.main? + th= t('activerecord.models.platform') + tbody + - @repository.repository_statuses.sort_by{ |s| s.platform.name }.each do |status| + tr + td= t("layout.regeneration_statuses.statuses.#{status.human_status}") + td= t("layout.regeneration_statuses.last_regenerated_statuses.#{status.human_regeneration_status}") + td= link_to_file_store('regeneration.log', status.last_regenerated_log_sha1) + td= status.last_regenerated_at + - unless @platform.main? + td= status.platform.name +- if @platform.main? + .row.top-space + .col-md-12 = render "shared/members_table", remove_members_path: remove_members_platform_repository_path(@platform, @repository), add_member_path: add_member_platform_repository_path(@platform, @repository), diff --git a/app/views/platforms/repositories/index.html.slim b/app/views/platforms/repositories/index.html.slim index 790bcc6cc..bf6336295 100644 --- a/app/views/platforms/repositories/index.html.slim +++ b/app/views/platforms/repositories/index.html.slim @@ -1,20 +1,14 @@ - title = title_object(@platform) - set_meta_tags title: [title, t('layout.repositories.list_header')] -- title = t('layout.repositories.list_header') + ' - ' + title -- set_meta_tags og: { title: title, - description: truncate(@platform.description, length: 255) } -- set_meta_tags twitter: { title: title, - description: truncate(@platform.description, length: 200) } = render 'submenu' if params[:platform_id] - -.container.col-md-12 - - if policy(@platform.repositories.build).create? - .row - a.btn.btn-primary href=new_platform_repository_path(@platform) - = t("layout.repositories.new") - hr - .row - - = render 'list', object: @repositories - = will_paginate @repositories +.row + .col-md-6.col-md-offset-3 + rd-widget + rd-widget-header title=t('layout.repositories.list_header') + -if policy(@platform.repositories.build).create? + a.btn.btn-primary.pull-right href=new_platform_repository_path(@platform) + = t("layout.repositories.new") + rd-widget-body class="no-padding" + = render 'list', object: @repositories + = will_paginate @repositories \ No newline at end of file diff --git a/app/views/platforms/repositories/manage_projects.html.slim b/app/views/platforms/repositories/manage_projects.html.slim new file mode 100644 index 000000000..f2c31d213 --- /dev/null +++ b/app/views/platforms/repositories/manage_projects.html.slim @@ -0,0 +1,20 @@ += render 'submenu' + +.row + .col-md-4 + .row + rd-widget + rd-widget-header title=(t("layout.repositories.add_projects_to") + ' ' + @repository.name) + rd-widget-body + = simple_form_for :repository, url: add_project_platform_repository_path(@platform, @repository), html: { method: :put } do |f| + = f.input :projects_list, as: :text + = f.button :submit, t('layout.add') + .row.top-space + rd-widget + rd-widget-header title=(t("layout.repositories.remove_projects_from") + ' ' + @repository.name) + rd-widget-body + = simple_form_for :repository, url: remove_project_platform_repository_path(@platform, @repository), html: { method: :delete } do |f| + = f.input :projects_list, as: :text + = f.button :submit, t('layout.delete'), class: 'btn-danger' + .col-md-8 + = render 'proj_list', object: @projects, repository: @repository \ No newline at end of file diff --git a/app/views/platforms/repositories/new.html.slim b/app/views/platforms/repositories/new.html.slim index 15686c75a..211d4b56f 100644 --- a/app/views/platforms/repositories/new.html.slim +++ b/app/views/platforms/repositories/new.html.slim @@ -1,9 +1,10 @@ -set_meta_tags title: [title_object(@platform), t('layout.repositories.new')] = render 'submenu' +.row -.container.col-md-offset-2.col-md-8 - h3 - = t("layout.repositories.new_header") - .row - = simple_form_for @repository, url: platform_repositories_path(@platform) do |f| - = render 'form', f: f + .col-md-offset-2.col-md-8 + rd-widget + rd-widget-header title=t("layout.repositories.new_header") + rd-widget-body + = simple_form_for @repository, url: platform_repositories_path(@platform) do |f| + = render 'form', f: f diff --git a/app/views/platforms/repositories/projects_list.html.slim b/app/views/platforms/repositories/projects_list.html.slim deleted file mode 100644 index 75a3329bf..000000000 --- a/app/views/platforms/repositories/projects_list.html.slim +++ /dev/null @@ -1,13 +0,0 @@ -= render 'submenu' - -.container.col-md-offset-2.col-md-8 - h3= raw "#{t("layout.repositories.add_projects_to")}: #{link_to @repository.name, platform_repository_path(@platform, @repository)}" - - .row - = simple_form_for :repository, url: add_project_platform_repository_path(@platform, @repository), html: { method: :put } do |f| - = f.input :projects_list, as: :text - = f.button :submit, t('layout.add') - hr - - .row - = render 'proj_list', object: @projects diff --git a/app/views/platforms/repositories/remove_project.html.slim b/app/views/platforms/repositories/remove_project.html.slim deleted file mode 100644 index 0a6ef4462..000000000 --- a/app/views/platforms/repositories/remove_project.html.slim +++ /dev/null @@ -1,10 +0,0 @@ -= render 'submenu' -/ = render 'sidebar' - -.container.col-md-offset-2.col-md-8 - h3= raw "#{t("layout.repositories.remove_projects_from")}: #{link_to @repository.name, platform_repository_path(@platform, @repository)}" - - .row - = simple_form_for :repository, url: remove_project_platform_repository_path(@platform, @repository), html: { method: :delete } do |f| - = f.input :projects_list, as: :text - = f.button :submit, t('layout.delete'), class: 'btn-danger' diff --git a/app/views/platforms/repositories/show.html.slim b/app/views/platforms/repositories/show.html.slim index b50509d7c..ad744f786 100644 --- a/app/views/platforms/repositories/show.html.slim +++ b/app/views/platforms/repositories/show.html.slim @@ -1,37 +1,25 @@ - title = title_object(@repository) - set_meta_tags title: title -- set_meta_tags og: { title: title, - description: truncate(@repository.description, length: 255) } -- set_meta_tags twitter: { title: title, - description: truncate(@repository.description, length: 200) } + = render 'submenu' -.container.col-md-12 - .row - h3 - = t("layout.repositories.about") - |   - i - = @repository.name - - p= @repository.description - .row - - if policy(@repository).update? - a.btn.btn-primary href=edit_platform_repository_path(@platform, @repository) - = t("layout.edit") - |   - - if policy(@repository).destroy? - = link_to t('layout.delete'), platform_repository_path(@platform, @repository), method: 'delete', class: 'btn btn-danger', data: { confirm: t("layout.repositories.confirm_delete") } - .row - hr - h3= t("layout.projects.list_header") - - if policy(@repository).add_project? - a.btn.btn-primary href=add_project_platform_repository_path(@platform, @repository) - = t('layout.projects.add') - |   - - if policy(@repository).remove_project? - a.btn.btn-primary href=remove_project_platform_repository_path(@platform, @repository) - = t('layout.repositories.mass_delete') - .row - hr - = render 'proj_list' +.row + .col-md-9 + = render 'proj_list', repository: @repository + .col-md-3 + rd-widget + rd-widget-header title=(t("layout.repositories.about") + " " + @repository.name) + rd-widget-body + p= @repository.description + - if policy(@repository).update? || policy(@repository).destroy? || policy(@repository).remove_project? || policy(@repository).add_project? + rd-widget-footer + - if policy(@repository).update? + a.btn.btn-primary href=edit_platform_repository_path(@platform, @repository) + = t("layout.edit") + |   + - if policy(@repository).manage_projects? + a.btn.btn-primary href=manage_projects_platform_repository_path(@platform, @repository) + = t('layout.projects.manage_projects') + |   + - if policy(@repository).destroy? + = link_to t('layout.delete'), platform_repository_path(@platform, @repository), method: 'delete', class: 'btn btn-danger', data: { confirm: t("layout.repositories.confirm_delete") } \ No newline at end of file diff --git a/app/views/projects/build_lists/_buttons.html.slim b/app/views/projects/build_lists/_buttons.html.slim index 6aee9e547..e3c147af6 100644 --- a/app/views/projects/build_lists/_buttons.html.slim +++ b/app/views/projects/build_lists/_buttons.html.slim @@ -1,32 +1,31 @@ - if policy(build_list).cancel? - .row + .row ng-show='build_list.can_cancel' = link_to t("layout.build_lists.cancel"), cancel_build_list_path(build_list), method: :put, data: { confirm: t('layout.confirm') }, - class: 'btn btn-primary', - 'ng-show' => 'build_list.can_cancel' + class: 'btn btn-primary' -.row.top-space ng-show="build_list.can_publish && build_list.status == #{BuildList::BUILD_PUBLISHED}" +.row ng-show="build_list.can_publish && build_list.status == #{BuildList::BUILD_PUBLISHED}" = submit_tag t('layout.publish_again'), data: { confirm: t("layout.publish_again_warning") }, name: 'publish', class: 'btn btn-primary' -.row.top-space ng-show="build_list.can_publish && build_list.can_publish_in_future && build_list.extra_build_lists_published && build_list.status == #{BuildList::TESTS_FAILED}" +.row ng-show="build_list.can_publish && build_list.can_publish_in_future && build_list.extra_build_lists_published && build_list.status == #{BuildList::TESTS_FAILED}" = submit_tag t('layout.publish'), data: { confirm: t('layout.build_lists.tests_failed') }, name: 'publish', class: 'btn btn-primary' -.row.top-space ng-show="build_list.can_publish && build_list.can_publish_in_future && build_list.extra_build_lists_published && build_list.status != #{BuildList::TESTS_FAILED} && build_list.status != #{BuildList::BUILD_PUBLISHED}" +.row ng-show="build_list.can_publish && build_list.can_publish_in_future && build_list.extra_build_lists_published && build_list.status != #{BuildList::TESTS_FAILED} && build_list.status != #{BuildList::BUILD_PUBLISHED}" = submit_tag t('layout.publish'), data: { confirm: t('layout.confirm') }, name: 'publish', class: 'btn btn-primary' -.row.top-space ng-show='build_list.can_publish_into_testing' +.row ng-show='build_list.can_publish_into_testing' = link_to t('layout.publish_into_testing'), publish_into_testing_build_list_path(build_list), method: :put, @@ -34,7 +33,7 @@ class: 'btn btn-primary' - if policy(build_list).reject_publish? - .row.top-space ng-show='build_list.can_reject_publish' + .row ng-show='build_list.can_reject_publish' = link_to t('layout.reject_publish'), reject_publish_build_list_path(build_list), method: :put, @@ -42,7 +41,7 @@ class: 'btn btn-primary' - if policy(build_list).rerun_tests? - .row.top-space ng-show="build_list.status == #{BuildList::TESTS_FAILED} || build_list.status == #{BuildList::SUCCESS}" + .row ng-show="build_list.status == #{BuildList::TESTS_FAILED} || build_list.status == #{BuildList::SUCCESS}" = link_to t('layout.build_lists.rerun_tests'), rerun_tests_build_list_path(build_list), method: :put, @@ -50,7 +49,7 @@ class: 'btn btn-primary' - if policy(build_list).create_container? - .row.top-space ng-show='build_list.can_create_container' + .row ng-show='build_list.can_create_container' = link_to t('layout.build_lists.create_container'), create_container_build_list_path(build_list), method: :put, @@ -58,13 +57,13 @@ class: 'btn btn-primary' - if policy(build_list).create? - .row.top-space + .row = link_to t('layout.build_lists.recreate_build_list'), new_project_build_list_path(build_list.project, build_list_id: build_list.id), class: 'btn btn-primary' - if can_run_dependent_build_lists?(build_list) - .row.top-space ng-show='build_list.dependent_projects_exists' + .row ng-show='build_list.dependent_projects_exists' = link_to t('projects.build_lists.dependent_projects.title'), dependent_projects_build_list_path(build_list), class: 'btn btn-primary' diff --git a/app/views/projects/build_lists/index.html.slim b/app/views/projects/build_lists/index.html.slim index 9055bf76c..cbbc07c41 100644 --- a/app/views/projects/build_lists/index.html.slim +++ b/app/views/projects/build_lists/index.html.slim @@ -3,7 +3,7 @@ == render 'projects/build_lists/filter' rd-widget rd-widget-header title="Build Lists {{::widgetTitle}}" icon="fa-gears" - .form-inline ng-init="autoreload=true" + .form-inline.pull-right ng-init="autoreload=true" button ng-model="autoreload" ng-click="setAutoreload(autoreload)" class="btn btn-default" uib-btn-checkbox="" = t 'layout.autoreload_page' button class="btn btn-default" ng-click="openFilters()" ng-disabled="isRequest" diff --git a/app/views/projects/build_lists/show.html.slim b/app/views/projects/build_lists/show.html.slim index ae508e9de..34a0e49fe 100644 --- a/app/views/projects/build_lists/show.html.slim +++ b/app/views/projects/build_lists/show.html.slim @@ -22,7 +22,8 @@ div[ ng-controller='BuildListController' = render 'shared/build_results', subject: @build_list .row.top-space ng-show="build_list.status == #{BuildList::BUILD_STARTED}" - = render 'shared/log', { build_started: true, get_log_path: log_build_list_path(@build_list) } + .col-md-12 + = render 'shared/log', { build_started: true, get_log_path: log_build_list_path(@build_list) } .row.top-space .col-md-10 @@ -189,4 +190,5 @@ div[ ng-controller='BuildListController' rd-widget-header title="Actions" rd-widget-body = form_for @build_list, url: publish_build_list_path(@build_list), html: {class: :"form-inline"} do |f| - = render 'buttons', build_list: @build_list \ No newline at end of file + .buttons-block + = render 'buttons', build_list: @build_list \ No newline at end of file diff --git a/app/views/projects/projects/index.html.slim b/app/views/projects/projects/index.html.slim index 26ad69ea8..3fe44edfe 100644 --- a/app/views/projects/projects/index.html.slim +++ b/app/views/projects/projects/index.html.slim @@ -1,11 +1,11 @@ .row.top-space - .col-md-6 + .col-md-6.col-md-offset-3 rd-widget div ng-controller="ProjectsController" rd-widget-header title=(t "dashboard.projects.title") icon="fa-cube" input.form-control.input-sm [ng-model="search" placeholder=(t "dashboard.projects.search") ng-change="searchProjects(search)" ng-model-options="{ debounce: 500 }"] - rd-widget-body classes="medium no-padding" loading="requesting" + rd-widget-body classes="no-padding" loading="requesting" .table-responsive table.table ng-cloak=true thead diff --git a/app/views/search/_project.html.slim b/app/views/search/_project.html.slim index 584e23c9a..7b3dee7eb 100644 --- a/app/views/search/_project.html.slim +++ b/app/views/search/_project.html.slim @@ -1,10 +1,3 @@ h4 - - if project.public? - i.fa.fa-unlock-alt.text-success> - - else - i.fa.fa-lock.text-danger> a href=project_path(project) = project.name_with_owner -.help-block - => t('.updated') - = time_ago_in_words(project.updated_at) diff --git a/app/views/search/index.html.slim b/app/views/search/index.html.slim index 5489c6b34..f86236d36 100644 --- a/app/views/search/index.html.slim +++ b/app/views/search/index.html.slim @@ -1,42 +1,25 @@ -.row - .col-md-3.col-md-offset-1 - h3 - = t('.advanced') - .col-md-7.offset10 - = simple_form_for @search, url: search_index_path, method: :get do |f| - .row - .col-md-6 - =hidden_field_tag :type, @type - = f.input :query, label: false, input_html: { name: 'query' } - .col-md-6 - = f.button :submit, t('.submit') - |   - = t('layout.or') - |   - a href=search_index_path - = t('layout.clear') +.row.top-space + .col-md-10.col-md-offset-1 + rd-widget + rd-widget-header title=t('layout.search.header') + rd-widget-body + .row + .col-md-3 + .panel.panel-default + .panel-body + ul.nav.nav-pills.nav-stacked + - t('.types').each do |k, v| + li class=('active' if k.to_s == @type) + a href=search_index_path(params.merge(type: k, page: 1)) + span.badge.pull-right + = @search.send(k).count + = v -.row - .col-md-3.col-md-offset-1 - .panel.panel-default - .panel-body - ul.nav.nav-pills.nav-stacked - - t('.types').each do |k, v| - li class=('active' if k.to_s == @type) - a href=search_index_path(params.merge(type: k, page: 1)) - span.badge.pull-right - = @search.send(k).count - = v - - - .col-md-7 - table.table.table-striped - thead - tr - th - tbody - - @collection.each do |c| - tr - td= render @type.singularize, @type.singularize.to_sym => c - = will_paginate @collection + .col-md-9 + table.table.table-striped + tbody + - @collection.each do |c| + tr + td= render @type.singularize, @type.singularize.to_sym => c + = will_paginate @collection, rd_widget_footer: true diff --git a/app/views/shared/_angularjs_paginate.html.slim b/app/views/shared/_angularjs_paginate.html.slim index a81009560..1d91b827d 100644 --- a/app/views/shared/_angularjs_paginate.html.slim +++ b/app/views/shared/_angularjs_paginate.html.slim @@ -2,13 +2,25 @@ / $scope.goToPage = (number) -> / $location.search('page', number) -uib-pagination[ boundary-links = 'true' - total-items = total_items - ng-model = page - previous-text = "‹" next-text = "›" - first-text = "«" last-text = "»" - items-per-page = per_page - max-size = 5 - rotate = 'false' - ng-show = "#{total_items} > #{per_page}" - ng-change = select_page ] +- if rd_widget_footer + rd-widget-footer ng-show = "#{total_items} > #{per_page}" + uib-pagination[ boundary-links = 'true' + total-items = total_items + ng-model = page + previous-text = "‹" next-text = "›" + first-text = "«" last-text = "»" + items-per-page = per_page + max-size = 5 + rotate = 'false' + ng-change = select_page ] +- else + uib-pagination[ boundary-links = 'true' + total-items = total_items + ng-model = page + previous-text = "‹" next-text = "›" + first-text = "«" last-text = "»" + items-per-page = per_page + max-size = 5 + rotate = 'false' + ng-show = "#{total_items} > #{per_page}" + ng-change = select_page ] \ No newline at end of file diff --git a/app/views/shared/_members_table.html.slim b/app/views/shared/_members_table.html.slim index f8ba19ff2..a7e6fef50 100644 --- a/app/views/shared/_members_table.html.slim +++ b/app/views/shared/_members_table.html.slim @@ -1,80 +1,82 @@ - update_roles_path ||= false -= form_tag remove_members_path, id: 'members_form', method: :delete do - table.table.table-striped - thead - tr - - if policy(editable_object).remove_members? - th - th - = t("layout.collaborators.members") - - if policy(editable_object).remove_members? - - if update_roles_path - th.buttons.text-center colspan=3 - = t("layout.collaborators.roles") - th.buttons - = t("layout.remove") - tbody - - if update_roles_path - - actors ||= editable_object.actors - - members.each do |user| - tr - - if policy(editable_object).remove_members? - td - = check_box_tag "members[]", user.id - td - span - = image_tag avatar_url(user), size: '30x30' - |   - = link_to user.fullname, user_path(user) - - if policy(editable_object).remove_members? - - if update_roles_path - - actor = actors.find{ |a| a.actor_id == user.id } - - Relation::ROLES.each_with_index do |role, i| - td ng-init="user_#{user.id}_role = '#{actor.role}'" - input[ - type = 'radio' - ng-model = "user_#{user.id}_role" - value = role ] - |   - = t("layout.collaborators.role_names.#{ role }") - td +rd-widget + rd-widget-header title=t("layout.collaborators.members") + rd-widget-body + = form_tag remove_members_path, id: 'members_form', method: :delete do + table.table.table-striped + thead + tr + - if policy(editable_object).remove_members? + th + th + = t("layout.collaborators.members") + - if policy(editable_object).remove_members? - if update_roles_path - - path = "#{update_roles_path}?member_id=#{user.id}" - a[ - ng-href = "{{'#{path}&role=' + user_#{user.id}_role}}" - data-method = 'put' - data-confirm = t('layout.confirm') ] + th.buttons.text-center colspan=3 + = t("layout.collaborators.roles") + th.buttons + = t("layout.remove") + tbody + - if update_roles_path + - actors ||= editable_object.actors + - members.each do |user| + tr + - if policy(editable_object).remove_members? + td + = check_box_tag "members[]", user.id + td + span + = image_tag avatar_url(user), size: '30x30' + |   + = link_to user.fullname, user_path(user) + - if policy(editable_object).remove_members? + - if update_roles_path + - actor = actors.find{ |a| a.actor_id == user.id } + - Relation::ROLES.each_with_index do |role, i| + td ng-init="user_#{user.id}_role = '#{actor.role}'" + input[ + type = 'radio' + ng-model = "user_#{user.id}_role" + value = role ] + |   + = t("layout.collaborators.role_names.#{ role }") + td + - if update_roles_path + - path = "#{update_roles_path}?member_id=#{user.id}" + a[ + ng-href = "{{'#{path}&role=' + user_#{user.id}_role}}" + data-method = 'put' + data-confirm = t('layout.confirm') ] - span.glyphicon.glyphicon-ok - |   + span.glyphicon.glyphicon-ok + |   - = link_to "#{remove_members_path}?members=#{user.id}", method: :delete, data: { confirm: t("layout.confirm") } do - span.glyphicon.glyphicon-remove - |   + = link_to "#{remove_members_path}?members=#{user.id}", method: :delete, data: { confirm: t("layout.confirm") } do + span.glyphicon.glyphicon-remove + |   - - if policy(editable_object).remove_members? - = submit_tag t('layout.delete'), class: 'btn btn-danger', data: {'disable-with' => t('layout.processing')} + - if policy(editable_object).remove_members? + = submit_tag t('layout.delete'), class: 'btn btn-danger', data: {'disable-with' => t('layout.processing')} -- if policy(editable_object).add_member? - hr + - if policy(editable_object).add_member? + rd-widget-footer + = simple_form_for :user, url: add_member_path, + html: { class: 'form-inline', ng_controller:"MembersController" }, + wrapper: :inline_form do |f| - = simple_form_for :user, url: add_member_path, - html: { class: 'form-inline' }, - wrapper: :inline_form do |f| + = hidden_field_tag 'member_id', nil, value: '{{memberId}}' + - autocomplete_path ||= autocomplete_user_uname_autocompletes_path + = f.input :uname, + input_html: { uib_typeahead: 'user.name for user in getUsers($viewValue)', + typeahead_on_select: 'select($item, $model, $label)', + ng_model: 'member' } - = hidden_field_tag 'member_id', nil, id: 'member_id_field' - - autocomplete_path ||= autocomplete_user_uname_autocompletes_path - = f.input :uname, - input_html: { 'data-ajax' => autocomplete_path, - 'data-id' => '#member_id_field', - class: 'typeahead' } + - if update_roles_path + |   + = f.input :role, + collection: options_for_collaborators_roles_select, + input_html: { name: :role }, + include_blank: false - - if update_roles_path - |   - = f.input :role, - collection: options_for_collaborators_roles_select, - input_html: { name: :role }, - include_blank: false - - |   - = f.button :submit, t('layout.add') + |   + = f.button :submit, t('layout.add') diff --git a/app/views/statistics/index.html.slim b/app/views/statistics/index.html.slim index 5cdc96eb7..aff204744 100644 --- a/app/views/statistics/index.html.slim +++ b/app/views/statistics/index.html.slim @@ -1,7 +1,7 @@ - set_meta_tags title: t('.header') .row.top-space - .col-md-8.col-md-offset-2 + .col-md-12 rd-widget rd-widget-header title=t('.header') rd-widget-body diff --git a/app/views/users/profile/_projects.html.slim b/app/views/users/profile/_projects.html.slim index a1513a3f9..7ec9cd2a2 100644 --- a/app/views/users/profile/_projects.html.slim +++ b/app/views/users/profile/_projects.html.slim @@ -1,65 +1,12 @@ -= simple_form_for :project, html: { 'ng-submit' => 'search()', id: 'search_projects_form' } do |f| - = hidden_field_tag 'subject_uname', subject.uname - - .row - - if current_user - .col-md-2 - .btn-group ng-cloak = true - button.btn.btn-default.dropdown-toggle[ type="button" - id="dropdownVisibility" - aria-expanded="false" - data-toggle="dropdown" ] - span> ng-show="visibility == 'all'" - = t('.visibilities.all') - span> ng-show="visibility == 'open'" - i.fa.fa-unlock-alt.text-success> - = t('.visibilities.open') - span> ng-show="visibility == 'hidden'" - i.fa.fa-lock.text-danger> - = t('.visibilities.hidden') - span.caret - - ul.dropdown-menu role="menu" - li role="presentation" - a.btn-link.pointer role="menuitem" tabindex="-1" ng-click="visibility = 'all'" - = t('.visibilities.all') - li role="presentation" - a.btn-link.pointer role="menuitem" tabindex="-1" ng-click="visibility = 'open'" - i.fa.fa-unlock-alt.text-success> - = t('.visibilities.open') - li role="presentation" - a.btn-link.pointer role="menuitem" tabindex="-1" ng-click="visibility = 'hidden'" - i.fa.fa-lock.text-danger> - = t('.visibilities.hidden') - - - .col-md-5 - = f.input :name, - label: false, - input_html: { ng_model: 'term' } - - .col-md-5 - => f.button :submit, t('.search') - => t('.or') - = link_to t('.clear'), subject, class: 'btn btn-default' -hr - -table.table.table-striped ng-show='!processing' - thead - tr - th - tbody - tr ng-repeat='project in projects' - td - h4 - i.fa.fa-unlock-alt.text-success> ng-if='project.public' - i.fa.fa-lock.text-danger> ng-if='!project.public' - a ng-href='{{project.path}}' - | {{project.name}} - .help-block title = '{{project.updated_at_utc}}' - => t('.updated') - | {{project.updated_at | amDateFormat:'YYYY-MM-DD HH:mm'}} ( - span am-time-ago = 'project.updated_at' - | ) - -= angularjs_paginate \ No newline at end of file +div ng-controller='ProfileController' ng-init=('init("'+subject.uname+'")') + rd-widget + rd-widget-header title=t('top_menu.projects') + input.form-control [placeholder=t("simple_form.placeholders.project.name") ng-model="project_name" ng-change="search(project_name)" ng-model-options="{debounce: 500}" ng-disabled="total_items == 0 && !term"] + rd-widget-body class="no-padding" loading="processing" + table.table.table-striped + tbody + tr ng-repeat='project in projects' + td + a ng-href='{{project.path}}' + | {{project.name}} + = angularjs_paginate rd_widget_footer: true \ No newline at end of file diff --git a/app/views/users/profile/show.html.slim b/app/views/users/profile/show.html.slim index 81c1d0b92..29a0b3241 100644 --- a/app/views/users/profile/show.html.slim +++ b/app/views/users/profile/show.html.slim @@ -4,40 +4,41 @@ .row .col-md-3.col-md-offset-1 - - size = User::AVATAR_SIZES[:big] - = image_tag avatar_url(@user, :big), - alt: @user.uname, height: size, width: size - - if @user.name.present? - h2= @user.name.truncate(20) - h3.help-block= @user.uname.truncate(20) - hr + rd-widget + - title=@user.uname.truncate(20) + (@user.name.present? ? ' (' + @user.name.truncate(20) + ')' : '') + rd-widget-header title=title + rd-widget-body + - size = User::AVATAR_SIZES[:big] + = image_tag avatar_url(@user, :big), + alt: @user.uname, height: size, width: size + hr - - if @user.professional_experience.present? - b= t('activerecord.attributes.user.professional_experience') - p= @user.professional_experience + - if @user.professional_experience.present? + b= t('activerecord.attributes.user.professional_experience') + p= @user.professional_experience - - unless @user.hide_email? - b= t('activerecord.attributes.user.email') - p= mail_to @user.email, @user.email.truncate(50), title: @user.email + - unless @user.hide_email? + b= t('activerecord.attributes.user.email') + p= mail_to @user.email, @user.email.truncate(50), title: @user.email - - if @user.site.present? - b= t('activerecord.attributes.user.site') - p= link_to @user.site.truncate(50), @user.site + - if @user.site.present? + b= t('activerecord.attributes.user.site') + p= link_to @user.site.truncate(50), @user.site - - if @user.company.present? - b= t('activerecord.attributes.user.company') - p= @user.company.truncate(50) + - if @user.company.present? + b= t('activerecord.attributes.user.company') + p= @user.company.truncate(50) - - if @user.location.present? - b= t('activerecord.attributes.user.location') - p= @user.location.truncate(50) - hr - h4= t('top_menu.groups') - - size = User::AVATAR_SIZES[:micro] - - @groups.each do |group| - p - => image_tag avatar_url(group, :micro), alt: group.uname, height: size, width: size - = link_to group.uname.truncate(20), group + - if @user.location.present? + b= t('activerecord.attributes.user.location') + p= @user.location.truncate(50) + hr + h4= t('top_menu.groups') + - size = User::AVATAR_SIZES[:micro] + - @groups.each do |group| + p + => image_tag avatar_url(group, :micro), alt: group.uname, height: size, width: size + = link_to group.uname.truncate(20), group .col-md-7 @@ -53,11 +54,14 @@ a href="#" = t('top_menu.statistics') - .offset10 ng-show="tab == 'projects'" ng-controller='ProfileController' ng-cloak = true + div ng-show="tab == 'projects'" = render 'projects', subject: @user #manage-statistics.offset10[ ng-show = "tab == 'statistics'" ng-controller = 'StatisticsController' ng-cloak = true ] - = render 'statistics' + rd-widget + rd-widget-header title=t('top_menu.statistics') + rd-widget-body + = render 'statistics' diff --git a/config/application.yml.sample b/config/application.yml.sample index 13892d90b..02e8cfa56 100644 --- a/config/application.yml.sample +++ b/config/application.yml.sample @@ -53,8 +53,8 @@ common: &common development: <<: *common - root_path: /var/rosa - git_path: /var/rosa + root_path: /share + git_path: /share tmpfs_path: /dev/shm do-not-reply-email: do-not-reply@localhost github_services: diff --git a/config/locales/models/repository.en.yml b/config/locales/models/repository.en.yml index e3ef8003c..2e9d89fd7 100644 --- a/config/locales/models/repository.en.yml +++ b/config/locales/models/repository.en.yml @@ -25,6 +25,7 @@ en: clear_warning: Attention! Cleared packages cannot be restored! regenerate_metadata: Regenerate metadata mass_delete: Mass delete + manage_projects: Manage projects personal_repositories: settings_header: Settings diff --git a/config/routes.rb b/config/routes.rb index c978249a2..33bc7ecb7 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -169,9 +169,8 @@ Rails.application.routes.draw do resources :repositories do member do - get :add_project + get :manage_projects put :add_project - get :remove_project delete :remove_project get :projects_list delete :remove_members @@ -193,7 +192,10 @@ Rails.application.routes.draw do put :cancel } end - collection { get :autocomplete_project } + collection { + get :autocomplete_project + get :project_versions + } end resources :maintainers, only: [:index] end diff --git a/lib/ext/bootstrap_link_renderer.rb b/lib/ext/bootstrap_link_renderer.rb index 577c544c9..3a5e2a5b8 100644 --- a/lib/ext/bootstrap_link_renderer.rb +++ b/lib/ext/bootstrap_link_renderer.rb @@ -13,7 +13,12 @@ class BootstrapLinkRenderer < WillPaginate::ActionView::LinkRenderer end end.join(@options[:link_separator]) - tag("ul", list_items, class: ul_class) + res = tag("ul", list_items, class: ul_class) + if @options[:rd_widget_footer] + tag("rd-widget-footer", res) + else + res + end end def container_attributes