MDL-65475 forum: Align items in forum settings menu
authorMihail Geshoski <mihail@moodle.com>
Fri, 3 May 2019 05:39:25 +0000 (13:39 +0800)
committerMihail Geshoski <mihail@moodle.com>
Fri, 3 May 2019 05:39:25 +0000 (13:39 +0800)
mod/forum/lang/en/forum.php
mod/forum/templates/discussion_favourite_toggle.mustache
mod/forum/templates/discussion_lock_toggle.mustache
mod/forum/templates/discussion_pin_toggle.mustache
mod/forum/templates/forum_action_menu.mustache
mod/forum/templates/forum_discussion_favourite_toggle.mustache

index c1827a2..3c5f98f 100644 (file)
@@ -325,6 +325,7 @@ $string['lockdiscussionafter_help'] = 'Discussions may be automatically locked a
 Users with the capability to reply to locked discussions can unlock a discussion by replying to it.';
 $string['longpost'] = 'Long post';
 $string['locked'] = 'Locked';
+$string['lockdiscussion'] = 'Lock this discussion';
 $string['lockupdated'] = 'The lock option has been updated.';
 $string['mailnow'] = 'Send forum post notifications with no editing-time delay';
 $string['manydiscussions'] = 'Discussions per page';
@@ -634,6 +635,7 @@ $string['trackingtype_help'] = 'Read tracking enables participants to easily che
 If set to optional, participants can choose whether to turn tracking on or off via a link in the administration block. (Users must also enable forum tracking in their forum preferences.)
 
 If \'Allow forced read tracking\' is enabled in the site administration, then a further option is available - forced. This means that tracking is always on, regardless of users\' forum preferences.';
+$string['unlockdiscussion'] = 'Unlock this discussion';
 $string['unread'] = 'Unread';
 $string['unreadposts'] = 'Unread posts';
 $string['unreadpostsnumber'] = '{$a} unread posts';
index b99270e..246ab35 100644 (file)
 }}
 {{#capabilities.favourite}}
     <a
-        class="btn btn-link"
+        class="{{$classes}}dropdown-item menu-action{{/classes}}"
+        role="{{$role}}menuitem{{/role}}"
         data-type="favorite-toggle"
         data-action="toggle"
         data-discussionid="{{id}}"
         data-forumid="{{forumid}}"
         tabindex="-1"
+        href=""
         {{#userstate.favourited}}
             data-targetstate="0"
             title="{{#str}}removefromfavourites, mod_forum{{/str}}"
             title="{{#str}}addtofavourites, mod_forum{{/str}}"
         {{/userstate.favourited}}
     >
-        {{$favouritecontent}}
-            {{#userstate.favourited}}
-                {{#str}}removefromfavourites, mod_forum{{/str}}
-            {{/userstate.favourited}}
-            {{^userstate.favourited}}
-                {{#str}}addtofavourites, mod_forum{{/str}}
-            {{/userstate.favourited}}
-        {{/favouritecontent}}
+        <span class="menu-action-text">
+            {{$favouritecontent}}
+                {{#userstate.favourited}}
+                    {{#str}}removefromfavourites, mod_forum{{/str}}
+                {{/userstate.favourited}}
+                {{^userstate.favourited}}
+                    {{#str}}addtofavourites, mod_forum{{/str}}
+                {{/userstate.favourited}}
+            {{/favouritecontent}}
+        </span>
     </a>
 {{/capabilities.favourite}}
\ No newline at end of file
index 0a55e95..bf0e62d 100644 (file)
@@ -35,7 +35,8 @@
     }
 }}
 <a
-    class="btn btn-link"
+    class="dropdown-item menu-action"
+    role="menuitem"
     data-type="lock-toggle"
     data-action="toggle"
     data-discussionid="{{id}}"
         title="{{#str}}clicktolockdiscussion, forum{{/str}}"
     {{/locked}}
 >
-    {{#locked}}
-        {{#str}}locked, forum{{/str}}
-    {{/locked}}
-    {{^locked}}
-        {{#str}}notlocked, forum{{/str}}
-    {{/locked}}
+    <span class="menu-action-text">
+        {{#locked}}
+            {{#str}}unlockdiscussion, forum{{/str}}
+        {{/locked}}
+        {{^locked}}
+            {{#str}}lockdiscussion, forum{{/str}}
+        {{/locked}}
+    </span>
 </a>
\ No newline at end of file
index 587fd1d..de2f5b6 100644 (file)
@@ -34,7 +34,8 @@
 }}
 {{#capabilities.pin}}
     <a
-        class="btn btn-link"
+        class="dropdown-item menu-action"
+        role="menuitem"
         data-type="pin-toggle"
         data-action="toggle"
         data-discussionid="{{id}}"
             title="{{#str}}pindiscussion, mod_forum{{/str}}"
         {{/pinned}}
     >
-        {{#pinned}}
-            {{#str}}unpindiscussion, mod_forum{{/str}}
-        {{/pinned}}
-        {{^pinned}}
-            {{#str}}pindiscussion, mod_forum{{/str}}
-        {{/pinned}}
+        <span class="menu-action-text">
+            {{#pinned}}
+                {{#str}}unpindiscussion, mod_forum{{/str}}
+            {{/pinned}}
+            {{^pinned}}
+                {{#str}}pindiscussion, mod_forum{{/str}}
+            {{/pinned}}
+        </span>
     </a>
 {{/capabilities.pin}}
\ No newline at end of file
index 09cf1c7..34eedee 100644 (file)
         {{/settings.excludetext}}
 
     </button>
-    <div class="dropdown-menu dropdown-menu-right"
+    <div class="dropdown-menu dropdown-menu-right menu"
          aria-labelledby="forum-action-menu-{{id}}-menu"
          data-rel="menu-content"
          role="menu"
          id="forum-action-menu-{{id}}-menu">
         {{#capabilities.favourite}}
-        <div class="dropdown-item" role="menuitem">
             {{> mod_forum/discussion_favourite_toggle}}
-        </div>
         {{/capabilities.favourite}}
         {{#capabilities.pin}}
-        <div class="dropdown-item" role="menuitem">
             {{> mod_forum/discussion_pin_toggle}}
-        </div>
         {{/capabilities.pin}}
         {{#capabilities.manage}}
         {{^istimelocked}}
-        <div class="dropdown-item" role="menuitem">
             {{> forum/discussion_lock_toggle }}
-        </div>
         {{/istimelocked}}
         {{/capabilities.manage}}
     </div>
index c1c93ad..7b0eaa0 100644 (file)
@@ -30,6 +30,8 @@
     }
 }}
 {{< mod_forum/discussion_favourite_toggle }}
+    {{$classes}}btn btn-link{{/classes}}
+    {{$role}}{{/role}}
     {{$favouritecontent}}
         {{#userstate.favourited}}
             {{#pix}}t/star, mod_forum, {{#str}}removefromfavourites, mod_forum{{/str}}{{/pix}}