gitlabhq/doc/code/classes/IssuesHelper.html

401 lines
15 KiB
HTML
Raw Normal View History

<?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>IssuesHelper</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>
IssuesHelper
</h1>
<ul class="files">
<li><a href="../files/app/helpers/issues_helper_rb.html">app/helpers/issues_helper.rb</a></li>
</ul>
</div>
<div id="bodyContent">
<div id="content">
<!-- Method ref -->
<div class="sectiontitle">Methods</div>
<dl class="methods">
<dt>I</dt>
<dd>
<ul>
<li>
<a href="#method-i-issue_css_classes">issue_css_classes</a>,
</li>
<li>
<a href="#method-i-issue_tags">issue_tags</a>,
</li>
<li>
<a href="#method-i-issues_active_milestones">issues_active_milestones</a>,
</li>
<li>
<a href="#method-i-issues_filter">issues_filter</a>
</li>
</ul>
</dd>
<dt>L</dt>
<dd>
<ul>
<li>
<a href="#method-i-labels_autocomplete_source">labels_autocomplete_source</a>
</li>
</ul>
</dd>
<dt>P</dt>
<dd>
<ul>
<li>
<a href="#method-i-project_issues_filter_path">project_issues_filter_path</a>
</li>
</ul>
</dd>
<dt>U</dt>
<dd>
<ul>
<li>
<a href="#method-i-unassigned_filter">unassigned_filter</a>
</li>
</ul>
</dd>
</dl>
<!-- Methods -->
<div class="sectiontitle">Instance Public methods</div>
<div class="method">
<div class="title method-title" id="method-i-issue_css_classes">
<b>issue_css_classes</b>(issue)
<a href="../classes/IssuesHelper.html#method-i-issue_css_classes" name="method-i-issue_css_classes" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-issue_css_classes_source')" id="l_method-i-issue_css_classes_source">show</a>
</p>
<div id="method-i-issue_css_classes_source" class="dyn-source">
<pre><span class="ruby-comment"># File app/helpers/issues_helper.rb, line 7</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">issue_css_classes</span> <span class="ruby-identifier">issue</span>
<span class="ruby-identifier">classes</span> = <span class="ruby-string">&quot;issue&quot;</span>
<span class="ruby-identifier">classes</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot; closed&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">issue</span>.<span class="ruby-identifier">closed</span>
<span class="ruby-identifier">classes</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-string">&quot; today&quot;</span> <span class="ruby-keyword">if</span> <span class="ruby-identifier">issue</span>.<span class="ruby-identifier">today?</span>
<span class="ruby-identifier">classes</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div class="method">
<div class="title method-title" id="method-i-issue_tags">
<b>issue_tags</b>()
<a href="../classes/IssuesHelper.html#method-i-issue_tags" name="method-i-issue_tags" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-issue_tags_source')" id="l_method-i-issue_tags_source">show</a>
</p>
<div id="method-i-issue_tags_source" class="dyn-source">
<pre><span class="ruby-comment"># File app/helpers/issues_helper.rb, line 14</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">issue_tags</span>
<span class="ruby-ivar">@project</span>.<span class="ruby-identifier">issues</span>.<span class="ruby-identifier">tag_counts_on</span>(<span class="ruby-value">:labels</span>).<span class="ruby-identifier">map</span>(&amp;<span class="ruby-value">:name</span>)
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div class="method">
<div class="title method-title" id="method-i-issues_active_milestones">
<b>issues_active_milestones</b>()
<a href="../classes/IssuesHelper.html#method-i-issues_active_milestones" name="method-i-issues_active_milestones" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-issues_active_milestones_source')" id="l_method-i-issues_active_milestones_source">show</a>
</p>
<div id="method-i-issues_active_milestones_source" class="dyn-source">
<pre><span class="ruby-comment"># File app/helpers/issues_helper.rb, line 40</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">issues_active_milestones</span>
<span class="ruby-ivar">@project</span>.<span class="ruby-identifier">milestones</span>.<span class="ruby-identifier">active</span>.<span class="ruby-identifier">order</span>(<span class="ruby-string">&quot;id desc&quot;</span>).<span class="ruby-identifier">all</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div class="method">
<div class="title method-title" id="method-i-issues_filter">
<b>issues_filter</b>()
<a href="../classes/IssuesHelper.html#method-i-issues_filter" name="method-i-issues_filter" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-issues_filter_source')" id="l_method-i-issues_filter_source">show</a>
</p>
<div id="method-i-issues_filter_source" class="dyn-source">
<pre><span class="ruby-comment"># File app/helpers/issues_helper.rb, line 25</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">issues_filter</span>
{
<span class="ruby-identifier">all</span><span class="ruby-operator">:</span> <span class="ruby-string">&quot;all&quot;</span>,
<span class="ruby-identifier">closed</span><span class="ruby-operator">:</span> <span class="ruby-string">&quot;closed&quot;</span>,
<span class="ruby-identifier">to_me</span><span class="ruby-operator">:</span> <span class="ruby-string">&quot;assigned-to-me&quot;</span>,
<span class="ruby-identifier">open</span><span class="ruby-operator">:</span> <span class="ruby-string">&quot;open&quot;</span>
}
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div class="method">
<div class="title method-title" id="method-i-labels_autocomplete_source">
<b>labels_autocomplete_source</b>()
<a href="../classes/IssuesHelper.html#method-i-labels_autocomplete_source" name="method-i-labels_autocomplete_source" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-labels_autocomplete_source_source')" id="l_method-i-labels_autocomplete_source_source">show</a>
</p>
<div id="method-i-labels_autocomplete_source_source" class="dyn-source">
<pre><span class="ruby-comment"># File app/helpers/issues_helper.rb, line 34</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">labels_autocomplete_source</span>
<span class="ruby-identifier">labels</span> = <span class="ruby-ivar">@project</span>.<span class="ruby-identifier">issues_labels</span>.<span class="ruby-identifier">order</span>(<span class="ruby-string">'count DESC'</span>)
<span class="ruby-identifier">labels</span> = <span class="ruby-identifier">labels</span>.<span class="ruby-identifier">map</span>{ <span class="ruby-operator">|</span><span class="ruby-identifier">l</span><span class="ruby-operator">|</span> { <span class="ruby-identifier">label</span><span class="ruby-operator">:</span> <span class="ruby-identifier">l</span>.<span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span><span class="ruby-operator">:</span> <span class="ruby-identifier">l</span>.<span class="ruby-identifier">name</span> } }
<span class="ruby-identifier">labels</span>.<span class="ruby-identifier">to_json</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div class="method">
<div class="title method-title" id="method-i-project_issues_filter_path">
<b>project_issues_filter_path</b>(project, params = {})
<a href="../classes/IssuesHelper.html#method-i-project_issues_filter_path" name="method-i-project_issues_filter_path" class="permalink">Link</a>
</div>
<div class="description">
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-project_issues_filter_path_source')" id="l_method-i-project_issues_filter_path_source">show</a>
</p>
<div id="method-i-project_issues_filter_path_source" class="dyn-source">
<pre><span class="ruby-comment"># File app/helpers/issues_helper.rb, line 2</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">project_issues_filter_path</span> <span class="ruby-identifier">project</span>, <span class="ruby-identifier">params</span> = {}
<span class="ruby-identifier">params</span>[<span class="ruby-value">:f</span>] <span class="ruby-operator">||=</span> <span class="ruby-identifier">cookies</span>[<span class="ruby-string">'issue_filter'</span>]
<span class="ruby-identifier">project_issues_path</span> <span class="ruby-identifier">project</span>, <span class="ruby-identifier">params</span>
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
<div class="method">
<div class="title method-title" id="method-i-unassigned_filter">
<b>unassigned_filter</b>()
<a href="../classes/IssuesHelper.html#method-i-unassigned_filter" name="method-i-unassigned_filter" class="permalink">Link</a>
</div>
<div class="description">
<p>Returns an OpenStruct object suitable for use by
<code>options_from_collection_for_select</code> to allow filtering issues
by an unassigned <a href="User.html">User</a> or <a
href="Milestone.html">Milestone</a></p>
</div>
<div class="sourcecode">
<p class="source-link">
Source:
<a href="javascript:toggleSource('method-i-unassigned_filter_source')" id="l_method-i-unassigned_filter_source">show</a>
</p>
<div id="method-i-unassigned_filter_source" class="dyn-source">
<pre><span class="ruby-comment"># File app/helpers/issues_helper.rb, line 20</span>
<span class="ruby-keyword">def</span> <span class="ruby-keyword ruby-title">unassigned_filter</span>
<span class="ruby-comment"># Milestone uses :title, Issue uses :name</span>
<span class="ruby-constant">OpenStruct</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">id</span><span class="ruby-operator">:</span> <span class="ruby-number">0</span>, <span class="ruby-identifier">title</span><span class="ruby-operator">:</span> <span class="ruby-string">'Unspecified'</span>, <span class="ruby-identifier">name</span><span class="ruby-operator">:</span> <span class="ruby-string">'Unassigned'</span>)
<span class="ruby-keyword">end</span></pre>
</div>
</div>
</div>
</div>
</div>
</body>
</html>