From 78d8a0a1c6fcf8d47729b1d18ea59e7b44ba70bb Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 2 Feb 2015 09:09:45 +0800
Subject: [PATCH 01/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=84=8F=E8=A7=81?=
=?UTF-8?q?=E5=8F=8D=E9=A6=88=E6=8A=98=E5=8F=A0=E5=90=8E=E8=83=8C=E6=99=AF?=
=?UTF-8?q?=E4=B8=BA=E9=80=8F=E6=98=8E?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/_base_feedback.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/layouts/_base_feedback.html.erb b/app/views/layouts/_base_feedback.html.erb
index 2039735bc..c4479b43a 100644
--- a/app/views/layouts/_base_feedback.html.erb
+++ b/app/views/layouts/_base_feedback.html.erb
@@ -8,7 +8,7 @@
html{ overflow-x:hidden;}
.custom_service p img {display: inline; margin-top:-5px; vertical-align:middle;}
-.scrollsidebar{position:absolute; z-index:999; top:150px;}
+.scrollsidebar{position:absolute; z-index:999; top:150px;background:none !important;}
.side_content{width:154px; height:auto; overflow:hidden; float:left; }
.side_content .side_list {width:154px;overflow:hidden;}
.show_btn{ width:0; height:112px; overflow:hidden; margin-top:50px; float:left; cursor:pointer;}
From a29887cfed64d5a382887cc117f281038c79f709 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Mon, 2 Feb 2015 09:43:35 +0800
Subject: [PATCH 02/10] =?UTF-8?q?=E5=85=B3=E9=97=AD=E9=97=AE=E5=8D=B7?=
=?UTF-8?q?=E5=90=8E=EF=BC=8C=E5=8F=91=E5=B8=83=E9=97=AE=E5=8D=B7=E5=92=8C?=
=?UTF-8?q?=E5=85=B6=E4=BB=96=E7=9A=84=E5=8F=91=E5=B8=83=E9=97=AE=E5=8D=B7?=
=?UTF-8?q?=E6=A1=86=E6=A1=86=E6=9C=AA=E5=AF=B9=E9=BD=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/poll/_poll.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/poll/_poll.html.erb b/app/views/poll/_poll.html.erb
index 644b678b8..33bff6258 100644
--- a/app/views/poll/_poll.html.erb
+++ b/app/views/poll/_poll.html.erb
@@ -46,7 +46,7 @@
<% else%>
-
<% for attachment in attachments %>
-
- <% if options[:length] %>
- <%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true,:length => options[:length] -%>
- <% else %>
- <%= link_to_short_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
- <% end %>
-
-
+
+
+ <% if options[:length] %>
+ <%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true,:length => options[:length] -%>
+ <% else %>
+ <%= link_to_attachment attachment, :class => 'icon icon-attachment', :download => true -%>
+ <% end %>
+
+
<% if attachment.is_text? %>
<%= link_to image_tag('magnifier.png'),
:controller => 'attachments',
@@ -19,8 +20,9 @@
<%= h(truncate(" - #{attachment.description}", length: options[:length] ? options[:length]:15, omission: '...')) unless attachment.description.blank? %>
-
(<%= number_to_human_size attachment.filesize %>)
-
+
(
+ <%= number_to_human_size attachment.filesize %>)
+
<% if options[:deletable] %>
<% if attachment.container_type == 'HomeworkAttach' %>
<%= link_to image_tag('delete.png'), {:controller => 'attachments', :action => 'delete_homework', :id => attachment.id},
@@ -39,8 +41,8 @@
<% end %>
<% end %>
<% if options[:wrap] %>
-
-
+
+
<% end %>
<% if options[:author] %>
From 26b1f9f43356e75a0006db48b8ebd90e779bc138 Mon Sep 17 00:00:00 2001
From: huang
Date: Tue, 3 Feb 2015 11:24:46 +0800
Subject: [PATCH 10/10] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BC=81=E4=B8=9A?=
=?UTF-8?q?=E7=89=88=E4=B8=AD=E5=AD=98=E5=9C=A8=E7=9A=84=E4=B8=80=E4=BA=9B?=
=?UTF-8?q?bug=20=E6=9C=80=E5=A4=9A=E5=8F=AA=E6=98=BE=E7=A4=BA=E5=8D=81?=
=?UTF-8?q?=E4=B8=AA=E9=A1=B9=E7=9B=AE=20=E6=8F=90=E7=A4=BA=E7=9A=84?=
=?UTF-8?q?=E6=A0=B7=E5=BC=8F=20=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/welcome_controller.rb | 26 +++++++++++++++++---------
app/views/organizations/index.html.erb | 6 +++---
app/views/welcome/index.html.erb | 6 +++---
3 files changed, 23 insertions(+), 15 deletions(-)
diff --git a/app/controllers/welcome_controller.rb b/app/controllers/welcome_controller.rb
index 144199b86..9001546dc 100644
--- a/app/controllers/welcome_controller.rb
+++ b/app/controllers/welcome_controller.rb
@@ -25,22 +25,30 @@ class WelcomeController < ApplicationController
before_filter :entry_select, :only => [:index]
def index
- unless params[:project].nil?
- @cur_projects = Project.find(params[:project])
- @organization = @cur_projects.enterprise_name
- @organization_projects = Project.find_by_sql(["select * from projects where enterprise_name =? ", @organization])
+ # 企业版定制: params[:project]为传过来的参数
+ unless params[:organization].nil?
+ @cur_projects = Project.find(params[:organization])
+ @organization = @cur_projects.enterprise_name
+ @organization_projects = current_user.admin? ? Project.where("enterprise_name =? ", @organization) : Project.all_public.where("enterprise_name =? ", @organization)
@e_count = @organization_projects.count
+ @part_projects = []
+ # 取十个
+ @organization_projects.each do |obj|
+ break if(@organization_projects[10] == obj)
+ @part_projects << Project.visible.find_by_id("#{obj.id}") unless obj.id.nil?
+ end
+ # 不够十个的用最火项目替代
+ @e_count < 9 ? @part_projects = find_miracle_project( 9 - @e_count, 3,"score desc") : @part_projects
+ # 配置文件首页定制
@enterprise_page = FirstPage.find_by_page_type('enterprise')
if @enterprise_page.nil?
@enterprise_page = FirstPage.new
@enterprise_page.page_type = 'enterprise'
end
- if @e_count < 9
- part_count = 9 - @e_count
- # @part_projects = find_all_hot_project part_count, order
- @part_projects = find_miracle_project(part_count, 3,"score desc")
- end
+ # 主页配置部分结束
+
end
+ # end 企业版定制结束
if @first_page.nil? || @first_page.sort_type.nil?
@projects = find_miracle_project(10, 3,"score desc")
else
diff --git a/app/views/organizations/index.html.erb b/app/views/organizations/index.html.erb
index 3e0e507c5..45813ced5 100644
--- a/app/views/organizations/index.html.erb
+++ b/app/views/organizations/index.html.erb
@@ -5,11 +5,11 @@
<% if @projects.count == 0 %>
<%= l(:label_enterprise_nil) %>
<% else %>
- <% @projects.each do |project| %>
- <% unless project.enterprise_name.blank? %>
+ <% @projects.each do |organization| %>
+ <% unless organization.enterprise_name.blank? %>
-
- <%= link_to project.enterprise_name, home_path(:project => project) %>
+ <%= link_to organization.enterprise_name, home_path(:organization => organization) %>
<% end %>
<% end %>
diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb
index 30f9f01bb..3e0a50ceb 100644
--- a/app/views/welcome/index.html.erb
+++ b/app/views/welcome/index.html.erb
@@ -48,7 +48,7 @@
<% end %>
<% else %>
- <%= link_to @organization, options={:action => 'index', :enterprise => @organization}, html_options={ :method => 'get', :style => "color: #E8770D"} %>
+ <%= @organization %>
@@ -87,7 +87,7 @@
<% else %>
<% if @e_count == 0 %>
- <%= l(:label_enterprise_tips) %>
+ <%= l(:label_enterprise_tips) %>
<% @projects.map do |project| %>
<%= render :partial => 'hot_projects_list', :locals => {:project => project} %>
<% end %>
@@ -95,7 +95,7 @@
<% @organization_projects.map do |project| %>
<%= render :partial => 'hot_projects_list', :locals => {:project => project} %>
<% end %>
- <%= l(:label_part_enterprise_tips) %>
+ <%= l(:label_part_enterprise_tips) %>
<% @part_projects.map do |project| %>
<%= render :partial => 'hot_projects_list', :locals => {:project => project} %>
<% end %>