Skip to content

Commit

Permalink
Hide draft UIs in templates
Browse files Browse the repository at this point in the history
  • Loading branch information
nlhkabu committed Jan 18, 2018
1 parent f7eab74 commit 730d1c2
Show file tree
Hide file tree
Showing 3 changed files with 114 additions and 111 deletions.
1 change: 1 addition & 0 deletions warehouse/static/sass/blocks/_package-description.scss
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,5 @@
font-style: italic;
margin: 0;
padding: 0;
line-height: 42px;
}
216 changes: 109 additions & 107 deletions warehouse/templates/manage/project.html
Original file line number Diff line number Diff line change
Expand Up @@ -61,25 +61,29 @@ <h1 class="package-snippet__title page-title">{{ project.name }}</h1>
<i class="fa fa-eye" aria-hidden="true"></i>
Preview Project
</a>
<a href="#delete-project-modal" class="dropdown__link">
<i class="fa fa-trash" aria-hidden="true"></i>
Delete Project
</a>
<a href="{{ request.route_path('help')}}#updating-projects" class="dropdown__link">
<i class="fa fa-pencil" aria-hidden="true"></i>
Update Project (help)
</a><!-- TODO: add help content -->
{# TODO: https://github.com/pypa/warehouse/issues/2805
<a href="#delete-project-modal" class="dropdown__link">
<i class="fa fa-trash" aria-hidden="true"></i>
Delete Project
</a>
#}
{# https://github.com/pypa/warehouse/issues/2806
<a href="{{ request.route_path('help')}}#updating-projects" class="dropdown__link">
<i class="fa fa-pencil" aria-hidden="true"></i>
Update Project (help)
</a>
#}
</div>
</div>
</div>
</div>

<nav class="tabs">
<a href="{{ request.route_path('manage.project.settings', name=project.normalized_name)}}" class="tabs__tab {% if active_tab == 'releases' %}tabs__tab--is-active{% endif %}">Releases</a>
<a href="{{ request.route_path('manage.project.roles', name=project.normalized_name)}}" class="tabs__tab {% if active_tab == 'collaborators' %}tabs__tab--is-active{% endif %}">Collaborators</a>
<a href="#" class="tabs__tab">Documentation</a>
{# TODO: https://github.com/pypa/warehouse/issues/582
<a href="#" class="tabs__tab">Documentation</a>
#}
</nav>

{% block main %}
<h2>Releases ({{ project.releases|length }})</h2>
{% if project.releases %}
Expand All @@ -91,137 +95,135 @@ <h2>Releases ({{ project.releases|length }})</h2>
<th class="table__options"></th>
</thead>
<tbody>
{% for release in project.releases %}
<tr>
<td class="table__version"><a href="TODO: link to release edit page">{{ release.version }}</a></td>
<td class="table__date"><time class="-js-relative-time" datetime="{{ release.created|format_datetime('yyyy-MM-ddTHH:mm:ss') }}">{{ release.created|format_date()}}</time></td>
<td class="table__summary">
{% if release.summary %}
{{ release.summary }}
{% else %}
{% endif %}
{% for release in project.releases %}
<tr>
<td class="table__version">
{# TODO: https://github.com/pypa/warehouse/issues/2807 <a href="">{{ release.version }}</a> #}
{{ release.version }}
</td>
<td class="table__options">
<div class="dropdown dropdown--with-icons">
<button class="dropdown__trigger button">
Options
<span class="dropdown__trigger-caret">
<i class="fa fa-caret-down" aria-hidden="true"></i>
<span class="sr-only">view submenu</span>
</span>
</button>
<div class="dropdown__content">
<a href="" class="dropdown__link">
<i class="fa fa-pencil" aria-hidden="true"></i>
Edit
</a><!-- TODO: link to release detail page -->
<a href="{{ request.route_path('packaging.release', name=release.project.name, version=release.version) }}" class="dropdown__link">
<i class="fa fa-eye" aria-hidden="true"></i>
Preview
</a>
<a href="#delete-release-modal-{{ loop.index }}" class="dropdown__link">
<i class="fa fa-trash" aria-hidden="true"></i>
Delete
</a>
</div>
</div>
</td>
<td class="table__options">
<div class="dropdown">
<button class="dropdown__trigger button">
Options
<span class="dropdown__trigger-caret">
<i class="fa fa-caret-down" aria-hidden="true"></i>
<span class="sr-only">view submenu</span>
</span>
</button>
<div class="dropdown__content">
<a href="" class="dropdown__link">Edit</a><!-- TODO: link to release detail page -->
<a href="{{ request.route_path('packaging.release', name=release.project.name, version=release.version) }}" class="dropdown__link">Preview</a>
<a href="" class="dropdown__link">Delete</a>
<td class="table__date"><time class="-js-relative-time" datetime="{{ release.created|format_datetime('yyyy-MM-ddTHH:mm:ss') }}">{{ release.created|format_date()}}</time></td>
<td class="table__summary">
{% if release.summary %}
{{ release.summary }}
{% else %}
&mdash;
{% endif %}
</td>
<td class="table__options">
<div class="dropdown dropdown--with-icons">
<button class="dropdown__trigger button">
Options
<span class="dropdown__trigger-caret">
<i class="fa fa-caret-down" aria-hidden="true"></i>
<span class="sr-only">view submenu</span>
</span>
</button>
<div class="dropdown__content">
{# TODO: https://github.com/pypa/warehouse/issues/2807
<a href="" class="dropdown__link">
<i class="fa fa-pencil" aria-hidden="true"></i>
Edit
</a>
#}
<a href="{{ request.route_path('packaging.release', name=release.project.name, version=release.version) }}" class="dropdown__link">
<i class="fa fa-eye" aria-hidden="true"></i>
Preview
</a>
{# TODO: https://github.com/pypa/warehouse/issues/2808
<a href="#delete-release-modal-{{ loop.index }}" class="dropdown__link">
<i class="fa fa-trash" aria-hidden="true"></i>
Delete
</a>
#}
</div>
</div>
</div>
</td>
</tr>
{% endfor %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
<br>
<br/>
{% else %}
<h2>No releases</h2>
{% endif %}
{# TODO: https://github.com/pypa/warehouse/issues/2809
<div class="callout-block">
<h3>Creating a New Release</h3>
<p>TODO: Some help text here</p>
</div>
{% else %}
<h2>No releases</h2>
<!-- TODO: link to instructions on how to create a release -->
{% endif %}
#}
{% endblock %}
</div>
</div>
</div>
<!-- delete modals -->
<div id="delete-project-modal" class="modal">
<div class="modal__content" role="dialog">
<a href="#modal-close" title="Close" class="modal__close">
<i class="fa fa-times" aria-hidden="true"></i>
<span class="sr-only">close</span>
</a>
<div class="modal__body">
<h3 class="modal__title">Delete {{ project.name }}?</h3>
<div class="callout-block callout-block--danger callout-block--bottom-margin no-top-margin">
<p>Warning: This action cannot be undone!</p>
</div>
<p>Confirm the project name and enter your password to continue.</p>
<form class="modal__form">
<label for="project-name">Project Name</label>
<input type="text" id="project-name" placeholder="Confirm project name">
<div class="split-layout">
<label for="project">Password</label>
<label for="show-password" class="show-password">
<input id="show-password" type="checkbox">&nbsp;Show password
</label>
</div>
<input type="password" id="project" placeholder="Your password">
</form>
</div>
<div class="modal__footer">
<a href="#modal-close" class="button modal__action">Cancel</a>
<button class="button button--highlight modal__action">Delete Project</button>
</div>
</div>
</div>

{% for release in project.releases %}
<div id="delete-release-modal-{{ loop.index }}" class="modal">
<!-- delete modals -->
{# TODO: https://github.com/pypa/warehouse/issues/2805
<div id="delete-project-modal" class="modal">
<div class="modal__content" role="dialog">
<a href="#modal-close" title="Close" class="modal__close">
<i class="fa fa-times" aria-hidden="true"></i>
<span class="sr-only">close</span>
</a>
<div class="modal__body">
<h3 class="modal__title">Delete {{ project.name }} - release {{ release.version }}?</h3>
<h3 class="modal__title">Delete {{ project.name }}?</h3>
<div class="callout-block callout-block--danger callout-block--bottom-margin no-top-margin">
<p>Warning: This action cannot be undone!</p>
</div>
<p>Enter your password to continue.</p>
<p>Confirm the project name and enter your password to continue.</p>
<form class="modal__form">
<label for="project-name">Project Name</label>
<input type="text" id="project-name" placeholder="Confirm project name">
<div class="split-layout">
<label for="password">Password</label>
<label for="project">Password</label>
<label for="show-password" class="show-password">
<input id="show-password" type="checkbox">&nbsp;Show password
</label>
</div>
<input type="password" id="password" placeholder="Your password">
<input type="password" id="project" placeholder="Your password">
</form>
</div>
<div class="modal__footer">
<a href="#modal-close" class="button modal__action">Cancel</a>
<button class="button button--highlight modal__action">Delete Release</button>
<button class="button button--highlight modal__action">Delete Project</button>
</div>
</div>
</div>
{% endfor %}
#}

{# TODO: https://github.com/pypa/warehouse/issues/2808
{% for release in project.releases %}
<div id="delete-release-modal-{{ loop.index }}" class="modal">
<div class="modal__content" role="dialog">
<a href="#modal-close" title="Close" class="modal__close">
<i class="fa fa-times" aria-hidden="true"></i>
<span class="sr-only">close</span>
</a>
<div class="modal__body">
<h3 class="modal__title">Delete {{ project.name }} - release {{ release.version }}?</h3>
<div class="callout-block callout-block--danger callout-block--bottom-margin no-top-margin">
<p>Warning: This action cannot be undone!</p>
</div>
<p>Enter your password to continue.</p>
<form class="modal__form">
<div class="split-layout">
<label for="password">Password</label>
<label for="show-password" class="show-password">
<input id="show-password" type="checkbox">&nbsp;Show password
</label>
</div>
<input type="password" id="password" placeholder="Your password">
</form>
</div>
<div class="modal__footer">
<a href="#modal-close" class="button modal__action">Cancel</a>
<button class="button button--highlight modal__action">Delete Release</button>
</div>
</div>
</div>
{% endfor %}
#}

</div>
</section>
{% endblock %}
8 changes: 4 additions & 4 deletions warehouse/templates/packaging/detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,16 @@ <h1 class="package-header__name">
</div>
</section>

{% if release.summary %}<!-- todo: or logged in user can edit package -->
{% if release.summary %}{# TODO: https://github.com/pypa/warehouse/issues/2810 - add "or logged in user can edit package" #}
<section class="horizontal-section horizontal-section--grey horizontal-section--thin">
<div class="site-container">
<div class="split-layout split-layout--middle">
{% if release.summary %}
<p class="package-description">{{ release.summary }}</p>
{% endif %}
<!-- todo: if logged in user can edit package -->
<a href="{{ request.route_path('manage.project.settings', name=project.normalized_name) }}" class="button button--highlight">Edit Project</a>
<!-- end todo -->
<a href="{{ request.route_path('manage.project.settings', name=project.normalized_name) }}" class="button button--highlight">Edit Project</a>
{# TODO: https://github.com/pypa/warehouse/issues/2810 (if logged in user can edit package)
#}
</div>
</div>
</section>
Expand Down

0 comments on commit 730d1c2

Please sign in to comment.