Comments (3)
This issue can be resolved through the following code:
HTML:
<div class="container">
<div class="wrap">
<div class="box">
<p data-copy-text="">pip install Django==4.2</p>
</div>
</div>
</div>
CSS:
font-size: 16px;
}
* {
box-sizing: border-box;
margin: 0;
padding: 0;
line-height: 1;
border: 0;
}
html,
body {
width: 100vw;
min-width: 100vw;
height: 100vh;
min-height: 100vh;
}
body {
background-color: #f5f5f4;
font-family: 'Catamaran', sans-serif;
}
p {
font-size: 1.25rem;
line-height: 1.25;
}
.container {
display: flex;
justify-content: center;
align-items: center;
width: 100%;
height: 100%;
}
.container .wrap {
flex: 0 1 37.5rem;
margin: 0.625rem;
}
.container .wrap .box {
padding: 1.25rem;
background-color: #fff;
border: 0.0625rem solid #607d8b;
border-radius: 0.1875rem;
}
.container .wrap .box:not(:last-child) {
margin-bottom: 1.5625rem;
}
[data-copy-text] + i.material-icons {
transition: all 0.25s ease-in-out;
position: absolute;
top: 0;
right: 0;
background-color: #f5f5f4;
padding: 0.3125rem 0.625rem;
color: #000;
border-color: #607d8b;
border-style: solid;
border-top-right-radius: 0.1875rem;
border-bottom-width: 0.0625rem;
border-left-width: 0.0625rem;
opacity: 0.3;
cursor: pointer;
z-index: 1;
}
[data-copy-text] + i.material-icons:hover,
[data-copy-text] + i.material-icons.active {
background-color: #607d8b;
opacity: 1;
color: #fff;
}```
JavaScript:
'use strict';
document.addEventListener('DOMContentLoaded', function() {
copyText.init()
});
var copyText = {
init: function() {
if (document.querySelectorAll('[data-copy-text]').length) {
var cp = document.querySelectorAll('[data-copy-text]');
for (var i = 0, l = cp.length; i < l; i++) {
copyText.addCopy(cp[i]);
}
}
},
addCopy: function(el) {
if (typeof el !== 'undifined') {
var parent = el.parentNode;
if (!parent.querySelectorAll('span.copy-btn').length && window.getSelection) {
var cpBtn = document.createElement('I');
parent.setAttribute('style', 'position:relative');
parent.appendChild(cpBtn);
cpBtn.classList.add('material-icons');
cpBtn.textContent = 'content_copy';
cpBtn.innerHTML = '';
cpBtn.setAttribute('title', 'Copy Text');
copyText.addCopyEvent(cpBtn, el);
}
}
},
addCopyEvent: function(btn, el) {
var coppied = false;
var timer = 0;
function copyText() {
function showCheckmark() {
btn.textContent = 'check';
btn.classList.add('active');
}
function hideCheckmark() {
btn.classList.remove('active');
btn.textContent = 'content_copy';
timer = 0;
}
if (timer === 0) {
if (window.getSelection) {
var selection = window.getSelection();
var range = document.createRange();
range.selectNodeContents(el);
selection.removeAllRanges();
selection.addRange(range);
try {
document.execCommand('copy');
coppied = true;
} catch (err) {
console.error(err);
}
selection.removeAllRanges();
} else {
console.error('your browser does not support copy');
}
if (coppied) {
clearTimeout(timer);
showCheckmark();
timer = setTimeout(hideCheckmark, 2000);
}
}
}
if (typeof btn !== 'undifined' && typeof el !== 'undifined') {
btn.addEventListener('click', copyText, false);
}
},
}
**I hope the reviewer finds these code snippets useful for the improvement of their download page, So assign this to me I'll resolve it super fast. I want to contribute to Django.**
Before :
![image](https://user-images.githubusercontent.com/83120798/229566139-bc5d887c-db26-4f7a-b2dd-2230454d7209.png)
After :
![image](https://user-images.githubusercontent.com/83120798/229566297-7be1828f-1c3b-4d67-9950-8c1f3303c0e1.png)
from code.djangoproject.com.
@Chandrababu-Namani Great brother, can you attach some screenshot so that reviewer can review it super fast, and I would also hope this issue would get assigned to you brother
from code.djangoproject.com.
You also raised the issue at djangoproject.com, which is the correct repository.
django/djangoproject.com#1338
I think this issue should be closed and handled in djangoproject.com 👍
from code.djangoproject.com.
Related Issues (20)
- Filing a new bug when you're not logged in is *extremely* difficult HOT 4
- models.Datefield being localized where it shouldn't HOT 4
- Update to Trac 1.4.x HOT 4
- Timeline incredibly slow. HOT 1
- Django raw sql query issue using class based view HOT 1
- The text input for "assign to" starts out pre-filled to an invalid value
- Update name and logo for Django's Trac integration with GitHub. HOT 3
- Unable to login through GitHub Login HOT 6
- Update footer to match dp.com
- Error creating users in tests HOT 1
- Upgrade PostgreSQL to version 14
- trac "pull requests" entry disappears when editing HOT 3
- Django admin layout breaks when using help_text in 2 columns in admin HOT 2
- A transition is missing in the navigation bar HOT 2
- Current guidelines for local setup broken due to Trac database_version update HOT 1
- "The Trac Environment needs to be upgraded" after installing locally
- "Save as new" with read-only fields HOT 1
- Add a link to the password reset URL. HOT 2
- Reports don't work after being logged out HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from code.djangoproject.com.