From 1498f5c20b9c0d94b526be368a4f685db8b47a4e Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 22 Aug 2014 08:57:00 +0800 Subject: [PATCH 1/5] =?UTF-8?q?1.=E4=BF=AE=E6=94=B9=E8=AF=BE=E7=A8=8B?= =?UTF-8?q?=E9=80=9A=E7=9F=A5=E6=97=B6=E6=8C=89=E9=92=AE=E7=8A=B6=E6=80=81?= =?UTF-8?q?=202.=E6=96=B0=E5=BB=BA=E4=BD=9C=E4=B8=9A=E6=8F=8F=E8=BF=B0?= =?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/news/_course_show.html.erb | 6 +++--- config/locales/zh.yml | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/views/news/_course_show.html.erb b/app/views/news/_course_show.html.erb index c6661d9fe..b86cea93f 100644 --- a/app/views/news/_course_show.html.erb +++ b/app/views/news/_course_show.html.erb @@ -69,9 +69,9 @@ :html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %> <%= render :partial => 'course_form', :locals => { :f => f, :is_new => false } %> <%#= submit_tag l(:button_save) %> - <%= link_to l(:button_save), "#", :onclick => 'submitNews();' %> - <%= preview_link preview_news_path(:course_id => @course, :id => @news), 'news-form',target='preview',{:class => ''} %> | - <%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;' %> + <%= link_to l(:button_save), "#", :onclick => 'submitNews();',:class => 'whiteButton m3p10' %> + <%= preview_link preview_news_path(:course_id => @course, :id => @news), 'news-form',target='preview',{:class => 'whiteButton m3p10'} %> | + <%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;',:class => 'whiteButton m3p10' %> <% end %>
diff --git a/config/locales/zh.yml b/config/locales/zh.yml index a73f9db56..4f0744d86 100644 --- a/config/locales/zh.yml +++ b/config/locales/zh.yml @@ -1641,7 +1641,7 @@ zh: label_call_bonus: 奖金 label_bids_form_new_description: 企业可以在此发布一个软件开发任务或者一个技术方案需求:(1)获得价廉物美的解决方案;(2)发现对此项任务有贡献的大学生,获得可以招聘的人才。 label_bids_form_contest_new_description: 企业或者高校可以在此发布一个竞赛。 - label_homeworks_form_new_description: 发布一个作业,作业提交方式可以是附件或者项目形式,在作业类型里面设置。 + label_homeworks_form_new_description: 发布一个作业,作业提交方式可以是附件或者项目形式。 label_fork_form_new_description: 该需求将作为某课程的作业被发布,作业提交方式可以使附件或者项目形式,在作业类型里面设置。 label_bids_new_money: 输入奖励金额,如 500,2.5等 label_bids_new_credit: 输入该作业对应课程的学分,如 3,2.5等 From 589c6d37db19d7caef7796de1d799353d11e35bb Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Fri, 22 Aug 2014 09:20:03 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E5=8F=96=E6=B6=88=E6=97=A5=E6=9C=9F?= =?UTF-8?q?=E7=BC=96=E8=BE=91=E6=A1=86=E5=8F=AF=E6=89=8B=E5=8A=A8=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E7=9A=84=E9=97=AE=E9=A2=98=20#1045?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/_homework_form.html.erb | 4 ++-- app/views/courses/_homework_form.html.erb | 2 +- app/views/memos/_form.html.erb | 14 +++++++------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/app/views/bids/_homework_form.html.erb b/app/views/bids/_homework_form.html.erb index f7c753b45..463b2b621 100644 --- a/app/views/bids/_homework_form.html.erb +++ b/app/views/bids/_homework_form.html.erb @@ -26,9 +26,9 @@

<%= f.text_field :name, :required => true, :size => 60, :style => "width:490px;", :maxlength => Bid::NAME_LENGTH_LIMIT %>

<%= f.text_area :description, :rows => 8, :class => 'wiki-edit', :style => "font-size:small;width:490px;margin-left:10px;", :maxlength => Bid::DESCRIPTION_LENGTH_LIMIT %>

-

<%= f.text_field :deadline, :required => true, :size => 60, :style => "width:150px;" %><%= calendar_for('bid_deadline')%>

diff --git a/app/views/courses/_homework_form.html.erb b/app/views/courses/_homework_form.html.erb index 41c059603..bfecb5304 100644 --- a/app/views/courses/_homework_form.html.erb +++ b/app/views/courses/_homework_form.html.erb @@ -30,7 +30,7 @@ <%#= f.text_field :budget, :required => true, :size => 60, :style => "width:350px;", :placeholder => l(:label_bids_reward_what) %>

--> <% time = (Time.now + 3600 * 24).strftime('%Y-%m-%d') %> -

<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}") %><%= calendar_for('bid_deadline')%> +

<%= f.text_field(:deadline, :required => true, :size => 60, :style => "width:150px;",:value => "#{time}",:readonly => "readonly") %><%= calendar_for('bid_deadline')%>

<%= f.select :is_evaluation, is_evaluation_option %>

diff --git a/app/views/memos/_form.html.erb b/app/views/memos/_form.html.erb index d4b517048..116f97149 100644 --- a/app/views/memos/_form.html.erb +++ b/app/views/memos/_form.html.erb @@ -2,12 +2,12 @@

<%= l(:label_homeworks_form_new_description) %>

+ <%# if @memo.safe_attribute? 'sticky' %> + <%#= f.check_box :sticky %> <%= l(:label_board_sticky) %> + <%# end %> + <%# if @memo.safe_attribute? 'locked' %> + <%#= f.check_box :locked %> <%#= label_tag 'memo_locked', l(:label_board_locked) %> + <%# end %> + <%# end %> -->

<%= f.text_field :content, :required => true, :size => 60, :style => "width:150px;" %>

<%= hidden_field_tag 'subject', ||=@memo.subject %> \ No newline at end of file From b635a6b3c5492476b35225f839872a12637b3360 Mon Sep 17 00:00:00 2001 From: zhanghaitao <562681745@qq.com> Date: Fri, 22 Aug 2014 09:38:07 +0800 Subject: [PATCH 3/5] =?UTF-8?q?1.=E6=B7=BB=E5=8A=A0=E5=B7=A5=E4=BD=9C?= =?UTF-8?q?=E5=8F=B0=E5=88=86=E9=A1=B5=E5=A4=84=E7=90=86=E6=93=8D=E4=BD=9C?= =?UTF-8?q?=202.=E5=88=86=E9=A1=B5=E5=A4=84=E7=90=86=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E5=87=BD=E6=95=B0=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/issues_controller.rb | 4 +++ app/controllers/my_controller.rb | 27 ++++++++++++++++++- app/views/my/blocks/_assiagn_issue.html.erb | 26 ++++++++++++++++++ .../my/blocks/_issuesassignedtome.html.erb | 20 +++----------- app/views/my/page.js.erb | 1 + app/views/my/page2.js.erb | 1 + config/routes.rb | 2 ++ 7 files changed, 63 insertions(+), 18 deletions(-) create mode 100644 app/views/my/blocks/_assiagn_issue.html.erb create mode 100644 app/views/my/page.js.erb create mode 100644 app/views/my/page2.js.erb diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 9d734db37..b522a09d6 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -83,6 +83,10 @@ class IssuesController < ApplicationController :limit => @limit) @issue_count_by_group = @query.issue_count_by_group + + + + respond_to do |format| format.html { render :template => 'issues/index', :layout => @project_base_tag }#by young format.api { diff --git a/app/controllers/my_controller.rb b/app/controllers/my_controller.rb index 91da700a1..14814ed32 100644 --- a/app/controllers/my_controller.rb +++ b/app/controllers/my_controller.rb @@ -37,14 +37,39 @@ class MyController < ApplicationController }.freeze def index + page render :action => 'page' - end + end # Show user's page def page @user = User.current + @Issues= Issue.visible.open. + where(:assigned_to_id => ([User.current.id] + User.current.group_ids)) + @limit = 10 + @feedback_count = @Issues.count + @feedback_pages = Paginator.new @feedback_count, @limit, params['page'] + @offset ||= @feedback_pages.offset + @curse_attachments = @Issues[@offset, @limit] + + @blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT + end + + def page2 + @limit = 10 + @user = User.current + @Issues= Issue.visible.open. + where(:assigned_to_id => ([User.current.id] + User.current.group_ids)) + @feedback_count = @Issues.count + @feedback_pages = Paginator.new @feedback_count, @limit, params['page'] + @offset ||= @feedback_pages.offset + @curse_attachments = @Issues[@offset, @limit] + @state = false @blocks = @user.pref[:my_page_layout] || DEFAULT_LAYOUT + respond_to do |format| + format.js + end end # Edit user's account diff --git a/app/views/my/blocks/_assiagn_issue.html.erb b/app/views/my/blocks/_assiagn_issue.html.erb new file mode 100644 index 000000000..6e7df84fd --- /dev/null +++ b/app/views/my/blocks/_assiagn_issue.html.erb @@ -0,0 +1,26 @@ +<% assigned_issues = issuesassignedtome_items %> +<%= render :partial => 'issues/list_simple', :locals => { :issues => assigned_issues } %> +<% if assigned_issues.length > 0 %> + + +

<%= link_to l(:label_issue_view_all), :controller => 'issues', + :action => 'index', + :set_filter => 1, + :assigned_to_id => 'me', + :sort => 'priority:desc,updated_on:desc' %>

+<% end %> +<% content_for :header_tags do %> +<%= auto_discovery_link_tag(:atom, + {:controller => 'issues', :action => 'index', :set_filter => 1, + :assigned_to_id => 'me', :format => 'atom', :key => User.current.rss_key}, + {:title => l(:label_assigned_to_me_issues)}) %> + +<% end %> \ No newline at end of file diff --git a/app/views/my/blocks/_issuesassignedtome.html.erb b/app/views/my/blocks/_issuesassignedtome.html.erb index 02d8c9aa6..0b20dd4e5 100644 --- a/app/views/my/blocks/_issuesassignedtome.html.erb +++ b/app/views/my/blocks/_issuesassignedtome.html.erb @@ -1,18 +1,4 @@

<%=l(:label_assigned_to_me_issues)%> (<%= Issue.visible.open.count(:conditions => {:assigned_to_id => ([User.current.id] + User.current.group_ids)})%>)

- -<% assigned_issues = issuesassignedtome_items %> -<%= render :partial => 'issues/list_simple', :locals => { :issues => assigned_issues } %> -<% if assigned_issues.length > 0 %> -

<%= link_to l(:label_issue_view_all), :controller => 'issues', - :action => 'index', - :set_filter => 1, - :assigned_to_id => 'me', - :sort => 'priority:desc,updated_on:desc' %>

-<% end %> - -<% content_for :header_tags do %> -<%= auto_discovery_link_tag(:atom, - {:controller => 'issues', :action => 'index', :set_filter => 1, - :assigned_to_id => 'me', :format => 'atom', :key => User.current.rss_key}, - {:title => l(:label_assigned_to_me_issues)}) %> -<% end %> +
+ <%= render :partial => "my/blocks/assiagn_issue" %> +
\ No newline at end of file diff --git a/app/views/my/page.js.erb b/app/views/my/page.js.erb new file mode 100644 index 000000000..d3f47a8e1 --- /dev/null +++ b/app/views/my/page.js.erb @@ -0,0 +1 @@ +$("#asdsadwsc").html("<%= escape_javascript(render :partial => 'my/blocks/assiagn_issue') %>"); \ No newline at end of file diff --git a/app/views/my/page2.js.erb b/app/views/my/page2.js.erb new file mode 100644 index 000000000..d3f47a8e1 --- /dev/null +++ b/app/views/my/page2.js.erb @@ -0,0 +1 @@ +$("#asdsadwsc").html("<%= escape_javascript(render :partial => 'my/blocks/assiagn_issue') %>"); \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index f93318c7d..ed9001ee2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -275,6 +275,8 @@ RedmineApp::Application.routes.draw do match 'my/remove_block', :controller => 'my', :action => 'remove_block', :via => :post match 'my/order_blocks', :controller => 'my', :action => 'order_blocks', :via => :post + get 'my/page2', :to => 'my#page2', :as => "my_page2" + resources :users match 'users/:id/memberships/:membership_id', :to => 'users#edit_membership', :via => :put, :as => 'user_membership' match 'users/:id/memberships/:membership_id', :to => 'users#destroy_membership', :via => :delete From 6253f281bc4d482c45de17f7179a4e5b81789e81 Mon Sep 17 00:00:00 2001 From: linhk <304431313@.com> Date: Fri, 22 Aug 2014 09:56:03 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E8=AF=84=E5=AE=A1?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E4=BD=8D=E7=BD=AE=E6=9B=B4=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/attachments/file.html.erb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/views/attachments/file.html.erb b/app/views/attachments/file.html.erb index 57393b81e..c85cbe32a 100644 --- a/app/views/attachments/file.html.erb +++ b/app/views/attachments/file.html.erb @@ -4,7 +4,13 @@

<%= h("#{@attachment.description} - ") unless @attachment.description.blank? %> <%= link_to_user(@attachment.author) %>, <%= format_time(@attachment.created_on) %>

<%= link_to_attachment @attachment, :text => l(:button_download), :download => true -%> - (<%= number_to_human_size @attachment.filesize %>)

+ (<%= number_to_human_size @attachment.filesize %>)    + <%= link = link_to(l(:button_add), {:controller => 'code_review', + :action => 'assign', :action_type => 'attachment', + :id=>@attachment.project, + :change_id => '', :attachment_id => @attachment.id, + }, :class => 'icon icon-add') %> +

  From 0d93783764f5892c5af273c1700cfe71ead20eed Mon Sep 17 00:00:00 2001 From: zhanghaitao <562681745@qq.com> Date: Fri, 22 Aug 2014 10:20:30 +0800 Subject: [PATCH 5/5] =?UTF-8?q?#1047=20=E4=BF=AE=E5=A4=8D=E4=BD=9C?= =?UTF-8?q?=E5=93=81=E4=B8=8B=E8=BD=BD--=E5=86=85=E5=AE=B9=E8=B6=85?= =?UTF-8?q?=E5=87=BA=E5=8F=B3=E8=BE=B9=E6=A1=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/files/_show_all_attachment.html.erb | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/app/views/files/_show_all_attachment.html.erb b/app/views/files/_show_all_attachment.html.erb index 043fe1183..f865235ae 100644 --- a/app/views/files/_show_all_attachment.html.erb +++ b/app/views/files/_show_all_attachment.html.erb @@ -3,7 +3,8 @@ <% attachmenttypes = @project.attachmenttypes %> <% delete_allowed = User.current.allowed_to?(:manage_files, @project) %> <% edit_allowed = User.current.allowed_to?(:manage_files, @project) %> - +
+
@@ -40,17 +41,17 @@ <%next%> <%end%> "> - + - - + - - + - + - @@ -83,7 +84,7 @@
<%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %><%= link_to_attachment file, :download => true, :title => file.filename+"\n"+file.description.to_s, :style => "width: 230px; overflow: hidden; white-space: nowrap;text-overflow: ellipsis;" %> <%= number_to_human_size(file.filesize) %> + <%= number_to_human_size(file.filesize) %> <%= file.attachmentstype.typeName %> <%= render :partial => 'attachments/type_edit', :locals => {:attachmenttypes => attachmenttypes, :attachment => file, :contentype => selContentType} %> <%= file.show_suffix_type %> + <%= file.show_suffix_type %> <%= file.file_dense_str %>   @@ -58,9 +59,9 @@ :attachment => file} %> <%= file.downloads %><%= file.downloads %> + <%= link_to(image_tag('delete.png'), attachment_path(file), :data => {:confirm => l(:text_are_you_sure)}, :method => :delete) if delete_allowed %>
- +