diff --git a/services/web/app/views/templates.jade b/services/web/app/views/templates.jade index aaccdbde8a..ed86f628db 100644 --- a/services/web/app/views/templates.jade +++ b/services/web/app/views/templates.jade @@ -286,32 +286,31 @@ script(type="text/template")#publishProjectTemplate - -if(session && session.user && session.user.isAdmin) - .box - .page-header - h2 Publish project as template - - #publishedAsTemplateArea.show-when-published.alert.alert-success - p - .btn.btn-warning#unPublishProjectAsTemplate.pull-right Unpublish - i.icon-ok - | Your project is currently published. - a#templateLink(href='{{canonicalUrl}}') View in template gallery. - p - | Lastest version: {{publishedDate}}. + .box + .page-header + h2 Publish project as template + + #publishedAsTemplateArea.show-when-published.alert.alert-success + p + .btn.btn-warning#unPublishProjectAsTemplate.pull-right Unpublish + i.icon-ok + | Your project is currently published. + a#templateLink(href='{{canonicalUrl}}') View in template gallery. + p + | Lastest version: {{publishedDate}}. - #problemWithPublishingArea - p There is a problem with our publishing service, please try again in a few minutes. - #publishWorkingArea - p Working... - div.show-when-published.show-when-unpublished.project-description - label(for="project-description") Description - .row-fluid - textarea(placeholder="Template description", name="project-description").span12#projectDescription {{description}} - #unpublishedAsTemplateArea.show-when-unpublished - .btn.btn-success#publishProjectAsTemplate Publish - p.show-when-published - button.btn.btn-success#republishProjectAsTemplate Re-Publish + #problemWithPublishingArea + p There is a problem with our publishing service, please try again in a few minutes. + #publishWorkingArea + p Working... + div.show-when-published.show-when-unpublished.project-description + label(for="project-description") Description + .row-fluid + textarea(placeholder="Template description", name="project-description").span12#projectDescription {{description}} + #unpublishedAsTemplateArea.show-when-unpublished + .btn.btn-success#publishProjectAsTemplate Publish + p.show-when-published + button.btn.btn-success#republishProjectAsTemplate Re-Publish script(type="text/template")#settingsPanelTemplate diff --git a/services/web/public/coffee/project-members/ProjectMembersManager.coffee b/services/web/public/coffee/project-members/ProjectMembersManager.coffee index d597345777..a93b8c09e9 100644 --- a/services/web/public/coffee/project-members/ProjectMembersManager.coffee +++ b/services/web/public/coffee/project-members/ProjectMembersManager.coffee @@ -25,10 +25,11 @@ define [ @publishProjectView?.refreshPublishStatus() setupPublish = _.once => - @publishProjectView = new PublishProjectView - ide: @ide - el: $("#publishProject") - @publishProjectView.render() + if @ide.security? and @ide.security.permissionsLevel == "owner" + @publishProjectView = new PublishProjectView + ide: @ide + el: $("#publishProject") + @publishProjectView.render() setupArea() if @ide?