Project

General

Profile

Feature #34703 » diff-rejected.patch

Mizuki ISHIKAWA, 2021-02-10 09:18

View differences:

app/helpers/application_helper.rb
)
end
def copy_object_url_link(url, only_icon=false)
tag.div(class: 'copy-link-wrapper') do
link_to_function(l(:button_copy_link), "copyTextToClipboard(this);",
class: "#{only_icon ? 'icon-only' : 'icon'} icon-copy-link",
data: {'clipboard-text' => url},
title: l(:button_copy_link)) +
tag.span(l(:text_success_copied), class: 'success-copied-message')
end
end
private
def wiki_helper
app/helpers/journals_helper.rb
# Returns the action links for an issue journal
def render_journal_actions(issue, journal, options={})
links = []
indice = journal.indice || @journal.issue.visible_journals_with_index.find{|j| j.id == @journal.id}.indice
links << copy_object_url_link(issue_url(issue, anchor: "note-#{indice}", only_path: false), true)
if journal.notes.present?
if options[:reply_links]
indice = journal.indice || @journal.issue.visible_journals_with_index.find{|j| j.id == @journal.id}.indice
links << link_to(l(:button_quote),
quoted_issue_path(issue, :journal_id => journal, :journal_indice => indice),
:remote => true,
app/views/issues/_action_menu.html.erb
:class => 'icon icon-edit', :accesskey => accesskey(:edit) if @issue.editable? %>
<%= link_to l(:button_log_time), new_issue_time_entry_path(@issue),
:class => 'icon icon-time-add' if User.current.allowed_to?(:log_time, @project) %>
<%= copy_object_url_link(issue_url(@issue, only_path: false)) %>
<%= watcher_link(@issue, User.current) %>
<%= link_to l(:button_copy), project_copy_issue_path(@project, @issue),
:class => 'icon icon-copy' if User.current.allowed_to?(:copy_issues, @project) && Issue.allowed_target_projects.any? %>
config/locales/en.yml
button_change_password: Change password
button_copy: Copy
button_copy_and_follow: Copy and follow
button_copy_link: Copy link
button_annotate: Annotate
button_update: Update
button_configure: Configure
......
text_select_apply_tracker: "Select tracker"
text_avatar_server_config_html: The current avatar server is <a href="%{url}">%{url}</a>. You can configure it in config/configuration.yml.
text_no_subject: no subject
text_success_copied: Copied.
default_role_manager: Manager
public/javascripts/application.js
return key;
}
function copyTextToClipboard(target) {
if (target) {
var temp = document.createElement('textarea');
temp.value = target.getAttribute('data-clipboard-text');
document.body.appendChild(temp);
temp.select();
document.execCommand('copy');
if (temp.parentNode) {
temp.parentNode.removeChild(temp);
}
$(target.nextElementSibling).show().delay(2000).fadeOut(300);
}
return false;
}
function updateIssueFrom(url, el) {
$('#all_attributes input, #all_attributes textarea, #all_attributes select').each(function(){
$(this).data('valuebeforeupdate', $(this).val());
public/stylesheets/application.css
#history div:target h4.note-header {background-color:#DDEEFF;}
#history p.nodata {display: none;}
.copy-link-wrapper {
display: inline; position: relative;
}
.copy-link-wrapper .success-copied-message {
display: none;
z-index: 25;
position: absolute;
border: 1px solid #555;
background-color: #fff;
padding: 4px;
font-size: 0.8em;
color: #453f3f;
top: 15px;
right: 0px;
}
div#activity dl, #search-results { margin-left: 2em; }
div#activity dd, #search-results dd { margin-bottom: 1em; padding-left: 18px; font-size: 0.9em; }
div#activity dt.me .time { border-bottom: 1px solid #999; }
......
.icon-file.application-pdf { background-image: url(../images/files/pdf.png); }
.icon-file.application-zip { background-image: url(../images/files/zip.png); }
.icon-file.application-gzip { background-image: url(../images/files/zip.png); }
.icon-copy-link { background-image: url(../images/page_link.png); }
.sort-handle.ajax-loading { background-image: url(../images/loading.gif); }
tr.ui-sortable-helper { border:1px solid #e4e4e4; }
(4-4/9)