Revision 1298:4f746d8966dd .svn/pristine/05

View differences:

.svn/pristine/05/05366a1767d0cebdb112d7b0a839d8704040e98a.svn-base
1
#!/usr/bin/env ruby
2
#
3
# You may specify the path to the FastCGI crash log (a log of unhandled
4
# exceptions which forced the FastCGI instance to exit, great for debugging)
5
# and the number of requests to process before running garbage collection.
6
#
7
# By default, the FastCGI crash log is RAILS_ROOT/log/fastcgi.crash.log
8
# and the GC period is nil (turned off).  A reasonable number of requests
9
# could range from 10-100 depending on the memory footprint of your app.
10
#
11
# Example:
12
#   # Default log path, normal GC behavior.
13
#   RailsFCGIHandler.process!
14
#
15
#   # Default log path, 50 requests between GC.
16
#   RailsFCGIHandler.process! nil, 50
17
#
18
#   # Custom log path, normal GC behavior.
19
#   RailsFCGIHandler.process! '/var/log/myapp_fcgi_crash.log'
20
#
21
require File.dirname(__FILE__) + "/../config/environment"
22
require 'fcgi_handler'
23

  
24
RailsFCGIHandler.process!
.svn/pristine/05/05764e8ea551fb41de1ac455c66cb6f2907259b8.svn-base
1
/* Portuguese initialisation for the jQuery UI date picker plugin. */
2
jQuery(function($){
3
	$.datepicker.regional['pt'] = {
4
		closeText: 'Fechar',
5
		prevText: '<Anterior',
6
		nextText: 'Seguinte',
7
		currentText: 'Hoje',
8
		monthNames: ['Janeiro','Fevereiro','Março','Abril','Maio','Junho',
9
		'Julho','Agosto','Setembro','Outubro','Novembro','Dezembro'],
10
		monthNamesShort: ['Jan','Fev','Mar','Abr','Mai','Jun',
11
		'Jul','Ago','Set','Out','Nov','Dez'],
12
		dayNames: ['Domingo','Segunda-feira','Terça-feira','Quarta-feira','Quinta-feira','Sexta-feira','Sábado'],
13
		dayNamesShort: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],
14
		dayNamesMin: ['Dom','Seg','Ter','Qua','Qui','Sex','Sáb'],
15
		weekHeader: 'Sem',
16
		dateFormat: 'dd/mm/yy',
17
		firstDay: 0,
18
		isRTL: false,
19
		showMonthAfterYear: false,
20
		yearSuffix: ''};
21
	$.datepicker.setDefaults($.datepicker.regional['pt']);
22
});
.svn/pristine/05/05d53773172688f95b7f90e6ffa69f1cbdf7504b.svn-base
1
<div class="contextual">
2
  &#171;
3
  <% unless @changeset.previous.nil? -%>
4
    <%= link_to_revision(@changeset.previous, @project, :text => l(:label_previous)) %>
5
  <% else -%>
6
    <%= l(:label_previous) %>
7
  <% end -%>
8
|
9
  <% unless @changeset.next.nil? -%>
10
    <%= link_to_revision(@changeset.next, @project, :text => l(:label_next)) %>
11
  <% else -%>
12
    <%= l(:label_next) %>
13
  <% end -%>
14
  &#187;&nbsp;
15

  
16
  <% form_tag({:controller => 'repositories',
17
               :action     => 'revision',
18
               :id         => @project,
19
               :rev        => nil},
20
               :method     => :get) do %>
21
    <%= text_field_tag 'rev', @rev, :size => 8 %>
22
    <%= submit_tag 'OK', :name => nil %>
23
  <% end %>
24
</div>
25

  
26
<h2><%= l(:label_revision) %> <%= format_revision(@changeset) %></h2>
27

  
28
<table class="revision-info">
29
  <% if @changeset.scmid %>
30
    <tr>
31
      <td>ID</td><td><%= h(@changeset.scmid) %></td>
32
    </tr>
33
  <% end %>
34
  <% unless @changeset.parents.blank? %>
35
    <tr>
36
      <td><%= l(:label_parent_revision) %></td>
37
      <td>
38
        <%= @changeset.parents.collect{
39
              |p| link_to_revision(p, @project, :text => format_revision(p))
40
            }.join(", ") %>
41
      </td>
42
    </tr>
43
  <% end %>
44
  <% unless @changeset.children.blank? %>
45
    <tr>
46
      <td><%= l(:label_child_revision) %></td>
47
      <td>
48
       <%= @changeset.children.collect{
49
              |p| link_to_revision(p, @project, :text => format_revision(p))
50
             }.join(", ") %>
51
      </td>
52
    </tr>
53
  <% end %>
54
</table>
55
<p>
56
<span class="author">
57
<%= authoring(@changeset.committed_on, @changeset.author) %>
58
</span>
59
</p>
60

  
61
<%= textilizable @changeset.comments %>
62

  
63
<% if @changeset.issues.visible.any? %>
64
<h3><%= l(:label_related_issues) %></h3>
65
<ul>
66
<% @changeset.issues.visible.each do |issue| %>
67
  <li><%= link_to_issue issue %></li>
68
<% end %>
69
</ul>
70
<% end %>
71

  
72
<% if User.current.allowed_to?(:browse_repository, @project) %>
73
<h3><%= l(:label_attachment_plural) %></h3>
74
<ul id="changes-legend">
75
<li class="change change-A"><%= l(:label_added)    %></li>
76
<li class="change change-M"><%= l(:label_modified) %></li>
77
<li class="change change-C"><%= l(:label_copied)   %></li>
78
<li class="change change-R"><%= l(:label_renamed)  %></li>
79
<li class="change change-D"><%= l(:label_deleted)  %></li>
80
</ul>
81

  
82
<p><%= link_to(l(:label_view_diff),
83
               :action => 'diff',
84
               :id     => @project,
85
               :path   => "",
86
               :rev    => @changeset.identifier) if @changeset.changes.any? %></p>
87

  
88
<div class="changeset-changes">
89
<%= render_changeset_changes %>
90
</div>
91
<% end %>
92

  
93
<% content_for :header_tags do %>
94
<%= stylesheet_link_tag "scm" %>
95
<% end %>
96

  
97
<% html_title("#{l(:label_revision)} #{format_revision(@changeset)}") -%>
.svn/pristine/05/05d8cde4a4e9772f7dcbafb481eff20153ca4409.svn-base
1
# Redmine - project management software
2
# Copyright (C) 2006-2013  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
module Redmine
19
  module MimeType
20

  
21
    MIME_TYPES = {
22
      'text/plain' => 'txt,tpl,properties,patch,diff,ini,readme,install,upgrade',
23
      'text/css' => 'css',
24
      'text/html' => 'html,htm,xhtml',
25
      'text/jsp' => 'jsp',
26
      'text/x-c' => 'c,cpp,cc,h,hh',
27
      'text/x-csharp' => 'cs',
28
      'text/x-java' => 'java',
29
      'text/x-html-template' => 'rhtml',
30
      'text/x-perl' => 'pl,pm',
31
      'text/x-php' => 'php,php3,php4,php5',
32
      'text/x-python' => 'py',
33
      'text/x-ruby' => 'rb,rbw,ruby,rake,erb',
34
      'text/x-csh' => 'csh',
35
      'text/x-sh' => 'sh',
36
      'text/xml' => 'xml,xsd,mxml',
37
      'text/yaml' => 'yml,yaml',
38
      'text/csv' => 'csv',
39
      'text/x-po' => 'po',
40
      'image/gif' => 'gif',
41
      'image/jpeg' => 'jpg,jpeg,jpe',
42
      'image/png' => 'png',
43
      'image/tiff' => 'tiff,tif',
44
      'image/x-ms-bmp' => 'bmp',
45
      'image/x-xpixmap' => 'xpm',
46
      'image/svg+xml'=> 'svg',
47
      'application/javascript' => 'js',
48
      'application/pdf' => 'pdf',
49
      'application/rtf' => 'rtf',
50
      'application/msword' => 'doc',
51
      'application/vnd.ms-excel' => 'xls',
52
      'application/vnd.ms-powerpoint' => 'ppt,pps',
53
      'application/vnd.openxmlformats-officedocument.wordprocessingml.document' => 'docx',
54
      'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' => 'xlsx',
55
      'application/vnd.openxmlformats-officedocument.presentationml.presentation' => 'pptx',
56
      'application/vnd.openxmlformats-officedocument.presentationml.slideshow' => 'ppsx',
57
      'application/vnd.oasis.opendocument.spreadsheet' => 'ods',
58
      'application/vnd.oasis.opendocument.text' => 'odt',
59
      'application/vnd.oasis.opendocument.presentation' => 'odp',
60
      'application/x-7z-compressed' => '7z',
61
      'application/x-rar-compressed' => 'rar',
62
      'application/x-tar' => 'tar',
63
      'application/zip' => 'zip',
64
      'application/x-gzip' => 'gz',
65
    }.freeze
66

  
67
    EXTENSIONS = MIME_TYPES.inject({}) do |map, (type, exts)|
68
      exts.split(',').each {|ext| map[ext.strip] = type}
69
      map
70
    end
71

  
72
    # returns mime type for name or nil if unknown
73
    def self.of(name)
74
      return nil unless name
75
      m = name.to_s.match(/(^|\.)([^\.]+)$/)
76
      EXTENSIONS[m[2].downcase] if m
77
    end
78

  
79
    # Returns the css class associated to
80
    # the mime type of name
81
    def self.css_class_of(name)
82
      mime = of(name)
83
      mime && mime.gsub('/', '-')
84
    end
85

  
86
    def self.main_mimetype_of(name)
87
      mimetype = of(name)
88
      mimetype.split('/').first if mimetype
89
    end
90

  
91
    # return true if mime-type for name is type/*
92
    # otherwise false
93
    def self.is_type?(type, name)
94
      main_mimetype = main_mimetype_of(name)
95
      type.to_s == main_mimetype
96
    end
97
  end
98
end
.svn/pristine/05/05fb4e3ebed828cf639f80e5d1d6da6095d43000.svn-base
1
# Redmine - project management software
2
# Copyright (C) 2006-2013  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
class ProjectEnumerationsController < ApplicationController
19
  before_filter :find_project_by_project_id
20
  before_filter :authorize
21

  
22
  def update
23
    if request.put? && params[:enumerations]
24
      Project.transaction do
25
        params[:enumerations].each do |id, activity|
26
          @project.update_or_create_time_entry_activity(id, activity)
27
        end
28
      end
29
      flash[:notice] = l(:notice_successful_update)
30
    end
31

  
32
    redirect_to settings_project_path(@project, :tab => 'activities')
33
  end
34

  
35
  def destroy
36
    @project.time_entry_activities.each do |time_entry_activity|
37
      time_entry_activity.destroy(time_entry_activity.parent)
38
    end
39
    flash[:notice] = l(:notice_successful_update)
40
    redirect_to settings_project_path(@project, :tab => 'activities')
41
  end
42
end

Also available in: Unified diff