From 9563b3b61ee33d0948a1b729398d82c2db14c3b8 Mon Sep 17 00:00:00 2001 From: Gustavo Vera Scuderi Date: Sun, 8 Oct 2017 00:15:35 -0300 Subject: [PATCH 01/28] Partial progress for issue #828 Signed-off-by: Gustavo Vera Scuderi --- app/css/app.css | 2 +- app/v2/mockups/dashboard.html | 6 +- ...tml => contribution-detail-modal-old.html} | 0 .../directives/contribution-detail.html | 71 +++++++ .../directives/discussion-panel-old.html | 194 +++++++++++------- .../partials/directives/discussion-panel.html | 88 ++++---- app/v2/stylesheets/discussion-panel.scss | 68 +++++- app/v2/stylesheets/main.scss | 2 +- 8 files changed, 307 insertions(+), 124 deletions(-) rename app/v2/partials/directives/{contribution-detail-modal.html => contribution-detail-modal-old.html} (100%) create mode 100644 app/v2/partials/directives/contribution-detail.html diff --git a/app/css/app.css b/app/css/app.css index 0f6ea557..ade7ebaa 100644 --- a/app/css/app.css +++ b/app/css/app.css @@ -2825,7 +2825,7 @@ i { .section .icon-circle-number { font-size: 2em; font-weight: 700; - line-height: 0.57143em; + line-height: 0.5714285714em; text-align: center; color: #FFFFFF; margin: 15px 0px 0px -30px; diff --git a/app/v2/mockups/dashboard.html b/app/v2/mockups/dashboard.html index eabaa5f6..fcea9948 100644 --- a/app/v2/mockups/dashboard.html +++ b/app/v2/mockups/dashboard.html @@ -201,11 +201,11 @@

{{ 'Comments' | translate}}

-
+ diff --git a/app/v2/partials/directives/contribution-detail-modal.html b/app/v2/partials/directives/contribution-detail-modal-old.html similarity index 100% rename from app/v2/partials/directives/contribution-detail-modal.html rename to app/v2/partials/directives/contribution-detail-modal-old.html diff --git a/app/v2/partials/directives/contribution-detail.html b/app/v2/partials/directives/contribution-detail.html new file mode 100644 index 00000000..e1a562a3 --- /dev/null +++ b/app/v2/partials/directives/contribution-detail.html @@ -0,0 +1,71 @@ + + diff --git a/app/v2/partials/directives/discussion-panel-old.html b/app/v2/partials/directives/discussion-panel-old.html index 87f88409..d6eeb6b2 100644 --- a/app/v2/partials/directives/discussion-panel-old.html +++ b/app/v2/partials/directives/discussion-panel-old.html @@ -1,89 +1,131 @@ -
-
-

{{'Conversations' | translate}}

-

 {{'Start a new conversation' | translate}}

-
-
  • -
    - -

    {{formatDate(discussion.creation)}}

    -
    - +
    + + + + -
    - {{discussion.text}} -
    - - - -
    -

    {{'Reply' | translate}}

    - -
    -
    - +
    +
    + +
    -
    - +
    +
    +
    + + +
    -
    -
  • -

    {{'no.discussion.message' | translate}}

    -
    + -
    -

    {{'Start a Conversation' | translate}}

    -
    -
    -
    - +
    +
  • +
    + +
    +
    +

    {{formatDate(discussion.creation)}}

    +
    +
    + +
    - + + + + +
    +
    +

    {{discussion.text}}

    +
    + +
      +
    • + +
      +
      +

      {{formatDate(comment.creation)}}

      +
      +
      + +
      +
      +
      + + + +

      +
      +
      +

      {{comment.text}}

      +
      + +
    • +
    + +
    +

    {{'Reply' | translate}}

    +
    +
    + +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    +
    +
    + + +
    +
    +
    + +
    - -
  • - -
    + + +

    {{'no.discussion.message' | translate}}

    + + diff --git a/app/v2/partials/directives/discussion-panel.html b/app/v2/partials/directives/discussion-panel.html index d6eeb6b2..eec81581 100644 --- a/app/v2/partials/directives/discussion-panel.html +++ b/app/v2/partials/directives/discussion-panel.html @@ -3,10 +3,21 @@ +
    +
    + Comments ({{discussions.length}}) +
    +
    + View comments by: + +
    +
    - -
    +
    @@ -22,42 +33,35 @@
    -
    -
    -
    -
    - - -
    -
    -
    +
    -
  • +
  • -
    -

    {{formatDate(discussion.creation)}}

    +
    + + + +
    -
    + +
    -
    - - - - -

    {{discussion.text}}

    @@ -66,22 +70,23 @@  {{'Reply to this comment' | translate}}  
      -
    • +
    • -
      -

      {{formatDate(comment.creation)}}

      -
      -
      - -
      -
      -
      - - - -

      +
      + + + + +
      + +
      + +

      {{comment.text}}

      @@ -92,8 +97,8 @@
    -
    -

    {{'Reply' | translate}}

    +
    +

    {{'Reply' | translate}}

    @@ -110,14 +115,13 @@

    {{'Reply' | translate}}

    -

    - - +
    diff --git a/app/v2/stylesheets/discussion-panel.scss b/app/v2/stylesheets/discussion-panel.scss index 8fa58a68..58f4d8b8 100644 --- a/app/v2/stylesheets/discussion-panel.scss +++ b/app/v2/stylesheets/discussion-panel.scss @@ -74,4 +74,70 @@ discussion-panel { .reply-count{ float: right; margin-right: 1em; -} \ No newline at end of file +} + + +.comments__section { + + .comments-header { + padding: 2rem 0 1rem; + strong { font-weight: bold; } + } + + .comments__listing { + margin-top: 90px; + } + + .conversation-container { + border: 1px solid #a5a5a5; + box-shadow: inset 0px 0px 2px rgba(0, 0, 0, 0.25); + padding: 0 1rem 0 0; + } + + .threaded-comments .comment-container { + border: none; + border-top: 1px solid #a5a5a5; + + .user__card .avatar_link { + font-style: normal; + font-weight: bold; + } + } + + .comment-text { + font-size: 1rem; + } + + .user__card { + margin-bottom: 1rem; + height: 3em; + figure, img { + width: 2.5em; + height: 2.5em; + } + .fn { + margin-top: -0.5rem; + span { + display: block; + font-size: 0.8rem; + margin-top: -0.2rem; + } + } + } + + .threaded-comments { + padding-right: 0; + padding-bottom: 1rem; + } + + .comments__reply { + h3 { font-weight: bold; } + .comments__listing { + margin-top: 0; + } + &.new { + padding-left: 1rem; + } + } + + } \ No newline at end of file diff --git a/app/v2/stylesheets/main.scss b/app/v2/stylesheets/main.scss index cb761f93..ac05b324 100644 --- a/app/v2/stylesheets/main.scss +++ b/app/v2/stylesheets/main.scss @@ -1187,7 +1187,7 @@ custom-field { @import "../components/breadcrumb/breadcrumb"; @import "../components/core/topbar-notifications/topbar-notifications"; // Uncomment this to test the discussion panel -//@import "../mockups/discussion-panel.scss"; +// @import "../mockups/discussion-panel.scss"; // Uncomment this to test the profile updates //@import "../mockups/profile.scss"; @import "../mockups/voting-summary-proposal-page"; From c99e0b1df3533640abfc424af31b5de85fbe2fdb Mon Sep 17 00:00:00 2001 From: Gustavo Vera Scuderi Date: Mon, 9 Oct 2017 23:43:04 -0300 Subject: [PATCH 02/28] Added model for detecting change in comment type Signed-off-by: Gustavo Vera Scuderi --- app/v2/directives/discussion-panel.js | 9 ++ ...il.html => contribution-detail-modal.html} | 0 .../directives/discussion-panel-content.html | 116 ++++++++++++++++++ .../partials/directives/discussion-panel.html | 2 +- 4 files changed, 126 insertions(+), 1 deletion(-) rename app/v2/partials/directives/{contribution-detail.html => contribution-detail-modal.html} (100%) create mode 100644 app/v2/partials/directives/discussion-panel-content.html diff --git a/app/v2/directives/discussion-panel.js b/app/v2/directives/discussion-panel.js index 2b73def9..f38958c5 100644 --- a/app/v2/directives/discussion-panel.js +++ b/app/v2/directives/discussion-panel.js @@ -40,6 +40,7 @@ scope.user = localStorageService.get('user'); scope.validateCaptchaResponse = validateCaptchaResponse.bind(scope); scope.setCaptchaResponse = setCaptchaResponse.bind(scope); + scope.vm['commentType'] = 'public'; if (scope.user) { var hasRol = Memberships.hasRol; @@ -63,6 +64,14 @@ } }); } + + scope.$watch('vm.commentType', function(value) { + if (value == 'public') { + scope.showCommentType = 'public'; + } else { + scope.showCommentType = 'members'; + } + }); loadDiscussions(scope, scope.spaceId); scope.newDiscussion = initContribution('DISCUSSION'); scope.newComment = initContribution('COMMENT'); diff --git a/app/v2/partials/directives/contribution-detail.html b/app/v2/partials/directives/contribution-detail-modal.html similarity index 100% rename from app/v2/partials/directives/contribution-detail.html rename to app/v2/partials/directives/contribution-detail-modal.html diff --git a/app/v2/partials/directives/discussion-panel-content.html b/app/v2/partials/directives/discussion-panel-content.html new file mode 100644 index 00000000..b4406b96 --- /dev/null +++ b/app/v2/partials/directives/discussion-panel-content.html @@ -0,0 +1,116 @@ +
    + +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    + +
    + +
    +
  • +
    + +
    +
    + + + + +
    + +
    + +
    +
    +
    +

    {{discussion.text}}

    +
    + +
      +
    • + +
      +
      + + + + +
      + +
      + +
      +
      +
      +

      {{comment.text}}

      +
      + +
    • +
    + +
    +

    {{'Reply' | translate}}

    +
    +
    +
    +
    +
    +
    + +
    +
    + +
    +
    +
    + +
    +
    +
    +
    + +
    +
    +
    +
    +
    +
    +
    +
  • +

    {{'no.discussion.message' | translate}}

    +
    \ No newline at end of file diff --git a/app/v2/partials/directives/discussion-panel.html b/app/v2/partials/directives/discussion-panel.html index eec81581..1b093e16 100644 --- a/app/v2/partials/directives/discussion-panel.html +++ b/app/v2/partials/directives/discussion-panel.html @@ -9,7 +9,7 @@
    View comments by: - From 1a2e3fc793b52718bcd933cb6cd7b48c743782df Mon Sep 17 00:00:00 2001 From: Gustavo Vera Scuderi Date: Mon, 16 Oct 2017 02:15:38 -0300 Subject: [PATCH 03/28] Added toolbar for contribution page refs socialappslab/appcivist-pb-client#852 Signed-off-by: Gustavo Vera Scuderi --- app/css/app.css | 2 +- app/v2/controllers/contribution/page.js | 7 +- app/v2/partials/contribution/page.html | 119 +++++++++++++++--------- app/v2/stylesheets/page_header.scss | 24 +++++ 4 files changed, 106 insertions(+), 46 deletions(-) diff --git a/app/css/app.css b/app/css/app.css index 0f6ea557..ade7ebaa 100644 --- a/app/css/app.css +++ b/app/css/app.css @@ -2825,7 +2825,7 @@ i { .section .icon-circle-number { font-size: 2em; font-weight: 700; - line-height: 0.57143em; + line-height: 0.5714285714em; text-align: center; color: #FFFFFF; margin: 15px 0px 0px -30px; diff --git a/app/v2/controllers/contribution/page.js b/app/v2/controllers/contribution/page.js index 5d0a4d78..f25e11ff 100644 --- a/app/v2/controllers/contribution/page.js +++ b/app/v2/controllers/contribution/page.js @@ -506,7 +506,8 @@ } res.$promise.then(function (data) { $scope.resources = data; - loadPictureResources() + loadPictureResources(); + loadDocuments(); }, function(error) { Notify.show('Error while trying to fetch resources', 'error'); }); @@ -523,6 +524,10 @@ } } + function loadDocuments() { + $scope.documents = $scope.resources.filter(resource => resource.resourceType !== 'PICTURE' && resource.resourceType !== 'VIDEO'); + } + function loadCampaignConfig() { if ($scope.campaign && $scope.campaign.rsID) { var rsp = Campaigns.getConfiguration($scope.campaign.rsID).get(); diff --git a/app/v2/partials/contribution/page.html b/app/v2/partials/contribution/page.html index 887f89eb..fa471dd6 100644 --- a/app/v2/partials/contribution/page.html +++ b/app/v2/partials/contribution/page.html @@ -261,52 +261,50 @@

    {{proposal.title}}

    -
    -
    -
    +
    @@ -521,6 +519,39 @@

    {{ 'Comments' | translate}}

    + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -487,12 +324,17 @@

    {{contributionType|titlecase|translate}}

    {{ 'Attachments' | translate }}

    +
    -
    +
    +
    + +
    + +
    +
    - - + + + + + +
    diff --git a/app/v2/partials/contribution/page.html b/app/v2/partials/contribution/page.html index 9c8b1473..41925f4d 100644 --- a/app/v2/partials/contribution/page.html +++ b/app/v2/partials/contribution/page.html @@ -204,23 +204,24 @@

    {{contributionType|titlecase|translate}}

    +
    -