Skip to content
This repository has been archived by the owner on Nov 25, 2020. It is now read-only.

Commit

Permalink
Update styling
Browse files Browse the repository at this point in the history
  • Loading branch information
cdujeu committed Feb 24, 2016
1 parent 2dddc17 commit d051f92
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 10 deletions.
1 change: 1 addition & 0 deletions core/src/plugins/action.share/class.ShareCenter.php
Expand Up @@ -1501,6 +1501,7 @@ public function shareNode($httpVars, &$update){

}

// OCS LINK
if(isSet($httpVars["ocs_data"])){

$ocsData = json_decode($httpVars["ocs_data"], true);
Expand Down
8 changes: 6 additions & 2 deletions core/src/plugins/action.share/res/react-share-form.css
Expand Up @@ -188,7 +188,8 @@ div#react_share_form div.user-badge span.avatar {
div#react_share_form div.user-badge.user-type-group span.avatar {
background-color: #47b092;
}
div#react_share_form div.user-badge.user-type-tmp_user span.avatar {
div#react_share_form div.user-badge.user-type-tmp_user span.avatar,
div#react_share_form div.user-badge.user-type-remote_user span.avatar {
background-color: #438db3;
}
div#react_share_form div.user-badge img {
Expand Down Expand Up @@ -245,7 +246,10 @@ div#react_share_form div.remote-users-add div.user {
}
div#react_share_form div.remote-users-add button.mui-icon-button {
margin-top: 26px;
color: #ccc;
color: #438db3;
}
div#react_share_form div.remote-users-add button.mui-icon-button.mui-is-disabled {
color: #eee;
}
div.react-autosuggest {
padding-left: 4px;
Expand Down
8 changes: 6 additions & 2 deletions core/src/plugins/action.share/res/react-share-form.less
Expand Up @@ -216,7 +216,8 @@ div#react_share_form {
background-color: @color1;
}
}
&.user-type-tmp_user{
&.user-type-tmp_user,
&.user-type-remote_user{
span.avatar{
background-color: @color3;
}
Expand Down Expand Up @@ -275,7 +276,10 @@ div#react_share_form {
}
button.mui-icon-button{
margin-top: 26px;
color: #ccc;
color: @color3;
&.mui-is-disabled{
color: #eee;
}
}
}
}
Expand Down
44 changes: 38 additions & 6 deletions core/src/plugins/action.share/res/react/ShareDialog.js
Expand Up @@ -74,8 +74,10 @@
}
if( (model.getNode().isLeaf() && auth.file_workspaces) || (!model.getNode().isLeaf() && auth.folder_workspaces)){
var users = model.getSharedUsers();
var ocsUsers = model.getOcsInvitations();
var totalUsers = users.length + ocsUsers.length;
panels.push(
<ReactMUI.Tab key="target-users" label={'Users' + (users.length?' ('+users.length+')':'')}>
<ReactMUI.Tab key="target-users" label={'Users' + (totalUsers?' ('+totalUsers+')':'')}>
<UsersPanel shareModel={model}/>
</ReactMUI.Tab>
);
Expand Down Expand Up @@ -259,8 +261,10 @@
}*/
if(this.props.type == 'group') {
avatar = <span className="avatar icon-group"/>;
}else if(this.props.type == 'temporary'){
}else if(this.props.type == 'temporary') {
avatar = <span className="avatar icon-plus"/>;
}else if(this.props.type == 'remote_user'){
avatar = <span className="avatar icon-cloud"/>;
}else{
avatar = <span className="avatar icon-user"/>;
}
Expand Down Expand Up @@ -588,6 +592,10 @@
shareModel: React.PropTypes.instanceOf(ReactModel.Share)
},

getInitialState: function(){
return {addDisabled: true};
},

addUser:function(){
var h = this.refs["host"].getValue();
var u = this.refs["user"].getValue();
Expand All @@ -598,21 +606,45 @@
this.props.shareModel.removeOcsInvitation(invite);
},

monitorInput:function(){
var h = this.refs["host"].getValue();
var u = this.refs["user"].getValue();
this.setState({addDisabled:!(h && u)});
},

render: function(){

var inv = this.props.shareModel.getOcsInvitations().map(function(invite){
var rem = function(){
this.removeUser(invite);
}.bind(this);
return <div>{invite.HOST} -- {invite.USER} -- <span onClick={rem}>X</span></div>;
var status;
if(!invite.STATUS){
status = 'not sent';
}else if(invite.STATUS == 1){
status = 'pending';
}else if(invite.STATUS == 2){
status = 'accepted';
}else if(invite.STATUS == 4){
status = 'rejected';
}
var menuItems = [{text:'Remove', callback:rem}];
return (
<UserBadge
label={invite.USER + " @ " + invite.HOST + " (" + status + ")"}
avatar={null}
type={"remote_user"}
menus={menuItems}
/>
);
}.bind(this));
return (
<div>
<h3>Remote Users</h3>
<div className="remote-users-add reset-pydio-forms">
<ReactMUI.TextField className="host" ref="host" floatingLabelText="Remote Host"/>
<ReactMUI.TextField className="user" ref="user" type="text" floatingLabelText="RemoteUser"/>
<ReactMUI.IconButton tooltip="Add" iconClassName="icon-plus-sign" onClick={this.addUser}/>
<ReactMUI.TextField className="host" ref="host" floatingLabelText="Remote Host" onChange={this.monitorInput}/>
<ReactMUI.TextField className="user" ref="user" type="text" floatingLabelText="RemoteUser" onChange={this.monitorInput}/>
<ReactMUI.IconButton tooltip="Add" iconClassName="icon-plus-sign" onClick={this.addUser} disabled={this.state.addDisabled}/>
</div>
<div>{inv}</div>
</div>
Expand Down

0 comments on commit d051f92

Please sign in to comment.