Revision 1297:0a574315af3e .svn/pristine/52

View differences:

.svn/pristine/52/52085347244afd004a84d9566613bc12acfd3185.svn-base
1
api.array :memberships, api_meta(:total_count => @member_count, :offset => @offset, :limit => @limit) do
2
  @members.each do |membership|
3
    api.membership do
4
      api.id membership.id
5
      api.project :id => membership.project.id, :name => membership.project.name
6
      api.__send__ membership.principal.class.name.underscore, :id => membership.principal.id, :name => membership.principal.name
7
      api.array :roles do
8
        membership.member_roles.each do |member_role|
9
          if member_role.role
10
            attrs = {:id => member_role.role.id, :name => member_role.role.name}
11
            attrs.merge!(:inherited => true) if member_role.inherited_from.present?
12
            api.role attrs
13
          end 
14
        end
15
      end
16
    end
17
  end
18
end
.svn/pristine/52/524fd46290a5b042d52b6965c04b076d495b7d24.svn-base
1
<% selector = ".#{watcher_css(watched)}" %>
2
$("<%= selector %>").each(function(){$(this).html("<%= escape_javascript watcher_link(watched, user) %>")});
.svn/pristine/52/5254040f55f9795eeba2da7fed7e73136e2f000e.svn-base
1
<div class="contextual">
2
<%= watcher_tag(@wiki, User.current) %>
3
</div>
4

  
5
<h2><%= l(:label_index_by_date) %></h2>
6

  
7
<% if @pages.empty? %>
8
<p class="nodata"><%= l(:label_no_data) %></p>
9
<% end %>
10

  
11
<% @pages_by_date.keys.sort.reverse.each do |date| %>
12
<h3><%= format_date(date) %></h3>
13
<ul>
14
<% @pages_by_date[date].each do |page| %>
15
    <li><%= link_to h(page.pretty_title), :action => 'show', :id => page.title, :project_id => page.project %></li>
16
<% end %>
17
</ul>
18
<% end %>
19

  
20
<% content_for :sidebar do %>
21
  <%= render :partial => 'sidebar' %>
22
<% end %>
23

  
24
<% unless @pages.empty? %>
25
<% other_formats_links do |f| %>
26
  <%= f.link_to 'Atom', :url => {:controller => 'activities', :action => 'index', :id => @project, :show_wiki_edits => 1, :key => User.current.rss_key} %>
27
  <% if User.current.allowed_to?(:export_wiki_pages, @project) %>
28
  <%= f.link_to('PDF', :url => {:action => 'export', :format => 'pdf'}) %>
29
  <%= f.link_to('HTML', :url => {:action => 'export'}) %>
30
  <% end %>
31
<% end %>
32
<% end %>
33

  
34
<% content_for :header_tags do %>
35
<%= auto_discovery_link_tag(:atom, :controller => 'activities', :action => 'index', :id => @project, :show_wiki_edits => 1, :format => 'atom', :key => User.current.rss_key) %>
36
<% end %>
.svn/pristine/52/526af1c2bfa92da73d02577e9ad25a11ff60e17c.svn-base
1
# Redmine - project management software
2
# Copyright (C) 2006-2012  Jean-Philippe Lang
3
#
4
# This program is free software; you can redistribute it and/or
5
# modify it under the terms of the GNU General Public License
6
# as published by the Free Software Foundation; either version 2
7
# of the License, or (at your option) any later version.
8
#
9
# This program is distributed in the hope that it will be useful,
10
# but WITHOUT ANY WARRANTY; without even the implied warranty of
11
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12
# GNU General Public License for more details.
13
#
14
# You should have received a copy of the GNU General Public License
15
# along with this program; if not, write to the Free Software
16
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
17

  
18
require File.expand_path('../../test_helper', __FILE__)
19

  
20
class DocumentCategoryTest < ActiveSupport::TestCase
21
  fixtures :enumerations, :documents, :issues
22

  
23
  def test_should_be_an_enumeration
24
    assert DocumentCategory.ancestors.include?(Enumeration)
25
  end
26

  
27
  def test_objects_count
28
    assert_equal 2, DocumentCategory.find_by_name("Uncategorized").objects_count
29
    assert_equal 0, DocumentCategory.find_by_name("User documentation").objects_count
30
  end
31

  
32
  def test_option_name
33
    assert_equal :enumeration_doc_categories, DocumentCategory.new.option_name
34
  end
35

  
36
  def test_default
37
    assert_nil DocumentCategory.find(:first, :conditions => { :is_default => true })
38
    e = Enumeration.find_by_name('Technical documentation')
39
    e.update_attributes(:is_default => true)
40
    assert_equal 3, DocumentCategory.default.id
41
  end
42

  
43
  def test_force_default
44
    assert_nil DocumentCategory.find(:first, :conditions => { :is_default => true })
45
    assert_equal 1, DocumentCategory.default.id
46
  end
47
end

Also available in: Unified diff