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

Change badge style #5189

Merged
merged 3 commits into from Jan 30, 2019
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
5 changes: 3 additions & 2 deletions media/css/core.css
Expand Up @@ -1105,11 +1105,12 @@ select.dropdown { display: none; }
.dropdown > ul:before { content:' '; visibility: visible; border:8px solid transparent; border-bottom-color: #465158; position:absolute; top:-16px; left:104px; }


.badge { position: relative; display: inline-block; width: 700px; left: -350px;}
.badge { position: absolute; left: 0; top: 0; z-index: 20; }
.badge > ul:before { visibility: visible; border:8px solid transparent; border-bottom-color: #465158; position:absolute; top:-16px; }
.badge > ul { margin-top: 3px; position:absolute; top:100%; background:#465158; padding:4px; border-radius:4px; z-index:1005; min-width:500; box-shadow: 0px 0px 8px 2px rgba(0,0,0,0.2); }
.badge > ul { margin-top: 3px; position:absolute; top:100%; background:#465158; padding:4px; border-radius:4px; z-index:1005; min-width:500px; box-shadow: 0px 0px 8px 2px rgba(0,0,0,0.2); width: 500px; }
.badge > ul > li { background: white; padding:8px 10px; border-bottom:1px solid #EEE; }
.badge pre { font-size: 12px; }
.badge-info:after { font-family: "FontAwesome"; content: "\f05a"; font-size: 23px; vertical-align: text-bottom; }

/* Modals */
.modal {
Expand Down
40 changes: 17 additions & 23 deletions readthedocs/templates/core/badge_markup.html
@@ -1,32 +1,26 @@
<div id="badge_markup" class="badge" style="display: none;">
<ul>
<li class="rst">
<h4>
reStructuredText
</h4>
<pre>
<ul>
<li class="rst">
<h4>reStructuredText</h4>
<pre>
.. image:: {{ badge_url }}
:target: {{ site_url }}
:alt: Documentation Status
</pre>
</li>
<li class="markdown">
<h4>
Markdown
</h4>
<pre>
</pre>
</li>
<li class="markdown">
<h4>Markdown</h4>
<pre>
[![Documentation Status]({{ badge_url }})]({{ site_url }})
</pre>
</li>
<li class="html">
<h4>
HTML
</h4>
<pre>
</pre>
</li>
<li class="html">
<h4>HTML</h4>
<pre>
&lt;a href='{{ site_url }}'&gt;
&lt;img src='{{ badge_url }}' alt='Documentation Status' /&gt;
&lt;/a&gt;
</pre>
</li>
</ul>
</pre>
</li>
</ul>
</div>
3 changes: 2 additions & 1 deletion readthedocs/templates/core/project_detail_right.html
Expand Up @@ -67,8 +67,9 @@ <h3>{% trans "Home Page" %}</h3>

{% block badge %}
<h3>{% trans "Badge" %}</h3>
<img src="{{ badge_url }}" />
<a href="{{ site_url }}" style="text-decoration: none;" onclick="$('#badge_markup').toggle(); return false;">
<img src="{{ badge_url }}" />
<span class="badge-info" title="Get this badge"></span>
</a>
{% include "core/badge_markup.html" with badge_url=badge_url site_url=site_url %}
{% endblock %}
Expand Down