about summary refs log tree commit diff
path: root/app/views/settings
diff options
context:
space:
mode:
authorDavid Yip <yipdw@member.fsf.org>2017-09-09 14:27:47 -0500
committerDavid Yip <yipdw@member.fsf.org>2017-09-09 14:27:47 -0500
commitb9f7bc149b2a6abfbdaee83e6992b617b8bdb18e (patch)
tree355225f4424a6ea1b40c66c5540ccab42096e3bf /app/views/settings
parente18ed4bbc7ab4e258d05a3e2a5db0790f67a8f37 (diff)
parent5d170587e3b6c1a3b3ebe0910b62a4c526e2900d (diff)
Merge branch 'origin/master' into sync/upstream
 Conflicts:
	app/javascript/mastodon/components/status_list.js
	app/javascript/mastodon/features/notifications/index.js
	app/javascript/mastodon/features/ui/components/modal_root.js
	app/javascript/mastodon/features/ui/components/onboarding_modal.js
	app/javascript/mastodon/features/ui/index.js
	app/javascript/styles/about.scss
	app/javascript/styles/accounts.scss
	app/javascript/styles/components.scss
	app/presenters/instance_presenter.rb
	app/services/post_status_service.rb
	app/services/reblog_service.rb
	app/views/about/more.html.haml
	app/views/about/show.html.haml
	app/views/accounts/_header.html.haml
	config/webpack/loaders/babel.js
	spec/controllers/api/v1/accounts/credentials_controller_spec.rb
Diffstat (limited to 'app/views/settings')
-rw-r--r--app/views/settings/applications/_fields.html.haml21
-rw-r--r--app/views/settings/applications/index.html.haml19
-rw-r--r--app/views/settings/applications/new.html.haml8
-rw-r--r--app/views/settings/applications/show.html.haml30
4 files changed, 78 insertions, 0 deletions
diff --git a/app/views/settings/applications/_fields.html.haml b/app/views/settings/applications/_fields.html.haml
new file mode 100644
index 000000000..b21f3cca6
--- /dev/null
+++ b/app/views/settings/applications/_fields.html.haml
@@ -0,0 +1,21 @@
+.fields-group
+  = f.input :name, placeholder: t('activerecord.attributes.doorkeeper/application.name')
+  = f.input :website, placeholder: t('activerecord.attributes.doorkeeper/application.website')
+
+.fields-group
+  = f.input :redirect_uri, wrapper: :with_block_label, label: t('activerecord.attributes.doorkeeper/application.redirect_uri'), hint: t('doorkeeper.applications.help.redirect_uri')
+
+  %p.hint= t('doorkeeper.applications.help.native_redirect_uri', native_redirect_uri: Doorkeeper.configuration.native_redirect_uri)
+
+.field-group
+  = f.input :scopes,
+    label: t('activerecord.attributes.doorkeeper/application.scopes'),
+    collection: Doorkeeper.configuration.scopes,
+    wrapper: :with_label,
+    include_blank: false,
+    label_method: lambda { |scope| safe_join([scope, content_tag(:span, t("doorkeeper.scopes.#{scope}"), class: 'hint')]) },
+    selected: f.object.scopes.all,
+    required: false,
+    as: :check_boxes,
+    collection_wrapper_tag: 'ul',
+    item_wrapper_tag: 'li'
diff --git a/app/views/settings/applications/index.html.haml b/app/views/settings/applications/index.html.haml
new file mode 100644
index 000000000..eea550388
--- /dev/null
+++ b/app/views/settings/applications/index.html.haml
@@ -0,0 +1,19 @@
+- content_for :page_title do
+  = t('doorkeeper.applications.index.title')
+
+%table.table
+  %thead
+    %tr
+      %th= t('doorkeeper.applications.index.application')
+      %th= t('doorkeeper.applications.index.scopes')
+      %th
+  %tbody
+    - @applications.each do |application|
+      %tr
+        %td= link_to application.name, settings_application_path(application)
+        %th= application.scopes
+        %td
+          = table_link_to 'times', t('doorkeeper.applications.index.delete'), settings_application_path(application), method: :delete, data: { confirm: t('doorkeeper.applications.confirmations.destroy') }
+
+= paginate @applications
+= link_to t('doorkeeper.applications.index.new'), new_settings_application_path, class: 'button'
diff --git a/app/views/settings/applications/new.html.haml b/app/views/settings/applications/new.html.haml
new file mode 100644
index 000000000..5274a430c
--- /dev/null
+++ b/app/views/settings/applications/new.html.haml
@@ -0,0 +1,8 @@
+- content_for :page_title do
+  = t('doorkeeper.applications.new.title')
+
+= simple_form_for @application, url: settings_applications_path do |f|
+  = render 'fields', f: f
+  
+  .actions
+    = f.button :button, t('doorkeeper.applications.buttons.submit'), type: :submit
diff --git a/app/views/settings/applications/show.html.haml b/app/views/settings/applications/show.html.haml
new file mode 100644
index 000000000..4d8555111
--- /dev/null
+++ b/app/views/settings/applications/show.html.haml
@@ -0,0 +1,30 @@
+- content_for :page_title do
+  = t('doorkeeper.applications.show.title', name: @application.name)
+
+%p.hint= t('applications.warning')
+
+%table.table
+  %tbody
+    %tr  
+      %th= t('doorkeeper.applications.show.application_id')
+      %td
+        %code= @application.uid
+    %tr
+      %th= t('doorkeeper.applications.show.secret')
+      %td
+        %code= @application.secret
+    %tr
+      %th{ rowspan: 2}= t('applications.your_token')
+      %td
+        %code= current_user.token_for_app(@application).token
+    %tr
+      %td= table_link_to 'refresh', t('applications.regenerate_token'), regenerate_settings_application_path(@application), method: :post
+
+%hr/
+
+= simple_form_for @application, url: settings_application_path(@application), method: :put do |f|
+  = render 'fields', f: f
+    
+  .actions
+    = f.button :button, t('generic.save_changes'), type: :submit
+