From c03ae5015e1ca26865048564dd6183b48ee5a69a Mon Sep 17 00:00:00 2001 From: George Vinogradov Date: Thu, 29 Mar 2012 20:27:33 +0400 Subject: [PATCH] [issue #195] Fixed leave button. Added participant icons. --- app/assets/images/group16.png | Bin 0 -> 941 bytes app/assets/images/group16g.png | Bin 0 -> 939 bytes app/assets/images/group32.png | Bin 0 -> 1277 bytes app/assets/images/group32g.png | Bin 0 -> 1284 bytes app/assets/images/user16.png | Bin 0 -> 667 bytes app/assets/images/user16g.png | Bin 0 -> 667 bytes app/assets/images/user32.png | Bin 0 -> 818 bytes app/assets/images/user32g.png | Bin 0 -> 818 bytes app/assets/stylesheets/design/custom.scss | 23 ++++++++++++++++++++++ app/helpers/projects_helper.rb | 12 +++++++++++ app/views/projects/_project.html.haml | 7 +++++-- app/views/projects/_project.json.jbuilder | 3 ++- app/views/projects/index.html.haml | 14 ++++++++----- config/locales/models/project.en.yml | 2 ++ config/locales/models/project.ru.yml | 2 ++ 15 files changed, 55 insertions(+), 8 deletions(-) create mode 100644 app/assets/images/group16.png create mode 100644 app/assets/images/group16g.png create mode 100644 app/assets/images/group32.png create mode 100644 app/assets/images/group32g.png create mode 100644 app/assets/images/user16.png create mode 100644 app/assets/images/user16g.png create mode 100644 app/assets/images/user32.png create mode 100644 app/assets/images/user32g.png diff --git a/app/assets/images/group16.png b/app/assets/images/group16.png new file mode 100644 index 0000000000000000000000000000000000000000..d2570824eb31d7cbd7418f278b191cf47d81edb8 GIT binary patch literal 941 zcmV;e15*5nP)KLZ*U+R`sCEkzKl)gj5&q@hY_5?)@_euSf22N!q0z{yc?Q2YY_Kym8e z5Fvwu2%hQO!{u_psMvL#(bD64NQRTZj^-}DnS22ry9f-;mW=gZvQj}U-ZdMsK&I8^7~DvX`q=i_N4!#MeLBR~lg%t&T zP~jq|h2km@#3b6Za8a8ULDaIeh!#;034^;(iXbRZXpsqFMK)=S;s~iT=Ab#gj~2cc z7e^5BtS;yL@Bf^0`CZ9z9Ci{iI}D}s;Rt{V+yh#GG;j-exj}mZxC7L=wQInl;ufz1 zSKPA>^mm-8Ie(-sd=cq?ZkADyI(U^bVwWH};#MuXFSarikf5YNMKHkOc51cm_m)u0)k) zPR*^v=a&lqm8Rt|F`K7hZzw%Jlb77fcfAQJfmgt7AogwgPdpykg;5biat%U3AN58V zA5+;FU;y2~TOc6=Z9ucvt-RFF=UX9DT%XU z!n7Qe5~-LtS;Dl7u%A?b=Pn@i0Dhm`ZrP5yQMqQ>_!Zd#o_Lpm2MS;T_dTJi$n)n8 zMs9rgzJSeoN5_W!u`*;?dJJ3@jipU~W7x&|k^ou>@EUjojBRDGt@t+pgo%`rgVbt9 P00000NkvXXu0mjf6KkH! literal 0 HcmV?d00001 diff --git a/app/assets/images/group16g.png b/app/assets/images/group16g.png new file mode 100644 index 0000000000000000000000000000000000000000..8c6790fcafadb0a25189f520fb1160fa8aa56c85 GIT binary patch literal 939 zcmV;c162HpP)KLZ*U+R`sCEkzKl)gj5&q@hY_5?)@_euSf22N!q0z{yc?Q2YY_Kym8e z5Fvwu2%hQO!{u_psMvL#(bD64NQRTZj^-}DnS22ry9f-;mW=gZvQj}U-ZdMsK&I8^7~DvX`q=iP9v}}~0v^|}oxnJ-!|e?L3x?Y~ z51ez)VPK-a<@Aw#!M(=;bMDvNlhOAV?*IXp=>sajSm;edLlx^#{~+b5LD5K8xQiRJNhZHd^78vDuFock)<@ay-=-R*RD-*~2#}BY zW4S`PK(SI>C2eVwTgnj+#PdJ_xB^`E44Q$bz!(tyu=ugHb#n_=y@iGbKwwjVwuYTd z&!?k+1q=f(fS3;S0^Q!UkQw65!dp&6dJwt*;MmrqM0^oKBB(y$ATVG6K2<#s?j-v& zOQtkKrCI@C;>#n_^Jx-I2{NS_75A?R(w;55d0on|>?|YslhU$N=F?KP_7hi=_*E5b zX=7-{8qm<{u%%Nge>Q-7Za~@qOx^5rq$6s{m8y-Y3kSIET?Uc{-~iV=Q0Ss~s3~z_ z>cKLZ*U+R`sCEkzKl)gj5&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J2uRE6j$uovi6*<&T67Cw6$ewQ+M9Id^rgd!nE8b|(8bIAOD ztx9+bs8!hl#d*c|OgfWhcIgE@0s>~eSzRvzzfW@lGQ;!Evmd~`! zKriUi3UFK8*iCl6^nIDD=8(A?fCF;P_;U(&0%y|jT3?4=Pnm0uKw2&xEcLFc}opDJ@DyFQU}x!)CPcBk}`vBU5N8K$K!sxHd92XDnAf*Jx3ifP6zH zQfKAOVnu!#XIrZH)cXmE!Clmaj~4+j>WplexS6v2<*bWem57KD zZnWK`)ae_(hNQqUiT6K0XaTcH6*BxaD~L+bmWQ1UH1#ymFAnZoBqT&h#BD8P*_fp`&CYV*+HeT~$dNCt uHGm}KLZ*U+R`sCEkzKl)gj5&q@hY_5?)@_euSf22N!q0z{yc?Q2YY_Kym8e z5Fvwu2%hQO!{u_psMvL#(bD64NQRTZj^-}DnS22ry9f-;mW=gZvQj}U-ZdMsK&I8^7~DvX`q=iq#_^v)1R)?;J+QL1jhGX70KqDqMFg=B zwDkZINFhWU3y)wW*ch-%6%f3KC>BKKU$50;mv$; z+`tI?A%4LH-r?@Fmj?u`;TgTi+r}Pt@f{a;GJu1md7&K~re+SX)pF&k1TaON@#~QL z6Yv@amO?HuF9E5 B8@&Jk literal 0 HcmV?d00001 diff --git a/app/assets/images/user16g.png b/app/assets/images/user16g.png new file mode 100644 index 0000000000000000000000000000000000000000..1f7a7508753296fb4f1a22774ca929b3d0c170a5 GIT binary patch literal 667 zcmV;M0%ZM(P)KLZ*U+R`sCEkzKl)gj5&q@hY_5?)@_euSf22N!q0z{yc?Q2YY_Kym8e z5Fvwu2%hQO!{u_psMvL#(bD64NQRTZj^-}DnS22ry9f-;mW=gZvQj}U-ZdMsK&I8^7~DvX`q=iq#_^v)1R)?;J+QL1jhGX70KqDqMHDMR zTMr0ZdV6{5s_R z1iXfUrI1U^O8{_vFJQYA5fBlVkLqF{NW|I5F17@-LGXQ3lBq5-CV|f4o002ovPDHLkV1l?2 B8>#>R literal 0 HcmV?d00001 diff --git a/app/assets/images/user32.png b/app/assets/images/user32.png new file mode 100644 index 0000000000000000000000000000000000000000..fb7a9dff8a1b75c14390e61d8f2d55cb0d21c5bf GIT binary patch literal 818 zcmV-21I_%2P)KLZ*U+R`sCEkzKl)gj5&q@hY_5?)@_euSf22N!q0z{yc?Q2YY_Kym8e z5Fvwu2%hQO!{u_psMvL#(bD64NQRTZj^-}DnS22ry9f-;mW=gZvQj}U-ZdMsK&I8^7~DvX`q=i;*l1b2|5C{kb|A0zx77AGl1^R83!te5a( zhTx-G4ECM*FQ`Xodg^%q$`Js{ArtqrCwu^S0J!%6g9tGO(;RdbKqmq~Cr<{NGyH#+ wF0q*hpcl;K8_rV%?&C)|+s)h$+=Z?N0B0&iBE={Tg8%>k07*qoM6N<$g7+I%2mk;8 literal 0 HcmV?d00001 diff --git a/app/assets/images/user32g.png b/app/assets/images/user32g.png new file mode 100644 index 0000000000000000000000000000000000000000..6c420a66f50b58bbcf92f5ee4f3c4662f7ef201b GIT binary patch literal 818 zcmV-21I_%2P)KLZ*U+R`sCEkzKl)gj5&q@hY_5?)@_euSf22N!q0z{yc?Q2YY_Kym8e z5Fvwu2%hQO!{u_psMvL#(bD64NQRTZj^-}DnS22ry9f-;mW=gZvQj}U-ZdMsK&I8^7~DvX`q=i<0WGdLD5C{lD|A3azStw)`1pfht zQWPY?sY1sNg;FWBOL1}0MbJs;n#rl?=nxRWEG-lRf{-OHrw}gQr1#!q&5#Gqa(>+R z%ln>tp0_j@3_PaF9$B;FHoW=yHaYbKP1NxMGdK%l8@=JpJN56y01{fpSJV>o^H{Pl39yZRMu2ZI0Xle}A^1m}#D0iAVKw>GCUk=hY(?{egm!U^Un%RaaGvFZ zrBQZ#j}iS<+M%au8A>yy@;|--d$P=FVf_jRSSVV8Do%sRWKj((Xy7F-@?OHv zIf4&sF4%YOzn~GJ>1h-Js6+s$giK6kPdEjb0!%zWKSGTDC participant_class(alone_member, project)} + = t("layout.collaborators.role_names.#{project.relations.by_user_through_groups(current_user).first.role}") %td.td5 - - unless project.owner == current_user + - unless project.owner == current_user or !alone_member = link_to remove_user_project_path(project), :method => :delete, :confirm => t("layout.confirm") do %span.delete   diff --git a/app/views/projects/_project.json.jbuilder b/app/views/projects/_project.json.jbuilder index 86c3d2723..a89cc7b17 100644 --- a/app/views/projects/_project.json.jbuilder +++ b/app/views/projects/_project.json.jbuilder @@ -7,7 +7,8 @@ json.project do |proj| proj.role t("layout.collaborators.role_names.#{project.relations.by_user_through_groups(current_user).first.role}").force_encoding(Encoding::UTF_8) - proj.leave_link remove_user_project_path(project) unless project.owner == current_user + 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.owner do |owner| owner.name project.owner.uname diff --git a/app/views/projects/index.html.haml b/app/views/projects/index.html.haml index 9c9bb852b..83893b761 100644 --- a/app/views/projects/index.html.haml +++ b/app/views/projects/index.html.haml @@ -2,7 +2,7 @@ - columns = [{:type => 'html'}, {:type => 'html', :sortable => false, :searchable => false}, - {:type => nil, :sortable => false, :searchable => false, :class => 'buttons'}, + {:type => nil, :sortable => false, :searchable => false, :class => 'rights'}, {:type => nil, :sortable => false, :searchable => false, :class => 'buttons'}] -#= raw datatable(columns, {:sort_by => "[0, 'asc']", :search_label => t("layout.search_by_name"), :processing => t("layout.processing"), -# :pagination_labels => {:previous => t("datatables.previous_label"), :next => t("datatables.next_label")}, @@ -44,6 +44,12 @@ '
' + owner + ' / ' + project + '
'; } + var thirdColumn = function(row) { + var project = row.project + + return '' + project.role + ''; + } + var lastColumn = function(row) { var project = row.project var res = ''; @@ -63,7 +69,7 @@ var inner = []; inner.push( firstColumn(data) ); inner.push( data.project.description ); - inner.push( data.project.role ); + inner.push( thirdColumn(data) ); inner.push( lastColumn(data) ); res.push( inner ); } @@ -113,9 +119,7 @@ return true; }); $search.live('keyup', function() { - if (this.value.length > 1) { - oTable.fnFilter(this.value); - } + oTable.fnFilter(this.value); }); }); diff --git a/config/locales/models/project.en.yml b/config/locales/models/project.en.yml index 4e1a50f05..c89796cd4 100644 --- a/config/locales/models/project.en.yml +++ b/config/locales/models/project.en.yml @@ -39,6 +39,8 @@ en: message: Message author: Author + participant_type: Part. type + current_branch: Current branch/tag current_commit: Current commit files_in_project: Files in diff --git a/config/locales/models/project.ru.yml b/config/locales/models/project.ru.yml index abc61082a..13ffe7d49 100644 --- a/config/locales/models/project.ru.yml +++ b/config/locales/models/project.ru.yml @@ -39,6 +39,8 @@ ru: message: Сообщение author: Автор + participant_type: Тип участия + current_branch: Текущая ветка/тег current_commit: Текущий коммит files_in_project: Файлы в