diff --git a/modules/core/client/directives/editable-line.client.directive.js b/modules/core/client/directives/editable-line.client.directive.js index 22496fb8..c2372ebb 100644 --- a/modules/core/client/directives/editable-line.client.directive.js +++ b/modules/core/client/directives/editable-line.client.directive.js @@ -27,9 +27,9 @@ $scope.input = jQuery($element).find('.editable-line-input'); $scope.originalDivBackground = $scope.div.css('background-color'); - $scope.div.awesomeCursor('wrench', { + $scope.div.awesomeCursor('pencil', { color: '#ff6000', - flip: 'horizontal', + flip: 'vertical', outline: '#ff3e00' }); diff --git a/modules/torrents/client/controllers/torrent-info.client.controller.js b/modules/torrents/client/controllers/torrent-info.client.controller.js index f4e89091..59cdc559 100644 --- a/modules/torrents/client/controllers/torrent-info.client.controller.js +++ b/modules/torrents/client/controllers/torrent-info.client.controller.js @@ -95,6 +95,11 @@ * $watch 'vm.torrentLocalInfo' */ $scope.$watch('vm.torrentLocalInfo', function (newValue, oldValue) { + if(vm.torrentLocalInfo) { + vm.torrentLocalInfo.resource_detail_info.custom_title = vm.TGI.getTorrentCustomTitle(vm.torrentLocalInfo); + vm.torrentLocalInfo.resource_detail_info.custom_subtitle = vm.TGI.getTorrentCustomSubTitle(vm.torrentLocalInfo); + } + if (vm.torrentLocalInfo && vm.torrentLocalInfo._replies) { var hasme = false; var meitem = null; @@ -517,13 +522,13 @@ } ] }, - { - icon: 'fa-user-md', - title: $translate.instant('TAB_MY_PANEL'), - templateUrl: 'myPanel.html', - ng_show: vm.torrentLocalInfo.isCurrentUserOwner, - badges: [] - }, + // { + // icon: 'fa-user-md', + // title: $translate.instant('TAB_MY_PANEL'), + // templateUrl: 'myPanel.html', + // ng_show: vm.torrentLocalInfo.isCurrentUserOwner, + // badges: [] + // }, { icon: 'fa-cog', title: $translate.instant('TAB_ADMIN_PANEL'), @@ -1011,6 +1016,69 @@ }); }; + /** + * isOwner + * @param o, topic or reply + * @returns {boolean} + */ + vm.isOwner = function (o) { + if (o) { + if (o.isCurrentUserOwner) { + return true; + } else { + return false; + } + } else { + return false; + } + }; + + /** + * canEdit + * @returns {boolean} + */ + vm.canEdit = function () { + if (vm.user.isOper) { + return true; + } else { + return false; + } + }; + + /** + * onTorrentTitleEdited + */ + $scope.onTorrentTitleEdited = function (modifyed) { + if (vm.torrentLocalInfo && modifyed) { + TorrentsService.update({ + _id: vm.torrentLocalInfo._id, + custom_title: vm.torrentLocalInfo.resource_detail_info.custom_title + }, function (res) { + vm.torrentLocalInfo = res; + NotifycationService.showSuccessNotify('TORRENT_UPDATE_SUCCESSFULLY'); + }, function (res) { + NotifycationService.showErrorNotify(res.data.message, 'TORRENT_UPDATE_ERROR'); + }); + } + }; + + /** + * onTorrentSubTitleEdited + */ + $scope.onTorrentSubTitleEdited = function (modifyed) { + if (vm.torrentLocalInfo && modifyed) { + TorrentsService.update({ + _id: vm.torrentLocalInfo._id, + custom_subtitle: vm.torrentLocalInfo.resource_detail_info.custom_subtitle + }, function (res) { + vm.torrentLocalInfo = res; + NotifycationService.showSuccessNotify('TORRENT_UPDATE_SUCCESSFULLY'); + }, function (res) { + NotifycationService.showErrorNotify(res.data.message, 'TORRENT_UPDATE_ERROR'); + }); + } + }; + /** * doUpdateTorrentInfo * @param minfo diff --git a/modules/torrents/client/less/torrents.less b/modules/torrents/client/less/torrents.less index 05542481..e20fe2bf 100644 --- a/modules/torrents/client/less/torrents.less +++ b/modules/torrents/client/less/torrents.less @@ -1,5 +1,9 @@ @import (reference) "../../../core/client/less/mt-var.less"; +.text-bold { + font-weight: bold; +} + .filter-tags { padding-bottom: 10px; margin-bottom: 15px; diff --git a/modules/torrents/client/views/view-torrent.client.view.html b/modules/torrents/client/views/view-torrent.client.view.html index fa1b84de..9c21fa15 100644 --- a/modules/torrents/client/views/view-torrent.client.view.html +++ b/modules/torrents/client/views/view-torrent.client.view.html @@ -579,13 +579,27 @@
+
{{ 'RESOURCE_TITLE' | translate}}:
+
+ +
+ +
{{ 'RESOURCE_SUB_TITLE' | translate}}:
+
+ +
+
{{ 'TABLE_FIELDS.PUBLISHER' | translate}}:
{{ 'ANONYMOUS' | translate }} -   {{'MESSAGES_FIELD.INFO_SEND_AT' | translate}}: {{vm.torrentLocalInfo.createdat | date: 'yyyy-MM-dd HH:mm:ss'}} +  {{'MESSAGES_FIELD.INFO_SEND_AT' | translate}}: {{vm.torrentLocalInfo.createdat | date: 'yyyy-MM-dd HH:mm:ss'}}
{{ 'TORRENT_FILENAME' | translate}}:
@@ -596,8 +610,8 @@
{{ 'TABLE_FIELDS.ABBR_SEEDS_LEECHERS_FINISHED' | translate}}:
- {{vm.torrentLocalInfo.torrent_seeds}}   - {{vm.torrentLocalInfo.torrent_leechers}}   + {{vm.torrentLocalInfo.torrent_seeds}}  + {{vm.torrentLocalInfo.torrent_leechers}} {{vm.torrentLocalInfo.torrent_finished}}
diff --git a/modules/torrents/server/controllers/torrents.server.controller.js b/modules/torrents/server/controllers/torrents.server.controller.js index 22ee34ec..251589f6 100644 --- a/modules/torrents/server/controllers/torrents.server.controller.js +++ b/modules/torrents/server/controllers/torrents.server.controller.js @@ -849,6 +849,14 @@ exports.update = function (req, res) { torrent.torrent_nfo = req.body.torrent_nfo; torrent.torrent_media_info = mediaInfo.getMediaInfo(req.body.torrent_nfo); } + if (req.body.hasOwnProperty('custom_title')) { + torrent.resource_detail_info.custom_title = req.body.custom_title; + torrent.markModified('resource_detail_info'); + } + if (req.body.hasOwnProperty('custom_subtitle')) { + torrent.resource_detail_info.custom_subtitle = req.body.custom_subtitle; + torrent.markModified('resource_detail_info'); + } torrent.save(function (err) { if (err) {