mirror of
https://github.com/stolksdorf/homebrewery.git
synced 2025-12-18 20:31:33 +00:00
Adding in a preview and share id to admin
This commit is contained in:
@@ -18,12 +18,18 @@ var HomebrewAdmin = React.createClass({
|
|||||||
return <tr className={cx('brewRow', {'isEmpty' : brew.text == ""})} key={brew.sharedId}>
|
return <tr className={cx('brewRow', {'isEmpty' : brew.text == ""})} key={brew.sharedId}>
|
||||||
|
|
||||||
<td>{brew.editId}</td>
|
<td>{brew.editId}</td>
|
||||||
|
<td>{brew.shareId}</td>
|
||||||
<td>{Moment(brew.createdAt).fromNow()}</td>
|
<td>{Moment(brew.createdAt).fromNow()}</td>
|
||||||
<td>{Moment(brew.updatedAt).fromNow()}</td>
|
<td>{Moment(brew.updatedAt).fromNow()}</td>
|
||||||
<td>{Moment(brew.lastViewed).fromNow()}</td>
|
<td>{Moment(brew.lastViewed).fromNow()}</td>
|
||||||
<td>{brew.views}</td>
|
<td>{brew.views}</td>
|
||||||
|
|
||||||
<td><a target="_blank" href={'/homebrew/share/' + brew.shareId}>view</a></td>
|
<td className='preview'>
|
||||||
|
<a target="_blank" href={'/homebrew/share/' + brew.shareId}>view</a>
|
||||||
|
<div className='content'>
|
||||||
|
{brew.text.slice(0, 500)}
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
<td><a href={'/homebrew/remove/' + brew.editId +'?admin_key=' + this.props.admin_key}><i className='fa fa-trash' /></a></td>
|
<td><a href={'/homebrew/remove/' + brew.editId +'?admin_key=' + this.props.admin_key}><i className='fa fa-trash' /></a></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
@@ -39,6 +45,7 @@ var HomebrewAdmin = React.createClass({
|
|||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Edit Id</th>
|
<th>Edit Id</th>
|
||||||
|
<th>Share Id</th>
|
||||||
<th>Created At</th>
|
<th>Created At</th>
|
||||||
<th>Last Updated</th>
|
<th>Last Updated</th>
|
||||||
<th>Last Viewed</th>
|
<th>Last Viewed</th>
|
||||||
|
|||||||
@@ -18,6 +18,35 @@
|
|||||||
min-width: 100px;
|
min-width: 100px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
|
|
||||||
|
&.preview{
|
||||||
|
position: relative;
|
||||||
|
|
||||||
|
&:hover{
|
||||||
|
.content{
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.content{
|
||||||
|
font-family: monospace;
|
||||||
|
text-align: left;
|
||||||
|
padding : 30px;
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
top : 100%;
|
||||||
|
left: 0px;
|
||||||
|
width : 300px;
|
||||||
|
max-height : 500px;
|
||||||
|
background-color: white;
|
||||||
|
z-index : 1000;
|
||||||
|
pointer-events: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user