From 3451ced8881ec2374f1e82f869a2bb1e81337503 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Fri, 13 Nov 2015 16:34:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=88=91=E7=9A=84=E7=BB=84?= =?UTF-8?q?=E7=BB=87=E9=A1=B5=E9=9D=A2=E5=8F=8A=E4=BF=AE=E6=94=B9bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/users_controller.rb | 8 +++++ app/views/layouts/_logined_header.html.erb | 3 ++ app/views/layouts/base_org.html.erb | 22 ++++++------ .../organizations/_show_org_document.html.erb | 2 +- app/views/users/user_organizations.html.erb | 35 +++++++++++++++++++ config/routes.rb | 3 +- public/stylesheets/org.css | 8 ++++- 7 files changed, 67 insertions(+), 14 deletions(-) create mode 100644 app/views/users/user_organizations.html.erb diff --git a/app/controllers/users_controller.rb b/app/controllers/users_controller.rb index 0d9588d24..273d48ccf 100644 --- a/app/controllers/users_controller.rb +++ b/app/controllers/users_controller.rb @@ -1910,6 +1910,14 @@ class UsersController < ApplicationController end end + def user_organizations + @user = User.current + @orgs = @user.organizations + respond_to do |format| + format.html {render :layout => 'static_base'} + end + end + private def find_user diff --git a/app/views/layouts/_logined_header.html.erb b/app/views/layouts/_logined_header.html.erb index ffda9c559..6e62e2d5e 100644 --- a/app/views/layouts/_logined_header.html.erb +++ b/app/views/layouts/_logined_header.html.erb @@ -86,6 +86,9 @@
  • <%= link_to "修改资料", my_account_path, :class => "menuGrey"%>
  • +
  • + <%= link_to "我的组织", user_organizations_user_path(:id => User.current.id), :class => "menuGrey"%> +
  • <%= link_to "新建组织", new_organization_path, :class => "menuGrey"%>
  • diff --git a/app/views/layouts/base_org.html.erb b/app/views/layouts/base_org.html.erb index 55fd13e7d..39a6e4fb4 100644 --- a/app/views/layouts/base_org.html.erb +++ b/app/views/layouts/base_org.html.erb @@ -76,17 +76,17 @@
    <%= link_to "动态",organization_path(@organization), :class => "homepageMenuText" %>
    -
    项目
    -
    - -
    + + + + + + + + + + +
    diff --git a/app/views/organizations/_show_org_document.html.erb b/app/views/organizations/_show_org_document.html.erb index 03e72263b..f1c633320 100644 --- a/app/views/organizations/_show_org_document.html.erb +++ b/app/views/organizations/_show_org_document.html.erb @@ -15,7 +15,7 @@
    <%= document.title %>
    - 发帖时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %>
    + 发布时间:<%= format_activity_day(document.created_at) %> <%= format_time(document.created_at, false) %> <% unless document.content.blank? %>
    <%= document.content.html_safe %> diff --git a/app/views/users/user_organizations.html.erb b/app/views/users/user_organizations.html.erb new file mode 100644 index 000000000..855dc9c95 --- /dev/null +++ b/app/views/users/user_organizations.html.erb @@ -0,0 +1,35 @@ +<%= stylesheet_link_tag 'pleft','header','new_user','repository','org' %> +<%#= stylesheet_link_tag 'pleft','prettify','jquery/jquery-ui-1.9.2','header','new_user','repository','org' %> +
    +
    +
    +
    + 组织列表 + +
    + + +
    +
    +
    + <% @orgs.each do |org| %> +
    +
    + <%= link_to image_tag(url_to_avatar(org), :width => '78', :height => '78', :alt => '组织logo'), :class => "linkGrey2" %> +
    +
    +
    + <%= link_to org.name, organization_path(org), :class => 'f16 linkBlue' %> +
    +
    <%= org.description %>
    +
    创建者:<%= link_to User.find(org.creator_id), user_path(org.creator_id), :class => 'linkGrey2', :target => '_blank' %>
    + +
    您的身份:<%= User.current.admin_of_org?(org) ? "组织管理员" : "组织成员" %>
    +
    + +
    +
    + <% end %> +
    +
    +
    \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index b7acc3bfa..1ea62752b 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -439,6 +439,7 @@ RedmineApp::Application.routes.draw do post 'import_resources_to_homework' get 'dealwith_apply_request' get 'store_selected_resource' + get 'user_organizations' # end end #resources :blogs @@ -485,7 +486,7 @@ RedmineApp::Application.routes.draw do ################# added by william match 'users/tag_save', :via => :post, :as => 'tag' match 'users/tag_saveEx', :via => [:get, :post] - + #get 'users/:id/user_organizations', :to => 'users#user_organizations', :as => 'user_organizations' post 'watchers/watch', :to => 'watchers#watch', :as => 'watch' delete 'watchers/watch', :to => 'watchers#unwatch' get 'watchers/new', :to => 'watchers#new' diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css index 9b44be938..c8116003e 100644 --- a/public/stylesheets/org.css +++ b/public/stylesheets/org.css @@ -43,4 +43,10 @@ a.cancelBtn:hover {background-color:#717171; color:#ffffff;} .relatedList ul li {border-bottom:1px solid #e4e4e4; width:320px; height:22px; vertical-align:middle; line-height:22px;} .relatedListName {width:240px; text-align:left; max-width:240px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;} .relatedListOption {width:80px; text-align:center;} -.relateOrgName {width:240px; max-width:240px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;color:#656565;} \ No newline at end of file +.relateOrgName {width:240px; max-width:240px; overflow:hidden; white-space:nowrap; text-overflow:ellipsis;color:#656565;} + +/*组织列表*/ +.mt28 {margin-top:28px;} +.orgWrap {width:880px; float:left;} +.orgTitle {width:880px; max-width:880px; margin-bottom:5px;word-break: break-all; word-wrap:break-word; } +.orgIntro {width:880px; max-width:880px; margin-bottom:6px; color:#484848;} \ No newline at end of file