From 1e262ec73174967d533937bf3c783f245346be44 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 11 Mar 2015 15:32:50 +0800
Subject: [PATCH 01/11] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B9=E7=9B=AE?=
=?UTF-8?q?=E4=B8=8A=E4=BC=A0=E8=B5=84=E6=BA=90=E9=93=BE=E6=8E=A5?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/controllers/files_controller.rb | 1 +
app/views/files/_project_file.html.erb | 2 +-
app/views/layouts/base_projects.html.erb | 2 +-
3 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb
index aacb32990..42fd40606 100644
--- a/app/controllers/files_controller.rb
+++ b/app/controllers/files_controller.rb
@@ -99,6 +99,7 @@ class FilesController < ApplicationController
end
def index
+ @flag = params[:flag] || false
#sort_init 'filename', 'asc'
sort_init 'created_on', 'desc'
sort_update 'created_on' => "#{Attachment.table_name}.created_on",
diff --git a/app/views/files/_project_file.html.erb b/app/views/files/_project_file.html.erb
index e204030f1..aa597f3f2 100644
--- a/app/views/files/_project_file.html.erb
+++ b/app/views/files/_project_file.html.erb
@@ -11,7 +11,7 @@
<%= link_to(l(:label_upload_files), 'javascript:void(0);', :class => 'icon m5p5 button_submit', :onclick => "$('#relation_file_div').slideUp();$('#upload_file_div').slideToggle('slow');") if User.current.allowed_to?(:manage_files, @project) %>
<%= link_to(l(:label_relation_files), 'javascript:void(0);', :onclick => "$('#upload_file_div').slideUp();$('#relation_file_div').slideToggle();", :class => 'icon m5p5 button_submit') if User.current.allowed_to?(:manage_files, @project) %>
+
">
<%= render :partial => 'new', locals: {project: @project} %>
diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb
index 64abd1306..3395e6f31 100644
--- a/app/views/layouts/base_projects.html.erb
+++ b/app/views/layouts/base_projects.html.erb
@@ -159,7 +159,7 @@
<%= link_to l(:label_course_file), project_files_path(@project), :style => "color:#3CA5C6" %>(<%= @project.attachments.count %>)
<% if User.current.logged? && User.current.member_of?(@project) %>
- <%= link_to "+上传资源", new_project_file_path(@project),:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %>
+ <%= link_to "+上传资源", project_files_path(@project, :flag => true),:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %>
<% end %>
<% end%>
From 4d58116da59b48f23661c91995c83d0f7ed6dec5 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 11 Mar 2015 15:44:22 +0800
Subject: [PATCH 02/11] =?UTF-8?q?#1997=20=E9=A1=B9=E7=9B=AE--=E5=B7=A5?=
=?UTF-8?q?=E5=85=B7=E9=9B=86=E4=B8=AD=E7=9A=84=E2=80=9C=E5=88=9B=E5=BB=BA?=
=?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E2=80=9D=E5=92=8C=E9=85=8D=E7=BD=AE?=
=?UTF-8?q?=E4=B8=AD=E2=80=9C=E6=96=B0=E5=BB=BA=E7=89=88=E6=9C=AC=E5=BA=93?=
=?UTF-8?q?=E2=80=9D=E6=89=93=E5=BC=80=E7=9A=84=E7=AA=97=E5=8F=A3=E4=B8=8D?=
=?UTF-8?q?=E4=B8=80=E6=A0=B7?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/base_projects.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb
index 3395e6f31..dbf15a566 100644
--- a/app/views/layouts/base_projects.html.erb
+++ b/app/views/layouts/base_projects.html.erb
@@ -168,7 +168,7 @@
<%= link_to l(:field_user_active_changeset), {:controller => 'repositories', :action => 'show', :id => @project.id}, :style => "color:#3CA5C6" %>
(<%= @project.repositories.count %>)
<% if User.current.logged? && User.current.member_of?(@project) %>
- <%= link_to "+创建版本库", new_project_repository_path(@project),:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %>
+ <%= link_to "+创建版本库", newrepo_project_repository_path(@project, :course => @project.project_type),:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %>
<% end %>
<% end %>
From 04e5aee3c24e6c5159b88dd7209de26c99fa67b1 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 11 Mar 2015 16:07:42 +0800
Subject: [PATCH 03/11] =?UTF-8?q?=E7=89=88=E6=9C=AC=E5=BA=93=E5=92=8C?=
=?UTF-8?q?=E6=96=B0=E5=BB=BA=E7=89=88=E6=9C=AC=E5=BA=93=E4=B8=A4=E4=B8=AA?=
=?UTF-8?q?=E4=B8=8D=E5=90=8C=E7=9A=84=E6=9D=83=E9=99=90?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/base_projects.html.erb | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb
index dbf15a566..d7f6ddeb5 100644
--- a/app/views/layouts/base_projects.html.erb
+++ b/app/views/layouts/base_projects.html.erb
@@ -167,9 +167,9 @@
<%= link_to l(:field_user_active_changeset), {:controller => 'repositories', :action => 'show', :id => @project.id}, :style => "color:#3CA5C6" %>
(<%= @project.repositories.count %>)
- <% if User.current.logged? && User.current.member_of?(@project) %>
- <%= link_to "+创建版本库", newrepo_project_repository_path(@project, :course => @project.project_type),:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %>
- <% end %>
+ <%# if User.current.logged? && User.current.member_of?(@project) && User.current.allowed_to?(:manage_repository, @project) %>
+ <%#= link_to "+创建版本库", newrepo_project_repository_path(@project, :course => @project.project_type),:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %>
+ <%# end %>
<% end %>
From 4b831c9e65fe9f0122dcc092bcd72523728f065d Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 11 Mar 2015 17:22:23 +0800
Subject: [PATCH 04/11] =?UTF-8?q?#2001=20=E9=A1=B9=E7=9B=AE--=E5=B7=A5?=
=?UTF-8?q?=E5=85=B7=E9=9B=86=E4=B8=ADwiki-=E2=80=9C=E6=9F=A5=E7=9C=8B?=
=?UTF-8?q?=E5=B7=AE=E5=88=AB=E2=80=9D=E4=B8=AD=E6=9C=89html=E6=A0=87?=
=?UTF-8?q?=E7=AD=BE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/application_helper.rb | 11 +++++++++++
app/views/wiki/diff.html.erb | 2 +-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 30b2e7a21..a36f4b183 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -1198,6 +1198,17 @@ module ApplicationHelper
html_safe
end
+ def wiki_simple_format_without_paragraph(text)
+ text.to_s.
+ gsub(/\r\n?/, "\n"). # \r\n and \r -> \n
+ gsub(/\n\n+/, "
"). # 2+ newline -> 2 br
+ gsub(/([^\n]\n)(?=[^\n])/, '\1
'). # 1 newline -> br
+ gsub(" ", " "). #gsub(/<\/?.*?>/,"").
+ gsub(/<\/?.*?>/, "").
+ gsub(""", "'").
+ html_safe
+ end
+
def lang_options_for_select(blank=true)
{ 'Chinese简体中文 '=> 'zh', :English => :en}
end
diff --git a/app/views/wiki/diff.html.erb b/app/views/wiki/diff.html.erb
index adeaa7cab..6af69db68 100644
--- a/app/views/wiki/diff.html.erb
+++ b/app/views/wiki/diff.html.erb
@@ -29,5 +29,5 @@
- <%= simple_format_without_paragraph @diff.to_html %>
+ <%= wiki_simple_format_without_paragraph @diff.to_html %>
From c36db9fd638a469c3bd8b510b18b6c7fa197aa84 Mon Sep 17 00:00:00 2001
From: huang
Date: Wed, 11 Mar 2015 22:42:42 +0800
Subject: [PATCH 05/11] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E5=B7=A6=E4=BE=A7?=
=?UTF-8?q?=E6=8C=89=E9=92=AE=E5=AE=9E=E7=8E=B0=E9=85=8D=E7=BD=AE-?=
=?UTF-8?q?=E6=A8=A1=E5=9D=97=E8=BF=9B=E8=A1=8C=E6=98=BE=E7=A4=BA/?=
=?UTF-8?q?=E9=9A=90=E8=97=8F=E7=AE=A1=E7=90=86?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/base_projects.html.erb | 29 +++++++++---------------
1 file changed, 11 insertions(+), 18 deletions(-)
diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb
index 8d39b6926..339c8aee0 100644
--- a/app/views/layouts/base_projects.html.erb
+++ b/app/views/layouts/base_projects.html.erb
@@ -137,23 +137,16 @@
<%= link_to l(:label_activity), {:controller => 'projects', :action => 'show', :id => @project.id}, :style => "color:#3CA5C6" %>
- <% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
-
- <%= link_to l(:label_issue_tracking), project_issues_path(@project), :style => "color:#3CA5C6" %>(<%= @project.issues.count %>)
-
- <% if User.current.logged? && User.current.member_of?(@project) %>
- <%= link_to "+发布问题", new_project_issue_path(@project) , :style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %>
- <% end %>
-
- <% end%>
- <% unless @project.enabled_modules.where("name = 'boards'").empty? %>
+ <% unless @project.enabled_modules.where("name = 'issue_tracking'").empty? %>
<%= link_to l(:label_issue_tracking), project_issues_path(@project), :style => "color:#3CA5C6" %>(<%= @project.issues.count %>)
- <% if User.current.member_of?(@project) %>
- <%= link_to "+"+l(:label_release_issue), new_project_issue_path(@project) , :style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %>
- <% end %>
+ <% if User.current.member_of?(@project) %>
+ <%= link_to "+"+l(:label_release_issue), new_project_issue_path(@project) , :style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %>
+ <% end %>
+ <% end %>
+ <% unless @project.enabled_modules.where("name = 'boards'").empty? %>
<%= link_to l(:project_module_boards), project_boards_path(@project), :style => "color:#3CA5C6" %>
(<%= @project.boards.first.topics.count %>)
@@ -161,16 +154,16 @@
<%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects',:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:4px;background:#28be6c;float:right;line-height:20px;" %>
<% end %>
- <% end%>
- <% unless @project.enabled_modules.where("name = 'files'").empty? %>
+ <% end%>
+ <% unless @project.enabled_modules.where("name = 'files'").empty? %>
<%= link_to l(:label_course_file), project_files_path(@project), :style => "color:#3CA5C6" %>(<%= @project.attachments.count %>)
<% if User.current.member_of?(@project) %>
<%= link_to "+"+l(:label_upload_files), new_project_file_path(@project),:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %>
<% end %>
- <% end%>
- <% unless @project.enabled_modules.where("name = 'repository'").empty? %>
+ <% end%>
+ <% unless @project.enabled_modules.where("name = 'repository'").empty? %>
<%= link_to l(:project_module_repository), {:controller => 'repositories', :action => 'show', :id => @project.id}, :style => "color:#3CA5C6" %>
(<%= @project.repositories.count %>)
@@ -178,7 +171,7 @@
<%= link_to "+"+l(:project_module_create_repository), new_project_repository_path(@project),:style => "font-size:12px;color:#fff; padding:1px 3px 3px 3px;height:18px;margin-top:3px;background:#28be6c;float:right;line-height:20px;" %>
<% end %>
- <% end %>
+ <% end %>
<%= l(:label_more) %>
From 29655838f0c5ab7cfdde1fddfbc3c66999a81164 Mon Sep 17 00:00:00 2001
From: huang
Date: Wed, 11 Mar 2015 23:50:37 +0800
Subject: [PATCH 06/11] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=B6=85=E8=BF=87?=
=?UTF-8?q?=E7=9A=84=E9=83=A8=E5=88=86=E7=94=A8=E2=80=9C=E5=B1=95=E7=A4=BA?=
=?UTF-8?q?=E6=9B=B4=E5=A4=9A=E4=BF=A1=E6=81=AF=E2=80=9D=E6=8B=89=E5=BC=80?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/base_projects.html.erb | 29 ++++++++++++++++-------
public/images/jiantou.jpg | Bin 0 -> 7528 bytes
public/stylesheets/application.css | 2 ++
3 files changed, 23 insertions(+), 8 deletions(-)
create mode 100644 public/images/jiantou.jpg
diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb
index 339c8aee0..934b4c955 100644
--- a/app/views/layouts/base_projects.html.erb
+++ b/app/views/layouts/base_projects.html.erb
@@ -50,11 +50,22 @@
return true;
}
}
+
+ // 项目描述超过展开
+ $(function(){
+ $(".subNav").click(function(){
+ $(this).toggleClass("currentDd").siblings(".subNav").removeClass("currentDd")
+ $(this).toggleClass("currentDt").siblings(".subNav").removeClass("currentDt")
+
+ // 修改数字控制速度, slideUp(500)控制卷起速度
+ $(this).next(".navContent").slideToggle(500).siblings(".navContent").slideUp(500);
+ })
+ })
- function submitSerch()
- {
- if(regexName()){$("#project_search_form").submit();}
- }
+ function show_more_msg()
+ {$("#course_description").toggleClass("course_description_none");}
+
+
<%= form_tag(projects_search_path, :method => :get, :id => "project_search_form") do %>
<%= text_field_tag 'name', params[:name], :size => 20, :onkeyup => "regexName();", :style => "float:left" %>
@@ -179,12 +190,14 @@