ソースを参照

Merge branch 'master' of https://github.com/Musare/Musare

KrisVos130 8 年 前
コミット
8b9fcd66ca

+ 25 - 23
README.md

@@ -1,33 +1,34 @@
-##Visit the official website!
-
-### https://musare.com/
+# [Musare](http://musare.com)
+> A modern, open-source, collaborative music app
 
 You can also find us on:
 * Twitter: https://twitter.com/musareapp
 
-##Get started with development!
+## Contributing
+
+#### Prerequisites
 
-First download Meteor: https://www.meteor.com/
-Then download Git (CLI): https://git-scm.com/
+- [Meteor](https://www.meteor.com/)
+- [Git (CLI)](https://git-scm.com/)
 
-Get your favourite code-editor out and follow the following steps to start contributing:
-1. Star the repository!
-2. Fork the repository to your account
-3. Clone your forked repo to your local machine using ```git clone https://github.com/[YourUserName]/Musare.git```
+#### Getting Started
 
-Navigate to "../app" and run ```meteor```. This will run a local instance of Musare on ```localhost:3000```.
+1. Fork the repository to your account.
+2. Clone your forked repo to your local machine using
+```git clone https://github.com/<username>/Musare.git```.
+3. Navigate to the `app` directory using `cd app`.
+4. Run `meteor` which will start a local instance of Musare on ```localhost:3000```.
 
-There you go, you're set to start coding!
+## Does the site not load?
 
-##Does the site not load?
+#### Try these methods first before reporting an issue:
 
-Try these methods first before reporting an issue:
+1. Refresh page or restart browser.
+2. Turn off all extensions.
+3. Clear cookies and cache.
+4. Update browser or try another (Chrome, Firefox).
+5. Flush browser DNS/Sockets and IP DNS.
 
-1. Refresh page or restart browser
-2. Turn off all extensions
-3. Clear cookies and cache
-4. Update browser or try another (Chrome, Firefox)
-5. Flush browser DNS/Sockets and IP DNS
 <hr>
 **Chrome**
 ```chrome://net-internals/#dns``` and ```chrome://net-internals/#sockets```
@@ -45,8 +46,9 @@ Try these methods first before reporting an issue:
 ```sudo discoveryutil mdnsflushcache```
 <hr>
 
-This did not fix your issue? or you're still not satisfied? Just create a issue ticket at:
-https://github.com/AkiraLaine/musare/issues
-Be sure to be as detailed as possible!
+#### Still having issues?
+
+Just create an issue ticket at:
+https://github.com/musare/musare/issues and be sure to be as detailed as possible!
 
-We are protected by [![CLA assistant](https://cla-assistant.io/readme/badge/Musare/Musare)](https://cla-assistant.io/Musare/Musare) so if you want to contribute please accept these terms, if you do not your pull request will be denied.
+We are protected by [![CLA assistant](https://cla-assistant.io/readme/badge/Musare/Musare)](https://cla-assistant.io/Musare/Musare) so if you want to contribute, please accept these terms. If you do not, your pull request will be denied.

+ 6 - 6
app/client/scripts/events.js

@@ -347,13 +347,13 @@ Template.profile.events({
         $("#edit-rank").hide();
         $("#cancel-rank").show();
     },
-    "click #submit-rank": function() {
-        $("#rank").show();
-        $("#rank-div").hide();
-        $("#edit-rank").show();
-        $("#cancel-rank").hide();
-        var newRank = $("#select-rank option:selected").val();
+    "click #promote-rank": function() {
+        var username = Session.get("username");
+        Meteor.call("promoteUserRank", username);
+    },
+    "click #demote-rank": function() {
         var username = Session.get("username");
+        Meteor.call("demoteUserRank", username);
     },
     "click #cancel-rank": function() {
         $("#rank").show();

+ 2 - 2
app/client/templates/faq.html

@@ -64,10 +64,10 @@
                     <div class="collapsible-body"><p>Yes! Just put /commands or /help in chat and it will show you all of the available chat commands.</p></div>
                 </li>
                 <h5>The people on Musare</h5>
-                <li>
+                <!-- <li>
                     <div class="collapsible-header"><i class="material-icons">help</i>Who are the Musare staff?</div>
                     <div class="collapsible-body"><p>You can check out the Musare staff on <a href="https://musare.com/team">our team page</a>.</p></div>
-                </li><li>
+                </li> --><li>
                     <div class="collapsible-header"><i class="material-icons">help</i>How do I become a staff member?</div>
                     <div class="collapsible-body"><p>We are currently not reviewing any staff applications. If you are an active contributor to Musare, we might consider some people as staff members. This is not a guarantee.</p></div>
                 </li>

+ 2 - 0
app/client/templates/footer.html

@@ -37,6 +37,8 @@
             <div class="col l2 s12 right">
                 <h5 class="grey-text text-darken-2">Links</h5>
                 <ul>
+                    <li><a class="grey-text text-darken-1" href="https://github.com/Musare/Musare">Github</a></li>
+                    <li><a class="grey-text text-darken-1" href="/feedback">Feedback</a></li>
                     <li><a class="grey-text text-darken-1" href="/faq">FAQ</a></li>
                     <li><a class="grey-text text-darken-1" href="/terms">Terms</a></li>
                     <li><a class="grey-text text-darken-1" href="/privacy">Privacy</a></li>

+ 4 - 34
app/client/templates/header.html

@@ -1,15 +1,6 @@
 <template name="header">
     <header>
         <!-- Dropdown Structure -->
-        <ul id="contributeDrop" class="dropdown-content">
-            <li><a href="https://www.github.com/Musare/Musare" target="_blank"
-                   class="grey-text text-darken-4">Github</a></li>
-            <li><a href="/feedback" class="grey-text text-darken-4">Feedback</a></li>
-        </ul>
-        <ul id="aboutDrop" class="dropdown-content">
-            <li><a href="/project" class="grey-text text-darken-4">The Project</a></li>
-            <!--<li><a href="/team" class="grey-text text-darken-4">The Team</a></li>-->
-        </ul>
         <ul id="accountDrop" class="dropdown-content">
             {{#if currentUser}}
                 <li><a href="/u/{{currentUser.profile.username}}" class="grey-text text-darken-4">Profile</a></li>
@@ -22,17 +13,14 @@
         </ul>
         <nav>
             <div class="nav-wrapper grey darken-3">
-                <a href="/" class="brand-logo"><img src="/logo.png" class="responsive-img" style="height: 60px;"/></a>
+                <a href="/" class="brand-logo">Musare</a>
                 <a href="#" data-activates="mobile-navi" class="button-collapse white-text"><i class="material-icons">menu</i></a>
                 <ul class="right hide-on-med-and-down scroll-fix">
                     {{#if isModerator}}
                         <li><a class="light-blue-text text-accent-4" href="/admin"><b>Admin</b></a></li>
                     {{/if}}
-                    <li><a href="/news" class="white-text">News</a></li>
-                    <li><a class="dropdown-button white-text" href="#!" data-activates="contributeDrop">Contribute<i
-                            class="material-icons right">arrow_drop_down</i></a></li>
-                    <li><a class="dropdown-button white-text" href="#!" data-activates="aboutDrop">About<i
-                            class="material-icons right">arrow_drop_down</i></a></li>
+                    <li><a href="/project" class="white-text">The Project</a></li>
+                    <li><a href="/" class="white-text">Donate</a></li>
                     <li><a class="dropdown-button white-text" href="#!" data-activates="accountDrop">
                         {{#if currentUser}}
                             {{currentUser.profile.username}}
@@ -47,25 +35,7 @@
                             <li><a href="/admin">Admin</a></li>
                         {{/if}}
                         <li>
-                            <a href="/news">News</a>
-                        </li>
-                        <li>
-                            <div class="collapsible-header black-text"><i class="material-icons">arrow_drop_down</i>
-                                Contribute
-                            </div>
-                            <div class="collapsible-body black-text">
-                                <a href="https://www.github.com/Musare/Musare" target="_blank">Github</a>
-                                <a href="/feedback">Feedback</a>
-                            </div>
-                        </li>
-                        <li>
-                            <div class="collapsible-header black-text"><i class="material-icons">arrow_drop_down</i>
-                                About
-                            </div>
-                            <div class="collapsible-body black-text">
-                                <a href="/project">The Project</a>
-                                <!--<a href="/team">The Team</a>-->
-                            </div>
+                            <a href="/project">The Project</a>
                         </li>
                         <li>
                             <div class="collapsible-header black-text"><i class="material-icons">arrow_drop_down</i>

+ 4 - 0
app/client/templates/profile.html

@@ -13,6 +13,10 @@
                     <div class="col s12 m12 l4">
                         <h4>User Info</h4>
                         <!--<p>Name: {{real_name}}</p>-->
+                        {{#if isModerator}}
+                          <a id="promote-rank" href="">Promote to Admin</a><br>
+                          <a id="demote-rank" href="">Demote to Admin</a>
+                        {{/if}}
                         <p>Username: {{username}}</p>
                         <p>First Joined: {{first_joined}}</p>
                         <p>Rank: {{rank}}</p>

+ 2 - 2
app/server/a.js

@@ -57,7 +57,7 @@ Meteor.updatedMethods = function(methods) {
                             throw new Meteor.Error(401, "Invalid permissions.");
                         }
                     } else if (requirement === "noMute") {
-                        if (isMuted()) {
+                        if (Meteor.isMuted()) {
                             throw new Meteor.Error(401, "Invalid permissions.");
                         }
                     }
@@ -67,4 +67,4 @@ Meteor.updatedMethods = function(methods) {
         };
         Meteor.methods(method);
     });
-};
+};

+ 23 - 7
app/server/server.js

@@ -1823,6 +1823,11 @@ Meteor.updatedMethods({
         },
         requirements: []
     },
+    promoteUserMethod: {
+      code: function(user) {
+        Meteor.users.find({"profile.usernameL": username.toLowerCase()})
+      }
+    },
     createArticle: {
         code: function(data) {
             var userId = Meteor.userId();
@@ -2045,13 +2050,24 @@ Meteor.updatedMethods({
         },
         requirements: ["login"]
     },
-    /*updateUserRank: function(newRank){
-     if (Meteor.userId()) {
-     Meteor.users.update(Meteor.userId(), {$set: {"profile.rank": newRank}});
-     } else {
-     throw new Meteor.Error(403, "Invalid permissions.");
-     }
-     },*/
+    promoteUserRank: {
+      code: function(username){
+        if (Meteor.userId()) {
+          Meteor.users.update({"username": username}, {$set: {"profile.rank": "admin"}});
+        } else {
+          throw new Meteor.Error(403, "Invalid permissions.");
+        }
+      }
+    },
+    demoteUserRank: {
+      code: function(username){
+        if (Meteor.userId()) {
+          Meteor.users.update({"username": username}, {$set: {"profile.rank": "default"}});
+        } else {
+          throw new Meteor.Error(403, "Invalid permissions.");
+        }
+      }
+    },
     deleteAccount: {
         code: function () {
             var user = Meteor.users.findOne(Meteor.userId());