Skip to content

Commit

Permalink
feat: Link on dashboard
Browse files Browse the repository at this point in the history
Refs: #RW-1104
  • Loading branch information
attiks committed Oct 15, 2024
1 parent 6ccae20 commit 2824323
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public function buildForm(array $form, FormStateInterface $form_state, ?Moderati
// Link to create a new entity.
$url_options = ['attributes' => ['target' => '_blank']];

if ($user && $user->hasRole('contributor')) {
if ($user && $user->hasPermission('create report content')) {
$links = $this->t('Create a new <a href="@job_url">Job vacancy</a>, a new <a href="@training_url">Training program</a> or a new <a href="@report_url">Report</a>', [
'@job_url' => Url::fromRoute('node.add', [
'node_type' => 'job',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
}
.rw-user-dashboard li + li {
margin-top: 32px;
break-inside: avoid;
}
[dir="ltr"] .rw-user-dashboard li {
padding-right: 32px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,24 @@
<a href="/user/{{ user.id() }}/bookmarks">{% trans %}Manage your bookmarks{% endtrans %}</a>
<p>{% trans %}Track content relevant to you on the site.{% endtrans %}</p>
</li>
{% if user.hasPermission('create job content') %}
<li>
<a href="/node/add/job">{% trans %}Post a job vacancy{% endtrans %}</a>
<p>{% trans %}Advertise job, consulting and internships vacancies.{% endtrans %}</p>
</li>
{% if user.hasPermission('create training content') %}
{% endif %}
<li>
<a href="/node/add/training">{% trans %}Post a training program{% endtrans %}</a>
<p>{% trans %}Advertise training programs for the humanitarian community.{% endtrans %}</p>
</li>
{% endif %}
{% if user.hasPermission('create report content') %}
<li>
<a href="/node/add/report">{% trans %}Post a report{% endtrans %}</a>
<p>{% trans %}Post a report for the humanitarian community.{% endtrans %}</p>
</li>
{% endif %}
<li>
<a href="/user/{{ user.id() }}/posts">{% trans %}View your posts{% endtrans %}</a>
<p>{% trans %}Manage the Job vacancies or Training programs you posted.{% endtrans %}</p>
Expand Down

0 comments on commit 2824323

Please sign in to comment.