From 33da5b4a44a458f8d0a6344945e87536a029cdc7 Mon Sep 17 00:00:00 2001
From: sw <939547590@qq.com>
Date: Wed, 29 Apr 2015 11:18:32 +0800
Subject: [PATCH 1/6] =?UTF-8?q?1=E3=80=81=E4=BD=9C=E4=B8=9A=E8=AF=84?=
=?UTF-8?q?=E8=AE=BA=E5=9B=9E=E5=A4=8D=E5=88=A0=E9=99=A4=E4=B8=8D=E5=8D=B3?=
=?UTF-8?q?=E4=BD=BF=E5=88=B7=E6=96=B0=202=E3=80=81=E5=8C=BF=E8=AF=84?=
=?UTF-8?q?=E5=BC=B9=E6=A1=86=E6=A0=B7=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/bids/_alert_anonyoms.html.erb | 4 ++--
app/views/bids/alert_anonymous_comment.js.erb | 2 +-
app/views/words/destroy.js.erb | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/app/views/bids/_alert_anonyoms.html.erb b/app/views/bids/_alert_anonyoms.html.erb
index 2f1c443f4..4da6e0a10 100644
--- a/app/views/bids/_alert_anonyoms.html.erb
+++ b/app/views/bids/_alert_anonyoms.html.erb
@@ -66,10 +66,10 @@
<% end %>
Date: Wed, 29 Apr 2015 14:29:03 +0800
Subject: [PATCH 2/6] =?UTF-8?q?=E8=AF=BE=E7=A8=8B=E8=AE=A8=E8=AE=BA?=
=?UTF-8?q?=E5=8C=BA=E4=BB=A3=E7=A0=81=E9=87=8D=E6=9E=84=20=E8=A7=A3?=
=?UTF-8?q?=E5=86=B3=E8=B7=AF=E7=94=B1=E5=8C=B9=E9=85=8D=E5=92=8CJS?=
=?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=86=B2=E7=AA=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/boards/_project_show.html.erb | 23 ---------------
.../layouts/_base_development_group.html.erb | 2 +-
app/views/layouts/_base_friend_group.html.erb | 2 +-
.../layouts/_base_research_team.html.erb | 2 +-
.../messages/_project_new_topic.html.erb | 28 +++++++++++++++++++
app/views/messages/new.html.erb | 13 +--------
public/javascripts/project.js | 11 +++++++-
7 files changed, 42 insertions(+), 39 deletions(-)
create mode 100644 app/views/messages/_project_new_topic.html.erb
diff --git a/app/views/boards/_project_show.html.erb b/app/views/boards/_project_show.html.erb
index 7c6594006..410648c15 100644
--- a/app/views/boards/_project_show.html.erb
+++ b/app/views/boards/_project_show.html.erb
@@ -1,12 +1,3 @@
-
<% if User.current.language == "zh"%>
@@ -16,20 +7,6 @@
<% end %>
-
- <% if User.current.logged? %>
- <%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %>
-
<%= l(:project_module_boards_post) %>
- <%= render :partial => 'messages/form_project', :locals => {:f => f} %>
-
- <%= l(:button_submit)%>
- <%= link_to l(:button_cancel), "#", :onclick => '$("#add-message").hide(); return false;', :class => 'grey_btn ml10 fl' %>
-
- <% end %>
-
-
- <% end %>
-
<% if !User.current.logged? %>
diff --git a/app/views/layouts/_base_development_group.html.erb b/app/views/layouts/_base_development_group.html.erb
index 9055b9a1b..6550ed874 100644
--- a/app/views/layouts/_base_development_group.html.erb
+++ b/app/views/layouts/_base_development_group.html.erb
@@ -23,7 +23,7 @@
(<%= @project.boards.first.topics.count %>)
<% end %>
<% if User.current.member_of?(@project) %>
- <%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects', :class => "subnav_green ml105" %>
+ <%= link_to "+"+l(:project_module_boards_post), new_board_message_path(@project.boards.first), :layout => 'base_projects', :class => "subnav_green ml105" %>
<% end %>
<% end%>
diff --git a/app/views/layouts/_base_friend_group.html.erb b/app/views/layouts/_base_friend_group.html.erb
index 71d375501..16ccc09e5 100644
--- a/app/views/layouts/_base_friend_group.html.erb
+++ b/app/views/layouts/_base_friend_group.html.erb
@@ -12,7 +12,7 @@
(<%= @project.boards.first.topics.count %>)
<% end %>
<% if User.current.member_of?(@project) %>
- <%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects', :class => "subnav_green ml105" %>
+ <%= link_to "+"+l(:project_module_boards_post), new_board_message_path(@project.boards.first), :layout => 'base_projects', :class => "subnav_green ml105" %>
<% end %>
<% end%>
diff --git a/app/views/layouts/_base_research_team.html.erb b/app/views/layouts/_base_research_team.html.erb
index 3f942bc40..17bf65b15 100644
--- a/app/views/layouts/_base_research_team.html.erb
+++ b/app/views/layouts/_base_research_team.html.erb
@@ -23,7 +23,7 @@
(<%= @project.boards.first.topics.count %>)
<% end %>
<% if User.current.member_of?(@project) %>
- <%= link_to "+"+l(:project_module_boards_post), project_boards_path(@project, :flag => true), :layout => 'base_projects', :class => "subnav_green ml105" %>
+ <%= link_to "+"+l(:project_module_boards_post), new_board_message_path(@project.boards.first), :layout => 'base_projects', :class => "subnav_green ml105" %>
<% end %>
<% end%>
diff --git a/app/views/messages/_project_new_topic.html.erb b/app/views/messages/_project_new_topic.html.erb
new file mode 100644
index 000000000..a8a8644c3
--- /dev/null
+++ b/app/views/messages/_project_new_topic.html.erb
@@ -0,0 +1,28 @@
+
+
+ <% if User.current.language == "zh"%>
+ <%= h @board.name %>
+ <% else %>
+ <%= l(:project_module_boards) %>
+ <% end %>
+
+
+
+<% if User.current.logged? %>
+ <%= form_for @message, :url => new_board_message_path(@board), :html => {:multipart => true, :id => 'message-form'} do |f| %>
+
<%= l(:project_module_boards_post) %>
+ <%= render :partial => 'messages/form_project', :locals => {:f => f} %>
+
+ <%= l(:button_submit)%>
+ <%= link_to l(:button_cancel), project_boards_path(@project), :class => 'grey_btn ml10 fl' %>
+
+ <% end %>
+
+
+<% else %>
+
+ <%= l(:label_user_login_project_board) %>
+ <%= link_to l(:label_user_login_new), signin_path, :class => "c_blue ml5" %>
+
+<% end %>
+
\ No newline at end of file
diff --git a/app/views/messages/new.html.erb b/app/views/messages/new.html.erb
index ec95b0df0..09a714850 100644
--- a/app/views/messages/new.html.erb
+++ b/app/views/messages/new.html.erb
@@ -1,16 +1,5 @@
<% if @project %>
-
- <%= link_to h(@board.name), :controller => 'boards', :action => 'show', :project_id => @project, :id => @board %>
- »
- <%= l(:label_message_new) %>
-
- <%= form_for @message, :url => {:action => 'new'}, :html => {:multipart => true, :id => 'message-form'} do |f| %>
- <%= render :partial => 'form', :locals => {:f => f,:is_new => true} %>
- <%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %>
- <%= preview_link({:controller => 'messages', :action => 'preview', :board_id => @board}, 'message-form' ,target='preview',{:class => 'whiteButton m3p10'} )%>
- <% end %>
-
-
+ <%= render :partial => 'project_new_topic' %>
<% elsif @course %>
<%= render :partial => 'course_new' %>
<% end %>
\ No newline at end of file
diff --git a/public/javascripts/project.js b/public/javascripts/project.js
index 795a56dd4..c2c4ab784 100644
--- a/public/javascripts/project.js
+++ b/public/javascripts/project.js
@@ -306,4 +306,13 @@ $(document).ready(function () {
$("pre").addClass("break_word");
}
- });
\ No newline at end of file
+ });
+
+//论坛提交
+function submitProjectBoard()
+{
+ if(regexSubject()&®exContent())
+ {
+ $("#message-form").submit();
+ }
+}
\ No newline at end of file
From 84a7bb5907af9df17e48530d062eb3ce173c7f37 Mon Sep 17 00:00:00 2001
From: huang
Date: Wed, 29 Apr 2015 14:57:12 +0800
Subject: [PATCH 3/6] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=B6=85=E7=BA=A7?=
=?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E4=B8=8D=E8=83=BD=E9=80=80=E5=87=BA?=
=?UTF-8?q?=E9=A1=B9=E7=9B=AE?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/_join_exit_project.html.erb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/app/views/layouts/_join_exit_project.html.erb b/app/views/layouts/_join_exit_project.html.erb
index 9cd376c60..1a757becc 100644
--- a/app/views/layouts/_join_exit_project.html.erb
+++ b/app/views/layouts/_join_exit_project.html.erb
@@ -16,7 +16,7 @@
<%= link_to " #{text}".html_safe,"javascript:void(0)" ,:onClick => "show_window();", :class => "pr_join_a",:id => "setting_project_type"%>
<% end %>
- <% if (User.current.member_of? @project) && User.current.login? &&
+ <% if (User.current.member_of? @project) && User.current.login? && !User.current.admin &&
Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.first.to_s != "Manager" %>
<%= exit_project_link(@project) %>
<% end %>
From dfcc076a7f0a0e985d03ed2b55e4d1197875fbde Mon Sep 17 00:00:00 2001
From: huang
Date: Wed, 29 Apr 2015 16:46:34 +0800
Subject: [PATCH 4/6] =?UTF-8?q?=E8=A7=92=E8=89=B2=E5=A4=9A=E9=80=89?=
=?UTF-8?q?=E7=9A=84=E6=97=B6=E5=80=99=E6=9D=83=E9=99=90=E6=8E=A7=E5=88=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/views/layouts/_join_exit_project.html.erb | 2 +-
app/views/projects/settings/_new_members.html.erb | 14 +++++++-------
2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/app/views/layouts/_join_exit_project.html.erb b/app/views/layouts/_join_exit_project.html.erb
index 1a757becc..ba3300d44 100644
--- a/app/views/layouts/_join_exit_project.html.erb
+++ b/app/views/layouts/_join_exit_project.html.erb
@@ -17,7 +17,7 @@
<% end %>
<% if (User.current.member_of? @project) && User.current.login? && !User.current.admin &&
- Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.first.to_s != "Manager" %>
+ !Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.first.to_s.include?("Manager") %>
<%= exit_project_link(@project) %>
<% end %>
diff --git a/app/views/projects/settings/_new_members.html.erb b/app/views/projects/settings/_new_members.html.erb
index 5e2c9f603..7abe6198c 100644
--- a/app/views/projects/settings/_new_members.html.erb
+++ b/app/views/projects/settings/_new_members.html.erb
@@ -18,19 +18,19 @@
<%= link_to_user_header member.principal,false,:class => "w140_h c_setting_blue fl" %>
- <%= h member.roles.sort.collect(&:to_s).join(', ') %>
- <%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member),
- :method => :put,
- :html => {:id => "member-#{member.id}-roles-form", :class => 'hol'}}
+ <%= h member.roles.sort.collect(&:to_s).join(', ') %>
+ <%= form_for(member, {:as => :membership, :remote => true, :url => membership_path(member),
+ :method => :put,
+ :html => {:id => "member-#{member.id}-roles-form", :class => 'hol'}}
) do |f| %>
- <% roles.each do |role| %>
+ <% roles.each do |role| %>
<%= check_box_tag 'membership[role_ids][]', role.id, member.roles.include?(role),
:disabled => member.member_roles.detect { |mr| mr.role_id == role.id && !mr.inherited_from.nil? } %>
<%= h role %>
- <% end %>
+ <% end %>
<%= hidden_field_tag 'membership[role_ids][]', '' %>
<% end %>
-
+
<% unless member.user_id == @project.user_id %>
编辑
<%= delete_link membership_path(member),
From 519eab76bdbe130996f1e6e9d15e6df0eca0a21e Mon Sep 17 00:00:00 2001
From: lizanle <491823689@qq.com>
Date: Wed, 29 Apr 2015 17:46:39 +0800
Subject: [PATCH 5/6] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=98=BE=E7=A4=BA?=
=?UTF-8?q?=E8=AF=BE=E7=A8=8B=E7=9A=84=E8=AF=BE=E4=BB=B6=E5=88=97=E8=A1=A8?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/api/mobile/apis/courses.rb | 12 ++++++++++++
app/api/mobile/entities/attachment.rb | 3 +++
app/services/courses_service.rb | 11 +++++++++++
3 files changed, 26 insertions(+)
diff --git a/app/api/mobile/apis/courses.rb b/app/api/mobile/apis/courses.rb
index 08c7adf10..ce02f4249 100644
--- a/app/api/mobile/apis/courses.rb
+++ b/app/api/mobile/apis/courses.rb
@@ -228,6 +228,18 @@ module Mobile
present :status, 0
end
+ desc '课程课件'
+ params do
+ requires :token, type: String
+ requires :course_id,type: Integer,desc: '课程id'
+ end
+ get ":course_id/attachments" do
+ cs = CoursesService.new
+ count = cs.course_attachments params
+ present :data, count, with: Mobile::Entities::Attachment
+ present :status, 0
+ end
+
end
end
end
diff --git a/app/api/mobile/entities/attachment.rb b/app/api/mobile/entities/attachment.rb
index 510db89be..080b24558 100644
--- a/app/api/mobile/entities/attachment.rb
+++ b/app/api/mobile/entities/attachment.rb
@@ -16,8 +16,11 @@ module Mobile
end
end
end
+ attachment_expose :id
attachment_expose :filename
attachment_expose :description
+ attachment_expose :downloads
+ attachment_expose :quotes
end
end
end
\ No newline at end of file
diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb
index e91883bee..b992665d3 100644
--- a/app/services/courses_service.rb
+++ b/app/services/courses_service.rb
@@ -428,6 +428,17 @@ class CoursesService
result
end
+ # 课程课件
+ def course_attachments params
+ result = []
+ @course = Course.find(params[:course_id])
+ @attachments = @course.attachments.order("created_on desc")
+ @attachments.each do |atta|
+ result << {:filename => atta.filename,:description => atta.description,:downloads => atta.downloads,:quotes => atta.quotes.nil? ? 0 :atta.quotes }
+ end
+ result
+ end
+
private
def show_homework_info course,bid,current_user,is_course_teacher
author_real_name = bid.author.lastname + bid.author.firstname
From bbe4c15293614be8553fc11549b5de8c3ad5700e Mon Sep 17 00:00:00 2001
From: whimlex
Date: Wed, 29 Apr 2015 17:50:35 +0800
Subject: [PATCH 6/6] =?UTF-8?q?=E9=97=AE=E9=A2=98=E8=B7=9F=E8=B8=AA?=
=?UTF-8?q?=E5=9B=BE=E7=89=87=E9=99=84=E4=BB=B6=E5=92=8C=E5=AE=9A=E4=B9=89?=
=?UTF-8?q?=E7=9A=84=E6=A0=B7=E5=BC=8F=E4=B8=8D=E4=B8=80=E6=97=B6=EF=BC=8C?=
=?UTF-8?q?=E8=B0=83=E6=95=B4=E5=9B=BE=E7=89=87=E7=BC=A9=E7=95=A5=E5=9B=BE?=
=?UTF-8?q?=E6=98=BE=E7=A4=BA=E6=96=B9=E5=BC=8F?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/helpers/application_helper.rb | 5 +--
.../attachments/_project_file_links.html.erb | 32 +++++++++++++++++++
public/stylesheets/project.css | 2 +-
3 files changed, 36 insertions(+), 3 deletions(-)
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb
index 6eb02f1cf..65ad32602 100644
--- a/app/helpers/application_helper.rb
+++ b/app/helpers/application_helper.rb
@@ -329,11 +329,12 @@ module ApplicationHelper
imagesize = attachment.thumbnail(:size => "200*200")
imagepath = named_attachment_path(attachment, attachment.filename)
if imagesize
- link_to image_tag(thumbnail_path(attachment), height: '73', width: '100'),
+ link_to image_tag(thumbnail_path(attachment), height: '73', width: '100', name: 'issue_attachment_picture'),
imagepath,
:title => attachment.filename
+
else
- link_to image_tag(imagepath , height: '73', width: '100'),
+ link_to image_tag(imagepath , height: '73', width: '100', name: 'issue_attachment_picture'),
imagepath,
:title => attachment.filename
end
diff --git a/app/views/attachments/_project_file_links.html.erb b/app/views/attachments/_project_file_links.html.erb
index 0135ee239..28fde5fe1 100644
--- a/app/views/attachments/_project_file_links.html.erb
+++ b/app/views/attachments/_project_file_links.html.erb
@@ -1,3 +1,35 @@
+
<% is_float ||= false %>
<% for attachment in attachments %>
diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css
index a62bd0389..4f9c6ec78 100644
--- a/public/stylesheets/project.css
+++ b/public/stylesheets/project.css
@@ -87,7 +87,7 @@ a.pro_mes_w{ height:20px; float:left;display:block; color:#999999;}
.pro_page_top{ font-size:14px; border-bottom:2px solid #64bdd9; margin-bottom:10px; padding-bottom:5px;}
.pro_page_tit{color:#3e4040; font-weight:bold;width:480px; float:left; font-size:14px; margin-bottom:5px;}
.pro_pic_box{ margin-left:60px; }
-.pro_pic{ width:100px; border:2px solid #CCC; margin:10px 0;}
+.pro_pic{ width:100px; height:73px;line-height:73px;border:2px solid #CCC; margin:10px 0;}
.pro_info_box{ margin-left:60px; background:#f0fbff; height:80px; padding:10px 0;}
.pro_info_box ul{}
.pro_info_box ul li{ margin-bottom:10px;}