From 2e9251530c5e61fe152120b264995f8d1dcffdde Mon Sep 17 00:00:00 2001 From: z9hang Date: Fri, 30 May 2014 16:27:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E7=BC=BA=E9=99=B7=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E7=95=99=E8=A8=80=E5=A4=84=E5=BC=95=E7=94=A8=E7=9A=84?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=E8=A2=AB=E9=81=AE=E4=BD=8F=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/journals_helper.rb | 32 +++++++++++++++++-- app/views/issues/_history.html.erb | 3 +- public/stylesheets/application.css | 2 +- .../stylesheets/application.css | 2 +- 4 files changed, 34 insertions(+), 5 deletions(-) diff --git a/app/helpers/journals_helper.rb b/app/helpers/journals_helper.rb index 48052445..26b4c13b 100644 --- a/app/helpers/journals_helper.rb +++ b/app/helpers/journals_helper.rb @@ -18,7 +18,7 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. module JournalsHelper - def render_notes(issue, journal, options={}) + def render_links(issue, journal, options={}) content = '' editable = User.current.logged? && (User.current.allowed_to?(:edit_issue_notes, issue.project) || (journal.user == User.current && User.current.allowed_to?(:edit_own_issue_notes, issue.project))) destroyable = User.current.logged? && ((journal.user == User.current) || (issue.author_id == User.current.id) || (User.current.admin == 1)) @@ -38,7 +38,35 @@ module JournalsHelper :title => l(:button_delete)) end end - content << content_tag('div', links.join(' ').html_safe, :class => 'contextual', :style => 'margin-top:-25px;') unless links.empty? + content << content_tag('div', links.join(' ').html_safe, :class => 'contextual') unless links.empty? + #content << textilizable(journal, :notes) + #css_classes = "wiki" + #css_classes << " editable" if editable + #content_tag('div', content.html_safe, :id => "journal-#{journal.id}-notes", :class => css_classes) + content.html_safe + end + + def render_notes (issue, journal, options={}) + content = '' + editable = User.current.logged? && (User.current.allowed_to?(:edit_issue_notes, issue.project) || (journal.user == User.current && User.current.allowed_to?(:edit_own_issue_notes, issue.project))) + destroyable = User.current.logged? && ((journal.user == User.current) || (issue.author_id == User.current.id) || (User.current.admin == 1)) + links = [] + if !journal.notes.blank? + links << link_to(l(:button_quote), + {:controller => 'journals', :action => 'new', :id => issue.id, :journal_id => journal}, + :remote => true, + :method => 'post', + :title => l(:button_quote)) if options[:reply_links] + links << link_to_in_place_notes_editor(l(:button_edit), "journal-#{journal.id}-notes", + { :controller => 'journals', :action => 'edit', :id => journal, :format => 'js' }, + :title => l(:button_edit)) if editable + #Added by young + if destroyable + links << link_to(l(:button_delete), { :controller => 'journals', :action => 'destroy', :id => journal, :format => 'js' }, + :title => l(:button_delete)) + end + end + #content << content_tag('div', links.join(' ').html_safe, :class => 'contextual', :style => 'margin-top:-25px;') unless links.empty? content << textilizable(journal, :notes) css_classes = "wiki" css_classes << " editable" if editable diff --git a/app/views/issues/_history.html.erb b/app/views/issues/_history.html.erb index fdc35f49..9823e30b 100644 --- a/app/views/issues/_history.html.erb +++ b/app/views/issues/_history.html.erb @@ -11,7 +11,8 @@ - + + diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 977aef8f..f5a21da5 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -1449,7 +1449,7 @@ div.square { overflow: hidden; width: .6em; height: .6em; } -.contextual {float:right; white-space: nowrap; line-height:1.4em;margin-top:5px; padding-left: 10px; font-size:0.9em;} +.contextual {float:right; white-space: nowrap; line-height:1.4em;/*margin-top:5px;*/ padding-left: 10px; font-size:0.9em;} .contextual input, .contextual select {font-size:0.9em;} .message .contextual { margin-top: 0; } diff --git a/public/themes/redpenny-master/stylesheets/application.css b/public/themes/redpenny-master/stylesheets/application.css index 20935830..0d7297c7 100644 --- a/public/themes/redpenny-master/stylesheets/application.css +++ b/public/themes/redpenny-master/stylesheets/application.css @@ -968,7 +968,7 @@ hr p { font-size: 13px; - /*position:relative;/*gcm*/ + /*position: static;/*gcm*/ } /*end*/ div.issue
<%= authoring journal.created_on, journal.user, :label => :label_updated_time_by %>
<%= authoring journal.created_on, journal.user, :label => :label_updated_time_by %>
<%= render_links(issue, journal, :reply_links => reply_links) unless journal.notes.blank? %>