From 38b1f69aa583b8b39d5fcaa515bef27de7df7e5c Mon Sep 17 00:00:00 2001 From: yanxd Date: Sat, 4 Jan 2014 17:29:35 +0800 Subject: [PATCH 1/7] fix bug in homework.html/ with admin or user who is belong to jfm. --- app/views/bids/_history.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/bids/_history.html.erb b/app/views/bids/_history.html.erb index b5b2f9499..a3560fc00 100644 --- a/app/views/bids/_history.html.erb +++ b/app/views/bids/_history.html.erb @@ -37,7 +37,7 @@ <% if @user==User.current|| User.current.admin? %> <%#= link_to(l(:label_bid_respond_delete), {:controller => 'bids', :action => 'destroy', :object_id => journal, :id => bid},:confirm => l(:label_delete_confirm), :remote => true, :method => 'delete', :class => "delete", :confirm => l(:text_are_you_sure), :title => l(:button_delete)) %> - <%= link_to(l(:label_bid_respond_delete), {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => user}, :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %> + <%= link_to(l(:label_bid_respond_delete), {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => @user}, :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %> <% end %> From 4b8a4c82c9ee3c17200c5d7883581da4a33a83ce Mon Sep 17 00:00:00 2001 From: yanxd Date: Mon, 6 Jan 2014 19:29:18 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E5=AD=A6=E5=8F=B7=E5=9C=A8=E4=BD=9C?= =?UTF-8?q?=E4=B8=9A=E9=87=8C=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98=EF=BC=8C?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E6=97=B6=E9=97=B4=E6=98=BE=E7=A4=BA=E4=B8=8D?= =?UTF-8?q?=E7=A1=AE=E5=AE=9A=E9=97=AE=E9=A2=98=EF=BC=8C=E9=A1=B9=E7=9B=AE?= =?UTF-8?q?=E7=BC=BA=E9=99=B7=E6=BB=91=E5=8A=A8=E6=95=88=E6=9E=9C=E4=B9=B1?= =?UTF-8?q?=E8=B7=B3=E9=97=AE=E9=A2=98=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/bids_helper.rb | 12 +++++++++-- app/helpers/welcome_helper.rb | 30 ++++++++++++++++++++------ app/views/bids/_homework_list.html.erb | 7 +++++- app/views/issues/_list.html.erb | 5 +---- app/views/issues/index.html.erb | 9 ++++---- app/views/projects/feedback.html.erb | 1 - app/views/welcome/index.html.erb | 2 +- 7 files changed, 46 insertions(+), 20 deletions(-) diff --git a/app/helpers/bids_helper.rb b/app/helpers/bids_helper.rb index cb3a8f784..bd39d6c28 100644 --- a/app/helpers/bids_helper.rb +++ b/app/helpers/bids_helper.rb @@ -129,8 +129,16 @@ module BidsHelper def im_watching_student_id? bid people = [] people << bid.author - bid.join_in_contests.each do |jic| - people << jic.user + case bid.reward_type # 天煞的bid分了三用途,里面各种hasmany还不定能用! + when 1 + when 2 + bid.join_in_contests.each do |jic| + people << jic.user + end + when 3 + people += bid.courses.first.users.to_a + else + raise 'bids_helper: unknow bid type' # 出了错看这里!不知道的抛异常,省的找不到出错的地方! end people.include?(User.current) end diff --git a/app/helpers/welcome_helper.rb b/app/helpers/welcome_helper.rb index 329f84742..69b06aa12 100644 --- a/app/helpers/welcome_helper.rb +++ b/app/helpers/welcome_helper.rb @@ -74,17 +74,31 @@ module WelcomeHelper def show_user_content event str = ' '.html_safe case event.event_type - when 'news' , 'issue', 'message' , 'bid' , 'wiki-page' , 'document' - str << content_tag("span", "发表了") << content_tag("span", find_all_event_type(event)) << ': '.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url, :target => "_blank" ) + when 'news' + str << content_tag("span", "发表了") << + content_tag("span", find_all_event_type(event)) << + ': '.html_safe << + link_to(truncate(strip_tags(event.event_description).gsub(/ /,''), length: 30, omission:'...'), event.event_url) + when 'issue', 'message' , 'bid' , 'wiki-page' , 'document' + str << content_tag("span", "发表了") << + content_tag("span", find_all_event_type(event)) << + ': '.html_safe << + link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) when 'reply' ,'Reply', 'Memo' str << content_tag("span", "发表了") << content_tag("span", find_all_event_type(event)) << ': '.html_safe << - link_to(truncate(strip_tags(event.event_description).gsub(/ /,''), length: 30, omission:'...'), event.event_url, :target => "_blank" ) + link_to(truncate(strip_tags(event.event_description).gsub(/ /,''), length: 30, omission:'...'), event.event_url) when 'attachment' - str << content_tag('span', '上传了') << content_tag('span', find_all_event_type(event)) << ': '.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) << link_to((' ['.html_safe+l(:label_downloads_list).to_s << ']'), project_files_path(event.container), :class => "attachments_list_color") + str << content_tag('span', '上传了') << + content_tag('span', find_all_event_type(event)) << + ': '.html_safe << + link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) << + link_to((' ['.html_safe+l(:label_downloads_list).to_s << ']'), project_files_path(event.container), :class => "attachments_list_color") else - str << content_tag("span", "更新了") << content_tag("span", find_all_event_type(event)) << ': '.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url, :target => "_blank" ) + str << content_tag("span", "更新了") << + content_tag("span", find_all_event_type(event)) << + ': '.html_safe << link_to(truncate(event.event_title, length: 30, omission:'...'), event.event_url) end str rescue Exception => e @@ -94,10 +108,12 @@ module WelcomeHelper def show_event_reply event str = "回复(" case event.event_type + when 'news' + str << link_to( event.comments.count, news_path(event)) << ")" when "issue" - str << link_to(cal_issues_count(event), issue_path(event), :target => "_blank" ) << ")" + str << link_to(cal_issues_count(event), issue_path(event)) << ")" when "Memo" - str << link_to(cal_memos_count(event), forum_memo_path(event.forum_id,event.id), :target => "_blank" ) << ")" + str << link_to(cal_memos_count(event), forum_memo_path(event.forum_id,event.id)) << ")" else str = "" end diff --git a/app/views/bids/_homework_list.html.erb b/app/views/bids/_homework_list.html.erb index 0fd2bf202..bae83f14a 100644 --- a/app/views/bids/_homework_list.html.erb +++ b/app/views/bids/_homework_list.html.erb @@ -13,6 +13,7 @@ <% end %> +<% display_id = im_watching_student_id? @bid%> <% @homework_list.each do |homework|%> <% if homework.attachments.any?%> @@ -24,7 +25,11 @@ - + + <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %> <% end %> @@ -85,3 +85,16 @@ <% html_title(l(:label_news_plural)) -%> + diff --git a/app/views/news/new.html.erb b/app/views/news/new.html.erb index 42dbcae85..feaf7540b 100644 --- a/app/views/news/new.html.erb +++ b/app/views/news/new.html.erb @@ -1,9 +1,9 @@ -

<%=l(:label_news_new)%>

+ <%= labelled_form_for @news, :url => project_news_index_path(@project), :html => { :id => 'news-form', :multipart => true } do |f| %> <%= render :partial => 'news/form', :locals => { :f => f } %> - <%= submit_tag l(:button_create), :class => "enterprise" %> - <%= preview_link preview_news_path(:project_id => @project), 'news-form' %> + <%= submit_tag l(:button_create), :class => "whiteButton m3p10 h30" %> + <%= preview_link preview_news_path(:project_id => @project), 'news-form' ,target='preview',{:class => 'whiteButton m3p10'}%> <% end %>
diff --git a/app/views/news/show.html.erb b/app/views/news/show.html.erb index 3c7d0adad..970e228e9 100644 --- a/app/views/news/show.html.erb +++ b/app/views/news/show.html.erb @@ -16,7 +16,7 @@ :html => { :id => 'news-form', :multipart => true, :method => :put } do |f| %> <%= render :partial => 'form', :locals => { :f => f } %> <%= submit_tag l(:button_save) %> - <%= preview_link preview_news_path(:project_id => @project, :id => @news), 'news-form' %> | + <%= preview_link preview_news_path(:project_id => @project, :id => @news), 'news-form',target='preview',{:class => ''} %> | <%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;' %> <% end %>
diff --git a/public/stylesheets/nyan.css b/public/stylesheets/nyan.css index a99eb1429..fcc58bd3e 100644 --- a/public/stylesheets/nyan.css +++ b/public/stylesheets/nyan.css @@ -3,19 +3,17 @@ .text_center{ text-align: center; } - * { font-family: Helvetica, Tahoma, Arial, "Microsoft YaHei", "微软雅黑", SimSun, "宋体", STXihei, "华文细黑", Heiti, "黑体", sans-serif; } + /* 按钮 *******************************************************************************/ -input[class='whiteButton'], .whiteButton { - +input[class~='whiteButton'], .whiteButton { -moz-box-shadow:inset 0px 1px 0px 0px #ffffff; -webkit-box-shadow:inset 0px 1px 0px 0px #ffffff; box-shadow:inset 0px 1px 0px 0px #ffffff; - background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #ffffff), color-stop(1, #f6f6f6)); background:-moz-linear-gradient(top, #ffffff 5%, #f6f6f6 100%); background:-webkit-linear-gradient(top, #ffffff 5%, #f6f6f6 100%); @@ -23,28 +21,24 @@ input[class='whiteButton'], .whiteButton { background:-ms-linear-gradient(top, #ffffff 5%, #f6f6f6 100%); background:linear-gradient(to bottom, #ffffff 5%, #f6f6f6 100%); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffffff', endColorstr='#f6f6f6',GradientType=0); - background-color:#ffffff; - -moz-border-radius:6px; -webkit-border-radius:6px; border-radius:6px; - border:1px solid #dcdcdc; - display:inline-block; color:#666666; + color: #116699; font-family:arial; font-size:15px; font-weight:bold; padding:6px 24px; + /*padding:3px 10px;*/ text-decoration:none; - text-shadow:0px 1px 0px #ffffff; - } -input[class='whiteButton']:hover, .whiteButton:hover { - +input[class~='whiteButton']:hover, .whiteButton:hover { + color: #c61a1a; background:-webkit-gradient(linear, left top, left bottom, color-stop(0.05, #f6f6f6), color-stop(1, #ffffff)); background:-moz-linear-gradient(top, #f6f6f6 5%, #ffffff 100%); background:-webkit-linear-gradient(top, #f6f6f6 5%, #ffffff 100%); @@ -52,14 +46,22 @@ input[class='whiteButton']:hover, .whiteButton:hover { background:-ms-linear-gradient(top, #f6f6f6 5%, #ffffff 100%); background:linear-gradient(to bottom, #f6f6f6 5%, #ffffff 100%); filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#f6f6f6', endColorstr='#ffffff',GradientType=0); - + text-decoration: none; background-color:#f6f6f6; } - - -input[class='whiteButton']:active, .whiteButton:active { +input[class~='whiteButton']:active, .whiteButton:active { position:relative; top:1px; + text-decoration: none; +} +input[class~='m3p10'], .m3p10 { + margin: 0; + padding: 3px 10px; + height: 20px; + display: inline-block; +} +input[class~='h30'], .h30{ + height: 30px; } /* minimal *******************************************************************************/ @@ -313,3 +315,25 @@ table.content-text-list tbody tr td.locked, div.memo-section .locked{ border-bottom-left-radius : 10px; border-bottom-right-radius: 10px; } +/* 项目新闻栏 +*******************************************************************************/ +.add_frame { + position:relative; + margin: 5px 10px 2px 0px; + padding: 10px 10px; + border-radius: 5px; + /*box-shadow: 1px 1px 6px rgb(241,241,241);*/ + /*border: 1px solid #F1F1F1;*/ +} +.add_frame_header{ + background: linear-gradient(#fbfbfb, #f8f8f8) repeat scroll 0% 0% transparent; + border-bottom: 1px solid rgb(226,226,226); + box-shadow: 0px 1px 0px white, 0px, -1px 0px rgb(245,245,245); + height: 39px; + font-size: 15px; + + line-height: 26px; + height: 30px; + font-size: 1.5em; + padding-left: 4%; +} From ea289ae0361bfc926f6be88101a25076ca174f36 Mon Sep 17 00:00:00 2001 From: yanxd Date: Wed, 8 Jan 2014 20:53:37 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E7=AB=9E=E8=B5=9B=E4=B8=AD=EF=BC=8C?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E9=A1=B9=E7=9B=AE404=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/bids/show_project.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/bids/show_project.html.erb b/app/views/bids/show_project.html.erb index 502d07d46..4b4d7040b 100644 --- a/app/views/bids/show_project.html.erb +++ b/app/views/bids/show_project.html.erb @@ -75,7 +75,7 @@ From 71775000a48bbca2c2dbf49d47917d12fbe7d6df Mon Sep 17 00:00:00 2001 From: yanxd Date: Thu, 9 Jan 2014 08:34:30 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E6=96=B0=E5=BB=BA=E6=96=B0=E9=97=BBcss?= =?UTF-8?q?=EF=BC=8C=E6=95=99=E5=B8=88=E6=96=B0=E5=BB=BA=E8=AF=BE=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/boards/show.html.erb | 8 ++++---- app/views/messages/_form.html.erb | 9 ++++++--- app/views/users/_my_course.html.erb | 2 +- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/app/views/boards/show.html.erb b/app/views/boards/show.html.erb index 8c270eea7..8d31a0431 100644 --- a/app/views/boards/show.html.erb +++ b/app/views/boards/show.html.erb @@ -9,14 +9,14 @@ -
<%= link_to homework.user, user_path(homework.user)%> 提交了作业
<%= l(:label_bidding_user_studentcode) %> :<%= homework.user.user_extensions.student_id%>  + <% if display_id %> + <%= l(:label_bidding_user_studentcode) %> :<%= homework.user.user_extensions.student_id%> + <% end %> +
diff --git a/app/views/issues/_list.html.erb b/app/views/issues/_list.html.erb index 2019a7b45..ed4407fa9 100644 --- a/app/views/issues/_list.html.erb +++ b/app/views/issues/_list.html.erb @@ -1,5 +1,3 @@ -<%= form_tag({}) do -%> -<%= hidden_field_tag 'back_url', url_for(params), :id => nil %>
    <% issue_list(issues) do |issue, level| -%> @@ -57,5 +55,4 @@ <% end -%>
-
-<% end -%> \ No newline at end of file + \ No newline at end of file diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index a72eb4b41..a382a3f7e 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -4,7 +4,7 @@ :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }, :class => 'icon icon-add' %> <%= link_to l(:label_query), '#', :class => 'icon icon-help', - :onclick => '$("#custom_query").slideToggle(); ' if User.current.logged? %> + :onclick => '$("#custom_query").slideToggle(400); ' if User.current.logged? %> @@ -16,12 +16,12 @@ <% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %> - +
<%= form_tag({ :controller => 'issues', :action => 'index', :project_id => @project }, :method => :get, :id => 'query_form', :class => 'query_form') do %> <%= hidden_field_tag 'set_filter', '1' %>
----<%= l :label_query_new %>--- + ---<%= l :label_query_new %>---
"> @@ -59,7 +59,8 @@
<% end %> - +
+
<%= error_messages_for 'query' %> <% if @query.valid? %> diff --git a/app/views/projects/feedback.html.erb b/app/views/projects/feedback.html.erb index 7e1c4077c..027132cda 100644 --- a/app/views/projects/feedback.html.erb +++ b/app/views/projects/feedback.html.erb @@ -55,7 +55,6 @@ function checkMaxLength() { <%= image_tag(url_to_avatar(journal.user), :class => "avatar") %> <%= link_to journal.user, user_path(journal.user)%> - <%= l(:label_projects_feedback) %> <%= textilizable journal.notes%> <%= l :label_update_time %>: <%= format_time journal.created_on %> <% id = 'project_respond_form_'+journal.id.to_s%> diff --git a/app/views/welcome/index.html.erb b/app/views/welcome/index.html.erb index 2b4412bc6..742c28a25 100644 --- a/app/views/welcome/index.html.erb +++ b/app/views/welcome/index.html.erb @@ -138,7 +138,7 @@
<%= link_to event.event_author, (user_path(event.event_author) if event.event_author), :style => "color:green;", :target => "_blank" %><%= show_user_content event %> -

<%= time_tag_welcome event.event_datetime %>     <%= show_event_reply event %>

+

<%= l(:field_updated_on) %><%= time_tag_welcome event.event_datetime %>前     <%= show_event_reply event %>

<% end %> From eafbb208073dc78458b6e37cdb341b64dfaa2bc9 Mon Sep 17 00:00:00 2001 From: yanxd Date: Mon, 6 Jan 2014 21:11:20 +0800 Subject: [PATCH 3/7] =?UTF-8?q?=E5=8C=BF=E5=90=8D=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E7=A6=81=E6=AD=A2=E5=9B=9E=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/journals_for_message.rb | 10 +++++- app/views/bids/_history.html.erb | 5 +++ app/views/bids/show.html.erb | 1 + app/views/projects/feedback.html.erb | 32 +++++++++++++------ app/views/words/_journal_reply_items.html.erb | 7 +++- app/views/words/_message.html.erb | 8 +++-- 6 files changed, 50 insertions(+), 13 deletions(-) diff --git a/app/models/journals_for_message.rb b/app/models/journals_for_message.rb index 550197889..9ca8236d0 100644 --- a/app/models/journals_for_message.rb +++ b/app/models/journals_for_message.rb @@ -28,7 +28,15 @@ class JournalsForMessage < ActiveRecord::Base # default_scope { where('m_parent_id IS NULL') } - def remove_by_user? user + def self.create_by_user? user + if user.anonymous? + return false + else + return true + end + end + + def self.remove_by_user? user if( self.user == user || ( self.jour.kind_of?(User) && self.jour== user ) ) diff --git a/app/views/bids/_history.html.erb b/app/views/bids/_history.html.erb index a3560fc00..e8fced1fd 100644 --- a/app/views/bids/_history.html.erb +++ b/app/views/bids/_history.html.erb @@ -1,3 +1,4 @@ +<% reply_allow = JournalsForMessage.create_by_user? User.current %> <% tip1 = (@bid.reward_type == 3) ? l(:label_student_response) : l(:label_user_response) %>

<%=tip1%>

@@ -29,11 +30,13 @@ <%= l(:label_bids_published) %> <%= time_tag(journal.created_on).html_safe %> <%= l(:label_bids_published_ago) %> <% ids = 'project_respond_form_'+ journal.id.to_s%> + <% if reply_allow %> <%= link_to(l(:button_quote), {:controller => 'bids', :action => 'new', :id => bid, :journal_id => journal}, :remote => true, :method => 'post', :title => l(:button_quote))%> <%= link_to l(:label_bid_respond_quote),'', {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.show_name}: '); $('##{ids} textarea') ;return false;"} %> + <% end %> <% if @user==User.current|| User.current.admin? %> <%#= link_to(l(:label_bid_respond_delete), {:controller => 'bids', :action => 'destroy', :object_id => journal, :id => bid},:confirm => l(:label_delete_confirm), :remote => true, :method => 'delete', :class => "delete", :confirm => l(:text_are_you_sure), :title => l(:button_delete)) %> @@ -43,9 +46,11 @@
<% ids = 'project_respond_form_'+ journal.id.to_s%> + <% if reply_allow %>
<%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %>
+ <% end %>
<%= render :partial => "words/journal_reply", :locals => {:journal => journal } %> diff --git a/app/views/bids/show.html.erb b/app/views/bids/show.html.erb index aec3bb7ee..46b05c292 100644 --- a/app/views/bids/show.html.erb +++ b/app/views/bids/show.html.erb @@ -1,3 +1,4 @@ +<% reply_allow = JournalsForMessage.create_by_user? User.current %>
<%= image_tag(url_to_avatar(@bid.author), :class => "avatar")%> diff --git a/app/views/projects/feedback.html.erb b/app/views/projects/feedback.html.erb index 027132cda..a4e0a3a79 100644 --- a/app/views/projects/feedback.html.erb +++ b/app/views/projects/feedback.html.erb @@ -36,17 +36,27 @@ function checkMaxLength() { +<% reply_allow = JournalsForMessage.create_by_user? User.current %> +

<%= l(:label_user_response) %>

+<% if !User.current.logged?%> +
+ <%= l(:label_user_login_tips) %> + <%= link_to l(:label_user_login_new), signin_path %> +
+
+<% else %>
-<%= form_for('new_form', :method => :post, - :url => {:controller => 'words', :action => 'leave_project_message'}) do |f|%> - <%= f.text_area 'project_message', :rows => 3, :cols => 65, - :placeholder => "#{l(:label_welcome_my_respond)}", - :style => "resize: none; width: 98%", - :class => 'noline'%> - <%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-right: 1%; margin-top: 1px;"%> -<% end %> + <%= form_for('new_form', :method => :post, + :url => {:controller => 'words', :action => 'leave_project_message'}) do |f|%> + <%= f.text_area 'project_message', :rows => 3, :cols => 65, + :placeholder => "#{l(:label_welcome_my_respond)}", + :style => "resize: none; width: 98%", + :class => 'noline'%> + <%= submit_tag l(:button_leave_meassge), :name => nil , :class => "enterprise" , :style => "display: block; float: right; margin-right: 1%; margin-top: 1px;"%> + <% end %>
+<% end %>
<% if @jour.size >0 %>
    @@ -59,18 +69,22 @@ function checkMaxLength() { <%= l :label_update_time %>: <%= format_time journal.created_on %> <% id = 'project_respond_form_'+journal.id.to_s%> - <%= link_to l(:label_projects_feedback_respond),'', + <% if reply_allow %> + <%= link_to l(:label_projects_feedback_respond),'#', {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{id}'), $('##{id} textarea'), '#{l(:label_reply_plural)} #{journal.user.show_name}: '); return false;"} %> + <% end %>
    + <% if reply_allow %>
    <%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %>
    + <% end %>
    <%= render :partial => "words/journal_reply", :locals => {:journal => journal } %> diff --git a/app/views/words/_journal_reply_items.html.erb b/app/views/words/_journal_reply_items.html.erb index 0cc3e1709..a70a555aa 100644 --- a/app/views/words/_journal_reply_items.html.erb +++ b/app/views/words/_journal_reply_items.html.erb @@ -1,3 +1,4 @@ +<% reply_allow = JournalsForMessage.create_by_user? User.current %> <% ids_r = 'reply_respond_form_'+ reply.id.to_s %>
  • @@ -12,10 +13,12 @@

    <%= format_time reply.created_on %>

  • + <% if reply_allow %> <%= render :partial => "words/new_respond", :locals => {:journal => journal, :m_reply_id => m_reply_id} %> + <% end %>
    \ No newline at end of file diff --git a/app/views/words/_message.html.erb b/app/views/words/_message.html.erb index 7c7ae4acd..03547aa8d 100644 --- a/app/views/words/_message.html.erb +++ b/app/views/words/_message.html.erb @@ -35,6 +35,7 @@ function checkMaxLength() { } +<% reply_allow = JournalsForMessage.create_by_user? User.current %> <% if jour.size >0 %> <% remove_allowed = (User.current.id == jour.first.user_id) %>
      @@ -49,10 +50,11 @@ function checkMaxLength() { <%= l :label_comment_time %>:  <%= format_time journal.created_on %> <% ids = 'project_respond_form_'+ journal.id.to_s%> - <%= link_to l(:label_projects_feedback_respond),'', + <% if reply_allow %> + <%= link_to l(:label_projects_feedback_respond),'', {:focus => 'project_respond', :onclick => "toggleAndSettingWordsVal($('##{ids}'), $('##{ids} textarea'), '#{l(:label_reply_plural)} #{journal.user.show_name}: '); $('##{ids} textarea') ;return false;"} %> - + <% end %> <% if @user == User.current || User.current.admin? || journal.user.id == User.current.id %> <%= link_to(l(:label_newfeedback_delete), {:controller => 'words', :action => 'destroy', :object_id => journal, :user_id => user}, :remote => true, :confirm => l(:text_are_you_sure), :method => 'delete', :class => "delete", :title => l(:button_delete)) %> @@ -61,7 +63,9 @@ function checkMaxLength() {
      + <% if reply_allow %> <%= render :partial => 'words/new_respond', :locals => {:journal => journal, :m_reply_id => journal} %> + <% end %>
      From 789acee429587c920fc33ff37455690b1e448c8e Mon Sep 17 00:00:00 2001 From: yanxd Date: Tue, 7 Jan 2014 08:20:26 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E7=BC=BA=E9=99=B7=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E9=A3=98=E6=9D=A5=E9=A3=98=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/issues/index.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/issues/index.html.erb b/app/views/issues/index.html.erb index a382a3f7e..bd475a3a3 100644 --- a/app/views/issues/index.html.erb +++ b/app/views/issues/index.html.erb @@ -16,7 +16,7 @@
      <% html_title(@query.new_record? ? l(:label_issue_plural) : @query.name) %> -
      +
      <%= form_tag({ :controller => 'issues', :action => 'index', :project_id => @project }, :method => :get, :id => 'query_form', :class => 'query_form') do %> <%= hidden_field_tag 'set_filter', '1' %> @@ -60,7 +60,7 @@
      <% end %>
      -
      + <%= error_messages_for 'query' %> <% if @query.valid? %> From b9967074dc2d9b73ff343443c131bf8ed50c4b6f Mon Sep 17 00:00:00 2001 From: yanxd Date: Wed, 8 Jan 2014 20:18:32 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E6=96=B0=E9=97=BB=E7=95=8C=E9=9D=A2?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=EF=BC=8Cnew=E9=A1=B5=E9=9D=A2bug=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/news_controller.rb | 5 ++- app/views/issues/show.html.erb | 2 +- app/views/layouts/base_courses.html.erb | 2 +- app/views/news/_form.html.erb | 7 +++- app/views/news/index.html.erb | 51 +++++++++++++--------- app/views/news/new.html.erb | 6 +-- app/views/news/show.html.erb | 2 +- public/stylesheets/nyan.css | 56 ++++++++++++++++++------- 8 files changed, 86 insertions(+), 45 deletions(-) diff --git a/app/controllers/news_controller.rb b/app/controllers/news_controller.rb index a434fcc5a..ee3db741d 100644 --- a/app/controllers/news_controller.rb +++ b/app/controllers/news_controller.rb @@ -74,7 +74,7 @@ class NewsController < ApplicationController def new @news = News.new(:project => @project, :author => User.current) - @course_tag = @project.project_type + @course_tag = @project.project_type if @course_tag render :layout => 'base_courses' end @@ -89,7 +89,8 @@ class NewsController < ApplicationController flash[:notice] = l(:notice_successful_create) redirect_to project_news_index_path(@project) else - render :action => 'new' + layout_file = (@project.project_type == 1) ? 'base_courses' : 'base_projects' + render :action => 'new', :layout => layout_file end end diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 9bd47d416..7166f306f 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -101,7 +101,7 @@ end %> <%= call_hook(:view_issues_show_description_bottom, :issue => @issue) %> -<% if !@issue.leaf? || User.current.allowed_to?(:manage_subtasks, @project) %> +<% if false # !@issue.leaf? || User.current.allowed_to?(:manage_subtasks, @project) %>
      diff --git a/app/views/layouts/base_courses.html.erb b/app/views/layouts/base_courses.html.erb index 00adabffc..3602a8f93 100644 --- a/app/views/layouts/base_courses.html.erb +++ b/app/views/layouts/base_courses.html.erb @@ -7,7 +7,7 @@ <%= csrf_meta_tag %> <%= favicon %> - <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', :media => 'all' %> + <%= stylesheet_link_tag 'jquery/jquery-ui-1.9.2', 'application', 'nyan', :media => 'all' %> <%= stylesheet_link_tag 'rtl', :media => 'all' if l(:direction) == 'rtl' %> <%= javascript_heads %> <%= heads_for_theme %> diff --git a/app/views/news/_form.html.erb b/app/views/news/_form.html.erb index df80a7483..bfdfeaa37 100644 --- a/app/views/news/_form.html.erb +++ b/app/views/news/_form.html.erb @@ -1,9 +1,12 @@ <%= error_messages_for @news %> - +
      + <% str = (@project.project_type == 1) ? l(:bale_news_notice) : l(:label_news_new) %> + <%= str %> +

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

      -

      <%= f.text_area :description, :required => true, :cols => 60, :rows => 15, :class => 'wiki-edit', :style => "width:490px;" %>

      +

      <%= f.text_area :description, :required => true, :cols => 60, :rows => 11, :class => 'wiki-edit', :style => "width:490px;" %>

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

      diff --git a/app/views/news/index.html.erb b/app/views/news/index.html.erb index 80576e434..de734ef94 100644 --- a/app/views/news/index.html.erb +++ b/app/views/news/index.html.erb @@ -1,34 +1,34 @@ +<% + if @project.project_type == 1 + btn_tips = l(:label_news_notice) + label_tips = l(:label_course_news) + else + btn_tips = l(:label_news_new) + label_tips = l(:label_news) + end +%> +<% if @project && User.current.allowed_to?(:manage_news, @project) %>
      - <% if @project.project_type == 1%> - <%= link_to(l(:label_news_notice), + <%= link_to(btn_tips, new_project_news_path(@project), :class => 'icon icon-add', - :onclick => 'showAndScrollTo("add-news", "news_title"); return false;') if @project && User.current.allowed_to?(:manage_news, @project) %> - <% else %> - <%= link_to(l(:label_news_new), - new_project_news_path(@project), - :class => 'icon icon-add', - :onclick => 'showAndScrollTo("add-news", "news_title"); return false;') if @project && User.current.allowed_to?(:manage_news, @project) %> - <% end %> + :onclick => 'showAndScrollTo("add-news", "news_title"); return false;') %>
      -
<%= link_to_user(news.author)if news.respond_to?(:author) %><%= l(:label_project_newshare)%> <%= link_to h(news.title), news_path(news) %> - <%= delete_link news_path(news) if User.current.allowed_to?(:manage_news, @project) %>

- <%= link_to '创建项目', new_project_path, :target=>'_blank'%> + <%= link_to '创建项目', new_project_path(course: 0, project_type: 0), :target=>'_blank'%>