gitlabhq/doc/code/classes/NotesHelper.html
2012-12-30 14:43:00 +02:00

258 lines
No EOL
9.2 KiB
HTML

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>NotesHelper</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" href="../css/reset.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../css/main.css" type="text/css" media="screen" />
<link rel="stylesheet" href="../css/github.css" type="text/css" media="screen" />
<script src="../js/jquery-1.3.2.min.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/jquery-effect.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/main.js" type="text/javascript" charset="utf-8"></script>
<script src="../js/highlight.pack.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="banner">
<h1>
<span class="type">Module</span>
NotesHelper
</h1>
<ul class="files">
<li><a href="../files/app/helpers/notes_helper_rb.html">app/helpers/notes_helper.rb</a></li>
</ul>
</div>
<div id="bodyContent">
<div id="content">
<!-- Method ref -->
<div class="sectiontitle">Methods</div>
<dl class="methods">
<dt>L</dt>
<dd>
<ul>
<li>
<a href="#method-i-link_to_commit_diff_line_note">link_to_commit_diff_line_note</a>,
</li>
<li>
<a href="#method-i-loading_more_notes-3F">loading_more_notes?</a>,
</li>
<li>
<a href="#method-i-loading_new_notes-3F">loading_new_notes?</a>
</li>
</ul>
</dd>
<dt>N</dt>
<dd>
<ul>
<li>
<a href="#method-i-note_for_main_target-3F">note_for_main_target?</a>
</li>
</ul>
</dd>
</dl>
<!-- Methods -->
<div class="sectiontitle">Instance Public methods</div>
<div class="method">
<div class="title method-title" id="method-i-link_to_commit_diff_line_note">
<b>link_to_commit_diff_line_note</b>(note)
<a href="../classes/NotesHelper.html#method-i-link_to_commit_diff_line_note" name="method-i-link_to_commit_diff_line_note" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-link_to_commit_diff_line_note_source')" id="l_method-i-link_to_commit_diff_line_note_source">show</a>
</p>
<div id="method-i-link_to_commit_diff_line_note_source" class="dyn-source">
<pre><span class="ruby-comment"># File app/helpers/notes_helper.rb, line 15</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">link_to_commit_diff_line_note</span>(<span class="ruby-identifier">note</span>)
<span class="ruby-identifier">commit</span> = <span class="ruby-identifier">note</span>.<span class="ruby-identifier">noteable</span>
<span class="ruby-identifier">diff_index</span>, <span class="ruby-identifier">diff_old_line</span>, <span class="ruby-identifier">diff_new_line</span> = <span class="ruby-identifier">note</span>.<span class="ruby-identifier">line_code</span>.<span class="ruby-identifier">split</span>(<span class="ruby-string">'_'</span>)
<span class="ruby-identifier">link_file</span> = <span class="ruby-identifier">commit</span>.<span class="ruby-identifier">diffs</span>[<span class="ruby-identifier">diff_index</span>.<span class="ruby-identifier">to_i</span>].<span class="ruby-identifier">new_path</span>
<span class="ruby-identifier">link_line</span> = <span class="ruby-identifier">diff_new_line</span>
<span class="ruby-identifier">link_to</span> <span class="ruby-node">&quot;#{link_file}:L#{link_line}&quot;</span>, <span class="ruby-identifier">project_commit_path</span>(<span class="ruby-ivar">@project</span>, <span class="ruby-identifier">commit</span>, <span class="ruby-identifier">anchor</span><span class="ruby-operator">:</span> <span class="ruby-identifier">note</span>.<span class="ruby-identifier">line_code</span>)
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div class="method">
<div class="title method-title" id="method-i-loading_more_notes-3F">
<b>loading_more_notes?</b>()
<a href="../classes/NotesHelper.html#method-i-loading_more_notes-3F" name="method-i-loading_more_notes-3F" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-loading_more_notes-3F_source')" id="l_method-i-loading_more_notes-3F_source">show</a>
</p>
<div id="method-i-loading_more_notes-3F_source" class="dyn-source">
<pre><span class="ruby-comment"># File app/helpers/notes_helper.rb, line 2</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">loading_more_notes?</span>
<span class="ruby-identifier">params</span>[<span class="ruby-value">:loading_more</span>].<span class="ruby-identifier">present?</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div class="method">
<div class="title method-title" id="method-i-loading_new_notes-3F">
<b>loading_new_notes?</b>()
<a href="../classes/NotesHelper.html#method-i-loading_new_notes-3F" name="method-i-loading_new_notes-3F" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-loading_new_notes-3F_source')" id="l_method-i-loading_new_notes-3F_source">show</a>
</p>
<div id="method-i-loading_new_notes-3F_source" class="dyn-source">
<pre><span class="ruby-comment"># File app/helpers/notes_helper.rb, line 6</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">loading_new_notes?</span>
<span class="ruby-identifier">params</span>[<span class="ruby-value">:loading_new</span>].<span class="ruby-identifier">present?</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div class="method">
<div class="title method-title" id="method-i-note_for_main_target-3F">
<b>note_for_main_target?</b>(note)
<a href="../classes/NotesHelper.html#method-i-note_for_main_target-3F" name="method-i-note_for_main_target-3F" class="permalink">Link</a>
</div>
<div class="description">
<p>Helps to distinguish e.g. commit notes in mr notes list</p>
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-note_for_main_target-3F_source')" id="l_method-i-note_for_main_target-3F_source">show</a>
</p>
<div id="method-i-note_for_main_target-3F_source" class="dyn-source">
<pre><span class="ruby-comment"># File app/helpers/notes_helper.rb, line 11</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">note_for_main_target?</span>(<span class="ruby-identifier">note</span>)
<span class="ruby-operator">!</span><span class="ruby-ivar">@mixed_targets</span> <span class="ruby-operator">||</span> <span class="ruby-ivar">@main_target_type</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">note</span>.<span class="ruby-identifier">noteable_type</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
</div>
</div>
</body>
</html>