Skip to content

Commit

Permalink
enhancement: The republish all button only appear when necessary.
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorybesson committed Mar 24, 2017
1 parent efb756c commit c5ebc68
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 34 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -19,6 +19,7 @@ before_install:
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo apt-get install -y libappindicator1 fonts-liberation; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb; fi
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo dpkg -i google-chrome*.deb; fi
- if [ "$TRAVIS_OS_NAME" == "osx" ]; brew install homebrew/science/opencv; fi
install:
- npm install
- npm run install-selenium
Expand Down
1 change: 0 additions & 1 deletion src/server/public/abecms/libs/slider-home.js
@@ -1,5 +1,4 @@
var tweets = twitterFetcher.fetch({
// "profile": {"screenName": 'rihanna'},
"profile": {"screenName": 'abe_cms'},
"domId": 'tweets-slider',
"maxTweets": 10,
Expand Down
2 changes: 2 additions & 0 deletions src/server/routes/get-main.js
Expand Up @@ -23,6 +23,7 @@ function renderAbeAdmin(EditorVariables, obj, filePath) {
files: []//Manager.instance.getList()
}

manager.nbPosts = Manager.instance.getList().length
manager.list = Manager.instance.getStructureAndTemplates()
manager.editConfig = EditorVariables.express.req.app.get('config')
manager.config = JSON.stringify(config)
Expand Down Expand Up @@ -128,6 +129,7 @@ var route = function(req, res, next) {
folderPath = path.dirname(filePath)

EditorVariables.isHome = false
EditorVariables.isEditor = true
var filePathTest = cmsData.revision.getDocumentRevision(filePath)
if(typeof filePathTest !== 'undefined' && filePathTest !== null) {
jsonPath = filePathTest.path
Expand Down
2 changes: 2 additions & 0 deletions src/server/views/partials/header-menu.html
Expand Up @@ -9,11 +9,13 @@
<a class="navbar-brand" href="/abe" title="abe@{{abeVersion}}"><img src="/abecms/image/white_logo_transparent_background_small.png" width="40"/></a>
</div>
<div class="collapse navbar-collapse" id="myNavbar">
{{#if isEditor}}
<ul class="nav navbar-nav navbar-center responsive-tool">
<li><a href="javascript:iframeResize('page-template', 320)"><span class="fa fa-mobile"></span></a></li>
<li><a href="javascript:iframeResize('page-template', 768)"><span class="fa fa-tablet"></span></a></li>
<li><a href="javascript:iframeReset('page-template')"><span class="fa fa-desktop"></span></a></li>
</ul>
{{/if}}
<ul class="nav navbar-nav navbar-right">
<li><a href="/abe/editor"><span class="fa fa-list"></span> Manager</a></li>
<li class="dropdown">
Expand Down
55 changes: 22 additions & 33 deletions src/server/views/partials/right-file-list.html
Expand Up @@ -2,10 +2,12 @@
<div class="manager-tab manager-files visible">
<br/>
{{#isAuthorized '/abe/generate-posts' @root.user.role.workflow}}
{{#unless (isTrue @root.config.publish.auto-republish.limit '>=' @root.manager.nbPosts)}}
<a href="#" class="btn-generate-posts pull-right btn btn-info btn-xs" data-generate-posts="true">
<span data-not-clicked>Republish site</span>
<span class="hidden" data-clicked>publishing...</span>
<span data-not-clicked>Republish site</span>
<span class="hidden" data-clicked>publishing...</span>
</a>
{{/unless}}
{{/isAuthorized}}
<br/><br/>
<div class="form-horizontal">
Expand All @@ -18,38 +20,25 @@
</div>
</div>
</div>

<!--div class="well well-sm">
<a href="/abe/page{{@root.json.abe_meta.link}}" target="_blank" class="btn-visit-site" data-href="/site/">
{{@root.text.visit_site}}
</a>
{{#isAuthorized '/abe/generate-posts' @root.user.role.workflow}}
<a href="#" class="btn-generate-posts pull-right btn btn-info btn-xs" data-generate-posts="true">
<span data-not-clicked>Republish site</span>
<span class="hidden" data-clicked>publishing...</span>
</a>
{{/isAuthorized}}
</div-->
<table class="table table-striped table-bordered table-responsive table-hover" id="navigation-list" style="width:100%">
<thead>
<tr>

<th>#</th>
<th>File path</th>
<th align="center">Template</th>
<th align="center" class="daterow">date</th>
{{#each @root.config.users.workflow}}
<th align="center">{{this}}</th>
{{/each}}
<th align="center">actions</th>
</tr>
</thead>
<tbody>
{{#each manager.home.files}}
{{listPage this @index @root.text}}
<table class="table table-striped table-bordered table-responsive table-hover" id="navigation-list" style="width:100%">
<thead>
<tr>
<th>#</th>
<th>File path</th>
<th align="center">Template</th>
<th align="center" class="daterow">date</th>
{{#each @root.config.users.workflow}}
<th align="center">{{this}}</th>
{{/each}}
</tbody>
</table>
<th align="center">actions</th>
</tr>
</thead>
<tbody>
{{#each manager.home.files}}
{{listPage this @index @root.text}}
{{/each}}
</tbody>
</table>
</div>
<script>
var workflow = []
Expand Down

0 comments on commit c5ebc68

Please sign in to comment.