From 7c87a3c671988ec7d20e37216a040210c358b013 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Wed, 8 Jun 2016 18:56:01 +0200 Subject: [PATCH 1/6] Add list all wiki pages --- app/coffee/app.coffee | 7 ++ app/coffee/modules/base.coffee | 1 + app/coffee/modules/common/components.coffee | 35 ++++++ app/coffee/modules/resources/wiki.coffee | 3 + app/coffee/modules/wiki/pages-list.coffee | 100 ++++++++++++++++++ app/locales/taiga/locale-en.json | 12 ++- .../common/components/user-display.jade | 13 +++ app/partials/wiki/wiki-list.jade | 44 ++++++++ app/partials/wiki/wiki-nav.jade | 1 + app/styles/layout/wiki.scss | 90 ++++++++++++++++ 10 files changed, 305 insertions(+), 1 deletion(-) create mode 100644 app/coffee/modules/wiki/pages-list.coffee create mode 100644 app/partials/common/components/user-display.jade create mode 100644 app/partials/wiki/wiki-list.jade diff --git a/app/coffee/app.coffee b/app/coffee/app.coffee index e5d828bf..c212486b 100644 --- a/app/coffee/app.coffee +++ b/app/coffee/app.coffee @@ -188,6 +188,13 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven # Wiki $routeProvider.when("/project/:pslug/wiki", {redirectTo: (params) -> "/project/#{params.pslug}/wiki/home"}, ) + $routeProvider.when("/project/:pslug/wiki-list", + { + templateUrl: "wiki/wiki-list.html", + loader: true, + section: "wiki" + } + ) $routeProvider.when("/project/:pslug/wiki/:slug", { templateUrl: "wiki/wiki.html", diff --git a/app/coffee/modules/base.coffee b/app/coffee/modules/base.coffee index e593f3c6..75b0e23e 100644 --- a/app/coffee/modules/base.coffee +++ b/app/coffee/modules/base.coffee @@ -80,6 +80,7 @@ urls = { "project-issues-detail": "/project/:project/issue/:ref" "project-wiki": "/project/:project/wiki" + "project-wiki-list": "/project/:project/wiki-list" "project-wiki-page": "/project/:project/wiki/:slug" # Team diff --git a/app/coffee/modules/common/components.coffee b/app/coffee/modules/common/components.coffee index 6f769312..8514be37 100644 --- a/app/coffee/modules/common/components.coffee +++ b/app/coffee/modules/common/components.coffee @@ -165,6 +165,41 @@ CreatedByDisplayDirective = ($template, $compile, $translate, $navUrls)-> module.directive("tgCreatedByDisplay", ["$tgTemplate", "$compile", "$translate", "$tgNavUrls", CreatedByDisplayDirective]) + +UserDisplayDirective = ($template, $compile, $translate, $navUrls)-> + # Display the user information (full name and photo). + # + # Example: + # div.creator(tg-user-display, tg-user-id="{{ user.id }}") + # + # Requirements: + # - model object must have the attributes 'created_date' and + # 'owner'(ng-model) + # - scope.usersById object is required. + + link = ($scope, $el, $attrs) -> + id = $attrs.tgUserId + console.log($scope.usersById[id]) + $scope.user = $scope.usersById[id] or { + full_name_display: $translate.instant("COMMON.EXTERNAL_USER") + photo: "/" + window._version + "/images/user-noimage.png" + } + + $scope.url = if $scope.owner?.is_active then $navUrls.resolve("user-profile", {username: $scope.owner.username}) else "" + + $scope.$on "$destroy", -> + $el.off() + + return { + link: link + restrict: "EA" + scope: true, + templateUrl: "common/components/user-display.html" + } + +module.directive("tgUserDisplay", ["$tgTemplate", "$compile", "$translate", "$tgNavUrls", + UserDisplayDirective]) + ############################################################################# ## Watchers directive ############################################################################# diff --git a/app/coffee/modules/resources/wiki.coffee b/app/coffee/modules/resources/wiki.coffee index c333d9cb..8c7beee4 100644 --- a/app/coffee/modules/resources/wiki.coffee +++ b/app/coffee/modules/resources/wiki.coffee @@ -34,6 +34,9 @@ resourceProvider = ($repo, $http, $urls) -> service.getBySlug = (projectId, slug) -> return $repo.queryOne("wiki", "by_slug?project=#{projectId}&slug=#{slug}") + service.list = (projectId) -> + return $repo.queryMany("wiki", {project: projectId}) + service.listLinks = (projectId) -> return $repo.queryMany("wiki-links", {project: projectId}) diff --git a/app/coffee/modules/wiki/pages-list.coffee b/app/coffee/modules/wiki/pages-list.coffee new file mode 100644 index 00000000..5aaddb8c --- /dev/null +++ b/app/coffee/modules/wiki/pages-list.coffee @@ -0,0 +1,100 @@ +### +# Copyright (C) 2014-2016 Andrey Antukh +# Copyright (C) 2014-2016 Jesús Espino Garcia +# Copyright (C) 2014-2016 David Barragán Merino +# Copyright (C) 2014-2016 Alejandro Alonso +# Copyright (C) 2014-2016 Juan Francisco Alcántara +# Copyright (C) 2014-2016 Xavi Julian +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +# File: modules/wiki/pages-list.coffee +### + +taiga = @.taiga + +mixOf = @.taiga.mixOf + +module = angular.module("taigaWiki") + +############################################################################# +## Wiki Pages List Controller +############################################################################# + +class WikiPagesListController extends mixOf(taiga.Controller, taiga.PageMixin) + @.$inject = [ + "$scope", + "$rootScope", + "$tgRepo", + "$tgModel", + "$tgConfirm", + "$tgResources", + "$routeParams", + "$q", + "$tgNavUrls", + "tgErrorHandlingService" + ] + + constructor: (@scope, @rootscope, @repo, @model, @confirm, @rs, @params, @q, + @navUrls, @errorHandlingService) -> + @scope.projectSlug = @params.pslug + @scope.wikiSlug = @params.slug + @scope.wikiTitle = @scope.wikiSlug + @scope.sectionName = "Wiki" + @scope.linksVisible = false + + promise = @.loadInitialData() + + # On Error + promise.then null, @.onInitialDataError.bind(@) + + loadProject: -> + return @rs.projects.getBySlug(@params.pslug).then (project) => + if not project.is_wiki_activated + @errorHandlingService.permissionDenied() + + @scope.projectId = project.id + @scope.project = project + @scope.$emit('project:loaded', project) + return project + + loadWikiPages: -> + promise = @rs.wiki.list(@scope.projectId).then (wikipages) => + @scope.wikipages = wikipages + + loadWikiLinks: -> + return @rs.wiki.listLinks(@scope.projectId).then (wikiLinks) => + @scope.wikiLinks = wikiLinks + + for link in @scope.wikiLinks + link.url = @navUrls.resolve("project-wiki-page", { + project: @scope.projectSlug + slug: link.href + }) + + selectedWikiLink = _.find(wikiLinks, {href: @scope.wikiSlug}) + @scope.wikiTitle = selectedWikiLink.title if selectedWikiLink? + + loadInitialData: -> + promise = @.loadProject() + return promise.then (project) => + @.fillUsersAndRoles(project.members, project.roles) + @q.all([@.loadWikiLinks(), @.loadWikiPages()]).then @.checkLinksPerms.bind(this) + + checkLinksPerms: -> + if @scope.project.my_permissions.indexOf("add_wiki_link") != -1 || + (@scope.project.my_permissions.indexOf("view_wiki_links") != -1 && @scope.wikiLinks.length) + @scope.linksVisible = true + +module.controller("WikiPagesListController", WikiPagesListController) diff --git a/app/locales/taiga/locale-en.json b/app/locales/taiga/locale-en.json index 0263a4f1..687c484a 100644 --- a/app/locales/taiga/locale-en.json +++ b/app/locales/taiga/locale-en.json @@ -1460,12 +1460,22 @@ "DELETE_LINK_TITLE": "Delete Wiki link", "NAVIGATION": { "SECTION_NAME": "Links", - "ACTION_ADD_LINK": "Add link" + "ACTION_ADD_LINK": "Add link", + "ALL_PAGES": "All pages" }, "SUMMARY": { "TIMES_EDITED": "times
edited", "LAST_EDIT": "last
edit", "LAST_MODIFICATION": "last modification" + }, + "SECTION_PAGES_LIST": "All pages", + "PAGES_LIST_COLUMNS": { + "TITLE": "Title", + "EDITIONS": "Editions", + "CREATED": "Created", + "MODIFIED": "Modified", + "CREATOR": "Creator", + "LAST_MODIFIER": "Last modifier" } }, "HINTS": { diff --git a/app/partials/common/components/user-display.jade b/app/partials/common/components/user-display.jade new file mode 100644 index 00000000..e3263d3b --- /dev/null +++ b/app/partials/common/components/user-display.jade @@ -0,0 +1,13 @@ +.user-avatar + a( + href="{{url}}" + title="{{user.full_name_display}}" + ) + img( + src="{{user.photo}}" + alt="{{user.full_name_display}}" + ) +a.user-full-name( + href="{{url}}" + title="{{user.full_name_display}}" +) {{user.full_name_display}} diff --git a/app/partials/wiki/wiki-list.jade b/app/partials/wiki/wiki-list.jade new file mode 100644 index 00000000..cc5e71c0 --- /dev/null +++ b/app/partials/wiki/wiki-list.jade @@ -0,0 +1,44 @@ +doctype html + +div.wrapper(ng-controller="WikiPagesListController as ctrl", + ng-init="section='wiki'") + tg-project-menu + sidebar.menu-secondary.extrabar(ng-if="linksVisible") + section.wiki-nav(tg-wiki-nav, ng-model="wikiLinks") + section.main.wiki + header + h1 + span(tg-bo-bind="project.name") + span.green(translate="PROJECT.SECTION.WIKI") + span.date(translate="WIKI.SECTION_PAGES_LIST") + + section.wiki-pages-table.basic-table + .row.title + .title-field( + translate="WIKI.PAGES_LIST_COLUMNS.TITLE" + ) + .editions-field( + translate="WIKI.PAGES_LIST_COLUMNS.EDITIONS" + ) + .creator-field( + translate="WIKI.PAGES_LIST_COLUMNS.CREATOR" + ) + .created-field( + translate="WIKI.PAGES_LIST_COLUMNS.CREATED" + ) + .last-modifier-field( + translate="WIKI.PAGES_LIST_COLUMNS.LAST_MODIFIER" + ) + .modified-field( + translate="WIKI.PAGES_LIST_COLUMNS.MODIFIED" + ) + + div.row.table-main(ng-repeat="wikipage in wikipages track by wikipage.slug") + div.title-field + a(href="", tg-nav="project-wiki-page:project=project.slug,slug=wikipage.slug") + | {{wikipage.slug}} + div.editions-field {{wikipage.editions}} + div.creator-field(tg-user-display, tg-user-id="{{wikipage.owner}}") + div.created-field(tg-bo-bind="wikipage.created_date|momentFormat:'DD MMM YYYY HH:mm'") + div.last-modifier-field(tg-user-display, tg-user-id="{{wikipage.last_modifier}}") + div.modified-field(tg-bo-bind="wikipage.modified_date|momentFormat:'DD MMM YYYY HH:mm'") diff --git a/app/partials/wiki/wiki-nav.jade b/app/partials/wiki/wiki-nav.jade index 258afc42..7137e16f 100644 --- a/app/partials/wiki/wiki-nav.jade +++ b/app/partials/wiki/wiki-nav.jade @@ -1,5 +1,6 @@ header h1(translate="WIKI.NAVIGATION.SECTION_NAME") + a(href="", tg-nav="project-wiki-list:project=project.slug", translate="WIKI.NAVIGATION.ALL_PAGES") nav ul.sortable diff --git a/app/styles/layout/wiki.scss b/app/styles/layout/wiki.scss index 6c661125..36b3b20f 100644 --- a/app/styles/layout/wiki.scss +++ b/app/styles/layout/wiki.scss @@ -91,3 +91,93 @@ top: .4rem; } } + +.wiki-pages-table { + display: flex; + margin-bottom: 2rem; + &.empty { + display: none; + } + .row { + &:hover { + background: lighten($primary, 65%); + transition: background .2s ease-in; + } + .icon { + display: inline; + } + } + .title { + @include font-size(medium); + @include font-type(bold); + border-bottom: 1px solid $gray-light; + &:hover { + background: transparent; + } + div { + cursor: pointer; + } + .votes { + color: $gray; + } + } + .table-main { + @include font-size(small); + border-bottom: 1px solid darken($whitish, 4%); + } + .avatar { + align-items: center; + display: flex; + img { + width: 35px; + } + figcaption { + flex-basis: 60%; + flex-grow: 1; + margin-left: .5rem; + } + } + .title-field { + overflow: hidden; + padding-right: 1rem; + width: 100%; + a { + @include ellipsis(100%); + display: block; + } + span { + vertical-align: middle; + &:first-child { + margin-right: .5rem; + } + } + } + .editions-field, + .created-field, + .modified-field, + .creator-field , + .last-modifier-field { + flex-basis: 140px; + flex-grow: 1; + flex-shrink: 0; + padding: 0 1rem; + position: relative; + text-align: left; + } + .creator-field , + .last-modifier-field { + display: flex; + flex-basis: 180px; + flex-direction: row; + .user-avatar { + flex-grow: 0; + img { + height: 48px; + } + } + .user-full-name { + flex-grow: 1; + padding: .5rem; + } + } +} From b0f990492d22c31043d98c1b9445b570c656b14c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20Juli=C3=A1n?= Date: Fri, 10 Jun 2016 13:03:40 +0200 Subject: [PATCH 2/6] Wiki Pages style --- app/locales/taiga/locale-en.json | 1 + app/partials/wiki/wiki-list.jade | 37 ++++--- app/partials/wiki/wiki-nav.jade | 56 ++++++---- app/partials/wiki/wiki-summary.jade | 22 ++-- app/partials/wiki/wiki.jade | 12 ++- app/styles/components/basic-table.scss | 3 + app/styles/layout/wiki.scss | 102 ++---------------- app/styles/modules/wiki/wiki-nav.scss | 3 - app/styles/modules/wiki/wiki-pages-table.scss | 48 +++++++++ app/styles/modules/wiki/wiki-summary.scss | 24 +++-- 10 files changed, 156 insertions(+), 152 deletions(-) create mode 100644 app/styles/modules/wiki/wiki-pages-table.scss diff --git a/app/locales/taiga/locale-en.json b/app/locales/taiga/locale-en.json index 687c484a..649b5508 100644 --- a/app/locales/taiga/locale-en.json +++ b/app/locales/taiga/locale-en.json @@ -1459,6 +1459,7 @@ "DELETE_LIGHTBOX_TITLE": "Delete Wiki Page", "DELETE_LINK_TITLE": "Delete Wiki link", "NAVIGATION": { + "HOME": "Main Page", "SECTION_NAME": "Links", "ACTION_ADD_LINK": "Add link", "ALL_PAGES": "All pages" diff --git a/app/partials/wiki/wiki-list.jade b/app/partials/wiki/wiki-list.jade index cc5e71c0..284b57e9 100644 --- a/app/partials/wiki/wiki-list.jade +++ b/app/partials/wiki/wiki-list.jade @@ -1,10 +1,15 @@ doctype html -div.wrapper(ng-controller="WikiPagesListController as ctrl", - ng-init="section='wiki'") +div.wrapper( + ng-controller="WikiPagesListController as ctrl" + ng-init="section='wiki'" +) tg-project-menu sidebar.menu-secondary.extrabar(ng-if="linksVisible") - section.wiki-nav(tg-wiki-nav, ng-model="wikiLinks") + section.wiki-nav( + tg-wiki-nav + ng-model="wikiLinks" + ) section.main.wiki header h1 @@ -33,12 +38,20 @@ div.wrapper(ng-controller="WikiPagesListController as ctrl", translate="WIKI.PAGES_LIST_COLUMNS.MODIFIED" ) - div.row.table-main(ng-repeat="wikipage in wikipages track by wikipage.slug") - div.title-field - a(href="", tg-nav="project-wiki-page:project=project.slug,slug=wikipage.slug") - | {{wikipage.slug}} - div.editions-field {{wikipage.editions}} - div.creator-field(tg-user-display, tg-user-id="{{wikipage.owner}}") - div.created-field(tg-bo-bind="wikipage.created_date|momentFormat:'DD MMM YYYY HH:mm'") - div.last-modifier-field(tg-user-display, tg-user-id="{{wikipage.last_modifier}}") - div.modified-field(tg-bo-bind="wikipage.modified_date|momentFormat:'DD MMM YYYY HH:mm'") + .row.table-main(ng-repeat="wikipage in wikipages track by wikipage.slug") + .title-field + a( + href="" + tg-nav="project-wiki-page:project=project.slug,slug=wikipage.slug" + ) {{wikipage.slug}} + .editions-field {{wikipage.editions}} + .creator-field( + tg-user-display + tg-user-id="{{wikipage.owner}}" + ) + .created-field(tg-bo-bind="wikipage.created_date|momentFormat:'DD MMM YYYY HH:mm'") + .last-modifier-field( + tg-user-display + tg-user-id="{{wikipage.last_modifier}}" + ) + .modified-field(tg-bo-bind="wikipage.modified_date|momentFormat:'DD MMM YYYY HH:mm'") diff --git a/app/partials/wiki/wiki-nav.jade b/app/partials/wiki/wiki-nav.jade index 7137e16f..afa7fb8f 100644 --- a/app/partials/wiki/wiki-nav.jade +++ b/app/partials/wiki/wiki-nav.jade @@ -1,29 +1,45 @@ header - h1(translate="WIKI.NAVIGATION.SECTION_NAME") - a(href="", tg-nav="project-wiki-list:project=project.slug", translate="WIKI.NAVIGATION.ALL_PAGES") + h1(translate="WIKI.NAVIGATION.SECTION_NAME") nav - ul.sortable - li.wiki-link(ng-repeat="link in wikiLinks", data-id!="{{ $index }}", tg-bind-scope) - tg-svg.dragger(svg-icon="icon-drag") - a.link-title(title!="{{ link.title }}", href!="{{ link.url }}") {{ link.title }} + ul + li.wiki-link + a.link-title( + href="" + tg-nav="project-wiki-list:project=project.slug" + translate="WIKI.NAVIGATION.ALL_PAGES" + ) - <% if (deleteWikiLinkPermission) { %> - a.js-delete-link.remove-wiki-page(title!="{{'WIKI.DELETE_LINK_TITLE' | translate}}") - tg-svg(svg-icon="icon-trash") - <% } %> + li.wiki-link + a.link-title( + href="" + tg-nav="project-wiki:project=project.slug" + translate="WIKI.NAVIGATION.HOME" + ) - input.hidden( - type="text" - placeholder="{{'COMMON.FIELDS.NAME' | translate}}" - value!="{{ link.title }}" - ) + ul.sortable + li.wiki-link(ng-repeat="link in wikiLinks", data-id!="{{ $index }}", tg-bind-scope) + <% if (addWikiLinkPermission) { %> + tg-svg.dragger(svg-icon="icon-drag") + <% } %> + a.link-title(title!="{{ link.title }}", href!="{{ link.url }}") {{ link.title }} - li.new.hidden - input( - type="text" - placeholder="{{'COMMON.FIELDS.NAME' | translate}}" - ) + <% if (deleteWikiLinkPermission) { %> + a.js-delete-link.remove-wiki-page(title!="{{'WIKI.DELETE_LINK_TITLE' | translate}}") + tg-svg(svg-icon="icon-trash") + <% } %> + + input.hidden( + type="text" + placeholder="{{'COMMON.FIELDS.NAME' | translate}}" + value!="{{ link.title }}" + ) + + li.new.hidden + input( + type="text" + placeholder="{{'COMMON.FIELDS.NAME' | translate}}" + ) <% if (addWikiLinkPermission) { %> a( diff --git a/app/partials/wiki/wiki-summary.jade b/app/partials/wiki/wiki-summary.jade index f2855cba..d10e398f 100644 --- a/app/partials/wiki/wiki-summary.jade +++ b/app/partials/wiki/wiki-summary.jade @@ -1,14 +1,14 @@ -div.wiki-times-edited - span.number <%- totalEditions %> - span.description(translate="WIKI.SUMMARY.TIMES_EDITED") - -div.wiki-last-modified - span.number <%- lastModifiedDate %> - span.description(translate="WIKI.SUMMARY.LAST_EDIT") - -div.wiki-username-edition - figure.avatar +.wiki-username-edition + .avatar img(src!="<%- user.imgUrl %>" alt!="<%- user.name %>") - div.wiki-user-modification + .wiki-user-modification span.description(translate="WIKI.SUMMARY.LAST_MODIFICATION") span.username <%- user.name %> + +.wiki-last-modified + span.number <%- lastModifiedDate %> + span.description(translate="WIKI.SUMMARY.LAST_EDIT") + +.wiki-times-edited + span.number <%- totalEditions %> + span.description(translate="WIKI.SUMMARY.TIMES_EDITED") diff --git a/app/partials/wiki/wiki.jade b/app/partials/wiki/wiki.jade index a7e59bd5..4435b495 100644 --- a/app/partials/wiki/wiki.jade +++ b/app/partials/wiki/wiki.jade @@ -4,7 +4,10 @@ div.wrapper(ng-controller="WikiDetailController as ctrl", ng-init="section='wiki'") tg-project-menu sidebar.menu-secondary.extrabar(ng-if="linksVisible") - section.wiki-nav(tg-wiki-nav, ng-model="wikiLinks") + section.wiki-nav( + tg-wiki-nav + ng-model="wikiLinks" + ) section.main.wiki header h1 @@ -12,13 +15,18 @@ div.wrapper(ng-controller="WikiDetailController as ctrl", span.green(translate="PROJECT.SECTION.WIKI") - div.summary.wiki-summary(tg-wiki-summary, ng-model="wiki", ng-if="wiki.id") h2.wiki-title(ng-bind='wikiTitle') section.wiki-content( tg-editable-wysiwyg, tg-editable-wiki-content, ng-model="wiki" ) + + div.summary.wiki-summary( + tg-wiki-summary + ng-model="wiki" + ng-if="wiki.id" + ) tg-attachments-full( ng-if="wiki.id" diff --git a/app/styles/components/basic-table.scss b/app/styles/components/basic-table.scss index 3e710ed1..09df2464 100644 --- a/app/styles/components/basic-table.scss +++ b/app/styles/components/basic-table.scss @@ -11,6 +11,9 @@ padding: .3rem 0; text-align: left; width: 100%; + @include breakpoint(tablet) { + flex-direction: column; + } @for $i from 1 through 8 { .width-#{$i} { flex-basis: 50px; diff --git a/app/styles/layout/wiki.scss b/app/styles/layout/wiki.scss index 36b3b20f..5b5c8874 100644 --- a/app/styles/layout/wiki.scss +++ b/app/styles/layout/wiki.scss @@ -1,11 +1,17 @@ .wiki { + .wysiwyg { + margin-bottom: 0; + } .wiki-title { @include font-type(light); - @include font-size(larger); + @include font-size(xxlarge); + margin-bottom: 0; + padding: 1rem; } .remove { @include font-size(small); color: $gray-light; + cursor: pointer; &:hover { color: $red-light; transition: color .1s linear; @@ -22,8 +28,8 @@ } .wiki-content { - @include cursor-progress; - margin-bottom: 2rem; + @include font-size(large); + max-width: 1024px; position: relative; &.editable { &:hover { @@ -91,93 +97,3 @@ top: .4rem; } } - -.wiki-pages-table { - display: flex; - margin-bottom: 2rem; - &.empty { - display: none; - } - .row { - &:hover { - background: lighten($primary, 65%); - transition: background .2s ease-in; - } - .icon { - display: inline; - } - } - .title { - @include font-size(medium); - @include font-type(bold); - border-bottom: 1px solid $gray-light; - &:hover { - background: transparent; - } - div { - cursor: pointer; - } - .votes { - color: $gray; - } - } - .table-main { - @include font-size(small); - border-bottom: 1px solid darken($whitish, 4%); - } - .avatar { - align-items: center; - display: flex; - img { - width: 35px; - } - figcaption { - flex-basis: 60%; - flex-grow: 1; - margin-left: .5rem; - } - } - .title-field { - overflow: hidden; - padding-right: 1rem; - width: 100%; - a { - @include ellipsis(100%); - display: block; - } - span { - vertical-align: middle; - &:first-child { - margin-right: .5rem; - } - } - } - .editions-field, - .created-field, - .modified-field, - .creator-field , - .last-modifier-field { - flex-basis: 140px; - flex-grow: 1; - flex-shrink: 0; - padding: 0 1rem; - position: relative; - text-align: left; - } - .creator-field , - .last-modifier-field { - display: flex; - flex-basis: 180px; - flex-direction: row; - .user-avatar { - flex-grow: 0; - img { - height: 48px; - } - } - .user-full-name { - flex-grow: 1; - padding: .5rem; - } - } -} diff --git a/app/styles/modules/wiki/wiki-nav.scss b/app/styles/modules/wiki/wiki-nav.scss index c19ee691..93245a85 100644 --- a/app/styles/modules/wiki/wiki-nav.scss +++ b/app/styles/modules/wiki/wiki-nav.scss @@ -47,9 +47,6 @@ } .wiki-nav { - ul { - border-top: 1px solid $gray-light; - } .add-button { color: $white; display: block; diff --git a/app/styles/modules/wiki/wiki-pages-table.scss b/app/styles/modules/wiki/wiki-pages-table.scss new file mode 100644 index 00000000..15991f3c --- /dev/null +++ b/app/styles/modules/wiki/wiki-pages-table.scss @@ -0,0 +1,48 @@ +.wiki-pages-table { + display: flex; + .row { + padding: .5rem; + } + .title { + @include font-size(medium); + @include font-type(bold); + } + .table-main { + @include font-size(small); + } + .title-field { + flex-basis: 180px; + flex-grow: 1; + flex-shrink: 0; + } + .created-field, + .created-field, + .modified-field { + flex-basis: 10vw; + flex-grow: 0; + flex-shrink: 0; + margin-right: .5rem; + } + .editions-field { + flex-basis: 80px; + flex-grow: 0; + flex-shrink: 0; + margin-right: .5rem; + } + .creator-field, + .last-modifier-field { + align-items: center; + display: flex; + flex-basis: 200px; + .user-avatar { + flex-grow: 0; + img { + height: 2rem; + } + } + .user-full-name { + flex-grow: 1; + padding: .5rem; + } + } +} diff --git a/app/styles/modules/wiki/wiki-summary.scss b/app/styles/modules/wiki/wiki-summary.scss index 21189166..1c400d20 100644 --- a/app/styles/modules/wiki/wiki-summary.scss +++ b/app/styles/modules/wiki/wiki-summary.scss @@ -1,28 +1,30 @@ .wiki-summary { align-items: center; - flex-wrap: wrap; justify-content: flex-start; + margin-top: 1rem; + &.summary { + background: $whitish; + color: $gray; + } div { display: flex; - justify-content: space-between; - margin-right: 1rem; - } - .number { - line-height: 2rem; - top: 0; + margin-right: 1.25rem; } .wiki-user-modification { display: flex; flex-direction: column; justify-content: flex-start; } - figure { - margin-right: .3rem; - width: 32px; + .avatar { + margin-right: .5rem; + width: 2.25rem; + } + img { + height: 100%; + width: 100%; } .username { @include font-size(large); - color: $primary-light; white-space: nowrap; } } From 8aef8cac8bd74f670159868779e972153e6377fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20Juli=C3=A1n?= Date: Fri, 10 Jun 2016 13:05:43 +0200 Subject: [PATCH 3/6] Center number of edition --- app/styles/modules/wiki/wiki-pages-table.scss | 1 + 1 file changed, 1 insertion(+) diff --git a/app/styles/modules/wiki/wiki-pages-table.scss b/app/styles/modules/wiki/wiki-pages-table.scss index 15991f3c..130cc9a0 100644 --- a/app/styles/modules/wiki/wiki-pages-table.scss +++ b/app/styles/modules/wiki/wiki-pages-table.scss @@ -28,6 +28,7 @@ flex-grow: 0; flex-shrink: 0; margin-right: .5rem; + text-align: center; } .creator-field, .last-modifier-field { From b88d3ba30e4c52baf48b9f01d047b32ddb0614d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Xavier=20Juli=C3=A1n?= Date: Fri, 10 Jun 2016 13:26:46 +0200 Subject: [PATCH 4/6] Update color to master mass white --- app/styles/modules/wiki/wiki-summary.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/styles/modules/wiki/wiki-summary.scss b/app/styles/modules/wiki/wiki-summary.scss index 1c400d20..30e7d128 100644 --- a/app/styles/modules/wiki/wiki-summary.scss +++ b/app/styles/modules/wiki/wiki-summary.scss @@ -3,7 +3,7 @@ justify-content: flex-start; margin-top: 1rem; &.summary { - background: $whitish; + background: $mass-white; color: $gray; } div { From a09a7fe5cdfafb1b80ed2d2c6b2d4592688aa4be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Tue, 14 Jun 2016 12:01:03 +0200 Subject: [PATCH 5/6] Correctly link user profile --- app/coffee/modules/common/components.coffee | 4 +--- app/partials/common/components/user-display.jade | 10 +++++++++- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/app/coffee/modules/common/components.coffee b/app/coffee/modules/common/components.coffee index 8514be37..eb4e2d6e 100644 --- a/app/coffee/modules/common/components.coffee +++ b/app/coffee/modules/common/components.coffee @@ -173,8 +173,6 @@ UserDisplayDirective = ($template, $compile, $translate, $navUrls)-> # div.creator(tg-user-display, tg-user-id="{{ user.id }}") # # Requirements: - # - model object must have the attributes 'created_date' and - # 'owner'(ng-model) # - scope.usersById object is required. link = ($scope, $el, $attrs) -> @@ -185,7 +183,7 @@ UserDisplayDirective = ($template, $compile, $translate, $navUrls)-> photo: "/" + window._version + "/images/user-noimage.png" } - $scope.url = if $scope.owner?.is_active then $navUrls.resolve("user-profile", {username: $scope.owner.username}) else "" + $scope.url = if $scope.user.is_active then $navUrls.resolve("user-profile", {username: $scope.user.username}) else "" $scope.$on "$destroy", -> $el.off() diff --git a/app/partials/common/components/user-display.jade b/app/partials/common/components/user-display.jade index e3263d3b..3e6bb71a 100644 --- a/app/partials/common/components/user-display.jade +++ b/app/partials/common/components/user-display.jade @@ -1,4 +1,4 @@ -.user-avatar +.user-avatar(ng-if="url") a( href="{{url}}" title="{{user.full_name_display}}" @@ -8,6 +8,14 @@ alt="{{user.full_name_display}}" ) a.user-full-name( + ng-if="url" href="{{url}}" title="{{user.full_name_display}}" ) {{user.full_name_display}} + +.user-avatar(ng-if="!url") + img( + src="{{user.photo}}" + alt="{{user.full_name_display}}" + ) +span.user-full-name(ng-if="!url") {{user.full_name_display}} From d01de86ec1565b4fdd6453bf4c723b5439241b48 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Espino?= Date: Tue, 14 Jun 2016 12:02:22 +0200 Subject: [PATCH 6/6] Add changelog entry --- CHANGELOG.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 97295de2..acc48670 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,17 +4,20 @@ ## 2.2.0 ???? (Unreleased) ### Features -- Show a confirmation notice when you exit edit mode by pressing ESC in the markdown inputs. - Add the tribe button to link stories from tree.taiga.io with gigs in tribe.taiga.io. +- Show a confirmation notice when you exit edit mode by pressing ESC in the markdown inputs. - Errors (not found, server error, permissions and blocked project) don't change the current url. - Neew Attachments image slider in preview mode. - New admin area to edit the tag colors used in your project. - Display the current user (me) at first in assignment lightbox (thanks to [@mikaoelitiana](https://github.com/mikaoelitiana)) -- Add a new permissions to allow add comments instead of use the existent modify permission for this purpose. -- Ability to edit comments, view edition history and redesign comments module UI. +- Divide the user dashboard in two columns in large screens, - Upvote and downvote issues from the issues list. -- Divide dashboard in two columns in large screens, -- Drag & Drop ordering for wiki links. +- Comments: + - Add a new permissions to allow add comments instead of use the existent modify permission for this purpose. + - Ability to edit comments, view edition history and redesign comments module UI. +- Wiki: + - Drag & Drop ordering for wiki links. + - Add a list of all wiki pages ### Misc - Lots of small and not so small bugfixes.