1
0
mirror of https://github.com/stolksdorf/homebrewery.git synced 2025-12-18 21:01:29 +00:00

Adding in a preview and share id to admin

This commit is contained in:
Scott Tolksdorf
2016-01-12 13:51:52 -05:00
parent df5260ce99
commit a11956e860
2 changed files with 37 additions and 1 deletions

View File

@@ -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>

View File

@@ -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;
}
}
} }
} }