drupalorg-1.0.x-dev/templates/forks/drupalorg-fork-list.html.twig

templates/forks/drupalorg-fork-list.html.twig
{#
Available variables:
- issue: Issue array with all the information returned from Gitlab.
- project: Project array that the issue belongs to.
- forks: Forks array with all the forks information.
- issue_specific_branches: Branches array.
- merge_requests: Merge Requests array with all the MR information.
- logged_in: User is logged in or not.
#}

<div class="forks-listing-wrapper">
  {% if forks %}
    <h5>{{ 'Forks'|t }}</h5>
    <p>{{ 'You can collaborate using the existing fork.'|t }}</p>

    {% for fork in forks %}
      <div class="fork" data-fork-id="{{ fork.id }}">
        <div class="fork-title">
          <a class="gitlab-link" href="{{ fork.web_url }}"><b>{{ fork.path_with_namespace }}</b></a>
        </div>
        <div class="fork-actions">
          {% if logged_in %}
            <a data-fork-id="{{ fork.id }}"
               data-source-link="{{ issue.web_url }}"
               class="button button--secondary request-access"
               href="{{ path('drupalorg.issue_fork_request_access', {
                 'source_link': issue.web_url,
                 'fork_id': fork.id,
               }) }}"
            >{{ 'Request access'|t }}</a>
          {% endif %}
        </div>
      </div>

      <div class="fork-commands">
        {{ include('@drupalorg/forks/drupalorg-fork-commands.html.twig') }}
      </div>

      <hr>
      <div class="fork-branches" data-fork-id="{{ fork.id }}">
        <h5>{{ 'Issue specific branches'|t }}</h5>
        {% if issue_specific_branches[fork.id]|length %}
          <p>
            {{ 'Branches listed here have the prefix <em>"@prefix"</em>. For a full list of branches click on the fork link above.'|t({
              '@prefix': issue.iid ~ '-'
            }) }}
          </p>
          {% for issue_branch in issue_specific_branches[fork.id] %}
            <div class="fork-branch-wrapper">
              {% if logged_in %}
                {% set mr_params = {
                  'change_branches': 'true',
                  'merge_request': {
                    'source_project_id': fork.id,
                    'source_branch': issue_branch.name,
                    'target_project_id': fork.forked_from_project.id
                  }
                } %}
                <a class="button create-mr-gitlab gitlab-link" href="{{ fork.web_url }}/-/merge_requests/new?{{ mr_params | url_encode }}">
                  {{ 'Create MR'|t }}
                </a>
              {% endif %}
              <a href="{{ issue_branch.web_url }}" class="branch-link gitlab-link">{{ issue_branch.name }}</a>
            </div>
          {% endfor %}
        {% else %}
          <p>{{ 'There are no issue specific branches created. For a full list of branches click on the fork link above.'|t }}</p>
          <p>{{ 'If you created a fork with a branch, it might take a few seconds to appear.'|t }}</p>
        {% endif %}

        {% if logged_in %}
          <a class="button create-branch-gitlab gitlab-link" href="{{ fork.web_url }}/-/branches/new?branch_name={{ issue.iid }}-">
            {{ 'Create new branch'|t }}
          </a>
        {% endif %}
      </div>
    {% endfor %}
  {% endif %}
</div>

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc