Skip to content

Commit

Permalink
Merge pull request #1653 from renujain31/survey_menu
Browse files Browse the repository at this point in the history
Adds navigation in dropdown menus in surveys and posts
  • Loading branch information
AmTryingMyBest authored Jun 7, 2021
2 parents d3e91d2 + ceb9f1c commit 30f0376
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<a data-modal="add-to-collection" ng-click="toggleCollection()">
<button data-modal="add-to-collection" ng-click="toggleCollection()" class="button-survey">
<svg class="iconic" role="img">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/img/iconic-sprite.svg#grid-three-up"></use>
</svg>
<span class="label"translate="set.add_to_collection">Add to collection</span>
</a>
</button>
12 changes: 6 additions & 6 deletions app/main/posts/common/post-actions.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@


<li ng-show="(post.allowed_privileges.indexOf('update') !== -1) && postIsUnlocked()">
<a ng-click="openEditMode(post.id)">
<button ng-click="openEditMode(post.id)" class="button-survey">
<svg class="iconic" role="img">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/img/iconic-sprite.svg#pencil"></use>
</svg>
<span class="label" translate="nav.edit">Edit</span>
</a>
</button>
</li>
<li>
<!-- Collection toggle link -->
Expand All @@ -38,7 +38,7 @@
<ul>
<li ng-repeat="status in statuses"
ng-show="post.allowed_privileges.indexOf('change_status') !== -1 && postIsUnlocked()">
<a ng-click="updateStatus(status)">
<button ng-click="updateStatus(status)" class="button-survey">
<svg class="iconic" role="img">
<use xlink:href="/img/iconic-sprite.svg#globe" ng-if="status=='published'"></use>
<use xlink:href="/img/iconic-sprite.svg#box" ng-if="status=='archived'"></use>
Expand All @@ -47,16 +47,16 @@
<span class="label" ng-if="status=='published'" translate="post.post_actions.publish">Publish</span>
<span class="label" ng-if="status=='draft'" translate="post.post_actions.put_under_review">Put under </span>
<span class="label" ng-if="status=='archived'" translate="post.post_actions.archive">Archive</span>
</a>
</button>
</li>

<li ng-show="post.allowed_privileges.indexOf('update') !== -1 && postIsUnlocked()">
<a ng-click="deletePost()">
<button ng-click="deletePost()" class="button-survey">
<svg class="iconic" role="img">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="/img/iconic-sprite.svg#trash"></use>
</svg>
<span class="label" translate="nav.delete">Delete</span>
</a>
</button>
</li>
</ul>
</div>
Expand Down
26 changes: 26 additions & 0 deletions app/settings/surveys/surveys.html
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,32 @@ <h2 class="listing-item-title inline-block"><a ui-sref="settings.surveys.create"
<div class="listing card">
<div class="listing-item" ng-show="forms.length" ng-repeat="form in forms">
<span class="post-band" ng-style="{backgroundColor: form.color}"></span>
<div class="listing-item-secondary" dropdown>
<button class="button-beta button-flat" data-toggle="dropdown-menu" dropdown-toggle>
<svg class="iconic" role="img">
<use xlink:href="/img/iconic-sprite.svg#ellipses"></use>
</svg>
<span class="hidden">More</span>
</button>
<ul class="dropdown-menu init" dropdown-menu>
<li>
<a href="/settings/surveys/duplicate/{{form.id}}">
<svg class="iconic" role="img">
<use xlink:href="/img/material/svg-sprite-content-symbol.svg#ic_content_copy_24px"></use>
</svg>
<span class="label" translate="survey.duplicate_survey">Duplicate</span>
</a>
</li>
<li>
<button class="button-survey" ng-click="deleteSurvey(form)">
<svg class="iconic" role="img">
<use xlink:href="/img/iconic-sprite.svg#trash"></use>
</svg>
<span class="label" translate="survey.delete">Delete</span>
</button>
</li>
</ul>
</div>
<div class="listing-item-primary">
<h2 class="listing-item-title">
<a href="/settings/surveys/edit/{{form.id}}" ng-show="!form.targeted_survey || !targetedSurveysEnabled">{{form.name}}</a></h2>
Expand Down

0 comments on commit 30f0376

Please sign in to comment.