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

Add "edit" and "view docs" buttons to subproject list #3572

Merged
merged 7 commits into from May 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
54 changes: 51 additions & 3 deletions media/css/core.css
Expand Up @@ -1068,6 +1068,43 @@ select.dropdown { display: none; }
}


/* Table lists */
div.module div.module-title {
height: 2.625em;
overflow: hidden;
}

div.module div.module-list ul li.module-item div.module-title .module-name {
line-height: 1.5em;
}
div.module div.module-list ul li.module-item div.module-title a.module-name {
text-decoration: none;
}

div.module div.module-list ul li.module-item div.module-title .module-info {
display: block;
font-size: .75em;
line-height: 1.5em;
color: #999;
}
div.module div.module-list ul li.module-item div.module-title a.module-info {
text-decoration: none;
}

div.module div.module-title ul.module-item-menu {
top: 10px;
right: 10px;
}

div.module div.module-list ul.module-item-menu a.module-action {
display: block;
height: 1em;
padding: .5em .75em;
font-size: 1em;
font-weight: normal;
}


/* Domain Pages */

.domain-machine { color: #999; }
Expand Down Expand Up @@ -1123,12 +1160,23 @@ div.httpexchange div.highlight pre {
font-size: .9em;
}


/* Subprojects */
div.module.project-subprojects div.subproject-meta {
font-size: .9em;
font-style: italic;

div.module.project-subprojects li.subproject a.subproject-url:before {
padding-right: .5em;
font-family: FontAwesome;
font-size: 1.2em;
content: "\f0c1";
}

div.module.project-subprojects li.subproject a.subproject-edit:before {
font-family: FontAwesome;
font-weight: normal;
content: "\f044";
}


/* Pygments */
div.highlight pre .hll { background-color: #ffffcc }
div.highlight pre .c { color: #60a0b0; font-style: italic } /* Comment */
Expand Down
64 changes: 37 additions & 27 deletions readthedocs/templates/projects/projectrelationship_list.html
Expand Up @@ -12,7 +12,7 @@
{% block project_edit_content_header %}{% trans "Subprojects" %}{% endblock %}

{% block project_edit_content %}
<p>
<p class="help_text">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was missing here :)

{% blocktrans trimmed %}
Subprojects are projects hosted from the same URL as their parent project.
This is useful for organizing multiple projects under a custom domain.
Expand Down Expand Up @@ -45,33 +45,43 @@
</div>

<div class="module project-subprojects">
<div class="module-list-wrapper">
<ul>
{% for subproject in object_list %}
<li class="module-item">
<div class="subproject-name">
<a href="{% url 'projects_subprojects_update' project_slug=project.slug subproject_slug=subproject.child.slug %}">
{{ subproject.child }}
</a>
</div>
<div class="module-list">
<div class="module-list-wrapper">
<ul class="subprojects">
{% for subproject in object_list %}
<li class="module-item subproject">
<div class="module-title">
<a
class="module-name"
href="{% url 'projects_manage' project_slug=subproject.child.slug %}">
{{ subproject.child }}
</a>
<span>
<a class="module-info subproject-url"
href="{{ subproject.get_absolute_url }}">
{{ subproject.get_absolute_url }}
</a>
</span>
</div>

<div class="subproject-meta">
<a href="{% url 'projects_manage' project_slug=subproject.child.slug %}">
{% trans "Project page" %}</a>
&nbsp;&dash;&nbsp;
<a href="{{ subproject.get_absolute_url }}">
{{ subproject.get_absolute_url }}
</a>
</div>
</li>
{% empty %}
<li class="module-item">
<p class="quiet">
{% trans 'No subprojects are currently configured' %}
</p>
</li>
{% endfor %}
</ul>
<ul class="module-item-menu subproject-menu">
<li>
<a
class="module-action subproject-edit"
href="{% url 'projects_subprojects_update' project_slug=project.slug subproject_slug=subproject.child.slug %}">
</a>
</li>
</ul>
</li>
{% empty %}
<li class="module-item">
<p class="quiet">
{% trans 'No subprojects are currently configured' %}
</p>
</li>
{% endfor %}
</ul>
</div>
</div>
</div>
{% endif %}
Expand Down