Compare commits

...

11 Commits

8 changed files with 52 additions and 19 deletions
Split View
  1. +30
    -9
      app/controllers/issues_controller.rb
  2. +1
    -0
      app/helpers/issues_helper.rb
  3. +6
    -3
      app/views/forums/index.html.erb
  4. +3
    -1
      app/views/issues/update.js.erb
  5. +2
    -1
      app/views/journals/diff.html.erb
  6. +3
    -1
      app/views/projects/settings/_new_versions.html.erb
  7. +1
    -1
      public/javascripts/jquery.colorbox-min.js
  8. +6
    -3
      public/javascripts/project.js

+ 30
- 9
app/controllers/issues_controller.rb View File

@@ -292,14 +292,20 @@ class IssuesController < ApplicationController
def update_user_issue_detail(issue, params)
case params[:type]
when "status"
issue.update_attribute(:status_id, params[:status_id])
when "assigned"
issue.update_attribute(:assigned_to_id, params[:assigned_to_id])
when "ratio"
issue.update_attribute(:done_ratio, params[:done_ratio])
when "prior"
issue.update_attribute(:priority_id, params[:priority_id])
when "status"
if params[:status_id] != "0"
issue.update_attribute(:status_id, params[:status_id])
end
when "assigned"
if params[:assigned_to_id] != "0"
issue.update_attribute(:assigned_to_id, params[:assigned_to_id])
end
when "ratio"
issue.update_attribute(:done_ratio, params[:done_ratio])
when "prior"
if params[:priority_id] != "0"
issue.update_attribute(:priority_id, params[:priority_id])
end
end
end
@@ -473,7 +479,22 @@ class IssuesController < ApplicationController
def reply
@issue = Issue.find(params[:id])
@jour = Journal.find(params[:journal_id])
@tempContent = "<blockquote>#{ll(Setting.default_language, :text_user_wrote, @jour.user.realname.blank? ? @jour.user.login: @jour.user.realname)} <br/>#{@jour.notes.html_safe}</blockquote>".html_safe
journal_details = @jour.details
@notes = ""
@note_temp = ""
#判断journal是否为引用
if @jour.notes != ""
@notes = @jour.notes
else
if @jour.details.any?
details_to_strings(@jour.details,true).each do |str|
@note_temp += str
end
@notes = @note_temp.gsub("</i> <strong>","</i><br /><strong>").gsub("</i><strong>","</i><br /><strong>").to_s
end
end
@tempContent = "<blockquote>#{ll(Setting.default_language, :text_user_wrote, @jour.user.realname.blank? ? @jour.user.login: @jour.user.realname)} <br/>#{@notes.html_safe}</blockquote>".html_safe
# @tempContent = "<blockquote>#{ll(Setting.default_language, :text_user_wrote, @jour.user.realname.blank? ? @jour.user.login: @jour.user.realname)} <br/>#{@jour.notes.html_safe}</blockquote>".html_safe
respond_to do |format|
format.js
end


+ 1
- 0
app/helpers/issues_helper.rb View File

@@ -20,6 +20,7 @@
module IssuesHelper
include ApplicationHelper
include TagsHelper
include ERB::Util
def issue_list(issues, &block)
ancestors = []
issues.each do |issue|


+ 6
- 3
app/views/forums/index.html.erb View File

@@ -28,6 +28,7 @@
}
}
$(function() {
hideError();
$("#complex").click(function(){
$("#reorder_popu").removeClass("sortArrowActiveU");
$("#reorder_popu").removeClass("sortArrowActiveD");
@@ -71,10 +72,11 @@
e.preventDefault();
}
})

});
function check_and_submit(doc){
$("#error").html('').hide();
check_forum_name();
$("#error").html("").hide();
// check_forum_name();
if( $("textarea[name='forum[name]']").val().trim() == "" && $("textarea[name='forum[description]']").val().trim() != "" ){
$("#error").html("名称不能为空").show();
return;
@@ -91,6 +93,7 @@
}
var check_pass = true;
function check_forum_name(){
$("#error").html("").hide();
check_pass = true;
name = $("textarea[name='forum[name]']").val().trim();
if( name != ""){
@@ -98,10 +101,10 @@
'<%= check_forum_name_forums_path %>',
{"forum_name":encodeURIComponent(name)},
function(data){

if( data == 'true'){
$("#error").html("贴吧名称已经存在").show();
check_pass = false;
return false;
}
}
);


+ 3
- 1
app/views/issues/update.js.erb View File

@@ -32,5 +32,7 @@ issue_desc_editor = KindEditor.create('#issue_description',
// "uploadJson":"/kindeditor/upload",
// "fileManagerJson":"/kindeditor/filemanager"});
<%else%>
alert('<%= @issue.errors.full_messages[0].to_s%>')
<% if @issue.errors.full_messages.length != 0 %>
alert('<%= @issue.errors.full_messages[0].to_s%>')
<%end%>
<%end %>

+ 2
- 1
app/views/journals/diff.html.erb View File

@@ -2,7 +2,8 @@
<p>由<%= @journal.user %> 更新于 <%= format_time @journal.created_on %></p>
<div class="text-diff" style="word-break:break-all; word-wrap:break-word;">
<%= @diff.to_html.gsub("&lt;","<").gsub("&gt;",">").gsub("&quot;","\"").gsub("&amp;gt;", ">").gsub("&amp;lt;", "<").gsub("&amp;quot;", "\"").html_safe %>
<% @new = @diff.to_html.gsub("&amp;","&").gsub("&lt;","<").gsub("&gt;",">").gsub("&quot;","\"").html_safe %>
<%= @new.gsub("&amp;","&").gsub("&lt;","<").gsub("&gt;",">").gsub("&quot;","\"").gsub("/>"," ").html_safe %>
</div>
<p><%= link_to l(:button_back), issue_path(@issue), :onclick => 'history.back(); return false;' %></p>


+ 3
- 1
app/views/projects/settings/_new_versions.html.erb View File

@@ -3,7 +3,9 @@
{
$("#pro_st_edit_ban").toggle();
}

$(function(){
window.location.hash = "#pro_st_edit_ban";
});
</script>
<% if @project.shared_versions.any? %>
<table class="pro_table">


+ 1
- 1
public/javascripts/jquery.colorbox-min.js
File diff suppressed because it is too large
View File


+ 6
- 3
public/javascripts/project.js View File

@@ -605,11 +605,13 @@ function regexTopicDescription()
{
$("#message_content_span").text("描述不能为空");
$("#message_content_span").css('color','#ff0000');
$("#message_content_span").focus();
return false;
}
else if(name.length >=6000){
$("#message_content_span").text("描述最多3000个汉字(或6000个英文字符)");
$("#message_content_span").css('color','#ff0000');
$("#message_content_span").focus();
return false;
}
else
@@ -618,14 +620,15 @@ function regexTopicDescription()
$("#message_content_span").css('color','#008000');
return true;
}
return false;
}
function submit_topic_project()
{
// if(regexTopicSubject() && regexTopicDescription())
// {
if(regexTopicSubject() && regexTopicDescription())
{
message_content_editor.sync();
$("#message-form-project").submit();
// }
}
}
function reset_topic(){


Loading…
Cancel
Save