-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP -- Roles for projects where users can apply for a position (role).
- Loading branch information
1 parent
48fad46
commit 26d1376
Showing
10 changed files
with
564 additions
and
7 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{extends designs/site.tpl} | ||
|
||
{block title}{_ "Roles"} — {$dwoo.parent}{/block} | ||
|
||
{block content} | ||
{capture assign=project}{projectLink $Project}{/capture} | ||
|
||
<div class="page-header"> | ||
<h1>Role Added</h1> | ||
</div> | ||
<p class="lead">{sprintf(_("%s has been added to %s"), $data->Role, $project)}</p> | ||
{/block} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{extends designs/site.tpl} | ||
|
||
{block title}{_ "Roles"} — {$dwoo.parent}{/block} | ||
|
||
{block content} | ||
{capture assign=project}{projectLink $Project}{/capture} | ||
|
||
<div class="page-header"> | ||
<h1>Application Added</h1> | ||
</div> | ||
<p class="lead">{sprintf(_(Your application for "%s has been added to %s"), $data->Role, $project)}</p> | ||
{/block} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{extends designs/site.tpl} | ||
|
||
{block title}{_ "Roles"} — {$dwoo.parent}{/block} | ||
|
||
{block content} | ||
{capture assign=project}{projectLink $Project}{/capture} | ||
|
||
<div class="page-header"> | ||
<h1>Role Modified</h1> | ||
</div> | ||
<p class="lead">{sprintf(_("%s has been modified for %s"), $data->Role, $project)}</p> | ||
{/block} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{extends designs/site.tpl} | ||
|
||
{block title}Roles — {$dwoo.parent}{/block} | ||
|
||
{block content} | ||
<div class="row"> | ||
<div class="col-sm-8 col-sm-offset-2 col-md-6 col-md-offset-3"> | ||
<div class="page-header"> | ||
<h1>Role Removed</h1> | ||
</div> | ||
<p>{if $data && $data->Role}({$data->Role|escape}){/if} has been removed from {projectLink $Project}</p> | ||
</div> | ||
</div> | ||
{/block} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
<?php | ||
|
||
namespace Laddr; | ||
|
||
use Emergence\People\Person; | ||
|
||
|
||
class ProjectRole extends \ActiveRecord | ||
{ | ||
// ActiveRecord configuration | ||
public static $tableName = 'project_roles'; // the name of this model's table | ||
|
||
// controllers will use these values to figure out what templates to use | ||
public static $singularNoun = 'project role'; // a singular noun for this model's object | ||
public static $pluralNoun = 'project roles'; // a plural noun for this model's object | ||
|
||
// gets combined with all the extended layers | ||
public static $fields = [ | ||
'ProjectID' => 'uint', | ||
'PersonID' => [ | ||
'type' =>'uint', | ||
'default'=>null | ||
], | ||
'Role' => 'string', | ||
'Description' => [ | ||
'type' =>'string', | ||
'default'=>null | ||
] | ||
]; | ||
|
||
public static $relationships = [ | ||
'Project' => [ | ||
'type' => 'one-one', | ||
'class' => Project::class | ||
], | ||
'Person' => [ | ||
'type' => 'one-one', | ||
'class' => Person::class | ||
] | ||
]; | ||
|
||
public static $dynamicFields = [ | ||
'Project', | ||
'Person' | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
<?php | ||
|
||
namespace Laddr; | ||
|
||
use Emergence\People\Person; | ||
|
||
|
||
class RoleApplication extends \ActiveRecord | ||
{ | ||
// ActiveRecord configuration | ||
public static $tableName = 'role_applications'; // the name of this model's table | ||
|
||
// controllers will use these values to figure out what templates to use | ||
public static $singularNoun = 'role application'; // a singular noun for this model's object | ||
public static $pluralNoun = 'role applications'; // a plural noun for this model's object | ||
|
||
// gets combined with all the extended layers | ||
public static $fields = [ | ||
'ProjectID' => 'uint', | ||
'PersonID' => 'uint', | ||
'RoleID' => 'uint', | ||
'Application' => 'string', | ||
'Status' => [ | ||
'type' => 'enum', | ||
'values' => [ | ||
'Pending', | ||
'Accepted', | ||
'Rejected' | ||
], | ||
'default' => 'Pending' | ||
] | ||
]; | ||
|
||
public static $relationships = [ | ||
'Project' => [ | ||
'type' => 'one-one', | ||
'class' => Project::class | ||
], | ||
'Person' => [ | ||
'type' => 'one-one', | ||
'class' => Person::class | ||
], | ||
'ProjectRole' => [ | ||
'type' => 'one-one', | ||
'class' => ProjectRole::class | ||
] | ||
]; | ||
|
||
public static $indexes = [ | ||
'ProjectRoleApplication' => [ | ||
'fields' => ['ProjectID', 'PersonID', 'RoleID'], | ||
'unique' => true | ||
] | ||
]; | ||
|
||
public static $dynamicFields = [ | ||
'Project', | ||
'Person', | ||
'Role' | ||
]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters