From 326730f6b1c96f21070958bde9467f3f0a626730 Mon Sep 17 00:00:00 2001
From: huang
Date: Mon, 28 Mar 2016 10:39:09 +0800
Subject: [PATCH 001/122] =?UTF-8?q?=E5=8C=97=E6=96=97=E6=A1=86=E6=9E=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/organizations_controller.rb | 9 +-
app/views/layouts/base_org_newstyle.html.erb | 208 +++++++++++++++++++
2 files changed, 216 insertions(+), 1 deletion(-)
create mode 100644 app/views/layouts/base_org_newstyle.html.erb
diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb
index da0eb8009..6cd55be39 100644
--- a/app/controllers/organizations_controller.rb
+++ b/app/controllers/organizations_controller.rb
@@ -28,11 +28,18 @@ class OrganizationsController < ApplicationController
helper :project_score
helper :issues
include UsersHelper
- before_filter :find_organization, :only => [:show, :members, :apply_subdomain]
+ before_filter :find_organization, :only => [:show, :members, :apply_subdomain, :select_org_layout]
layout 'base_org'
def index
end
+
+ # 组织风格判定
+ # style:为0的时候为老式风格,1 为新式风格
+ def select_org_layout
+ @org.style == 0 ? 'base_org' : 'base_org_newstyle'
+ end
+
def new
@organization = Organization.new
render :layout => 'new_base'
diff --git a/app/views/layouts/base_org_newstyle.html.erb b/app/views/layouts/base_org_newstyle.html.erb
new file mode 100644
index 000000000..0296d20b4
--- /dev/null
+++ b/app/views/layouts/base_org_newstyle.html.erb
@@ -0,0 +1,208 @@
+<% @nav_dispaly_project_label = 1
+ @nav_dispaly_forum_label = 1 %>
+<%#@nav_dispaly_project_label = 1 %>
+
+
+
+
+ <%= h html_title %>
+
+
+ <%= csrf_meta_tag %>
+ <%= favicon %>
+ <%= javascript_heads %>
+ <%= heads_for_theme %>
+ <%= stylesheet_link_tag 'pleft','prettify','jquery/jquery-ui-1.9.2','header','new_user','repository','courses','org', 'share' %>
+ <%= javascript_include_tag 'cookie','project', 'organization','header','prettify','select_list_move','org'%>
+ <%= javascript_include_tag 'attachments' %>
+ <%= call_hook :view_layouts_base_html_head %>
+
+ <%= yield :header_tags -%>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <% if User.current.logged? %>
+
+
+ <% else %>
+
+
+ <% end %>
+
+
+
+
+
+
+
+
+
+
+
+
+
+ <%= image_tag(url_to_avatar(@organization),width:"60", height: "60", :id=>'nh_user_tx') %>
+ <% if User.current.logged?%>
+ <% if User.current.id == @organization.creator_id%>
+
+ <% end %>
+ <% end%>
+
+
+
+ <%= link_to truncate(@organization.name,:length => 26), organization_path(@organization.id), :class=>"pr_info_name c_dark fb break_word" %>
+ <% if User.current.logged? %>
+ <% if @organization.is_public? %>
+ <%= l(:label_public)%>
+ <% else %>
+ <%= l(:label_private)%>
+ <% end %>
+ <% end %>
+
+
+ <% if User.current.admin_of_org?(@organization) %>
+
配置
+ <% end %>
+
+
+
+
+
+
+
+
+
+
+
+
+ <%= 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 %>
+ <% if User.current.logged? %>
+ |
+ <%= 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" %>)
+ <% end %>
+
+
+
+
访问计数 <%= @organization.visits.to_i %>
+
+
+
+
+
+
+
+
+
+
+
+
+ <%= l(:label_loading) %>
+
+
+
+
+
+
From f4b4bf40ded56a0e892fbb4071328be7517530d4 Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Mon, 28 Mar 2016 11:24:31 +0800
Subject: [PATCH 002/122] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=E7=BB=84=E7=BB=87=E6=98=BE=E7=A4=BA=E6=A8=A1=E5=BC=8F=E5=AD=97?=
=?UTF-8?q?=E6=AE=B5=EF=BC=8C=E5=B9=B6=E4=B8=94=E5=9C=A8=E6=96=B0=E5=BB=BA?=
=?UTF-8?q?=E7=BB=84=E7=BB=87=E5=92=8C=E9=85=8D=E7=BD=AE=E7=BB=84=E7=BB=87?=
=?UTF-8?q?=E4=B8=AD=E8=83=BD=E5=A4=9F=E9=80=89=E6=8B=A9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/organizations_controller.rb | 2 ++
app/views/organizations/new.html.erb | 7 +++++++
app/views/organizations/setting.html.erb | 14 ++++++++++++++
...22312_add_coulumn_show_mode_to_organizations.rb | 5 +++++
...160328022623_set_show_mode_for_organizations.rb | 12 ++++++++++++
5 files changed, 40 insertions(+)
create mode 100644 db/migrate/20160328022312_add_coulumn_show_mode_to_organizations.rb
create mode 100644 db/migrate/20160328022623_set_show_mode_for_organizations.rb
diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb
index da0eb8009..80f196ba5 100644
--- a/app/controllers/organizations_controller.rb
+++ b/app/controllers/organizations_controller.rb
@@ -56,6 +56,7 @@ class OrganizationsController < ApplicationController
@organization.description = params[:organization][:description]
@organization.is_public = params[:organization][:is_public]
@organization.allow_guest_download = params[:organization][:allow_guest_download] == '1' ? 1 : 0
+ @organization.show_mode = params[:show_mode]
@organization.creator_id = User.current.id
member = OrgMember.new(:user_id => User.current.id)
@@ -120,6 +121,7 @@ class OrganizationsController < ApplicationController
# @organization.domain = params[:organization][:domain]
@organization.is_public = params[:organization][:is_public] == 'on' ? 1 : 0
@organization.allow_guest_download = params[:organization][:allow_guest_download] == 'on' ? 1 : 0
+ @organization.show_mode = params[:show_mode]
#@organization.name = params[:organization][:name]
@organization.save
respond_to do |format|
diff --git a/app/views/organizations/new.html.erb b/app/views/organizations/new.html.erb
index b0c961d82..efe481b77 100644
--- a/app/views/organizations/new.html.erb
+++ b/app/views/organizations/new.html.erb
@@ -28,6 +28,13 @@
value:"#{User.current.id.to_s + '_' +Time.now.to_s.gsub(' ','_').gsub(':','').gsub('+','')}" %>
+
+ 显示模式 :
+
+
+
+
+
diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb
index c0ca2cfe4..b11e5a780 100644
--- a/app/views/organizations/setting.html.erb
+++ b/app/views/organizations/setting.html.erb
@@ -72,6 +72,20 @@
+
+ 显示模式 :
+ <% if @organization.show_mode == 0 %>
+
+
+
+
+ <% else %>
+
+
+
+
+ <% end %>
+
公开 :
class="ml3" />
diff --git a/db/migrate/20160328022312_add_coulumn_show_mode_to_organizations.rb b/db/migrate/20160328022312_add_coulumn_show_mode_to_organizations.rb
new file mode 100644
index 000000000..11f3fa22e
--- /dev/null
+++ b/db/migrate/20160328022312_add_coulumn_show_mode_to_organizations.rb
@@ -0,0 +1,5 @@
+class AddCoulumnShowModeToOrganizations < ActiveRecord::Migration
+ def change
+ add_column :organizations, :show_mode, :integer, :default => 0
+ end
+end
diff --git a/db/migrate/20160328022623_set_show_mode_for_organizations.rb b/db/migrate/20160328022623_set_show_mode_for_organizations.rb
new file mode 100644
index 000000000..719dfc1ff
--- /dev/null
+++ b/db/migrate/20160328022623_set_show_mode_for_organizations.rb
@@ -0,0 +1,12 @@
+class SetShowModeForOrganizations < ActiveRecord::Migration
+ def up
+ Organization.transaction do
+ Organization.all.each do |org|
+ org.update_attribute(:show_mode, 0)
+ end
+ end
+ end
+
+ def down
+ end
+end
From 67ff9fb6e2cde66514800aba2c1bdc106c7387e3 Mon Sep 17 00:00:00 2001
From: ouyangxuhua
Date: Mon, 28 Mar 2016 13:03:13 +0800
Subject: [PATCH 003/122] =?UTF-8?q?=E7=BB=84=E7=BB=87=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=E6=A8=A1=E5=BC=8F=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/organizations/setting.html.erb | 15 ++++-----------
1 file changed, 4 insertions(+), 11 deletions(-)
diff --git a/app/views/organizations/setting.html.erb b/app/views/organizations/setting.html.erb
index b11e5a780..39848d192 100644
--- a/app/views/organizations/setting.html.erb
+++ b/app/views/organizations/setting.html.erb
@@ -74,17 +74,10 @@
显示模式 :
- <% if @organization.show_mode == 0 %>
-
-
-
-
- <% else %>
-
-
-
-
- <% end %>
+ />
+
+ />
+
公开 :
class="ml3" />
From 4b6b5504cabd144adc9fed212c553c668173b645 Mon Sep 17 00:00:00 2001
From: huang
Date: Mon, 28 Mar 2016 14:11:40 +0800
Subject: [PATCH 004/122] =?UTF-8?q?=E5=8C=97=E6=96=97=E6=A1=86=E6=9E=B6?=
=?UTF-8?q?=EF=BC=88=E6=9C=AA=E5=AE=8C=EF=BC=89?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/organizations_controller.rb | 2 +-
app/views/layouts/base_org_newstyle.html.erb | 584 +++++++++++++-----
public/images/org_new_style/bg.jpg | Bin 0 -> 55689 bytes
public/images/org_new_style/bg2.jpg | Bin 0 -> 31668 bytes
public/images/org_new_style/con-left1.jpg | Bin 0 -> 6345 bytes
public/images/org_new_style/con-left2.jpg | Bin 0 -> 4417 bytes
public/images/org_new_style/con-right.gif | Bin 0 -> 1894 bytes
public/images/org_new_style/detailimg1.jpg | Bin 0 -> 50723 bytes
public/images/org_new_style/detailimg2.jpg | Bin 0 -> 33550 bytes
public/images/org_new_style/detailimg3.jpg | Bin 0 -> 22446 bytes
public/images/org_new_style/detailimg4.jpg | Bin 0 -> 32803 bytes
.../org_new_style/header-background.jpg | Bin 0 -> 134016 bytes
public/images/org_new_style/icons.png | Bin 0 -> 39862 bytes
public/images/org_new_style/img1.jpg | Bin 0 -> 27550 bytes
public/images/org_new_style/img2.jpg | Bin 0 -> 25093 bytes
public/images/org_new_style/logo.jpg | Bin 0 -> 16979 bytes
public/images/org_new_style/pic1.jpg | Bin 0 -> 57968 bytes
public/images/org_new_style/pic2.jpg | Bin 0 -> 54611 bytes
public/images/org_new_style/pic3.jpg | Bin 0 -> 34750 bytes
public/images/org_new_style/slide1.png | Bin 0 -> 235600 bytes
public/images/org_new_style/slide2.png | Bin 0 -> 232903 bytes
public/stylesheets/org_new_style.css | 182 ++++++
22 files changed, 604 insertions(+), 164 deletions(-)
create mode 100644 public/images/org_new_style/bg.jpg
create mode 100644 public/images/org_new_style/bg2.jpg
create mode 100644 public/images/org_new_style/con-left1.jpg
create mode 100644 public/images/org_new_style/con-left2.jpg
create mode 100644 public/images/org_new_style/con-right.gif
create mode 100644 public/images/org_new_style/detailimg1.jpg
create mode 100644 public/images/org_new_style/detailimg2.jpg
create mode 100644 public/images/org_new_style/detailimg3.jpg
create mode 100644 public/images/org_new_style/detailimg4.jpg
create mode 100644 public/images/org_new_style/header-background.jpg
create mode 100644 public/images/org_new_style/icons.png
create mode 100644 public/images/org_new_style/img1.jpg
create mode 100644 public/images/org_new_style/img2.jpg
create mode 100644 public/images/org_new_style/logo.jpg
create mode 100644 public/images/org_new_style/pic1.jpg
create mode 100644 public/images/org_new_style/pic2.jpg
create mode 100644 public/images/org_new_style/pic3.jpg
create mode 100644 public/images/org_new_style/slide1.png
create mode 100644 public/images/org_new_style/slide2.png
create mode 100644 public/stylesheets/org_new_style.css
diff --git a/app/controllers/organizations_controller.rb b/app/controllers/organizations_controller.rb
index 6cd55be39..68bcd2b22 100644
--- a/app/controllers/organizations_controller.rb
+++ b/app/controllers/organizations_controller.rb
@@ -29,7 +29,7 @@ class OrganizationsController < ApplicationController
helper :issues
include UsersHelper
before_filter :find_organization, :only => [:show, :members, :apply_subdomain, :select_org_layout]
- layout 'base_org'
+ layout 'base_org_newstyle'
def index
end
diff --git a/app/views/layouts/base_org_newstyle.html.erb b/app/views/layouts/base_org_newstyle.html.erb
index 0296d20b4..bdfec084f 100644
--- a/app/views/layouts/base_org_newstyle.html.erb
+++ b/app/views/layouts/base_org_newstyle.html.erb
@@ -1,6 +1,3 @@
-<% @nav_dispaly_project_label = 1
- @nav_dispaly_forum_label = 1 %>
-<%#@nav_dispaly_project_label = 1 %>
@@ -12,8 +9,8 @@
<%= favicon %>
<%= javascript_heads %>
<%= heads_for_theme %>
- <%= stylesheet_link_tag 'pleft','prettify','jquery/jquery-ui-1.9.2','header','new_user','repository','courses','org', 'share' %>
- <%= javascript_include_tag 'cookie','project', 'organization','header','prettify','select_list_move','org'%>
+ <%= stylesheet_link_tag 'org_new_style' %>
+ <%= javascript_include_tag 'org'%>
<%= javascript_include_tag 'attachments' %>
<%= call_hook :view_layouts_base_html_head %>
@@ -29,138 +26,434 @@
showMathMenuMSIE: false,
tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}
});
-
+
+
+
-
-
-
-
-
- <% if User.current.logged? %>
-
-
- <% else %>
-
-
- <% end %>
-
-
-
-
-
-
-
-
-
-
-
-
- <%= image_tag(url_to_avatar(@organization),width:"60", height: "60", :id=>'nh_user_tx') %>
- <% if User.current.logged?%>
- <% if User.current.id == @organization.creator_id%>
-
- <% end %>
- <% end%>
-
-
-
- <%= link_to truncate(@organization.name,:length => 26), organization_path(@organization.id), :class=>"pr_info_name c_dark fb break_word" %>
- <% if User.current.logged? %>
- <% if @organization.is_public? %>
- <%= l(:label_public)%>
- <% else %>
- <%= l(:label_private)%>
- <% end %>
- <% end %>
-
-
- <% if User.current.admin_of_org?(@organization) %>
-
配置
- <% end %>
-
-
-
-
-
-
-
-
-
-
-
-
- <%= 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 %>
- <% if User.current.logged? %>
- |
- <%= 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" %>)
- <% end %>
-
-
-
-
访问计数 <%= @organization.visits.to_i %>
-
-
-
-
-
-
-
-