Skip to content

Commit

Permalink
Merge pull request #627 from Martii/Issue-169andOtherPostFixes
Browse files Browse the repository at this point in the history
Move and duplicate Raw Source button to Source Code pages

Auto-merge
  • Loading branch information
Martii committed Apr 30, 2015
2 parents c4ab8b4 + 624873d commit 9c3f06a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
2 changes: 2 additions & 0 deletions controllers/user.js
Original file line number Diff line number Diff line change
Expand Up @@ -1281,6 +1281,8 @@ exports.editScript = function (aReq, aRes, aNext) {
script.installNameSlug = installNameSlug;
script.scriptPermalinkInstallPageUrl = 'https://' + aReq.get('host') +
script.scriptInstallPageUrl;
script.scriptRawPageUrl = '/src/' + (isLib ? 'libs' : 'scripts') + '/'
+ installNameSlug + (isLib ? '.js' : '.user.js#');

// Page metadata
pageMetadata(options);
Expand Down
14 changes: 8 additions & 6 deletions views/includes/scriptPageHeader.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
<h2 class="page-heading">
{{#isScriptPage}}
<a href="{{{script.scriptInstallPageUrl}}}" class="btn btn-info pull-right">
{{#script.isLib}}
<i class="fa fa-file-text-o"></i> Raw Source
{{/script.isLib}}
{{^script.isLib}}
<i class="fa fa-download"></i> Install
<a href="{{{script.scriptInstallPageUrl}}}" class="btn btn-info pull-right">
<i class="fa fa-download"></i> Install
</a>
{{/script.isLib}}
</a>
{{/isScriptPage}}
{{#isScriptViewSourcePage}}
<a href="{{{script.scriptRawPageUrl}}}" class="btn btn-info pull-right">
<i class="fa fa-file-text-o"></i> Raw Source
</a>
{{/isScriptViewSourcePage}}
{{#script.icon45Url}}
<span class="page-heading-icon" {{#script.icon45Url}}data-icon-src="{{{script.icon45Url}}}"{{/script.icon45Url}}>
{{#script.isLib}}<i class="fa fa-fw fa-file-excel-o"></i>{{/script.isLib}}{{^script.isLib}}<i class="fa fa-fw fa-file-code-o"></i>{{/script.isLib}}
Expand Down

0 comments on commit 9c3f06a

Please sign in to comment.