Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove links to packages from HTML #661

Open
sonecms opened this issue Jul 29, 2021 · 2 comments
Open

Remove links to packages from HTML #661

sonecms opened this issue Jul 29, 2021 · 2 comments

Comments

@sonecms
Copy link

sonecms commented Jul 29, 2021

Tell me how you can remove active links from the package versions so that the user cannot download them. I found the following line in the package.html.twig file:

                {%- if package.highest.type == 'metapackage' -%}
                {{ version.prettyVersion }}
                {%- elseif version.distType -%}
                <a class="badge badge-pill badge-secondary" href="{{ version.distUrl }}" title="dist-reference: {{ version.distReference }}{{ branch_alias }}">{{ version.prettyVersion }}</a>
                {%- elseif version.sourceUrl matches '#^https?:\/\/#' -%}
                <a class="badge badge-pill badge-secondary"  href="{{ version.sourceUrl }}" title="source-reference: {{ version.sourceReference }}{{ branch_alias }}">{{ version.prettyVersion }}</a>
                {%- else -%}
                <span class="badge badge-pill badge-secondary"  title="source-reference: {{ version.sourceReference }}{{ branch_alias }}">{{ version.prettyVersion }}</span>
                {%- endif -%}

Is there any section in the satis.json responsible for this?

@alcohol
Copy link
Member

alcohol commented Jul 29, 2021

Satis just uses the template file. So if you modify the template.. 🤷

@moneef
Copy link

moneef commented Jul 10, 2023

remove the if statements and keep {{ version.prettyVersion }} only or replace the section with the following code to show a bill shape instead of the version text only:

  <dd class="{{ col2_class }} field-releases filter-by" data-package-name="{{ package.highest.name }}">
        {% for version in package.versions %}

        {% set branch_alias = attribute(version.extra['branch-alias'], version.prettyVersion) %}
        {%- if branch_alias -%}
        {% set branch_alias = ", branch-alias: " ~ branch_alias %}
        {%- endif -%}

        <span class="badge rounded-pill bg-secondary text-light" title="source-reference: {{ version.sourceReference }}{{ branch_alias }}">{{ version.prettyVersion }}</span>

        {% endfor %}
   </dd>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants