diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index f6cfb9a16..0f6798328 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -2226,6 +2226,22 @@ module ApplicationHelper s end + # 获取issue类型 + def get_issue_type_new tracker_id + case tracker_id + when 1 + "缺陷" + when 2 + "功能" + when 3 + "支持" + when 4 + "任务" + when 5 + "周报" + end + end + def get_memo @new_memo = Memo.new @public_forum = Forum.find(1) rescue ActiveRecord::RecordNotFound diff --git a/app/views/attachments/_activity_attach.html.erb b/app/views/attachments/_activity_attach.html.erb index 48c01468a..ad87d28bf 100644 --- a/app/views/attachments/_activity_attach.html.erb +++ b/app/views/attachments/_activity_attach.html.erb @@ -1,3 +1,4 @@ + <% if activity.attachments.any? %> <% activity.attachments.each do |attachment| %>
diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index c37c589f1..ab5e94dd0 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -9,7 +9,7 @@ <%= favicon %> <%= javascript_heads %> <%= heads_for_theme %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/structure','scm','css/public', 'css/project','css/popup','repository','css/gantt', 'css/calendar' %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2','css/common','css/structure','scm','css/public', 'css/project','css/popup','repository','css/gantt', 'css/calendar', 'css/moduel' %> <%= call_hook :view_layouts_base_html_head %> <%= yield :header_tags -%> diff --git a/app/views/poll/show.html.erb b/app/views/poll/show.html.erb index 63f7feae5..055eecc7b 100644 --- a/app/views/poll/show.html.erb +++ b/app/views/poll/show.html.erb @@ -206,24 +206,26 @@ function onblur_<%= pq.id %>(obj) { $(window).unbind('beforeunload'); - $.ajax({ - type: "post", - url: "<%= commit_answer_poll_path(@poll) %>", - data: { - poll_question_id: <%= pq.id %> , - vote_text: obj.value - }, - success: function (data) { - var dataObj = eval(data); - obj.value = dataObj.text; - var span = $('#percent'); - span.html(dataObj.percent); - }, - error: function () { - alert("网络异常,答题失败,请确认网络正常连接后再答题。"); - } - }); - + var val = $(obj).val().trim(); + if(val != "") { + $.ajax({ + type: "post", + url: "<%= commit_answer_poll_path(@poll) %>", + data: { + poll_question_id: <%= pq.id %> , + vote_text: obj.value + }, + success: function (data) { + var dataObj = eval(data); + obj.value = dataObj.text; + var span = $('#percent'); + span.html(dataObj.percent); + }, + error: function () { + alert("网络异常,答题失败,请确认网络正常连接后再答题。"); + } + }); + } } > @@ -253,24 +255,27 @@ function onblur_<%= pa.id %>(obj) { $(window).unbind('beforeunload'); - $.ajax({ - type: "post", - url: "<%= commit_answer_poll_path(@poll) %>", - data: { - poll_question_id: <%= pq.id %> , - poll_answer_id: <%= pa.id %>, - vote_text: obj.value - }, - success: function (data) { - var dataObj = eval(data); - obj.value = dataObj.text; - var span = $('#percent'); - span.html(dataObj.percent); - }, - error: function () { - alert("网络异常,答题失败,请确认网络正常连接后再答题。"); - } - }); + var val = $(obj).val().trim(); + if(val != "") { + $.ajax({ + type: "post", + url: "<%= commit_answer_poll_path(@poll) %>", + data: { + poll_question_id: <%= pq.id %>, + poll_answer_id: <%= pa.id %>, + vote_text: obj.value + }, + success: function (data) { + var dataObj = eval(data); + obj.value = dataObj.text; + var span = $('#percent'); + span.html(dataObj.percent); + }, + error: function () { + alert("网络异常,答题失败,请确认网络正常连接后再答题。"); + } + }); + } }

<%= i + 1 %>.<%= pa.answer_text%>

diff --git a/app/views/projects/_act_issues.html.erb b/app/views/projects/_act_issues.html.erb index 8e448ffb2..ef86c2118 100644 --- a/app/views/projects/_act_issues.html.erb +++ b/app/views/projects/_act_issues.html.erb @@ -3,15 +3,12 @@
<%= link_to image_tag(url_to_avatar(activity.author), :width => "50", :height => "50"), user_path(activity.author_id), :alt => "用户头像" %> - <%= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %> + <%#= render :partial => 'users/show_detail_info', :locals => {:user => activity.author} %>
- <% if activity.try(:author).try(:realname) == ' ' %> - <%= link_to activity.try(:author), user_path(activity.author_id), :class => "newsBlue mr15" %> - <% else %> - <%= link_to activity.try(:author).try(:realname), user_path(activity.author_id), :class => "newsBlue mr15" %> - <% end %> TO + <%= link_to activity.try(:author).show_name, user_path(activity.author_id), :class => "newsBlue mr15" %> + TO <%= link_to activity.project.name.to_s+" | 项目问题", project_issues_path(activity.project), :class => "newsBlue ml15"%>
<% if User.current.logged? %> @@ -40,18 +37,8 @@
<% end %>
- <% case activity.tracker_id %> - <% when 1%> - 【缺陷】 - <% when 2%> - 【功能】 - <% when 3%> - 【支持】 - <% when 4%> - 【任务】 - <% when 5%> - 【周报】 - <% end %> + 【<%= get_issue_type_new(activity.tracker_id) %>】 + <%= link_to activity.subject.to_s, issue_path(activity), :class => "postGrey ml5", :target => "_blank" %> <%= get_issue_priority(activity.priority_id)[1] %> @@ -84,7 +71,7 @@ <% if User.current.member_of?(activity.project) && !activity.nil? && !activity.status.nil? %> <% unless params[:action] == "index" %>
- <%= render :partial => 'users/project_issue_detail', :locals => {:activity => activity} %> + <%= render :partial => 'projects/project_issue_detail', :locals => {:activity => activity} %>
<% end %> <% end %> @@ -96,7 +83,7 @@
- <%= render :partial => 'users/project_issue_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %> + <%= render :partial => 'projects/project_issue_reply', :locals => {:activity => activity, :user_activity_id => user_activity_id} %>
+
+
+ + + + + + +
\ No newline at end of file diff --git a/app/views/projects/_project_issue_reply.html.erb b/app/views/projects/_project_issue_reply.html.erb new file mode 100644 index 000000000..019e435b8 --- /dev/null +++ b/app/views/projects/_project_issue_reply.html.erb @@ -0,0 +1,101 @@ +<% count = activity.journals.count %> +
+ <%= render :partial => 'projects/project_reply_banner', :locals => {:count => count, :activity => activity, :user_activity_id => user_activity_id} %> + + <% comments = activity.journals.includes(:user, :details).reorder("created_on desc").limit(3) %> + <% if count > 0 %> +
+
    + <% comments.each do |comment| %> + +
  • +
    + <%= link_to image_tag(url_to_avatar(comment.creator_user), :width => 33, :height => 33, :alt => "用户头像"), user_url_in_org(comment.creator_user.id) %> +
    +
    + <%= render :partial => 'projects/project_issue_contents', :locals => {:comment => comment}%> + + <% if !comment.content_detail.blank? || comment.class == Journal %> +
    + <% if comment.class == Journal %> + <% if comment.details.any? %> + <% details_to_strings(comment.details).each do |string| %> +

    <%= string %>

    + <% end %> + <% end %> +

    <%= comment.notes.html_safe %>

    + <% else %> + <%= comment.content_detail.html_safe %> + <% end %> +
    +
    +
    + + + <%= render :partial => "praise_tread/praise", :locals => {:activity => comment, :user_activity_id => comment.id, :type => "reply"} %> + + + + <%= link_to( + l(:button_reply), + {:controller => 'users', :action => 'reply_to', :reply_id => comment.id, :type => 'Issue', :user_activity_id => user_activity_id, :activity_id => activity.id}, + :remote => true, + :method => 'get', + :title => l(:button_reply)) %> + + + <%= link_to( + l(:button_delete), + {:controller => 'issues',:action => 'delete_journal', :id => activity.id,:journal_id=>comment.id, :user_activity_id => user_activity_id}, + :method => 'get', + :confirm => l(:text_are_you_sure), + :remote=>true, + :id => "delete_reply_#{activity.id}_#{comment.id}", + :class => 'fr mr20 undis', + :title => l(:button_delete) + ) if comment.user_id == User.current.id %> + + +
    +
    +
    +

    + <% end %> +
    +
    +
  • + <% end %> +
+ + <%#= render :partial => 'users/news_replies', :locals => {:comments => comments, :user_activity_id => user_activity_id, :type => 'Issue', :activity_id => activity.id} %> +
+ <% end %> + +
+
<%= link_to image_tag(url_to_avatar(User.current), :width => "33", :height => "33"), user_path(activity.author_id), :alt => "用户头像" %>
+
+ <% if User.current.logged? %> +
+ <%= form_for('new_form',:url => add_journal_issue_path(activity.id, :user_activity_id => user_activity_id),:method => "post", :remote => true) do |f| %> + +
+ + +
+

+ <% end%> +
+ <% else %> + <%= render :partial => "projects/show_unlogged" %> + <% end %> +
+
+
+
+ +
\ No newline at end of file diff --git a/app/views/projects/_project_reply_banner.html.erb b/app/views/projects/_project_reply_banner.html.erb new file mode 100644 index 000000000..58c0688ee --- /dev/null +++ b/app/views/projects/_project_reply_banner.html.erb @@ -0,0 +1,32 @@ +
+
+ 回复 + ︿ + <%= count>0 ? "(#{count})" : "" %> + + <%=render :partial=> "praise_tread/praise", :locals => {:activity=>activity, :user_activity_id=>user_activity_id,:type=>"activity"}%> + +
+
<%#= format_date(activity.updated_on) %>
+ <%if count>3 %> +
+ <% if activity.class.to_s == 'HomeworkCommon' %> + + 展开更多 + + <% elsif activity.class.to_s == 'Message' %> + + 展开更多 + + <% elsif activity.class.to_s == 'BlogComment' %> + + 展开更多 + + <% else %> + + 展开更多 + + <% end %> +
+ <% end %> +
\ No newline at end of file diff --git a/app/views/projects/_show_unlogged.html.erb b/app/views/projects/_show_unlogged.html.erb new file mode 100644 index 000000000..223ee3f40 --- /dev/null +++ b/app/views/projects/_show_unlogged.html.erb @@ -0,0 +1,4 @@ +
+ 登录后可添加回复 + <%#= link_to "登录", signin_path, :class => "linkBlue", :target => "_blank" %> +
\ No newline at end of file diff --git a/app/views/projects/search_public_orgs_not_in_project.js.erb b/app/views/projects/search_public_orgs_not_in_project.js.erb index cb8fb3ea2..3be806b00 100644 --- a/app/views/projects/search_public_orgs_not_in_project.js.erb +++ b/app/views/projects/search_public_orgs_not_in_project.js.erb @@ -6,12 +6,12 @@ } <% end %> $("#search_orgs_result_list").html(""); -$("#search_orgs_result_list").append(''); <% if @org_count > 15 %> $("#paginator").html(' <%= pagination_links_full @orgs_page, @org_count ,:per_page_links => true,:remote =>true,:flag=>true%>'); $("#paginator").css("display", "block"); diff --git a/app/views/projects/settings/_added_orgs.html.erb b/app/views/projects/settings/_added_orgs.html.erb index 19e0c07fe..666a7e118 100644 --- a/app/views/projects/settings/_added_orgs.html.erb +++ b/app/views/projects/settings/_added_orgs.html.erb @@ -1,8 +1,8 @@