diff --git a/Gemfile b/Gemfile index fbe74f8dd..a43efbaeb 100644 --- a/Gemfile +++ b/Gemfile @@ -6,6 +6,10 @@ unless RUBY_PLATFORM =~ /w32/ gem 'iconv' end +source 'http://rubygems.oneapm.com' do + gem 'oneapm_rpm' +end + gem "mysql2", "= 0.3.18" gem 'redis-rails' gem 'rubyzip' diff --git a/app/api/mobile/apis/users.rb b/app/api/mobile/apis/users.rb index fa1856b3d..96b788dab 100644 --- a/app/api/mobile/apis/users.rb +++ b/app/api/mobile/apis/users.rb @@ -98,6 +98,7 @@ module Mobile params do requires :token, type: String requires :user_id, type: Integer,desc: '被留言的用户id' + requires :page,type:Integer,desc:'请求数据的页码' end get ':user_id/messages' do us = UsersService.new @@ -106,7 +107,7 @@ module Mobile present :status,0 end - desc "给用户留言或回复用户留言" + desc "回复用户留言" params do requires :token, type: String requires :user_id, type: Integer,desc: '被留言的用户id' @@ -115,12 +116,23 @@ module Mobile requires :parent_id,type:Integer,desc:'留言父id' requires :ref_message_id,type:Integer,desc:'引用消息id' end - post ':user_id/leave_message' do + post ':user_id/reply_message' do us = UsersService.new jours = us.reply_user_messages params,current_user present :status,0 end + desc "给用户留言" + params do + requires :token, type: String + requires :user_id, type: Integer,desc:'被留言的用户id' + requires :content, type: String,desc:'留言内容' + end + post ':user_id/leave_message' do + us = UsersService.new + us.leave_message params,current_user + present :data,0 + end end end end diff --git a/app/controllers/account_controller.rb b/app/controllers/account_controller.rb index 7976e1aa4..dc1cceb87 100644 --- a/app/controllers/account_controller.rb +++ b/app/controllers/account_controller.rb @@ -336,6 +336,7 @@ class AccountController < ApplicationController :expires => 1.month.from_now, :path => (Redmine::Configuration['autologin_cookie_path'] || '/'), :secure => (Redmine::Configuration['autologin_cookie_secure'] ? true : false), + :domain => Redmine::Configuration['cookie_domain'], :httponly => true } cookies[autologin_cookie_name] = cookie_options diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 0dc86fb01..88cd51d67 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -199,7 +199,7 @@ class ApplicationController < ActionController::Base # Logs out current user def logout_user if User.current.logged? - cookies.delete(autologin_cookie_name) + cookies.delete(autologin_cookie_name, domain: :all) # Token.delete_all(["user_id = ? AND action = ?", User.current.id, 'autologin']) self.logged_user = nil end diff --git a/app/controllers/avatar_controller.rb b/app/controllers/avatar_controller.rb index afd206c92..a7c0e7b95 100644 --- a/app/controllers/avatar_controller.rb +++ b/app/controllers/avatar_controller.rb @@ -24,6 +24,7 @@ class AvatarController < ApplicationController else @image_file=params[:filename] end + @temp_file = StringIO.new(@temp_file) end end end @@ -32,7 +33,7 @@ class AvatarController < ApplicationController if @temp_file.size > Setting.upload_avatar_max_size.to_i @status = 1 @msg = l(:error_upload_avatar_to_large, :max_size => number_to_human_size(Setting.upload_avatar_max_size.to_i)) - elsif Trustie::Utils::Image.new(@temp_file.tempfile.path).image? + elsif Trustie::Utils::Image.new(@temp_file).image? diskfile=disk_filename(@source_type,@source_id) @urlfile='/' << File.join("images","avatars",avatar_directory(@source_type),avatar_filename(@source_id,@image_file)) @@ -50,6 +51,7 @@ class AvatarController < ApplicationController md5 = Digest::MD5.new File.open(diskfile, "wb") do |f| if @temp_file.respond_to?(:read) + @temp_file.rewind buffer = "" while (buffer = @temp_file.read(8192)) f.write(buffer) diff --git a/app/controllers/bids_controller.rb b/app/controllers/bids_controller.rb index c98df27d3..35236414f 100644 --- a/app/controllers/bids_controller.rb +++ b/app/controllers/bids_controller.rb @@ -675,11 +675,12 @@ class BidsController < ApplicationController #删除作业 #by xianbo def homework_destroy - @bid_to_destroy = Bid.find params[:course_id] + @bid_to_destroy = Bid.find params[:id] + course_url = course_homework_path(@bid_to_destroy.courses.first) (render_403; return false) unless User.current.admin?||User.current.id==@bid_to_destroy.author_id @bid_to_destroy.destroy respond_to do |format| - format.html { redirect_to :back } + format.html { redirect_to course_url } format.js #format.api { render_api_ok } end diff --git a/app/controllers/issues_controller.rb b/app/controllers/issues_controller.rb index 83f68d8d8..539d84e65 100644 --- a/app/controllers/issues_controller.rb +++ b/app/controllers/issues_controller.rb @@ -126,11 +126,11 @@ class IssuesController < ApplicationController @edit_allowed = User.current.allowed_to?(:edit_issues, @project) @priorities = IssuePriority.active @time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project) - + @project_base_tag = (params[:project_id] || @issue.project) ? 'base_projects':'base'#by young @available_watchers = (@issue.project.users.sort + @issue.watcher_users).uniq - - respond_to do |format| + + respond_to do |format|`` format.html { retrieve_previous_and_next_issue_ids render :template => 'issues/show', :layout => @project_base_tag#by young diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index 536ea6bba..b9e46daee 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -348,7 +348,7 @@ class ProjectsController < ApplicationController if !params[:mail].blank? && User.find_by_mail(params[:mail].to_s).nil? email = params[:mail] Mailer.run.send_invite_in_project(email, @project, User.current) - @is_zhuce =false + @is_zhuce = false flash[:notice] = l(:notice_email_sent, :value => email) elsif !User.find_by_mail(params[:mail].to_s).nil? user = User.find_by_mail(params[:mail].to_s) diff --git a/app/controllers/zipdown_controller.rb b/app/controllers/zipdown_controller.rb index 06d69f72e..d9b900833 100644 --- a/app/controllers/zipdown_controller.rb +++ b/app/controllers/zipdown_controller.rb @@ -9,10 +9,14 @@ class ZipdownController < ApplicationController #统一下载功能 def download - begin - send_file "#{OUTPUT_FOLDER}/#{params[:file]}", :filename => params[:filename], :type => detect_content_type(params[:file]) - rescue => e - render file: 'public/no_file_found.html' + if User.current.logged? + begin + send_file "#{OUTPUT_FOLDER}/#{params[:file]}", :filename => params[:filename], :type => detect_content_type(params[:file]) + rescue => e + render file: 'public/no_file_found.html' + end + else + render_403 end end diff --git a/app/services/courses_service.rb b/app/services/courses_service.rb index 26d8df16f..49170bf30 100644 --- a/app/services/courses_service.rb +++ b/app/services/courses_service.rb @@ -364,19 +364,20 @@ class CoursesService latest_course_dynamics = [] latest_news = course.news.order("created_on desc").first unless latest_news.nil? - latest_course_dynamics << {:type => 1,:time => latest_news.created_on,:message => l(:label_recently_updated_notification,:locale => get_user_language(current_user))} + latest_course_dynamics << {:type => 1,:time => latest_news.created_on, + :message =>latest_news.author.realname<< l(:label_recently_updated_notification,:locale => get_user_language(current_user))<<":"<< latest_news.title } end latest_message = course.journals_for_messages.order("created_on desc").first unless latest_message.nil? - latest_course_dynamics << {:type => 2,:time => latest_message.created_on,:message => l(:label_recently_updated_message,:locale => get_user_language(current_user))} + latest_course_dynamics << {:type => 2,:time => latest_message.created_on,:message =>latest_message.user.realname << l(:label_recently_updated_message,:locale => get_user_language(current_user))<<":"< 3,:time => latest_attachment.created_on,:message => l(:label_recently_updated_courseware,:locale => get_user_language(current_user))} + latest_course_dynamics << {:type => 3,:time => latest_attachment.created_on,:message =>latest_attachment.author.realname<< l(:label_recently_updated_courseware,:locale => get_user_language(current_user))<<":"< 4,:time => latest_bid.updated_on,:message => l(:label_recently_updated_homework,:locale => get_user_language(current_user))} + latest_course_dynamics << {:type => 4,:time => latest_bid.updated_on,:message => latest_bid.author.realname< get_user_language(current_user))<<":"< 4,:time => latest_homework_attach.updated_at,:message => l(:label_recently_updated_homework,:locale => get_user_language(current_user))} + latest_course_dynamics << {:type => 4,:time => latest_homework_attach.updated_at,:message =>latest_homework_attach.user.realname<< l(:label_recently_updated_homework,:locale => get_user_language(current_user))<<":"<<(latest_homework_attach.name.nil? ? latest_homework_attach.description : latest_homework_attach.name)} end latest_course_dynamics.sort!{|order,newer| newer[:time] <=> order[:time]} latest_course_dynamic = latest_course_dynamics.first diff --git a/app/services/users_service.rb b/app/services/users_service.rb index a8aacb095..7d7976bb5 100644 --- a/app/services/users_service.rb +++ b/app/services/users_service.rb @@ -158,7 +158,7 @@ class UsersService # 获取某个用户的所有留言信息 def get_all_messages params user = User.find(params[:user_id]) - jours = user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC') + jours = user.journals_for_messages.where('m_parent_id IS NULL').order('created_on DESC').page(params[:page] || 1).per(10) jours.update_all(:is_readed => true, :status => false) jours.each do |journal| fetch_user_leaveWord_reply(journal).update_all(:is_readed => true, :status => false) @@ -184,7 +184,11 @@ class UsersService user.add_jour(nil, nil,nil,options) end - + # 给用户留言 + def leave_message params,current_user + obj = User.find(params[:user_id]).add_jour(current_user, params[:content], 0) + obj + end #关注列表 diff --git a/app/views/courses/homework.html.erb b/app/views/courses/homework.html.erb index f7cf2a360..7b74351cd 100644 --- a/app/views/courses/homework.html.erb +++ b/app/views/courses/homework.html.erb @@ -21,6 +21,9 @@

<%= l(:lebel_homework_commit)%> ( <%= link_to bid.homeworks.count, course_for_bid_path(bid.id), :class => 'c_red'%> )

<% if @is_teacher%> <%= bid_anonymous_comment(bid)%> + <% if bid.homeworks.empty? %> + <%= link_to(l(:button_delete),bids_homework_path(:id => bid.id), :method => :delete, :confirm => l(:label_delete_confirm), :class => "fr mr10 work_edit") %> + <% end %> <%= link_to(l(:button_edit),edit_bid_path(:course_id =>@course.id, :bid_id => bid.id), :class => "fr mr10 work_edit") %> <% elsif @is_student%> <%= student_anonymous_comment bid %> @@ -59,4 +62,4 @@
    <%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => false, :flag => true%>
-
\ No newline at end of file +
diff --git a/app/views/issues/_action_menu.html.erb b/app/views/issues/_action_menu.html.erb index a5823ede3..2643c93e7 100644 --- a/app/views/issues/_action_menu.html.erb +++ b/app/views/issues/_action_menu.html.erb @@ -1,6 +1,6 @@ <%#= watcher_link_issue(@issue, User.current) %> -<%#= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'icon icon-copy' if User.current.allowed_to?(:add_issues, @project) %> +<%= link_to l(:button_copy), project_copy_issue_path(@project, @issue), :class => 'talk_edit fr' if User.current.allowed_to?(:add_issues, @project) %> <%= link_to l(:button_delete), issue_path(@issue.id), :data => {:confirm => issues_destroy_confirmation_message(@issue)}, :method => :delete, :class => 'talk_edit fr' if User.current.allowed_to?(:delete_issues, @project) %> <%= link_to l(:button_edit), edit_issue_path(@issue.id), :onclick => 'showAndScrollTo("all_attributes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:edit_issues, @project) %> <%= link_to l(:label_user_newfeedback), edit_issue_path(@issue.id), :onclick => 'showAndScrollTo("update", "issue_notes"); return false;', :class => 'talk_edit fr', :accesskey => accesskey(:edit) if @issue.editable? && User.current.allowed_to?(:add_issue_notes, @project) %> diff --git a/app/views/issues/_form.html.erb b/app/views/issues/_form.html.erb index 4cd370adc..41fca87eb 100644 --- a/app/views/issues/_form.html.erb +++ b/app/views/issues/_form.html.erb @@ -5,12 +5,10 @@
  • <% if @issue.safe_attribute? 'tracker_id' %> - <%= f.select :tracker_id, - @issue.project.trackers.collect { |t| [t.name, t.id] }, - {:required => true, :no_label => true}, - :onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')", - :class => "w90" - %> + <%= f.select :tracker_id, @issue.project.trackers.collect { |t| [t.name, t.id] }, + {:required => true, :no_label => true}, + :onchange => "updateIssueFrom('#{escape_javascript project_issue_form_path(@project, :id => @issue, :format => 'js')}')", + :class => "w90" %> <% end %>
  • @@ -31,11 +29,10 @@ <% if @issue.safe_attribute? 'subject' %> <%= f.text_field :subject, - :class => "w583", - :maxlength => 255, - :style => "font-size:small", - :no_label => true - %> + :class => "w576", + :maxlength => 255, + :style => "font-size:small", + :no_label => true %> <%= javascript_tag do %> observeAutocompleteField('issue_subject', @@ -54,16 +51,17 @@ <% if @issue.safe_attribute? 'description' %> <%= f.label_for_field :description, :required => @issue.required_attribute?('description'), :no_label => true, :class => "label" %> - <%= link_to_function image_tag('edit.png'), '$(this).hide(); $("#issue_description_and_toolbar").show()' unless @issue.new_record? %> - <%= content_tag 'span', :id => "issue_description_and_toolbar", :style => (@issue.new_record? ? nil : 'display:none') do %> - <%= f.text_area :description, - :rows => (@issue.description.blank? ? 10 : [[10, @issue.description.length / 50].max, 100].min), - :accesskey => accesskey(:edit), - :class => "w583", - :no_label => true %> - <% end %> - - <%= wikitoolbar_for 'issue_description' %> + <%#= link_to_function image_tag('edit.png'), '$(this).hide(); $("#issue_description_and_toolbar").show()' unless @issue.new_record? %> + <%#= content_tag 'span', :id => "issue_description_and_toolbar" do %> + <%= f.kindeditor :description,:editor_id => "issue_desc_editor", + # :rows => (@issue.description.blank? ? 10 : [[10, @issue.description.length / 50].max, 100].min), + # :accesskey => accesskey(:edit), + # :class => "w583", + :width=>'87%', + :resizeType => 0, + :no_label => true %> + <%# end %> + <%#= wikitoolbar_for 'issue_description' %> <% end %>
  • @@ -96,20 +94,20 @@
    - - - - <%#= link_to "", + + + + <%#= link_to "", # {:controller => 'watchers', :action => 'new', :project_id => @issue.project}, # :remote => true, # :method => 'get', :class => "pic_sch mt5 ml5" %> - + <%#= javascript_tag "observeSearchfield('user_search', 'users_for_watcher', '#{ escape_javascript watchers_autocomplete_for_user_path(:user => @available_watchers, :format => 'js', :flag => 'ture') }')" %> - - - + + + <%= call_hook(:view_issues_form_details_bottom, {:issue => @issue, :form => f}) %> diff --git a/app/views/issues/new.html.erb b/app/views/issues/new.html.erb index 137e203ef..77f3baf31 100644 --- a/app/views/issues/new.html.erb +++ b/app/views/issues/new.html.erb @@ -1,3 +1,4 @@ +<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>

    <%= l(:label_issue_new) %>

    @@ -10,7 +11,7 @@ <%= render :partial => 'issues/form', :locals => {:f => f} %> - + <%= l(:button_create) %> <%#= preview_link preview_new_issue_path(:project_id => @project), 'issue-form', 'preview', {:class => "blue_btn fl ml10"} %> diff --git a/app/views/issues/show.html.erb b/app/views/issues/show.html.erb index 112b64745..59ad0b1d2 100644 --- a/app/views/issues/show.html.erb +++ b/app/views/issues/show.html.erb @@ -1,3 +1,4 @@ +<%= javascript_include_tag "/assets/kindeditor/kindeditor" %>

    <%= l(:label_issue_edit) %>

    @@ -32,7 +33,7 @@ <% if @issue.description? || @issue.attachments.any? -%> <% if @issue.description? %> <%#= link_to l(:button_quote), quoted_issue_path(@issue.id), :remote => true, :method => 'post', :class => 'icon icon-comment' if authorize_for('issues', 'edit') %> - <%= textilizable @issue, :description, :attachments => @issue.attachments %> + <%= textAreailizable @issue, :description, :attachments => @issue.attachments %> <% end %>
    @@ -102,13 +103,13 @@
    + <% if @issue.editable? %>
    <%= render :partial => 'edit' %>
    -

    - + <%= l(:button_submit) %> <% end %> @@ -123,18 +124,12 @@ <%= render :partial => 'changesets', :locals => {:changesets => @changesets} %> <% end %> - - - -
    <% other_formats_links do |f| %> <%= f.link_to 'Atom', :url => {:key => User.current.rss_key} %> <%= f.link_to 'PDF' %> <% end %> - <% content_for :sidebar do %> <%= render :partial => 'issues/sidebar' %>
    diff --git a/app/views/layouts/_base_feedback.html.erb b/app/views/layouts/_base_feedback.html.erb index d9bd5e376..07f852914 100644 --- a/app/views/layouts/_base_feedback.html.erb +++ b/app/views/layouts/_base_feedback.html.erb @@ -14,7 +14,7 @@ .close_btn span { display:none;} .side_center .custom_service p { text-align:center; padding:6px 0; margin:0; vertical-align:middle;} .msgserver { margin:2px 0px 0px 4px; padding-top: 0px} - .msgserver a { background:url(/images/sidebar_bg.png) no-repeat -119px -115px; padding-left:22px;} + .msgserver a { padding-left:4px;} .opnionText{ width:122px; height:180px; border-color: #DFDFDF; background:#fff; color:#999; padding:3px; font-size:12px;} .opnionButton{ display:block; background:#15bccf; width:130px; height:23px; margin-top:5px; text-align:center; padding-top:3px;} .opnionButton:hover{background: #0fa9bb; } @@ -180,7 +180,9 @@ function cookieget(n) <% end %>
    diff --git a/app/views/layouts/_new_feedback.html.erb b/app/views/layouts/_new_feedback.html.erb index 67b4af32c..3b8098ed5 100644 --- a/app/views/layouts/_new_feedback.html.erb +++ b/app/views/layouts/_new_feedback.html.erb @@ -22,10 +22,9 @@ <% end %>
    diff --git a/app/views/layouts/base_projects.html.erb b/app/views/layouts/base_projects.html.erb index beade0a7a..87ceeaf9a 100644 --- a/app/views/layouts/base_projects.html.erb +++ b/app/views/layouts/base_projects.html.erb @@ -18,54 +18,7 @@ <%= yield :header_tags -%> - - @@ -83,13 +36,7 @@
    @@ -164,14 +114,14 @@ <% end %> - + <%#--project_new_type: 1为开发组;2为科研组;3为朋友圈子--%>
    <% if @project.project_new_type == 1 || @project.project_new_type.nil? %> - <%= render :partial => 'projects/development_group', :locals => {:project => @project}%> + <%= render :partial => 'projects/development_group', :locals => {:project => @project, :attaments_num => attaments_num} %> <% elsif @project.project_new_type == 2 %> - <%= render :partial => 'projects/research_team', :locals => {:project => @project}%> + <%= render :partial => 'projects/research_team', :locals => {:project => @project, :attaments_num => attaments_num} %> <% else %> - <%= render :partial => 'projects/friend_group', :locals => {:project => @project}%> + <%= render :partial => 'projects/friend_group', :locals => {:project => @project, :attaments_num => attaments_num} %> <% end %>
    @@ -230,8 +180,55 @@
  • id="friend_organization"/>
  • 确定 - + +
    123
    <%= render :partial => 'layouts/new_feedback' %> diff --git a/app/views/layouts/project_base.html.erb b/app/views/layouts/project_base.html.erb deleted file mode 100644 index af376b1f5..000000000 --- a/app/views/layouts/project_base.html.erb +++ /dev/null @@ -1,47 +0,0 @@ -<% @nav_dispaly_project_label = 1 - @nav_dispaly_forum_label = 1 %> - - - - - <%=h html_title %> - - - <%= csrf_meta_tag %> - <%= favicon %> - <%= 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 %> - <%= javascript_include_tag "jquery.leanModal.min" %> - <%= javascript_include_tag 'seems_rateable/jRating', 'seems_rateable/rateable'%> - <%= heads_for_theme %> - <%= call_hook :view_layouts_base_html_head %> - - <%= yield :header_tags -%> - - -
    -
    -
    - <%=render :partial => 'layouts/base_header'%> -
    -
    - <%= render_flash_messages %> - <%= yield %> - <%= call_hook :view_layouts_base_content %> -
    - <%=render :partial => 'layouts/base_footer'%> -
    - -
    -
    - - - - - -
    -
    -<%= call_hook :view_layouts_base_body_bottom %> - - diff --git a/app/views/memos/quote.js.erb b/app/views/memos/quote.js.erb index b3d860916..3dbf9eb95 100644 --- a/app/views/memos/quote.js.erb +++ b/app/views/memos/quote.js.erb @@ -1,4 +1,5 @@ //ckeditor.setData("<%= raw escape_javascript(@content) %>"); $('#message_quote').html("<%= raw escape_javascript(@temp.content.html_safe) %>"); $('#quote').val("<%= raw escape_javascript(@content) %>"); -showAndScrollTo("new_memo", "cke_editor01"); \ No newline at end of file +showAndScrollTo("new_memo", "cke_editor01"); +$("img").removeAttr("align"); \ No newline at end of file diff --git a/app/views/memos/show.html.erb b/app/views/memos/show.html.erb index fb66c621e..5452aa893 100644 --- a/app/views/memos/show.html.erb +++ b/app/views/memos/show.html.erb @@ -182,4 +182,5 @@ } }); }; + $("img").removeAttr("align"); \ No newline at end of file diff --git a/app/views/news/_project_form.html.erb b/app/views/news/_project_form.html.erb index 37f11d3f0..33613e5a7 100644 --- a/app/views/news/_project_form.html.erb +++ b/app/views/news/_project_form.html.erb @@ -1,26 +1,35 @@ -
  • +<%= javascript_include_tag "/assets/kindeditor/kindeditor" %> +
  • - +

  • -
  • - - -

    +
  • + <% if is_new %> + <%= hidden_field_tag :asset_id,params[:asset_id],:required => false,:style => 'display:none' %> + + <%= f.kindeditor :description,:width=>'91%',:editor_id=>'project_news_description_editor' %> +

    + <% else %> + + <%= f.kindeditor :description,:width=>'91%', :editor_id=>'project_news_description_editor', :owner_id => @news.id, :owner_type => OwnerTypeHelper::NEWS %> +

    + <% end %> +
  • -
  • - +
  • + <%= render :partial => 'attachments/new_form', :locals => {:container => @news} %>
  • -
  • +
  • <% if is_new %> - <%= link_to l(:button_create), "#", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'blue_btn fl c_white' %> + <%= link_to l(:button_create), "javascript:void(0)", :onclick => 'submitNews();', :onmouseover => 'submitFocus(this);', :class => 'blue_btn fl c_white' %> <%= link_to l(:button_cancel), project_news_index_path(@project), :onclick => '$("#add-news").hide()', :class => 'blue_btn grey_btn fl c_white' %> <% else %> - <%= link_to l(:button_save), "#", :onclick => 'submitNews();',:onmouseover => 'this.focus()',:class => 'blue_btn fl c_white' %> - <%= link_to l(:button_cancel), "#", :onclick => '$("#edit-news").hide(); return false;',:class => 'blue_btn grey_btn fl c_white' %> + <%= link_to l(:button_save), "javascript:void(0)", :onclick => "submitNews();",:onmouseover => 'this.focus()',:class => 'blue_btn fl c_white' %> + <%= link_to l(:button_cancel), news_path(@news), :class => 'blue_btn grey_btn fl c_white' %> <% end %>
  • diff --git a/app/views/news/_project_news.html.erb b/app/views/news/_project_news.html.erb index 75b51ab6c..7b6a16e38 100644 --- a/app/views/news/_project_news.html.erb +++ b/app/views/news/_project_news.html.erb @@ -29,7 +29,7 @@ <%= link_to_user_header(news.author,false,{:class=> 'problem_name c_orange fl'}) if news.respond_to?(:author) %> <%= l(:label_add_news) %>:<%= link_to h(news.title), news_path(news),:class => 'problem_tit fl fb c_dblue' %>
    -

    <%= news.description %>

    +

    <%=textAreailizable news.description %>

    <%= l(:label_create_time) %> :<%= format_time(news.created_on) %> diff --git a/app/views/news/_project_show.html.erb b/app/views/news/_project_show.html.erb index 9d598f0b5..f95192d64 100644 --- a/app/views/news/_project_show.html.erb +++ b/app/views/news/_project_show.html.erb @@ -82,8 +82,9 @@ :onclick => '$("#edit-news").show(); return false;') if User.current.allowed_to?(:manage_news, @project) %> <%= delete_link news_path(@news),:class => 'talk_edit fr' if User.current.allowed_to?(:manage_news, @project) %>
    -
    <%= textAreailizable(@news, :description) %>
    <%= l(:label_create_time) %> : <%= format_time(@news.created_on) %>
    - <%= link_to_attachments_course @news %> +
    <%= textAreailizable(@news, :description) %>
    + <%= link_to_attachments_course @news %>
    + <%= l(:label_create_time) %> : <%= format_time(@news.created_on) %>
    diff --git a/app/views/projects/_development_group.html.erb b/app/views/projects/_development_group.html.erb index 676761831..d4bc7012a 100644 --- a/app/views/projects/_development_group.html.erb +++ b/app/views/projects/_development_group.html.erb @@ -1,4 +1,3 @@ -<% attaments_num = @project.attachments.count+Attachment.where(["`container_type` = 'Version' and `container_id` in (?)",@project.versions.map{ |v| v.id}]).all.count %>