Skip to content
This repository has been archived by the owner on Apr 24, 2024. It is now read-only.

Commit

Permalink
improve default placeholder texts for empty dashboard views, also inc…
Browse files Browse the repository at this point in the history
…lude links to edit information
  • Loading branch information
zegenie committed Sep 8, 2018
1 parent 338fcb2 commit 0450a1a
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@
<?php endforeach; ?>
</ul>
<?php else: ?>
<div class="no-projects">
<div class="no-items no-projects">
<?= fa_image_tag('star-half-o'); ?>
<span><?php echo __('You are not associated with any projects'); ?></span>
<?php if ($tbg_user->canAccessConfigurationPage(framework\Settings::CONFIGURATION_SECTION_PROJECTS) && framework\Context::getScope()->hasProjectsAvailable()): ?>
<button class="button button-silver project-quick-edit" onclick="TBG.Main.Helpers.Backdrop.show('<?= make_url('get_partial_for_backdrop', ['key' => 'project_config']); ?>');"><?= __('Create project'); ?></button>
<button class="button button-silver" onclick="TBG.Main.Helpers.Backdrop.show('<?= make_url('get_partial_for_backdrop', ['key' => 'project_config']); ?>');"><?= __('Create project'); ?></button>
<?php endif; ?>
</div>
<?php endif; ?>
15 changes: 10 additions & 5 deletions core/modules/project/Components.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,25 +147,30 @@ public function componentDashboardViewProjectStatistics()

public function componentDashboardViewProjectUpcoming()
{

$this->project = framework\Context::getCurrentProject();
$this->upcoming_milestones = $this->project->getUpcomingMilestones(21);
$this->starting_milestones = $this->project->getStartingMilestones(21);
}

public function componentDashboardViewProjectRecentIssues()
{
$this->issues = framework\Context::getCurrentProject()->getRecentIssues($this->view->getDetail());
$this->project = framework\Context::getCurrentProject();
$this->issues = $this->project->getRecentIssues($this->view->getDetail());
}

public function componentDashboardViewProjectRecentActivities()
{
$this->recent_activities = framework\Context::getCurrentProject()->getRecentActivities(10, false, null, true);
$this->project = framework\Context::getCurrentProject();
$this->recent_activities = $this->project->getRecentActivities(10, false, null, true);
}

public function componentDashboardViewProjectDownloads()
{
$builds = framework\Context::getCurrentProject()->getBuilds();
$this->project = framework\Context::getCurrentProject();
$builds = $this->project->getBuilds();
$active_builds = array();

foreach (framework\Context::getCurrentProject()->getEditions() as $edition_id => $edition)
foreach ($this->project->getEditions() as $edition_id => $edition)
{
$active_builds[$edition_id] = array();
}
Expand Down
1 change: 1 addition & 0 deletions core/modules/project/controllers/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -1135,6 +1135,7 @@ public function runConfigureProjectSettings(framework\Request $request)
$apply_template = (!$this->selected_project->getID());

try {
$this->selected_project->setOwner($this->getUser());
$this->selected_project->save();
if ($apply_template) {
$this->selected_project->applyTemplate($request['project_type']);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,12 @@
{
?><div class="content no-items">
<?= fa_image_tag('download'); ?>
<?php echo __('There are no downloadable releases at the moment'); ?>
<span><?php echo __('There are no downloadable releases at the moment'); ?></span>
<?php if ($tbg_user->canEditProjectDetails($project)): ?>
<?php if ($project->isBuildsEnabled()): ?>
<?php echo link_tag(make_url('project_release_center', array('project_key' => $project->getKey())), __('Manage project releases'), ['class' => 'button button-silver']); ?>
<?php endif; ?>
<?php endif; ?>
</div><?php
}

Expand Down
10 changes: 2 additions & 8 deletions core/modules/project/templates/_dashboardviewprojectinfo.inc.php
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
<?php
$projectHasDescription = $view->getProject()->hasDescription();
?>
<div id="project_description"<?php if(!$projectHasDescription) echo ' class="none"'; ?>>
<?php
if ($projectHasDescription)
echo tbg_parse_text($view->getProject()->getDescription());
else
echo __('This project has no description');
?>
<div id="project_description"<?php if (!$projectHasDescription) echo ' class="none"'; ?>>
<?php echo ($projectHasDescription) ? tbg_parse_text($view->getProject()->getDescription()) : __('This project has no description'); ?>
</div>
<?php if ($view->getProject()->hasOwner()): ?>
<div class="project_role">
Expand Down Expand Up @@ -51,4 +46,3 @@
<?php if ($view->getProject()->hasDocumentationURL()): ?>
<a class="button button-silver dash" href="<?php echo $view->getProject()->getDocumentationURL(); ?>" target="_blank"><?php echo __('Open documentation'); ?></a>
<?php endif; ?>
<br style="clear: both;">
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,11 @@
</div>
<?php endforeach; ?>
<?php else: ?>
<p class="content faded_out"><?php echo __('No users or teams assigned'); ?>.</p>
<p class="no-items">
<?= fa_image_tag('users'); ?>
<span><?php echo __('No users or teams assigned to this project'); ?></span>
<?php if ($tbg_user->canEditProjectDetails($project)): ?>
<a href="<?= make_url('project_settings', ['project_key' => $project->getKey()]); ?>" class="button button-silver project-quick-edit"><?= __('Set up project team'); ?></a>
<?php endif; ?>
</p>
<?php endif; ?>
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
<div class="dashboard_milestones">
<?php $milestone_cc = 0; ?>
<?php foreach (\thebuggenie\core\framework\Context::getCurrentProject()->getUpcomingMilestones(21) as $milestone): ?>
<?php foreach ($upcoming_milestones as $milestone): ?>
<?php if ($milestone->isScheduled()): ?>
<?php include_component('main/milestonedashboardbox', array('milestone' => $milestone)); ?>
<?php $milestone_cc++; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php foreach (\thebuggenie\core\framework\Context::getCurrentProject()->getStartingMilestones(21) as $milestone): ?>
<?php foreach ($starting_milestones as $milestone): ?>
<?php if ($milestone->isStarting()): ?>
<?php include_component('main/milestonedashboardbox', array('milestone' => $milestone)); ?>
<?php $milestone_cc++; ?>
Expand All @@ -16,6 +16,9 @@
<?php if ($milestone_cc == 0): ?>
<div class="no-items">
<?= fa_image_tag('calendar-plus-o'); ?>
<?php echo __('Upcoming milestones appear here'); ?>
<span><?php echo __('Upcoming milestones appear here'); ?></span>
<?php if ($tbg_user->hasProjectPageAccess('project_roadmap', $project)): ?>
<?php echo link_tag(make_url('project_roadmap', array('project_key' => $project->getKey())), __('Open project roadmap'), ['class' => 'button button-silver']); ?>
<?php endif; ?>
</div>
<?php endif; ?>
4 changes: 2 additions & 2 deletions core/modules/project/templates/_editproject.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</tr>
<?php else: ?>
<tr>
<td colspan="2">
<td colspan="2" class="project_type_container">
<label><?= __('Select type of project'); ?></label>
<div class="config_explanation">
<?= __('Select the type of project you are creating. The type of project decides initial workflows, issue types, settings and more. You can always configure this later.'); ?>
Expand All @@ -64,7 +64,7 @@
<label for="project_edit_type_team_project"><?= fa_image_tag('users'); ?><span><h1><?= __('Distributed teams project'); ?></h1><?= __('For projects with multiple teams, often distributed across locations'); ?></span></label>
<input type="radio" name="project_type" value="open-source" id="project_edit_type_open_source_regular">
<label for="project_edit_type_open_source_regular"><?= fa_image_tag('code-fork'); ?><span><h1><?= __('Classic open source'); ?></h1><?= __('For medium/small open source projects without multiple teams'); ?></span></label>
<input type="radio" name="project_type" value="classic" id="project_edit_type_regular">
<input type="radio" name="project_type" value="classic" checked id="project_edit_type_regular">
<label for="project_edit_type_regular"><?= fa_image_tag('code'); ?><span><h1><?= __('Classic software project'); ?></h1><?= __('Classic project template without specific settings'); ?></span></label>
<input type="radio" name="project_type" value="agile" id="project_edit_type_agile">
<label for="project_edit_type_agile"><?= fa_image_tag('repeat', ['style' => 'transform: rotate(90deg)']); ?><span><h1><?= __('Agile software project'); ?></h1><?= __('For projects with an agile methodology like e.g. scrum or kanban'); ?></span></label>
Expand Down
2 changes: 1 addition & 1 deletion core/modules/project/templates/_recentactivities.inc.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<?php else: ?>
<div class="no-items">
<?= fa_image_tag('files-o'); ?>
<?php echo __($empty); ?>
<span><?php echo __($empty); ?></span>
</div>
<?php endif; ?>
</div>
16 changes: 11 additions & 5 deletions themes/oxygen/css/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -10989,6 +10989,10 @@ div.quickaddtask .close_micro_popup_link {
box-sizing: border-box;
}

#project_info .project_type_container {
padding-top: 25px;
}

.project_save_container .button, .project_save_container .button:hover {
font-size: 1.1em;
padding: 6px 12px;
Expand Down Expand Up @@ -11275,6 +11279,7 @@ div.quickaddtask .close_micro_popup_link {

#project_description.none {
color: #AAA;
margin: 10px;
}

.project_information_sidebar {
Expand Down Expand Up @@ -16863,26 +16868,27 @@ td.legendLabel {
padding: 10px !important;
}

.dashboard_view_container .no-projects, .dashboard_view_container .no-items {
.dashboard_view_container .no-items {
font-size: 1.5em;
text-align: center;
padding: 25px;
color: #AAA;
}
.dashboard_view_container .no-projects span, .dashboard_view_container .no-items span {
.dashboard_view_container .no-items span {
display: block;
padding-bottom: 15px;
}
.dashboard_view_container .no-projects button {
.dashboard_view_container .no-items .button {
font-size: .6em;
padding: 5px 8px;
}
.dashboard_view_container .no-projects .fa, .dashboard_view_container .no-items .fa {
.dashboard_view_container .no-items .fa {
font-size: 2.5em;
display: block;
padding: 0 0 25px 0;
color: #CCC;
}
.dashboard_view_container .no-projects .fa {
.dashboard_view_container .no-items.no-projects .fa {
color: orange;
}

Expand Down

0 comments on commit 0450a1a

Please sign in to comment.