keithsalisbury-subtrac 0.1.9 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/VERSION.yml
CHANGED
data/lib/subtrac.rb
CHANGED
@@ -291,7 +291,7 @@ module Subtrac
|
|
291
291
|
# TODO: implement a mask for .svn folders
|
292
292
|
# TODO: refactor /common to the app config
|
293
293
|
FileUtils.cp_r(Dir.glob(File.join(subtrac_path, "common/.")),docs_dir)
|
294
|
-
FileUtils.cp_r(Dir.glob(File.join(subtrac_path, "shared/.")),File.join(trac_dir, ".shared"))
|
294
|
+
FileUtils.cp_r(Dir.glob(File.join(subtrac_path, "shared/.")),create_if_missing(File.join(trac_dir, ".shared")))
|
295
295
|
end
|
296
296
|
|
297
297
|
def self.create_environment_directories(overwrite=false)
|
@@ -321,9 +321,22 @@ module Subtrac
|
|
321
321
|
# create svn+trac directory
|
322
322
|
create_if_missing File.join(svn_dir,client_name)
|
323
323
|
create_if_missing File.join(trac_dir,client_name)
|
324
|
+
|
325
|
+
# create a project for this clients trac theme
|
326
|
+
create_project("trac_theme", client_name,@APP_CONFIG[:default_theme_template])
|
327
|
+
|
328
|
+
# check the theme project out
|
329
|
+
client_theme_dir = File.join(trac_dir,client_name,".theme")
|
330
|
+
create_if_missing(client_theme_dir)
|
331
|
+
FileUtils.chown_R('www-data', 'www-data', client_theme_dir, :verbose => true) if SUBTRAC_ENV != 'test'
|
332
|
+
puts "Attempting checkout of theme project..."
|
333
|
+
|
334
|
+
`sudo svn co --username #{@APP_CONFIG[:admin][:username]} --password #{@APP_CONFIG[:admin][:password]} \
|
335
|
+
file://#{svn_dir}/#{client_name}/trac_theme/trunk #{client_theme_dir}` if SUBTRAC_ENV != 'test'
|
336
|
+
|
324
337
|
end
|
325
338
|
|
326
|
-
def self.create_project(project, client)
|
339
|
+
def self.create_project(project, client, project_type=@APP_CONFIG[:default_project_template])
|
327
340
|
puts "\n==== Create a new project called #{project} for #{client} ===="
|
328
341
|
|
329
342
|
client_name = client.downcase
|
@@ -345,7 +358,7 @@ module Subtrac
|
|
345
358
|
create_if_missing project_svn_dir
|
346
359
|
create_if_missing project_trac_dir
|
347
360
|
|
348
|
-
project_template = File.join(subtrac_path, @APP_CONFIG[:templates][:projects]
|
361
|
+
project_template = File.join(subtrac_path, @APP_CONFIG[:templates][:projects],project_type)
|
349
362
|
|
350
363
|
# copy template svn project to a temp folder, then svn import it into the repo
|
351
364
|
say("Create temporary project directory and copy template files...")
|
@@ -4,7 +4,7 @@
|
|
4
4
|
PythonHandler trac.web.modpython_frontend
|
5
5
|
PythonOption TracEnvParentDir <%= trac_dir %>/<%= client_name %>
|
6
6
|
PythonOption TracUriRoot /<%= client_name %>
|
7
|
-
PythonOption TracEnvIndexTemplate <%= trac_dir %>/<%= client_name
|
7
|
+
PythonOption TracEnvIndexTemplate <%= trac_dir %>/<%= client_name %>/.theme/index/index.html
|
8
8
|
PythonOption PYTHON_EGG_CACHE /tmp
|
9
9
|
</location>
|
10
10
|
<location <%= @APP_CONFIG[:urls][:svn] %>/<%= client_name %>>
|
@@ -8,15 +8,14 @@
|
|
8
8
|
<title>Available Projects</title>
|
9
9
|
</head>
|
10
10
|
<body>
|
11
|
-
<h1>Available Projects</h1>
|
11
|
+
<h1>Available Projects for Subtrac</h1>
|
12
12
|
<ul>
|
13
|
-
<
|
14
|
-
<
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
</li>
|
13
|
+
<py:for each="project in projects" py:choose="">
|
14
|
+
<li py:when="project.href">
|
15
|
+
<a href="$project.href"
|
16
|
+
title="$project.description">$project.name</a>
|
17
|
+
</li>
|
18
|
+
</py:for>
|
20
19
|
</ul>
|
21
20
|
</body>
|
22
21
|
</html>
|