From 5034ddb4b644d77cb866751043392ae97c241a69 Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 7 Dec 2015 12:53:51 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=BB=84=E7=BB=87?= =?UTF-8?q?=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_org.html.erb | 56 +++++++++++++++---- .../organizations/_join_course_menu.html.erb | 5 +- .../organizations/_join_project_menu.html.erb | 5 +- .../_org_left_subfield_list.html.erb | 3 - .../organizations/join_course_menu.js.erb | 10 +++- .../organizations/join_project_menu.js.erb | 10 +++- public/stylesheets/new_user.css | 2 +- 7 files changed, 68 insertions(+), 23 deletions(-) diff --git a/app/views/layouts/base_org.html.erb b/app/views/layouts/base_org.html.erb index 67cffab28..9ca590390 100644 --- a/app/views/layouts/base_org.html.erb +++ b/app/views/layouts/base_org.html.erb @@ -18,16 +18,30 @@ <%= call_hook :view_layouts_base_html_head %> <%= yield :header_tags -%> - + + + +
- +
    - + <% if User.current.logged? %> <% else %> @@ -73,10 +87,12 @@
    <%= link_to @organization.name, organization_path(@organization.id), :class=>"pr_info_name fl c_dark fb break_word" %> - <% if @organization.is_public? %> - <%= l(:label_public)%> - <% else %> - <%= l(:label_private)%> + <% if User.current.logged? %> + <% if @organization.is_public? %> + <%= l(:label_public)%> + <% else %> + <%= l(:label_private)%> + <% end %> <% end %>
    @@ -95,10 +111,17 @@
    - <%= link_to '文章', organization_org_document_comments_path(@organization) %> ( - <%= link_to OrgDocumentComment.where("organization_id =? and parent_id is null", @organization.id).count, organization_org_document_comments_path(@organization), :class => "linkBlue" %> - ) |  - <%= link_to '成员', members_organization_path(@organization.id) %> (<%= link_to @organization.org_members.count, members_organization_path(@organization.id), :id => 'org_members_count_id', :class => "linkBlue" %>) + <%= link_to '文章', organization_org_document_comments_path(@organization) %>  + <% if User.current.logged? %> + ( + <%= link_to OrgDocumentComment.where("organization_id =? and parent_id is null", @organization.id).count, organization_org_document_comments_path(@organization), :class => "linkBlue" %> + ) + <% end %> +  |  + <%= link_to '成员', members_organization_path(@organization.id) %>  + <% if User.current.logged? %> + (<%= link_to @organization.org_members.count, members_organization_path(@organization.id), :id => 'org_members_count_id', :class => "linkBlue" %>) + <% end %>
@@ -152,6 +175,17 @@ $("#projectMenu").mouseleave(function(){ $("#topnav_project_menu").hide(); }); + + function show_homepage(id, has_homepage){ + if (has_homepage == 1) + { + window.location.href = "/organizations/" + id + "?show_homepage=1"; + } + else + { + alert("您还没有设置首页! 您可以把您喜欢的文章设为组织首页。"); + } + } diff --git a/app/views/organizations/_join_course_menu.html.erb b/app/views/organizations/_join_course_menu.html.erb index d875550de..fa507db28 100644 --- a/app/views/organizations/_join_course_menu.html.erb +++ b/app/views/organizations/_join_course_menu.html.erb @@ -22,11 +22,10 @@ -
+
请选择关联到组织的课程
-
<%=form_tag url_for(:controller => 'organizations', :action => 'join_courses', :organization_id => organization_id),:method => 'post', :id => 'join_courses_form', :remote => true,:class=>"resourcesSearchBox" do %> @@ -42,7 +41,7 @@
-
+ + $(document).ready(function(){ + $("#orgUser,#orgSwitch").click(function(){ + $(".org_login_list").toggle(); + if($("#orgArrow").attr("class") == "orgMenuArrow"){ + $("#orgArrow").attr("class","orgMenuArrow2"); + } + else { + $("#orgArrow").attr("class","orgMenuArrow") ; + } + }); + if($(".org_login_list").children().click){ + $(".org_login_list").css("display","none"); + $("#orgArrow").attr("class","orgMenuArrow"); + }; + }); + diff --git a/public/stylesheets/org.css b/public/stylesheets/org.css index 897eb8734..220120346 100644 --- a/public/stylesheets/org.css +++ b/public/stylesheets/org.css @@ -64,4 +64,8 @@ a.cancelBtn:hover {background-color:#717171; color:#ffffff;} a.linkGrey8 {color:#888888;} a.linkGrey8:hover {color:#585858;} .orgBorder {width:583px; height:21px; border-bottom:3px solid #e4e4e4; float:left;} -.orgListRow {border-bottom:1px solid #e4e4e4; padding-bottom:5px; color:#555555;} \ No newline at end of file +.orgListRow {border-bottom:1px solid #e4e4e4; padding-bottom:5px; color:#555555;} +.orgMenuArrow {background:url(../images/nav_icon.png) -10px -165px no-repeat; position:relative; display:inline-block; width:20px; height:30px;} +.orgMenuArrow2 {background:url(../images/nav_icon.png) -10px -132px no-repeat; position:relative; display:inline-block; width:20px; height:30px;} +.org_login_list{ border:1px solid #eaeaea; background:#fff; padding-left:10px; padding-bottom:10px; padding-top:8px; width:60px; left:-53px; position:absolute; z-index:9999; line-height:2; box-shadow: 0px 2px 8px rgba(146, 153, 169, 0.5); margin-top: 30px;} +#orgUserName {max-width:50px; overflow:hidden; white-space: nowrap; text-overflow: ellipsis; display:inline-block;} \ No newline at end of file From 9f30c7a44e9ebb1309950642e25d11fa51c8c64e Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Mon, 7 Dec 2015 14:37:35 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E5=A6=82=E6=9E=9C=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E7=99=BB=E9=99=86=EF=BC=8C=E4=B8=8D=E8=83=BD?= =?UTF-8?q?=E5=9C=A8=E7=BB=84=E7=BB=87=E9=A1=B5=E9=9D=A2=E4=B8=AD=EF=BC=8C?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E9=A1=B9=E7=9B=AE=E6=88=96=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/organizations/_org_left_subfield_list.html.erb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/views/organizations/_org_left_subfield_list.html.erb b/app/views/organizations/_org_left_subfield_list.html.erb index 065d362d6..cb604f6ba 100644 --- a/app/views/organizations/_org_left_subfield_list.html.erb +++ b/app/views/organizations/_org_left_subfield_list.html.erb @@ -3,7 +3,9 @@
项目 - <%=link_to "", join_project_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联项目"%> + <% if User.current.logged? %> + <%=link_to "", join_project_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联项目"%> + <% end %>
    @@ -12,7 +14,9 @@
课程 - <%=link_to "", join_course_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联课程"%> + <% if User.current.logged? %> + <%=link_to "", join_course_menu_organization_path(organization),:remote => true, :method => "post", :class => "homepageMenuSetting fr", :title => "关联课程"%> + <% end %>
    From 5eb249515c7244cdcc2600e4a68d70e463c02d60 Mon Sep 17 00:00:00 2001 From: huang Date: Mon, 7 Dec 2015 15:12:30 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=A0=B7=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/repositories/show.html.erb | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/app/views/repositories/show.html.erb b/app/views/repositories/show.html.erb index be303a2ab..259e8c185 100644 --- a/app/views/repositories/show.html.erb +++ b/app/views/repositories/show.html.erb @@ -28,10 +28,9 @@ <% unless User.current.id == @project.user_id %>
    <%= link_to "".html_safe+"Fork", {:controller => 'repositories', :action => 'forked'}, :class=>"vl_btn"%> + <%= @project.forked_count.to_i %> +
    <% end %> - <%#= link_to "My span #{@user.profile.my_data}".html_safe, "#", class: 'button white' %> - - <%= @project.forked_count.to_i %>
<% if @changesets && !@changesets.empty? %> @@ -53,12 +52,14 @@ - <%=link_to @changesets_all_count, {:action => 'changes', :path => to_path_param(@path), :id => @project, :repository_id => @repository.identifier_param, :rev => @rev,:page=>1 ,:commit_count =>"#{@changesets_all_count}"} %> 提交 - + <%=link_to @changesets_all_count, {:action => 'changes', :path => to_path_param(@path), :id => @project, + :repository_id => @repository.identifier_param, + :rev => @rev,:page=>1 , + :commit_count =>"#{@changesets_all_count}"} %> 提交
<% end %> -
+ <% if !@entries.nil? && authorize_for('repositories', 'browse') %> @@ -67,14 +68,14 @@ <%# end %> <%= render :partial => 'dir_list' %> <% end %> -<%= render_properties(@properties) %> +<%#= render_properties(@properties) %> -<%= render_properties(@properties) %> +<%#= render_properties(@properties) %> 如何提交代码 - +
<% content_for :header_tags do %> <%= stylesheet_link_tag "scm" %> <% end %>