From b5719aca8ec83f6b5baf3d326e85bb9b0f88028c Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 14 May 2015 14:38:22 +0800 Subject: [PATCH 01/17] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A6=96=E9=A1=B5?= =?UTF-8?q?=E6=88=91=E8=A6=81=E6=8F=90=E9=97=AE=E5=90=8E=E6=96=B0=E5=BB=BA?= =?UTF-8?q?=E5=B8=96=E5=AD=90=E6=98=BE=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/memos/_topic_form.html.erb | 12 +++++------ app/views/memos/new.html.erb | 32 ++++++++++++++-------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/app/views/memos/_topic_form.html.erb b/app/views/memos/_topic_form.html.erb index 3ce8cdf9a..6ce63bef6 100644 --- a/app/views/memos/_topic_form.html.erb +++ b/app/views/memos/_topic_form.html.erb @@ -2,15 +2,15 @@
<%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> -

<%= f.text_field :subject, :required => true, :size => 95 %>

+

<%= f.text_field :subject, :required => true, :size => 95, :style => 'width:98%' %>

<%= f.kindeditor :content,:width=>'99%', :required => true %>

-
+
-

- <%= l(:label_attachment_plural) %>
- <%= render :partial => 'attachments/form', :locals => {:container => @memo} %> -

+ +
+ <%= render :partial => 'attachments/form', :locals => {:container => @memo} %> +
<%= f.submit :value => l(:label_memo_create), :style => "margin-left: 100px;"%> <%= link_to l(:button_back), forum_path(@forum) %>
<% end %> \ No newline at end of file diff --git a/app/views/memos/new.html.erb b/app/views/memos/new.html.erb index b884df909..8a1863047 100644 --- a/app/views/memos/new.html.erb +++ b/app/views/memos/new.html.erb @@ -5,22 +5,22 @@ <% @nav_dispaly_forum_label = 1%> <%= javascript_include_tag "/assets/kindeditor/kindeditor" %> -
- - - - - - - - - - -
<%= l(:label_projects_community)%><%= l(:label_user_location) %> : - -
<%= link_to request.host()+"/forums", forums_path %>

<%=link_to l(:label_home),home_path %> > <%=link_to l(:label_forum), :controller => 'forums', :action => 'index' %> > <%=link_to @forum.name %>

-
+
+ + + + + + + + + + +
<%= l(:label_projects_community)%><%= l(:label_user_location) %> : + +
<%= link_to request.host()+"/forums", forums_path %>

<%=link_to l(:label_home),home_path %> > <%=link_to l(:label_forum), :controller => 'forums', :action => 'index' %> > <%=link_to @forum.name %>

+

<%=l(:label_memo_new)%>

From 963a21283f094f338ed66a744b5271a304d50e21 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 14 May 2015 15:09:15 +0800 Subject: [PATCH 02/17] =?UTF-8?q?1=E3=80=81=E4=BF=AE=E6=94=B9=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E6=89=93=E5=88=86=E6=8F=92=E4=BB=B6=E6=98=9F=E6=98=9F?= =?UTF-8?q?=E7=A7=BB=E4=BD=8D=202=E3=80=81=E4=BF=AE=E6=94=B9=E8=BF=94?= =?UTF-8?q?=E8=BF=98=E6=89=B9=E6=94=B9=E7=BB=93=E6=9E=9C=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attachments/_homework_jour_link.html.erb | 2 +- app/views/homework_attach/_addjour.html.erb | 2 +- public/stylesheets/css.css | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/views/attachments/_homework_jour_link.html.erb b/app/views/attachments/_homework_jour_link.html.erb index e0efa211c..8721d41ac 100644 --- a/app/views/attachments/_homework_jour_link.html.erb +++ b/app/views/attachments/_homework_jour_link.html.erb @@ -13,6 +13,6 @@ :target => "_blank"%>
<% end %> -
+
<% end %>
diff --git a/app/views/homework_attach/_addjour.html.erb b/app/views/homework_attach/_addjour.html.erb index c6a08209c..7dbaa0017 100644 --- a/app/views/homework_attach/_addjour.html.erb +++ b/app/views/homework_attach/_addjour.html.erb @@ -59,7 +59,7 @@ 文件: -
+
<%= render :partial => 'attachments/form' %>
diff --git a/public/stylesheets/css.css b/public/stylesheets/css.css index ea42f7887..ebb290597 100644 --- a/public/stylesheets/css.css +++ b/public/stylesheets/css.css @@ -86,7 +86,7 @@ a.wzan_visited{background:url(images/pic_zan.png) 0 0 no-repeat;} .ping_con h2{ font-size:14px; color:#444443; margin-bottom:10px; } .ping_con p{ color:#777777; font-size:12px; border-bottom:1px dashed #CCC; padding-bottom:5px;} .ping_con p span a{ color:#777777;} -.ping_star{ width:185px; color:#333; font-weight:bold; margin-bottom:5px;} +.ping_star{ width:195px; color:#333; font-weight:bold; margin-bottom:5px;} .ping_star span a{ float:right; width:20px; height:20px; background:url(images/star.png);background-repeat: no-repeat; margin-right:3px;} .ping_con textarea{ height:76px; border:1px solid #15bccf; margin-bottom:5px; color:#666; font-size:12px;} a.ping_sub{ float:right; height:22px; width:60px; margin-right:20px; background:#15bccf; color:#fff; text-align:center;} From 72ef4e1db4bf56e8c0aeca354425ef72b97f5eb9 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Thu, 14 May 2015 15:11:20 +0800 Subject: [PATCH 03/17] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AE=A8=E8=AE=BA?= =?UTF-8?q?=E5=8C=BA=E7=BC=96=E8=BE=91=E6=98=AF=E4=B8=BB=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E5=86=85=E5=AE=B9=E4=B8=BA=E7=A9=BA=E6=97=B6=E6=8A=A5=E9=94=99?= =?UTF-8?q?=E4=BB=A5=E5=8F=8A=E5=8A=A8=E6=80=81=E9=A1=B5=E9=9D=A2=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E9=97=AE=E9=A2=98=20Signed-off-by:=20alan=20<54753343?= =?UTF-8?q?4@qq.com>?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/boards/_course_new.html.erb | 2 +- app/views/boards/_course_show.html.erb | 2 +- app/views/boards/_edit.html.erb | 2 +- app/views/boards/_form_course.html.erb | 12 +++--- app/views/boards/_form_project.html.erb | 16 +++---- app/views/boards/_project_show.html.erb | 19 +-------- app/views/boards/show.html.erb | 30 +++++++++++--- app/views/courses/show.html.erb | 2 +- app/views/projects/show.html.erb | 4 +- public/javascripts/course.js | 55 +++++++++++++------------ public/javascripts/project.js | 39 +++++++++++------- public/stylesheets/project.css | 2 +- 12 files changed, 98 insertions(+), 87 deletions(-) diff --git a/app/views/boards/_course_new.html.erb b/app/views/boards/_course_new.html.erb index fba80127b..a380ad67f 100644 --- a/app/views/boards/_course_new.html.erb +++ b/app/views/boards/_course_new.html.erb @@ -3,7 +3,7 @@ <%= render :partial => 'form_course', :locals => {:f => f, :topic => @message} %>
  • <%= l(:button_cancel) %> - <%= l(:button_submit)%> + <%= l(:button_submit)%>
  • <% end %> diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index 5dde6c460..19d0e6bc9 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -32,7 +32,7 @@

    讨论区共有<%= @topic_count %>个帖子

    <% if @topics.any? %> <% @topics.each do |topic| %> -
    +
    <%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %>
    <% author = topic.author.to_s + ":" %> diff --git a/app/views/boards/_edit.html.erb b/app/views/boards/_edit.html.erb index 15358c03a..a9acbf85f 100644 --- a/app/views/boards/_edit.html.erb +++ b/app/views/boards/_edit.html.erb @@ -12,7 +12,7 @@ } do |f| %> <%= render :partial => 'form_project', :locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %> - <%= l(:button_submit)%> + <%= l(:button_submit)%> <%= l(:button_cancel) %> <%#= link_to l(:button_cancel), board_message_url(topic.board, topic.root, :r => (topic.parent_id && topic.id)), :class => "blue_btn grey_btn fl c_white" %> diff --git a/app/views/boards/_form_course.html.erb b/app/views/boards/_form_course.html.erb index 09ee1c3b4..945f58c22 100644 --- a/app/views/boards/_form_course.html.erb +++ b/app/views/boards/_form_course.html.erb @@ -8,16 +8,16 @@ <%= f.text_field :subject, { size: 60, id: "message_subject",:class=>"talk_input w585" }.merge(extra_option) %> -

    +

    <% else %>
  • - <%= f.text_field :subject, { size: 60, id: "message_subject", onkeyup: "regexSubject();",:class=>"talk_input w585" }.merge(extra_option) %> + <%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}", onkeyup: "regexSubject('#{f.object.id}');",:class=>"talk_input w585" }.merge(extra_option) %> -

    +

  • <% end %>
  • @@ -40,12 +40,12 @@ <% end %> <%= text_area :quote,:quote,:style => 'display:none' %> <% if replying%> - <%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)", :style=>"width: 575px;" %> + <%= f.text_area :content, :class => 'talk_text fl', :id => "message_content#{f.object.id}", :onkeyup => "regexContent('#{f.object.id}');", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)", :style=>"width: 575px;" %> <% else %> - <%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %> + <%= f.text_area :content, :class => 'talk_text fl', :id => "message_content#{f.object.id}", :onkeyup => "regexContent('#{f.object.id}');", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %> <% end %>
    -

    +

  • diff --git a/app/views/boards/_form_project.html.erb b/app/views/boards/_form_project.html.erb index 3ecffa3e2..8288debe2 100644 --- a/app/views/boards/_form_project.html.erb +++ b/app/views/boards/_form_project.html.erb @@ -5,19 +5,19 @@
  • - <%= f.text_field :subject, { size: 60, id: "message_subject",:class=>"talk_input w585" }.merge(extra_option) %> + <%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}",:class=>"talk_input w585" }.merge(extra_option) %> -

    +

  • <% else %>
  • - <%= f.text_field :subject, { size: 60, id: "message_subject", onkeyup: "regexSubject();",:class=>"talk_input w585" }.merge(extra_option) %> + <%= f.text_field :subject, { size: 60, id: "message_subject#{f.object.id}", onkeyup: "regexSubject('#{f.object.id}');",:class=>"talk_input w585" }.merge(extra_option) %> -

    +

  • <% end %>
  • @@ -36,16 +36,16 @@
  • <% unless replying %> - + <% end %> <%= text_area :quote,:quote,:style => 'display:none' %> <% if replying%> - <%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)", :style=>"width: 575px;" %> + <%= f.text_area :content, :class => 'talk_text fl', :id => "message_content#{f.object.id}", :onkeyup => "regexContent('#{f.object.id}');", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)", :style=>"width: 575px;" %> <% else %> - <%= f.text_area :content, :class => 'talk_text fl', :id => 'message_content', :onkeyup => "regexContent();", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %> + <%= f.text_area :content, :class => 'talk_text fl', :id => "message_content#{f.object.id}", :onkeyup => "regexContent('#{f.object.id}');", :maxlength => 5000,:placeholder => "最多3000个汉字(或6000个英文字符)" %> <% end %>
    -

    +

  • diff --git a/app/views/boards/_project_show.html.erb b/app/views/boards/_project_show.html.erb index 8a9ffd990..63bb66a6a 100644 --- a/app/views/boards/_project_show.html.erb +++ b/app/views/boards/_project_show.html.erb @@ -33,7 +33,7 @@ <% if @topics.any? %> <% @topics.each do |topic| %> -
    +
    <%= link_to image_tag(url_to_avatar(topic.author), :width=>"42",:height=>"42"), user_path(topic.author),:class =>'talkmain_pic fl' %>
    <% author = topic.author.to_s + ":" %> @@ -215,20 +215,5 @@ $("#message_form").submit(); } } - function regexContent() - { - var content = $.trim($("#message_content").val()); - if(content.length ==0) - { - $("#message_content_span").text("<%= l(:label_reply_empty) %>"); - $("#message_content_span").css('color','#ff0000'); - flag = false; - } - else - { - $("#message_content_span").text("<%= l(:label_field_correct) %>"); - $("#message_content_span").css('color','#008000'); - flag = true; - } - } + \ No newline at end of file diff --git a/app/views/boards/show.html.erb b/app/views/boards/show.html.erb index 2e736bdf7..c111aeaf0 100644 --- a/app/views/boards/show.html.erb +++ b/app/views/boards/show.html.erb @@ -25,14 +25,29 @@ <% if @project %> <%= render :partial => 'project_show', locals: {project: @project} %> diff --git a/app/views/courses/show.html.erb b/app/views/courses/show.html.erb index 2a818b892..29e7f1097 100644 --- a/app/views/courses/show.html.erb +++ b/app/views/courses/show.html.erb @@ -15,7 +15,7 @@   <%= l(:label_new_activity) %>: <%= link_to "#{eventToLanguageCourse(e.event_type, @course)} "<< format_activity_title(e.event_title), (e.event_type.eql?("attachment")&&e.container.kind_of?(Course)) ? course_files_path(e.container) : - (e.event_type.eql?("bid") ? homework_course_path(@course) : e.event_url),:class => "problem_tit c_dblue fl fb"%> + (e.event_type.eql?("bid") ? homework_course_path(@course) : (e.event_type.eql?("message") ? course_boards_path(@course,:topic_id => e.id) : e.event_url)),:class => "problem_tit c_dblue fl fb"%>

    <%= e.event_description.html_safe %>
    diff --git a/app/views/projects/show.html.erb b/app/views/projects/show.html.erb index abc63601e..6aab0a4a9 100644 --- a/app/views/projects/show.html.erb +++ b/app/views/projects/show.html.erb @@ -66,9 +66,7 @@ <%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %> <%= l(:label_new_activity) %> : <%= link_to format_activity_title("#{act.board.name}: #{act.subject}"), - {:controller => 'messages', - :action => 'show', - :board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}), + project_boards_path(@project,:topic_id => act.id), :class => "problem_tit fl fb " %>

    <%= textAreailizable act,:content %>
    diff --git a/public/javascripts/course.js b/public/javascripts/course.js index f0b1338da..227048ef6 100644 --- a/public/javascripts/course.js +++ b/public/javascripts/course.js @@ -151,45 +151,48 @@ function submit_edit_course(id) /////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////课程讨论区 -function regexSubject() -{ - var content = $.trim($("#message_subject").val()); - if(content.length ==0) - { - $("#subject_span").text("主题不能为空"); - $("#subject_span").css('color','#ff0000'); +function regexSubject(id) { + var subjectid = "#message_subject" + id ; + var content = $.trim($(subjectid).val()); + var message = "#subject_span" + id; + if (content.length == 0) { + $(message).text("主题不能为空"); + $(message).css('color', '#ff0000'); return false; } - else - { - $("#subject_span").text("填写正确"); - $("#subject_span").css('color','#008000'); + else { + $(message).text("填写正确"); + $(message).css('color', '#008000'); return true; } return false; } -function regexContent() -{ - var content = message_content_editor.html(); - if(content.length ==0) - { - $("#message_content_span").text("描述不能为空"); - $("#message_content_span").css('color','#ff0000'); +function regexContent(id) { + var contentid = "#message_content" + id; + var message = "#message_content_span"+ id; + var content = $.trim($(contentid).val()); + if (content.length == 0) { + $(message).text("描述不能为空"); + $(message).css('color', '#ff0000'); return false; } - else - { - $("#message_content_span").text("填写正确"); - $("#message_content_span").css('color','#008000'); + else { + $(message).text("填写正确"); + $(message).css('color', '#008000'); return true; } return false; } -function submitCoursesBoard() -{ - message_content_editor.sync(); - if(regexSubject()&®exContent()){$("#message-form").submit();} + +// 项目讨论区编辑和提交 +function submitProjectsBoard(id) { + var formid = "#message-form" + id; + if (regexSubject(id) && regexContent(id)) { + $(formid).submit(); + } } + + /////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////// 课程通知 function regexTitle() diff --git a/public/javascripts/project.js b/public/javascripts/project.js index 0bc094b1d..c892f964b 100644 --- a/public/javascripts/project.js +++ b/public/javascripts/project.js @@ -144,42 +144,49 @@ $(function(){ /////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////项目讨论区 -function regexSubject() { - var content = $.trim($("#message_subject").val()); +function regexSubject(id) { + var subjectid = "#message_subject" + id ; + var content = $.trim($(subjectid).val()); + var message = "#subject_span" + id; if (content.length == 0) { - $("#subject_span").text("主题不能为空"); - $("#subject_span").css('color', '#ff0000'); + $(message).text("主题不能为空"); + $(message).css('color', '#ff0000'); return false; } else { - $("#subject_span").text("填写正确"); - $("#subject_span").css('color', '#008000'); + $(message).text("填写正确"); + $(message).css('color', '#008000'); return true; } return false; } -function regexContent() { - var content = $.trim($("#message_content").val()); +function regexContent(id) { + + var contentid = "#message_content" + id; + var message = "#message_content_span"+ id; + var content = $.trim($(contentid).val()); if (content.length == 0) { - $("#message_content_span").text("描述不能为空"); - $("#message_content_span").css('color', '#ff0000'); + alert(message); + $(message).text("描述不能为空"); + $(message).css('color', '#ff0000'); return false; } else { - $("#message_content_span").text("填写正确"); - $("#message_content_span").css('color', '#008000'); + + $(message).text("填写正确"); + $(message).css('color', '#008000'); return true; } return false; } // 项目讨论区编辑和提交 -function submitProjectsBoard() { - if (regexSubject() && regexContent()) { - $("#message-form").submit(); +function submitProjectsBoard(id) { + var formid = "#message-form" + id; + if (regexSubject(id) && regexContent(id)) { + $(formid).submit(); } } - // 提交新闻 function regexTitle() { var name = $("#news_title").val(); diff --git a/public/stylesheets/project.css b/public/stylesheets/project.css index 14a7a9a34..3b04e23bf 100644 --- a/public/stylesheets/project.css +++ b/public/stylesheets/project.css @@ -738,6 +738,6 @@ a:hover.Reply_pic{border:1px solid #64bdd9;} .Replybox{ float:left; width:495px; margin-left:5px;} .talk_nextpage{ border:none; width:410px; margin:0 auto;} .newtalk { margin-top:8px; margin-right:8px;} -.talk_new{ border-bottom:1px dashed #d9d9d9; padding-bottom:10px;} + #about_newtalk{ display:none;} From 8d44ed2189456f5aa79030a309398c60d56a134b Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 14 May 2015 15:17:30 +0800 Subject: [PATCH 04/17] =?UTF-8?q?=E8=AF=BE=E7=A8=8B--=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=EF=BC=9A=E5=8F=96=E6=B6=88=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=EF=BC=8C=E5=BA=94=E8=AF=A5=E8=BF=94=E5=9B=9E?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E8=AF=A6=E6=83=85=E9=A1=B5=E9=9D=A2=EF=BC=8C?= =?UTF-8?q?=E8=80=8C=E9=9D=9E=E4=B8=80=E4=B8=AA=E7=A9=BA=E7=99=BD=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/news/_course_form.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/news/_course_form.html.erb b/app/views/news/_course_form.html.erb index a76d84701..32c8e368e 100644 --- a/app/views/news/_course_form.html.erb +++ b/app/views/news/_course_form.html.erb @@ -29,7 +29,7 @@ <%= link_to l(:button_cancel), course_news_index_path(@course), :onclick => '$("#add-news").hide()', :class => 'blue_btn grey_btn fl c_white' %> <% else %> <%= link_to l(:button_save), "javascript:void(0)", :onclick => "submitNews();",:onmouseover => 'this.focus()',:class => 'blue_btn fl c_white' %> - <%= link_to l(:button_cancel), "javascript:void(0)", :onclick => '$("#edit-news").hide(); return false;',:class => 'blue_btn grey_btn fl c_white' %> + <%= link_to l(:button_cancel), news_path(@news), :class => 'blue_btn grey_btn fl c_white' %> <% end %>

  • From 8a52225f4df6482472d6f38c64c84167a2169cab Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Thu, 14 May 2015 15:19:15 +0800 Subject: [PATCH 05/17] Signed-off-by: alan <547533434@qq.com> --- public/javascripts/project.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/javascripts/project.js b/public/javascripts/project.js index c892f964b..c28a86f08 100644 --- a/public/javascripts/project.js +++ b/public/javascripts/project.js @@ -166,7 +166,7 @@ function regexContent(id) { var message = "#message_content_span"+ id; var content = $.trim($(contentid).val()); if (content.length == 0) { - alert(message); + $(message).text("描述不能为空"); $(message).css('color', '#ff0000'); return false; From 2c568ed3701629eb79d2c154352244fc3aae0e85 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 14 May 2015 15:37:25 +0800 Subject: [PATCH 06/17] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=BB=E9=A1=B5?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD=E4=B8=8D=E5=AD=98=E5=9C=A8=E7=9A=84=E8=B5=84?= =?UTF-8?q?=E6=BA=90500=E9=94=99=E8=AF=AF=20=E5=AE=9A=E4=B9=89helper?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/application_helper.rb | 11 +++++++++++ app/views/files/_project_file_list.html.erb | 8 +++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 9c261df85..bb62695c0 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -593,6 +593,17 @@ module ApplicationHelper Project.project_tree(projects, &block) end + # 判断当前用户是否为项目管理员 + def is_project_manager?(user_id,project_id) + @result = false + mem = Member.where("user_id = ? and project_id = ?",user_id, project_id) + unless mem.blank? + mem.first.roles.to_s.include?("Manager") + @result = false + end + return @result + end + def principals_check_box_tags(name, principals) s = '' principals.each do |principal| diff --git a/app/views/files/_project_file_list.html.erb b/app/views/files/_project_file_list.html.erb index b2862a634..d3e383a4e 100644 --- a/app/views/files/_project_file_list.html.erb +++ b/app/views/files/_project_file_list.html.erb @@ -20,16 +20,14 @@
    <%= link_to_attachment file, :download => true,:text => truncate(file.filename,length: 35, omission: '...'), :title => file.filename+"\n"+file.description.to_s, :style => "overflow: hidden; white-space: nowrap;text-overflow: ellipsis;",:class => "c_dblue f_14 f_b f_l" %> <% if User.current.logged? %> - - - <%# if project.is_public? %> + <%#--私有项目资源不能引用,不能设置公开私有--%> + <%#--公开项目资源可以应用,管理员和资源上传者拥有设置公开私有权限--%> <%= link_to(l(:label_slected_to_other_project),quote_resource_show_project_project_file_path(project,file),:class => "f_l re_select",:remote => true) if has_project?(User.current,file) %> - <% if (Member.where(:user_id => User.current.id, :project_id => @project.id).first.roles.to_s.include?("Manager") || file.author_id == User.current.id) && project_contains_attachment?(project,file) && file.container_id == project.id && file.container_type == "Project" %> + <% if (is_project_manager?(User.current.id, @project.id) || file.author_id == User.current.id) && project_contains_attachment?(project,file) && file.container_id == project.id && file.container_type == "Project" %> <%= link_to (file.is_public? ? "公开":"私有"), update_file_dense_attachments_path(:attachmentid=>file.id,:newtype=>(file.is_public? ? 0:1)),:remote=>true,:class=>"f_l re_open",:method => :post %> <% end %> - <%# end %> <% end %>
    From 0708279c5ec60b687711a5e8053603c3b128302a Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Thu, 14 May 2015 15:42:20 +0800 Subject: [PATCH 07/17] Signed-off-by: alan <547533434@qq.com> --- app/views/boards/_course_show.html.erb | 14 +++++++------- app/views/boards/_edit.html.erb | 4 ++-- public/javascripts/project.js | 4 +++- 3 files changed, 12 insertions(+), 10 deletions(-) diff --git a/app/views/boards/_course_show.html.erb b/app/views/boards/_course_show.html.erb index 19d0e6bc9..617b9428a 100644 --- a/app/views/boards/_course_show.html.erb +++ b/app/views/boards/_course_show.html.erb @@ -40,12 +40,10 @@

      <%= h(topic.subject) %>

    <% if topic.course_editable_by?(User.current) %> - <%= l(:button_edit) %> - <% end %> - <% if topic.sticky? %> - <%= l(:label_board_sticky)%> + <%= l(:button_edit) %> <% end %> + <%= link_to( l(:button_delete), {:controller =>'messages',:action => 'destroy', :id => topic.id, :board_id => topic.board_id, :is_board=>'true'}, @@ -55,7 +53,9 @@ :style => ' margin-right: 10px;' ) if topic.destroyable_by?(User.current) %> - + <% if topic.sticky? %> + <%= l(:label_board_sticky)%> + <% end %>
    - <%= topic.content %> + <%= topic.content.html_safe %>
    diff --git a/app/views/boards/_edit.html.erb b/app/views/boards/_edit.html.erb index a9acbf85f..46131ca51 100644 --- a/app/views/boards/_edit.html.erb +++ b/app/views/boards/_edit.html.erb @@ -12,7 +12,7 @@ } do |f| %> <%= render :partial => 'form_project', :locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %> - <%= l(:button_submit)%> + <%= l(:button_submit)%> <%= l(:button_cancel) %> <%#= link_to l(:button_cancel), board_message_url(topic.board, topic.root, :r => (topic.parent_id && topic.id)), :class => "blue_btn grey_btn fl c_white" %> @@ -31,7 +31,7 @@ } do |f| %> <%= render :partial => 'form_course', :locals => {:f => f, :replying => !topic.parent.nil?, :topic => topic} %> - <%= l(:button_submit)%> + <%= l(:button_submit)%> <%= link_to l(:button_cancel), board_message_url(topic.board,topic.root, :r => (topic.parent_id &&topic.id)), :class => "blue_btn grey_btn fl c_white" %> <% end %> diff --git a/public/javascripts/project.js b/public/javascripts/project.js index c28a86f08..70888e5d0 100644 --- a/public/javascripts/project.js +++ b/public/javascripts/project.js @@ -145,6 +145,7 @@ $(function(){ /////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////项目讨论区 function regexSubject(id) { + var subjectid = "#message_subject" + id ; var content = $.trim($(subjectid).val()); var message = "#subject_span" + id; @@ -166,7 +167,7 @@ function regexContent(id) { var message = "#message_content_span"+ id; var content = $.trim($(contentid).val()); if (content.length == 0) { - + $(message).text("描述不能为空"); $(message).css('color', '#ff0000'); return false; @@ -183,6 +184,7 @@ function regexContent(id) { // 项目讨论区编辑和提交 function submitProjectsBoard(id) { var formid = "#message-form" + id; + if (regexSubject(id) && regexContent(id)) { $(formid).submit(); } From 725a6e4238a4141e9d4e70738fdd359d309c48cc Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 14 May 2015 16:03:37 +0800 Subject: [PATCH 08/17] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E5=8F=91=E5=B8=83?= =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E6=97=A5=E5=8E=86=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/stylesheets/application.css | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index a6d4bcb63..371015dbf 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -2004,9 +2004,15 @@ color:#505050; } img.ui-datepicker-trigger { - cursor: pointer; - vertical-align: middle; - margin-left: 4px; + display:block; + background:url(../images/public_icon.png) -31px 0 no-repeat; + cursor: pointer; + vertical-align: middle; + margin-left: 5px; + margin-top: 5px; + width:16px; + height:15px; + float:left; } /***** Progress bar *****/ From 33365f7ea6829b536821ba1397aba1531ea1822b Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Thu, 14 May 2015 16:04:07 +0800 Subject: [PATCH 09/17] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=96=E8=BE=91?= =?UTF-8?q?=E4=BD=9C=E4=B8=9A=E6=97=B6=E9=99=84=E4=BB=B6=E6=98=BE=E7=A4=BA?= =?UTF-8?q?=E7=A7=BB=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attachments/_form.html.erb | 3 +++ app/views/homework_attach/edit.html.erb | 30 +++++++++++++++++++------ 2 files changed, 26 insertions(+), 7 deletions(-) diff --git a/app/views/attachments/_form.html.erb b/app/views/attachments/_form.html.erb index 2e8800617..845e2b6a0 100644 --- a/app/views/attachments/_form.html.erb +++ b/app/views/attachments/_form.html.erb @@ -17,6 +17,7 @@ <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> +
    <% end %> <% container.saved_attachments.each_with_index do |attachment, i| %> @@ -34,10 +35,12 @@ <%= hidden_field_tag "attachments[p#{i}][token]", "#{attachment.token}" %> +
    <% end %> <% end %> <% project = project %> +
    <%#= button_tag "浏览", :type=>"button", :onclick=>"CompatibleSend();" %> diff --git a/app/views/homework_attach/edit.html.erb b/app/views/homework_attach/edit.html.erb index e31c5008f..16b9d2c7e 100644 --- a/app/views/homework_attach/edit.html.erb +++ b/app/views/homework_attach/edit.html.erb @@ -75,16 +75,32 @@ <%= f.text_area :description, :rows => 8, :name => "homework_description", :class => "w620", :maxlength => 3000, :placeholder => "最多3000个汉字" %>

    -

    -

    + -
    - <%= render :partial => 'attachments/form', :locals => {:container => @homework}%> + + + + +
    + <%= render :partial => 'attachments/form', :locals => {:container => @homework} %>
    -

    -

    + +

    - <% end %> -